After writing NVOPT register, firmware does not work anymore

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

After writing NVOPT register, firmware does not work anymore

Jump to solution
629 Views
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

Labels (1)
0 Kudos
1 Solution
490 Views
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.

View solution in original post

0 Kudos
2 Replies
491 Views
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 Kudos
490 Views
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 Kudos