occasional hard fault exception on using IAP command to read UID

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

occasional hard fault exception on using IAP command to read UID

ソリューションへジャンプ
1,353件の閲覧回数
brayannevillepa
Contributor II

lpc1114‌

I use LPC1114XL controller and came across an issue with IAP command to read UID. I was using this command in background loop to service a UART request(from PC) to read information. The code works, but rarely ends up at hard fault exception handler. With bit of debugging I was able to consistently reproduce the issue.  The problem occurs when the IAP routine is preempted by an interrupt. I couldn't find this issue documented in reference manual or errata. Can someone confirm if this issue and proposed workaround?

ラベル(2)
タグ(1)
0 件の賞賛
返信
1 解決策
1,234件の閲覧回数
bernhardfink
NXP Employee
NXP Employee

IAP uses a small memory area in SRAM, if you have interrupts this area might be overwritten (depending on you memory layout). This could explain the crash.

From the User Manual:

19.4.8  RAM used by ISP command handler
ISP commands use on-chip RAM from 0x1000 017C to 0x1000 025B. The user could use
this area, but the contents may be lost upon reset. Flash programming commands use the
top 32 bytes of on-chip RAM. The stack is located at (RAM top − 32). The maximum stack
usage is 256 bytes and it grows downwards.
19.4.9  RAM used by IAP command handler
Flash programming commands use the top 32 bytes of on-chip RAM. The maximum stack
usage in the user allocated stack space is 128 bytes and it grows downwards.

Regards,

Bernhard.

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
1,235件の閲覧回数
bernhardfink
NXP Employee
NXP Employee

IAP uses a small memory area in SRAM, if you have interrupts this area might be overwritten (depending on you memory layout). This could explain the crash.

From the User Manual:

19.4.8  RAM used by ISP command handler
ISP commands use on-chip RAM from 0x1000 017C to 0x1000 025B. The user could use
this area, but the contents may be lost upon reset. Flash programming commands use the
top 32 bytes of on-chip RAM. The stack is located at (RAM top − 32). The maximum stack
usage is 256 bytes and it grows downwards.
19.4.9  RAM used by IAP command handler
Flash programming commands use the top 32 bytes of on-chip RAM. The maximum stack
usage in the user allocated stack space is 128 bytes and it grows downwards.

Regards,

Bernhard.

0 件の賞賛
返信
1,234件の閲覧回数
brayannevillepa
Contributor II

Ok, that probably explains it. I do have the interrupt vector table mapped to SRAM. Thanks.

0 件の賞賛
返信
1,234件の閲覧回数
converse
Senior Contributor V

I know that for programming Flash, you must disable interrupts - maybe you need to do that for any IAP command. BTW: Why don't you read the UID once (at boot time) and then just return the value when requested, instead of making multiple IAP calls?

1,234件の閲覧回数
brayannevillepa
Contributor II

Thanks for the suggestion, I am using the IAP commands at init now. 

0 件の賞賛
返信