cancel
Showing results for 
Search instead for 
Did you mean: 

hello, I am using m24m01 EEPROM Ic, how to write and read data from eeprom, i was try with example code but i was getting no data in HAL_I2C_Mem_Read(&hi2c1,0xA1,0,0xFF,(uint8_t *)&data_read,1,1);

PrashantP
Associate II
 
3 REPLIES 3
berendi
Principal

You have my deepest sympathy.

Unfortunately, as I have yet no means to know

  1. how is the EEPROM connected
  2. what other components are sharing the connection
  3. whether it has power at all
  4. what is its part number
  5. what pullup resistors are there
  6. how do the signals look like
  7. what MCU are you using (with exact part number)
  8. what are RCC register settings
  9. what are in the GPIO registers
  10. what do I2C registers contain before the communication attempt
  11. what do I2C registers contain after the communication attempt

I can off no other advice than check each of those points thoroughly, using the board schematics and BOM, the EEPROM datasheet, the MCU datasheet and reference manual, and an oscilloscope.

PrashantP
Associate II

pullup resistor of 2.2 k

MCU is STM32f303c8

PrashantP
Associate II

These are my answers:

Note:- I am using examples of STM32F303C8 related boards.In that I am not using DMA and converted it by using an interrupt mode all other things I have same.

  1. M24M01-RP is connected by SCl and SDA line to my controller STM32F303C8 with pullups of 2.2.k
  2. No any other component is sharing connection only one slave.
  3. Yes. of course.
  4. M24M01-RPk625 and STM32F303C8.
  5. 2.2 k
  6. Not seen on scopee.
  7. STM32F303C8 -LQFP48
  8. RCC Settings:

/**

 * @brief System Clock Configuration

 *     The system Clock is configured as follow : 

 *      System Clock source      = PLL (HSE)

 *      SYSCLK(Hz)           = 72000000

 *      HCLK(Hz)            = 72000000

 *      AHB Prescaler         = 1

 *      APB1 Prescaler         = 2

 *      APB2 Prescaler         = 1

 *      HSE Frequency(Hz)       = 8000000

 *      HSE PREDIV           = 1

 *      PLLMUL             = RCC_PLL_MUL9 (9)

 *      Flash Latency(WS)       = 2

 * @param None

 * @retval None

9. GPIO Register is PB6 and PB7 as I2C pins.

10.In status register transmission enbale bit is set already all other bits are zero.

11. Controller stuck in this while loop.

 while (HAL_I2C_GetState(&I2cHandle) != HAL_I2C_STATE_READY)

   {

   }

Confusions:-----1.I have doubt in timeout value

2.page size in IC datsheet Is-256 but in example it is taken as 128.

3.Also about DMA and IT.