Overlay Management Unit

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Overlay Management Unit

1,762 次查看
jiangwei
Contributor II

Hi,

 

Are there any examples for how to create overlays for S32k396?

 

Regards!

 

#S32k396

0 项奖励
回复
6 回复数

1,654 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

I just obtained an example code from SW engineers. I am sharing it as it is including description below:

This demo can implement how to remap the Flash address to one specific RAM address, and how to config the overlay region. 

Development Env:

  • RTD: SW32K3_S32M27x_RTD_R21-11_5.0.0
  • EB Tresos 29.0 config the project and compile the project with the command line
  • Debug tool: Lauterbach. One debug script is in the example package

Debug steps:

  • To minimize the environmental deviation, please extract the package into the following position:

1.png

  • Replace the original RTD package file(C:\NXP\SW32K3_S32M27x_RTD_R21-11_5.0.0\eclipse\plugins\BaseNXP_TS_T40D34M50I0R0\header\S32K37_OMU_CM7.h //  C:\NXP\SW32K3_S32M27x_RTD_R21-11_5.0.0\eclipse\plugins\Platform_TS_T40D34M50I0R0\startup\src\system.c) with the following hotfix file 

2.png

  • Change the path to the following position, and use make build command to build the project. using make clean to clean the project

3.png

Hope it helps

0 项奖励
回复

1,598 次查看
jiangwei
Contributor II

Hi,

I am testing the memory overlay functionality for the S32K396. I have established the relationship between Mirrored Flash and RAM by using OMU.

  • Modify the value of RAM and the value of mirror flash is also changed.
  • When I read the original flash value, it still remains unchanged(The value of the mirror flash changes and should be read through the original flash.)

 

 

#define EXAMPLE_SECTOR_4_ADDR      (0x00400000U)
const uint32_t *Array4 = (uint32_t *)0x400000;
const uint32_t *Array4mirror = (uint32_t *)0x8400000;
uint32_t Value4 = 0;
uint32_t Value4mirror = 0;

......

    for(i = 0; i<OMU_NUM_BYTES; i++)
    {
        omu_flash_program_5data[i] = 5;
    }
    Flash_WriteFun(Example_MemInstanceId, EXAMPLE_SECTOR_4_ADDR,omu_flash_program_5data, OMU_NUM_BYTES);

......

   Value4 = Array4[10];
   Value4mirror = Array4mirror[10];

......

    OMU INIT and OMU Enable

......

    Value4 = Array4[10];
    Value4mirror = Array4mirror[10];

 

jiangwei_0-1732850106165.png

 

  • How to correctly read the changed value of Mirrored Flash through the Origin Flash address?
  • How to implement the request to read the original flash, S32K396 automatically reads the variable value on the ram address through OMU mapping?

Regards!

标记 (1)
0 项奖励
回复

1,573 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

I haven't tested it, but in the C module Omu_MappingTest.c, function Omu_MappingFun shows certain OMU test, so it should be possible to understand expected use.

0 项奖励
回复

1,553 次查看
jiangwei
Contributor II

Unfortunately, the data was not read from the original flash in the Omu_MappingTest.c program. I successfully read the ram value from the mirrored flash through the Omu_MappingTest.c program. But when I modified the program and tried to read the ram value from the original flash, the read value still did not change from the original flash value to the ram value, and the results were not as expected.

标记 (1)
0 项奖励
回复

1,539 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

I think it is correct, it worked this way on predecessor platforms as well (MPC57xx) i.e.

original flash address = physical address
mirrored flash address = logical address

calibration (overlay) runs above logical address and what is actually what you see (if I understand it well) that is changing data in RAM leads in changing of data in logical flash address

0 项奖励
回复

1,703 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

Unfortunately I am not aware of any example. I am double checking it with designers, I will let you know as soon as possible.

0 项奖励
回复