EPROM Memory creating for storing the flag in the S32K148 Hardware.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EPROM Memory creating for storing the flag in the S32K148 Hardware.

885 Views
Kallappa
Contributor III

Hello Team,

Currently, I have the bootloader which is located in the pflash in the first (512kb I .e starting from the 0x0000 0000)block of the memory. and Application code in the second(512KB i.e Starting from the 0x80000) pflash block.

Now I want to create a common space for storing some flags, and that flag is accessible to both (Bootloader and Application).

So I am new in these things if someone helps me to create the common space in the memory it will be really helpful.

Thanks in Advance,

Kallappa


0 Kudos
Reply
3 Replies

874 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Kallappa,

as a first step, I would recommend to read this application note:

https://www.nxp.com/docs/en/application-note/AN12003.pdf

The application note explains possible use-cases for FlexNVM memory. It depends if you want to use Emulated EEPROM and/or cryptographic features (CSEc) or if you want to use FlexNVM simply as DFlash.

Regards,

Lukas

 

0 Kudos
Reply

863 Views
Kallappa
Contributor III

Hello Lukas,

Thanks for the response,

As you suggested I gone through the Application Note.

As I mentioned in the message I just want to store the flag which will store the only True or False value.
and that location has to be accessed via bootloader as well as application.

so for this requirement, I can simply go for the FlexNVM as a DFlash to store the flag.

So now if I get some sample code snippet or the reference Document for how to do the partition and how to read and write at that location it will be really helpful.

Thanks once again for giving a quick response.

Regards,
Kallappa


0 Kudos
Reply

843 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Kallappa,
you can take a look at this SW example:
c:\NXP\S32DS_ARM_v2.2\S32DS\software\S32SDK_S32K1xx_RTM_3.0.0\examples\S32K148\driver_examples\system\flash_partitioning\

By default, all the FlexNVM is configured as Dflash but there’s a note in the RM that partition command should be executed anyway („Although this is the default value, a PGMPART command must be launched for this code to be valid.“).

The partition command is supposed to be executed only once. If you need to change the partition, mass erase is needed. So, you can run the partition command separately using some initialization project or you can run the partition only first time in your application project.
You need to call only FLASH_DRV_Init and FLASH_DRV_DEFlashPartition.
Then you can simply use FLASH_DRV_EraseSector and FLASH_DRV_Program command and you can read programmed value via pointer.

Regards,
Lukas

 

0 Kudos
Reply