structure - unaligned memory? hard fault

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

structure - unaligned memory? hard fault

ソリューションへジャンプ
1,709件の閲覧回数
mjg8t
Contributor IV

Hi There,

 

I think I may be having an unalignment memory hard fault occurring.  I am using some code which has run fine on the KL devices, but is giving the K22 a hard fault.  I have narrowed down the issue to writing to a structure variable.  

 

I have been happily naive about memory alignment and it appears it is time to learn more details about it in fixing my issue here.  I have attached the project which is running on the frdm-k22f board.  The main loop has a write to the structure and which seems to be casuing the issue.  

 

Can someone explain what is wrong with the structure defenition?  How I can avoid this in the future?  And how to fix it?

 

Thanks!

Original Attachment has been moved to: test_sd.zip

0 件の賞賛
返信
1 解決策
1,579件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi,

I read you code and found that pdev is a pointer. But I didn't see you initializing it. A pointer must point to a entity before you use it.

Regards

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,580件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi,

I read you code and found that pdev is a pointer. But I didn't see you initializing it. A pointer must point to a entity before you use it.

Regards

0 件の賞賛
返信
1,579件の閲覧回数
mjg8t
Contributor IV

Thank you for having a look!  Very glad it was a something so simple.  

0 件の賞賛
返信