News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

Zynqberry: bare metal camera initialization

Started by marph, December 02, 2018, 03:59:38 PM

Previous topic - Next topic

marph

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. 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?

Oleksandr Kiyenko

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

marph

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

Oleksandr Kiyenko

Hi,
This code should be placed after iic_init() and before access to camera registers.

BR
Alex