The address that the value of a global variable is stored is in Code flash memory ,not in SRAM

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

The address that the value of a global variable is stored is in Code flash memory ,not in SRAM

Jump to solution
2,535 Views
ycgxy1650601
Contributor III

hi:

As shown in the figure,There are two program debug diagrams(wrong version and Correct version).   The two versions of the program are similar,the only difference is at F red box.  The wrong version is the first figure,The correct version is the second figure.   The error appears at C ( D) red box.(C red box is expressed by assembly, D red box is expressed in C language;the two are the same. )

     The location of the error is the value of the global variable USART2_RX_STA ,in the first figure.   The value of the global variable is stored in the address that R29 points to ,in the first figure.The address (R29 000020E4)that R29 points to is in the Code flash memory region in the first figure; It is error.   The address (R30 40001348)that R30 points to is in the SRAM region in the second figure; It is correct. 

   The only difference between the two programs is at F, Why does the error version of the program go wrong ? Why is the value of a global variable stored USART2_RX_STA in the Code flash memory region ?  The actual value is error and fixed.  But The values you see through the debug window are correct (E red box).(The code is attached,  software version: CodeWarrior IDE 2.10)

4连续发送3次有问题.JPG4.1.JPG

memory map.JPG

thank you

Labels (1)
0 Kudos
1 Solution
2,480 Views
stanish
NXP Employee
NXP Employee

Hello,

Thank you for your report.

I haven't tried to reproduce but I'd suggest you to compile your project using the latest compiler version.

Please try to install CodeWarrior for MCUs v11.x evaluation version (https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=CWX-MCU-PROED-EX_11-1) 

Create a new project in project wizard and copy/paste the source code that reproduces the problem from your original project.

Do you still observe the issue?

Thanks&Regards,

Stan

View solution in original post

0 Kudos
2 Replies
2,481 Views
stanish
NXP Employee
NXP Employee

Hello,

Thank you for your report.

I haven't tried to reproduce but I'd suggest you to compile your project using the latest compiler version.

Please try to install CodeWarrior for MCUs v11.x evaluation version (https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=CWX-MCU-PROED-EX_11-1) 

Create a new project in project wizard and copy/paste the source code that reproduces the problem from your original project.

Do you still observe the issue?

Thanks&Regards,

Stan

0 Kudos
2,464 Views
ycgxy1650601
Contributor III

Hi stanish:

Thank you for your reply.

There seems to be something wrong with your download link. I downloaded the new CW version from other link. My Download link:https://www.nxp.com.cn/design/software/development-software/codewarrior-development-tools/codewarrio... 

Is the version OK?

And  I created a new project in project wizard and copy/paste the source code , all going well.

The problem is solved.

Thank you

0 Kudos