GD23Z icon indicating copy to clipboard operation
GD23Z copied to clipboard

EEPROM emulation

Open nopnop2002 opened this issue 7 years ago • 6 comments

STM32 has EEPROM emulation. So i change this code

[Current] #if defined(ARDUINO_ARCH_STM32) //FT81XMANIA TEAM (@lightcalamar) ///////////////////////////////////////////////////////////////////////////////////////////////////////

AT24Cxx eep(i2c_address, 32); if (eep.read(0) != 0x7c) { self_calibrate(); for (int i = 0; i < 24; i++) eep.write(1 + i, GDTR.rd(REG_TOUCH_TRANSFORM_A + i)); eep.write(0, 0x7c); // is written! } else { for (int i = 0; i < 24; i++) GDTR.wr(REG_TOUCH_TRANSFORM_A + i, eep.read(1 + i)); }

/////////////////////////////////////////////////////////////////////////////////////////////////////// //FT81XMANIA TEAM (@lightcalamar) #endif

[Edit] #if defined(__STM32F1__) uint16 Status; uint16_t Data; Status = EEPROM.read(0x10,&Data); Serial.print("Data.EEPROM[10]="); Serial.println(Data,HEX); if (Data != 0x7c) { self_calibrate(); for (int i = 0; i < 24; i++) { Data = GDTR.rd(REG_TOUCH_TRANSFORM_A + i); Serial.print("Data.rd[" + String(i) + "="); Serial.println(Data, HEX); EEPROM.write(0x20 + i, Data); } EEPROM.write(0x10, 0x7c); // is written! } else { for (int i = 0; i < 24; i++) { Status=EEPROM.read(0x20+i,&Data); Serial.print("Data.EEPROM[=" + String(i) + "]="); Serial.println(Data,HEX); GDTR.wr(REG_TOUCH_TRANSFORM_A + i, Data); } } #endif

nopnop2002 avatar Apr 08 '18 04:04 nopnop2002

Hello @nopnop2002

Thank you for your cooperation. Can you tell which Arduino core you are using with your STM32F1 board?

lightcalamar avatar Apr 09 '18 07:04 lightcalamar

I'm using this core.

https://github.com/rogerclarkmelbourne/Arduino_STM32

If you use EEPROM emulation,you don't need any external chip.

nopnop2002 avatar Apr 09 '18 07:04 nopnop2002

Yes. Exact.

If using Arduino_STM32 core, it does not make external EEPROM data. However in README.md we recommend using core for STM32GENERIC by Danieleff , installation for IDE Arduino with STM32 boards, then if you need external EEPROM, core Arduino_STM32 does not have support for F407, F429 or F767, although if STM32GENERIC by Danieleff offers support to STM32F1 and much more example; core 144 pin the F4 family etc ...

Be interesting and be able to increase the power of this library by supporting more cores.

Thank you!

lightcalamar avatar Apr 09 '18 08:04 lightcalamar

OK I respect your opinion. I'll make a library of STM32F103 exclusive use by making reference to your library. Please close this isuue. Thank you.

nopnop2002 avatar Apr 09 '18 14:04 nopnop2002

Thank you @nopnop2002 .However, I will include your code and make a bigger library.

Finish installing new core, specifically Huaweiwx https://github.com/huaweiwx/STM32GENERIC, this generic core of STM32 for Arduino, have an emulation library of EEPROM and I think it works as in STM32_duino core.

Conduct tests right now with my Nucleo-F767 board, and work up to serial monitor. Then be very interesting, include code.

Thank you!

lightcalamar avatar Apr 09 '18 15:04 lightcalamar

OK I'm waiting your new library to be completed. Thank you.

nopnop2002 avatar Apr 09 '18 15:04 nopnop2002