Author Topic: uTasker FlexNVM Simulator support  (Read 2793 times)

Offline tdrobnak

  • Newbie
  • *
  • Posts: 28
    • View Profile
uTasker FlexNVM Simulator support
« on: March 03, 2020, 02:54:19 PM »
Does anyone know if uTasker supports FlexNVM for EEPROM emulation?  NXP has two application notes on the subject:
  • AN4282 - Using Kinetis Family Enhanced EEPROM Functionality
  • AN5338 - How to use FlexMemory as D-Flash and EEPROM in KE1xF

I have looked through uTasker 1.4.12 and found no driver for FlexNVM so I added the necessary driver code from the NXP SDK 2.7.0 flexnvm_eeprom.c example.  I now have access to EEPROM emulation using FlexNVM when run on the hardware.  When I run on the uTasker simulator, I receive exceptions on access to the registers that control FlexNVM partitioning and status.  Has anyone else run into this situation?  Is there a way to work around it?

Thank you.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: uTasker FlexNVM Simulator support
« Reply #1 on: March 03, 2020, 08:23:04 PM »
Hi

By adding
    #define KINETIS_FLEX                                                 // part with flex memory
    #define SIZE_OF_FLEXFLASH   (32 * 1024)                              // 32k Flex

there is support for D-Flash but only for use as linear storage (eg. for parameter system or file system)

I was never very motivated by the EEPROM emulation features that can be configured since it is usually quite easy to do the same thing in P-flash (which all chips have and is therefore compatible) or D-flash (which is in essentially P-flash in a different memory area).
EEPROM emulation spreads smaller amounts of data across larger amounts of memory in order to be able to increase the overall write/erase limits to the range of traditional EEPROMs.

For this reason I never added EEPROM emulation based on FlexNVM, but if you send me the file that you use I will take a look into supporting emulation of it. It will essentially require catching the writes made and interpreting them in order to maintain a block of memory of the configured size and update its content accordingly. The full details about how the sectors are swapped aroud is probably not that relevant for a simulation that just needs to update the 'visible' content (as if it were EEPROM, or RAM).

Regards

Mark

P.S. i didn't realsise the KE1XF has FlexNVM before...

Offline tdrobnak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: uTasker FlexNVM Simulator support
« Reply #2 on: March 05, 2020, 03:12:45 PM »
Thank you, Mark for the explanation and offer to add emulation support for EEPROM emulation of FlexNVM.  When I get to a stopping point on my present task with this application, I will send you a file that provides FlexNVM EEPROM emulation support to uTasker in the hardware.

Tom