Global 32-bit value not writing correctly

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

Global 32-bit value not writing correctly

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

Hi everyone,

This has been driving me bonkers and I'm hoping the community can set me in the right direction. I have a MPC5554 device in which I declare a global 32-bit value and then in my main() function, I try to write it with a 32-bit value.  For one, the global value initializes strangely to 0xcececece, and then when I attempt to write my 32-bit value, it seems to just duplicate the lower half-word. I'm using the GHS environment and have attached a screenshot of the section of code along with register and memory location values.  From what I see of the assembler code, it should be writing my value correctly. I'm perplexed why it seems to only be writing half of R12 to the memory location.  Any ideas?

0 件の賞賛
返信
1 解決策
1,012件の閲覧回数
Eric_racing
Contributor I

So after some hard thought, I figured out the issue. I realized that this was being written to the external RAM device. Relocating to internal RAM immediately solved the issue.  Turns out that the GHS default boot code initializes the external bus in 16-bit mode and that is what was causing this behavior.  After correcting that, no issues!

So if you happen to see similar behavior, check the width setting of your external bus configuration!

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,013件の閲覧回数
Eric_racing
Contributor I

So after some hard thought, I figured out the issue. I realized that this was being written to the external RAM device. Relocating to internal RAM immediately solved the issue.  Turns out that the GHS default boot code initializes the external bus in 16-bit mode and that is what was causing this behavior.  After correcting that, no issues!

So if you happen to see similar behavior, check the width setting of your external bus configuration!

0 件の賞賛
返信