Project

General

Profile

JNZ Forth access to EEPROM?

Added by SabineT over 1 year ago

Hi!

JNZ uses the STM32L052, which has 2 kB EEPROM. But I don't find in Embello, how to access this EEPROM. Are there plans to add this to the library? Or is there an easy way?
Specially for storing settings like NodeID, Frequency, GroupID, etc. it would be fine to use the EEPROM.

Regards,
Sabine


Replies (3)

RE: JNZ Forth access to EEPROM? - Added by jcw over 1 year ago

Good idea, I hadn't looked into that.

Have just added jz4/ex/eeprom.fs as an example how to write EEPROM. Reading it is the same as other memory, i.e. via normal @ accesses. Sample output:

!s ex/eeprom.fs
1> eeprom.fs 23: EE-BASE 16 dump
08080000   00 00 00 00 00 00 00 00   00 00 00 00 00 00 00 00   ........ ........
 ok.
1> eeprom.fs 27: EE-BASE 16 dump
08080000   00 00 00 00 00 00 00 00   88 77 66 55 00 00 00 00   ........ .wfU....
 ok.
1> eeprom.fs 31: EE-BASE 16 dump
08080000   00 00 00 00 00 00 00 00   44 33 22 11 00 00 00 00   ........ D3".....
 ok.

The EEPROM memory on the L052 runs from $08080000 to $080807FF.

RE: JNZ Forth access to EEPROM? - Added by SabineT over 1 year ago

Thanks for adding the example!

RE: JNZ Forth access to EEPROM? - Added by SabineT over 1 year ago

I think you should add the constant definitions and the ee! sub to flib/stm32l0/hal.fs

    (1-3/3)