AnsweredAssumed Answered

MBD ToolBox : DataMemRead / DataMemWrite on flash

Question asked by adrien pol on Apr 20, 2018
Latest reply on Apr 23, 2018 by Constantin Razvan Chivu

Hello,

 

I would like to store some data on the flash of my MPC5744p, and to be able to keep them after a reset.

 

I follow advises from this post : How to manage the memory using the simulink?  (method 2)

 

I modified "MPC5744P_FLASH.ld" :

MEMORY {
    word                :           org = 0x00FA0000, len = 0x0000001F
    int_flash           :           org = 0x00FA0020, len = 0x0020DFE0
    m_dflash            :           org = 0x011AE000, len = 0x00050000  
    vector_table        :           org = 0x011FE000, len = 0x00001000
    exception_handlers  :           org = 0x011FF000, len = 0x00001000
    int_sram            :           org = 0x40000000, len = 0x0005F800
    stack_ram           :           org = 0x4005F800, len = 0x00000800
    local_sram          :           org = 0x50800000, len = 0x00010000
}

SECTIONS
{
    .dflash : { KEEP (*(.dflash)) } > m_dflash  /* place .dflash section into dflsah memory*/
.

.

.

 

Point on it in the Matlab configuration, and checked modification in the generated ".map"

 

In Simulink I have a DataMemRead and a DataMemWrite block with this configuration :

 

 

To test, I configure the Write box to write the data from a CAN Signal, on trigger. And I read it on a second CAN signal. 

I generate the ".elf" with Simulink, and use S32 Design Studio to flash on the board.

It works until this point.

 

But I can't view my data on the "Memory" View of S32 :

 

And after a reset my read data is always "0xFF".

 

If someone has a clue...

 

Regards,
Adrien.

Outcomes