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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
3,038件の閲覧回数
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

ラベル(1)
0 件の賞賛
返信
1 解決策
2,983件の閲覧回数
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 件の賞賛
返信
2 返答(返信)
2,984件の閲覧回数
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 件の賞賛
返信
2,967件の閲覧回数
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 件の賞賛
返信