Trenz Electronic GmbH Support Forum

Trenz Electronic Products => Trenz Electronic FPGA Modules => Topic started by: marph on December 02, 2018, 03:59:38 PM

Title: Zynqberry: bare metal camera initialization
Post by: marph on December 02, 2018, 03:59:38 PM
Hi,
I'm writing a bare metal application to initialize my raspberry camera. I tried to follow the instructions of https://forum.trenz-electronic.de/index.php?topic=939.0 (https://forum.trenz-electronic.de/index.php?topic=939.0). The modified "rpicam.c" is attached (as .txt, because .c extension isn't allowed). So far i2c initialization seems to be successful, but the application hangs up at line 27 when calling "XIicPs_MasterSendPolled()". I couldn't find any solution for this. Could you point out where the mistake is?
Title: Re: Zynqberry: bare metal camera initialization
Post by: Oleksandr Kiyenko on December 03, 2018, 10:39:28 AM
Hi,

To work with a camera using I2C bus, you have to program I2C mux first.
You need to switch it to bus 3. A code will be like
...
u8 WriteBuffer[1];
WriteBuffer[0] = 0x07;
Status = XIicPs_MasterSendPolled(InstancePtr, WriteBuffer, 1, 0x70);
...


Best regards
Oleksandr Kiyenko
Title: Re: Zynqberry: bare metal camera initialization
Post by: marph on December 04, 2018, 11:19:57 PM
Hi,
where do I have to add the code for chosing the channel of the I2C mux?

I guessed at the "iic_init()" function. After doing it, the behaviour was the same as in the previous post. The program still hangs at the first occurence of "XIicPs_MasterSendPolled()".

Best regards
Marph
Title: Re: Zynqberry: bare metal camera initialization
Post by: Oleksandr Kiyenko on December 05, 2018, 09:07:17 AM
Hi,
This code should be placed after iic_init() and before access to camera registers.

BR
Alex