After writing NVOPT register, firmware does not work anymore

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

After writing NVOPT register, firmware does not work anymore

跳至解决方案
647 次查看
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 解答
508 次查看
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 回复数
509 次查看
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 项奖励
508 次查看
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 项奖励