Skip to content

EEPROM emulation #2

Open
Open

Description

@nopnop2002

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

Activity

  1. lightcalamar commented on Apr 9, 2018

    @lightcalamar
    Owner

    Hello @nopnop2002

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

  2. nopnop2002 commented on Apr 9, 2018

    @nopnop2002
    Author

    I'm using this core.

    https://github.com/rogerclarkmelbourne/Arduino_STM32

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

  3. lightcalamar commented on Apr 9, 2018

    @lightcalamar
    Owner

    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!

  4. nopnop2002 commented on Apr 9, 2018

    @nopnop2002
    Author

    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.

  5. lightcalamar commented on Apr 9, 2018

    @lightcalamar
    Owner

    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!

  6. nopnop2002 commented on Apr 9, 2018

    @nopnop2002
    Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions