Skip to main content
Hrishikesh
Associate III
January 31, 2021
Question

External EEPROM not working

  • January 31, 2021
  • 1 reply
  • 825 views

I have a 24FC01, 1 Kbit EEPROM on my board. The SDA and SCL lines are pulled up to 3.3V through two 2K resistors. I'm using a STM32F407 MCU to read and write data to the EEPROM. Using the HAL libraries, I'm trying to check if the device is ready using 

HAL_I2C_IsDeviceReady(&i2c2, 0x50, 2, 100) function. However, this fails, returns false and triggers a hard fault. The I2C is configured in CubeMX with 100KHz clock speed and 7-bit addressing. What am I missing?

This topic has been closed for replies.

1 reply

Vangelis Fortounas
Associate II
January 31, 2021

hello

Shift the slave address 1 bit left

0x50<<1 or 0xA0

As for the hardfault, is i2c2 a valid handler? Instead use hi2c2 used in initialization from CubeMX.

Hrishikesh
Associate III
February 1, 2021

Oh yes, I read this but completely ignored it. Thank you. Also, yes I've been using hi2c2. This was a typo here. I'll retest and report back.