Data/Parameter Store in Embedding System Memory Permanently

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

Data/Parameter Store in Embedding System Memory Permanently

2,945 Views
bcelikte
Contributor III

Hi,

I am Baran Celikten, a member of Ford OTOSAN Battery Management System Team.

We are using SK32K144EVB and FRDM33771BSPIEVB cards to develop BMS algorithms. What we want to know is data or parameter change/store in embedded system permanently. In other words, when BMS sleeps or for any reason stops working (off-mode maybe), we want to use some of the last calculations (for ex. SOC, capacity or some logic counters). For this purpose, we need data store to memory. Is there a special box to write a parameter or data permanently in the embedded system memory to use later.

Thanks.

Baran Celikten

Labels (1)
8 Replies

2,678 Views
constantinrazva
NXP Employee
NXP Employee

Hello bcelikte@ford.com.tr,

If I understand correctly you are looking for a block to write data into a non-volatile memory - for the time being we do not have such support, but we will have it in our next release, which is on 20th July, so under 2 weeks from now. There you will find special blocks for read/write to non-volatile memory, so you can access your parameters after restart.

Kind regards,

Razvan. 

0 Kudos

2,678 Views
oeren5
Contributor III

Hi,

I try to write some data to permanent memory as well. I used EEPROM config,write and read blocks. But I encounter a problem while uploading this model from Simulink. The red LED right above the openSDA connectors turned on permanently and I could not upload any new models to board. I solved problem by using help in community (an example uploaded by using S32 design studio ARM).

I want to store some data permanently such that the board should store the data even it's power turned off and  I should be able to read the exact same data when I turned power on. I understand that I should write the data to non volatile memory but I could not understand how to do it.

To conclude, how can I write and store data to non volatile memory? Which MBDT blocks should I use to perform this taks?

Thanks in advance.

0 Kudos

2,678 Views
constantinrazva
NXP Employee
NXP Employee

Hello oeren5@ford.com.tr ,

What MCU are you using? Is it S32K144 ? In any case, paulvlase‌ can give you more details about how to use these blocks. Keep in mind that there are examples that we ship with our toolbox - you can find them in

{ROOT}\S32_Examples\s32k14x\flash

Kind regards,

Razvan.

P.S.: thank you in advance paulvlase

0 Kudos

2,678 Views
oeren5
Contributor III

Hi constantinrazvan.chivu

I tried the example that you provided and it worked.

But when I try to use same blocks (Flash config, Flash EEEwrite and Flash EEEread) in any other models I encounter with an flash memory error (red led turned on permanently and board can not communicate) every time and I have to reset the board memory when ever I try a memory example.

So, could you please provide more detailed explanations about these blocks and how can use these blocks for storing different data in a permanent way?

Thanks in advance. 

2,678 Views
paulvlase
NXP Employee
NXP Employee

Hi oeren5@ford.com.tr‌,

Beforing using the EEEPROM memory, you have to partition the FlexNVM memory as EEEPROM. To do that you use the FLASH_Config block.

Then you use the FLASH_EEEWrite block to write to the EEEPROM memory, and the FLASH_EEERead block to read from it.

We found that on S32K144 and S32K144W, when you partition the FlexNVM memory as EEEPROM, the OpenSDA fails to download any application after that. This issue was reported to PEMicro which develops the OpenSDA bootloader.

One workaround is to download the application from S32 Design Studio for ARM.

Another one is to use the RappiD bootloader instead of OpenSDA to download the application directly from Simulink.

First you have to write the bootloader to the board from S32 Design Studio for ARM.

1. Create a project from hello_world_s32k144 S32DS example  from File -> S32DS project from Example menu.

pastedImage_9.png

2. Open Run -> Debug Configurations ..., select hello_world_s32k144_debug_flash_pemicro configuration. For the C/C++ Application input select MBD_S32K_ROOT\tools\BootLoader\RBF_Files\S32K144_S32DS_UART1_CAN0.rbf tfile o flash, where MBD_S32K_ROOT is the output of mbd_find_s32k_root command in Matlab.

pastedImage_18.png

3. Press Debug button to write the RappiD bootloader to the board and once the debugger finishes to write the file to the board press the Disconnect button from toolbar or from Run -> Disconnect menu.

After you write the bootloader to the board, you have to change the Target Configuration parameters form the MBD_S32K14x_Config_Information:

pastedImage_7.png

1. Select Download Code after Build option.

2. Select Serial option for the Download Interface to downloand the appliction using the RappiD bootloader.

3. Select Boot Assist Module (BAM) Restart Request option.

3. Connect the S32K board to the PC and press the Refresh button to update the list of available COM Ports.

4. Select the COM Port of the S32K board.

5. Press the OK button to save the changes.

Now you can build the model as you would had done for OpenSDA. At the end of the build, you will see a dialog that will request you to reset the board. To do this you have to press the Reset button (SW5) on the S32K144-Q100 EVB board, next to the USB port, and click OK button in the dialog to start the download operation.

pastedImage_20.png

Once you reset the board, the application will be downloaded to the board and it should start to run.

Regards,

Paul

2,678 Views
oeren5
Contributor III

Hi paulvlase

Thanks a lot for your detailed explanations.

I followed your steps and firstly download the rbf file by using debug tool of S32DS for Arm. Then I configured the MBD_S32K14x_Config_Information as follow:

pastedImage_3.png

Then I successfully download the code and received the restart window and I pressed the start button and observe the RAppID progress:

pastedImage_4.png

pastedImage_5.png

After that the code is downloaded and I observe the data by using Freemaster tool. But when I powered off the board and turned on again in order to test the non-volatile memory I constantly received communication error in Freemaster and could not test the data. I received following error code and I wonder whether it is related with Freemaster or something I do. How can I fix this problem and observe that the data stored permanently even though the board is turned off and turned back on?

pastedImage_8.png

Thanks in advance.

0 Kudos

2,678 Views
mariuslucianand
NXP Employee
NXP Employee

paulvlase‌, can you please comment on this?

Marius

0 Kudos

2,678 Views
bcelikte
Contributor III

Great, thanks.

Could you please also refer the name of that special block to find it easily?

Thanks.

0 Kudos