After writing NVOPT register, firmware does not work anymore

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

After writing NVOPT register, firmware does not work anymore

ソリューションへジャンプ
645件の閲覧回数
eisenrah
Contributor I

Hello,


I developed a firmware with bootloader for the MC9S08DV32 microcontroller.

I'm now trying to secure the device so that the flash cannot be read after the device is shipped.

When I try to secure the device by defining a variable like...


"const unsigned char NVOPT_INIT  @0xFFBF = 0x7C"


...the device is secured, but the firmware does not work anymore as expected (normally there should be CAN messages sent every 20 ms, but there is no activity on the bus at all).

When i change the line back to...


"const unsigned char NVOPT_INIT  @0xFFBF = 0x02"


...everything works again as expected. I have no idea why only writing one byte to NVOPT changes the behavior in such a way. Because the Debug-Mode is disenabled when the device is secure, i have no way to debug this problem.


Can you help me?

I use the classic CodeWarrior IDE, lastest version, and a P&E micro USB Multilink Interface to program the chip.


Thank you very much,

Friedemann

ラベル(1)
0 件の賞賛
1 解決策
506件の閲覧回数
tonyp
Senior Contributor II

Your first value ($7C) disables vector redirection, the second ($02) enables it.

That is a significant difference if the code is meant to work with or without redirection.

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
507件の閲覧回数
tonyp
Senior Contributor II

Your first value ($7C) disables vector redirection, the second ($02) enables it.

That is a significant difference if the code is meant to work with or without redirection.

0 件の賞賛
506件の閲覧回数
eisenrah
Contributor I

You are right, thank you very much! I missed the FNORED bit.

I'm now securing with value 0x3C and unsecure with 0x3E.

Problem solved.

0 件の賞賛