This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Function spl_mmc_load_image() not returns when i2c_read() API is used in it in am335x.

Hi,


I have EEPROM over i2c on address 0x50 in am335x. After MLO is loaded it tries to call function  board_init_r of file spl.c. From this function it calls spl_mmc_load_image() of file spl_mmc.c.

Now when i puts below code in fuction spl_mmc_load_image() of file spl_mmc.c to read eeprom value then it reads correct value and comes at the end of the function.But it not returns back in function board_init_r() of spl.c file from where this function is called. So my execution is hanged at this point. If i comment out below code then everything works fine. Also putting this code in spl.c instead of spl_mmc.c in function board_init_r() before calling spl_mmc_load_image() also works fine with correct value without hanging.

uchar read_val;

printf("reading value :");

i2c_read(0x50, 0x1, 1, &read_val, 0);
printf("%d\n", read_val);

So, the problem is that i2c reading works fine but defining it in spl_mmc_load_image() not returns control to function from where it is called. Also i verified that print at last line of spl_mmc_load_image() comes.

Please provide me a solution.


Thanks in advance.

Regards,

Nilesh