- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
first i did some changes in the linker doc "linker_flash_s32k312.ld"
then i use this section likes follow:
when i did a line like this " if( eBootFlag == 0xAA) ", i got data from this section when power off the MCU and then power it on 5v. This line of code will crash the system. i want to know if there some wrong thing i did.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So your first problem is that "int_sram_ebotflg" is not initialized, right?
You can try to modify it in this way.
You still modify the link file as in the first problem, and then:
The program enters main()
1. Determine the reason for the MCU reset
2. If the last reset of the MCU is a functional reset, do not initialize "int_sram_ebotflg"
3. Otherwise, initialize the "int_sram_ebotflg" area
This should be able to solve your problem

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. Make sure that the SRAM must be initialized before use
The link file provided by NXP has already initialized the SRAM in the startup file. If the user modifies the link file, then it is necessary to ensure that the modified SRAM area is initialized.
2. Is the MPU configured correctly? You can turn off the MPU and try again
you can disable MPU like below shows and try again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Senlent
thanks for your reply.
i did some changes , _INT_SRAM_END which single is in the startup file . _INT_SRAM_END equal to ram_rsvd2 , so it is can't be initialized.
but if i distribute the SRAM as shown in the figure below :
After the following code is executed, the value in SRAM will be initialized to 0, but will Function Event Reset not change the value in SRAM?
so where should i to change make sure this data can‘t be changed if i choose "ram_rsvd2 : ORIGIN = 0x20418000, LENGTH = 0", The selection of SRAM is distributed in this way.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So your first problem is that "int_sram_ebotflg" is not initialized, right?
You can try to modify it in this way.
You still modify the link file as in the first problem, and then:
The program enters main()
1. Determine the reason for the MCU reset
2. If the last reset of the MCU is a functional reset, do not initialize "int_sram_ebotflg"
3. Otherwise, initialize the "int_sram_ebotflg" area
This should be able to solve your problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks @Senlent
I chose the area where SRAM starts and then i choose not to I chose not to initialize the SRAM at the time of the function event reset . the sram data i put in doesn't change.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
so i need to change Sd32? Where do you suggest I should change it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
