Error in declaring variable for storing at specified address in S32K312

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

Error in declaring variable for storing at specified address in S32K312

Jump to solution
1,346 Views
victory
Contributor V

Dear NXP,

1.RTD version: 4.0.0, S32DS version: 3.5

2.Add ExchangeInfo to the linker_flash_s32k312.ld, as attached.

victory_0-1724058629678.png

3.The variable g_u2CurrBootOrAppMode is declared in main.c at address 0x20417FF0 (ExchangeInfo), but the compiled map file shows that the variable is located at 0x20408004.

victory_1-1724058842976.png

Please respond promptly. Thank you!

 

 

0 Kudos
Reply
1 Solution
1,294 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@victory

I don't quite understand your question, what do you mean that the program is crashed?

It runs fine on my end.

Senlent_0-1724138296872.png

 

View solution in original post

0 Kudos
Reply
3 Replies
1,313 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@victory

I checked your linker file and actually you didn't configure "SECTIONS" areas for "ExchangeInfo"

I made a quick modification for your reference.

Senlent_0-1724119315634.png

 

0 Kudos
Reply
1,309 Views
victory
Contributor V

Hi,Selent

1.Based on your response, I modified linker_flash_s32k312.ld, and g_u2CurrBootOrAppMode can correctly point to 0x20407FF0.

2.When I assigned the value g_u2CurrBootOrAppMode = 0xAA55, I found that g_u2CurrBootOrAppMode was not set, and the program crashed, as shown in the image below. For detailed code, see the attachment.

0 Kudos
Reply
1,295 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@victory

I don't quite understand your question, what do you mean that the program is crashed?

It runs fine on my end.

Senlent_0-1724138296872.png

 

0 Kudos
Reply