4 posts / 0 new
Last post
paradisers
Offline
Last seen:2 years 10 months ago
Joined:2014-11-05 05:38
I2C example

Hi,
I run I2C drivers to access EEPROM.And it fails in “WAIT_UNTIL_I2C_FIFO_IS_EMPTY()" of "i2c_wait_until_eeprom_ready”.
But this example ran OK in the past few days.The hardware seems to be fine.
I have no idea about I2C's driver.
Could you please give me some proposals?

MHv_Dialog
Offline
Last seen:1 month 3 weeks ago
Staff
Joined:2013-12-06 15:10
Hi,

Hi,

It looks like something is going wrong during initialization of the EEPROM.

我建议你尝试peripheral_examples project. This project allows you to execute a very simple I2C interaction with an EEPROM. You will need to make modifications to fit your hardware ( periph_setup.h and peripherals.c).

The documents UM-B-004 andUM-B-005 should guide you.

paradisers
Offline
Last seen:2 years 10 months ago
Joined:2014-11-05 05:38
Hi,

Hi,
I just use the peripheral_examples project to test I2C communication.And also I can boot from EEPROM before.
But one day my board can't boot successfully.So I try the peripheral_examples project to test I2C.Then I found the code always failed in “WAIT_UNTIL_I2C_FIFO_IS_EMPTY()".
i2c_eeprom_write_page
-->i2c_wait_until_eeprom_ready
-->WAIT_UNTIL_I2C_FIFO_IS_EMPTY // a endless loop

Does it means the EEPROM respond with a NAK? Maybe the EEPROM goes wrong?

caicx
Offline
Last seen:6 years 2 months ago
Joined:2014-07-24 04:25
May you should use a hardware

May you should use a hardware logic analyzer to check, whether the eeprom have correct response.