Szymon Mroczek

S12XE programming and debugging issue

Discussion created by Szymon Mroczek on Mar 5, 2012
Latest reply on Mar 7, 2012 by kef

Hi All.


I am having troubles programming and debugging my S12XE based devices with CodeWarrior + ProcessorExpert + HiWave + P&E Micro USB BDM MultiLink debugger.


When I run debugging from CodeWarrior (Debug "play" alike icon button), HiWave launches and loading of executable file (abs) begins (see menu dialog "s12 executable loading configuration.png").

At verification stage error window appears (see "s12 programming issue 2.png").


I am not able to debug my code because of that. The address 0x0000C000 is where my code is placed (logical 0xC000).

I searched through my code repository revisions and I found that the problem appeared after setting Flash Module Security Bits to Unsecured State. I set this under ProcessorExpert while working on some flash related stuff.


So in my CPU bean the FLASH Security state option is set to Disabled now. Before it was set to Not initialized and then programming and debugging worked fine.

I checked that again and it works when not initialized, and does not work when set to Disabled.

I looked at code differences between those two settings.

When FLASH Security state option is set to Disabled, security bits SEC[1:0] are set to 10 meaning unsecured state (see Reference Manual, chapter 9.1.3).

When FLASH Security state option is set to Not initialized, security bits SEC[1:0] are NOT SET in code. 


I believe this is not ProcessorExpert issue, code generated seems to be OK with Reference Manual.

It's rather something else. Maybe I am missing something...

I couldn't find any info why setting security to unsecure state makes programming and debugging via HiWave + P&E Micro USB Multilink impossible...

Anyone anything?