MC9S12DT256 : have problem to when set __stack=0x3FFF

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

MC9S12DT256 : have problem to when set __stack=0x3FFF

ソリューションへジャンプ
1,215件の閲覧回数
lx
Contributor I

I am using MC9S12DT256MFUE. It supposes to have 12k RAM. But when I set __stack=0x3FFF, the stack was unable to update, i.e. when calling a sub-routine, the return address was not saved in the stack. The stack works if I set __stack=0x2FFF. Is there any other registers I need to initialize?

Thank you

ラベル(1)
0 件の賞賛
返信
1 解決策
1,017件の閲覧回数
Lundin
Senior Contributor IV

Yes, you might need to set the INITRM register, and possibly also INITRG and INITEE. These registers map the memory to certain addresses.Check the MMC part of the manual for details of how to set them.

 

There is a figure in the introduction chapter of the manual, displaying the default memory layout for the part out of reset. Registers, RAM and EEPROM may overlap. If that happens, registers take precedence over RAM, which takes precedence over EEPROM.

 

You should set INITRM, INITRG and INITEE immediately after setting the stack pointer, at the very beginning of your program.

 

Also make sure that the stack etc are properly mapped to the correct addresses. This is compiler-dependent. If you are using Codewarrior, this is done in the .prm file.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,018件の閲覧回数
Lundin
Senior Contributor IV

Yes, you might need to set the INITRM register, and possibly also INITRG and INITEE. These registers map the memory to certain addresses.Check the MMC part of the manual for details of how to set them.

 

There is a figure in the introduction chapter of the manual, displaying the default memory layout for the part out of reset. Registers, RAM and EEPROM may overlap. If that happens, registers take precedence over RAM, which takes precedence over EEPROM.

 

You should set INITRM, INITRG and INITEE immediately after setting the stack pointer, at the very beginning of your program.

 

Also make sure that the stack etc are properly mapped to the correct addresses. This is compiler-dependent. If you are using Codewarrior, this is done in the .prm file.

0 件の賞賛
返信
1,017件の閲覧回数
lx
Contributor I

Thank you Lundin.

0 件の賞賛
返信