How to store and read last data from non-volatile memory?

Showing results for 
Search instead for 
Did you mean: 

How to store and read last data from non-volatile memory?

Contributor III

Hello everyone,


This is Ozan and I am using S32K144, mbdt v4.2 and Matlab 2020a. I try to modify the BMS example in the toolbox. The example model provides several information such as cell voltages, pack voltage, cell temperature and pack current. 

I want to built a model which acts as simple Coulomb counter. The main goal is sum the pack current over period of time sample, subtract this summed value from remaining capacity and divide this over total capacity and store this data as packSOC (after multiplying with 100 for %). The model details and ss are provided below.

After calculating the packSOC I want to store this value in non-volatile memory in case the board is powered off. And I want to read this value and start SOC calculation from this stored lastSOC value. 

I observe non-sense and constantly floating values from Freemaster when I upload this model. I think the problem is related with initialization. 

I stuck with this problem quite a while and any help will be appreciated. Thanks in advance. 

The model ss:






0 Kudos
0 Replies