Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 5 months ago.
EEPROM Problem again?
Hello Bernard,
Some time ago i had problems with Atmel AT24C512 eeprom, and i could resolve them with your library, It was working like a charm.
For few days, i started to experince the problems again. I prepared a below sample code, but can't get the saved value from eeprom register. This library was working a week ago, Do you also experince problems? May be because of last mbed update?
My eeprom connections are valid: SDA - SDA, SCL - SCL, WP - Ground, AO,A1,NC,GND - GND, VCC - 3.3V, 2K2 resistors on SDA and SCL line,
My board is STM32F401RE Nucleo.
#include "mbed.h" #include "eeprom.h" // EEPROM Adress //#define EEPROM_ADDRESS 0x50 // EEPROM (AT24C512) address EEPROM eeprom(I2C_SDA, I2C_SCL, 0, EEPROM::T24C512); Serial pc(USBTX, USBRX); int main() { pc.printf("Hello\r\n"); uint32_t eeprom_adrr = 0; int16_t data = 111; int16_t res=0; eeprom.write(eeprom_adrr, data); wait_ms(5); eeprom.read(eeprom_adrr, res); pc.printf("%d", res); }
I had quick look your sample code in your header file. But how can i convert uint_32t, uint16_t, uint8_t, type variables read from eeprom to send a string in scanf?
I mean %d for uint32_t? %hhd for uint8_t?
Thanks and regards....