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?
Tried that with no success.
Here's part of HiWave's command window content just when preload command file is to be executed:
FP: FLASH parameters loaded for MC9S12XEG128_V2(NVMIF2 rev 1,1,1,1,1) from D:\Programy\Freescale\CWS12v5.1\prog\FPP\mcu02DD.fppexecuting cmd\P&E_Multilink_USB_Preload.cmd!// Before load the commands written below will be executed!FLASH NOUNSECUREdone cmd\P&E_Multilink_USB_Preload.cmdPreload command file correctly executed.USB HCS08/HCS12 MULTILINK detected - Flash Version 5.84executing cmd\P&E_Multilink_USB_Reset.cmd!// After reset the commands written below will be executeddone cmd\P&E_Multilink_USB_Reset.cmdReset command file correctly executed. MCU clock speed: 2012000 HzBlock Module Name Address Range Status 0 PFLASH 4000 - 7FFF Blank - Unselected 1 PFLASH C000 - FFFF Blank - Unselected 2 PFLASH E08000 -E3BFFF Blank - Unselected 3 PFLASH FC8000 -FFBFFF Blank - Unselected 4 DFLASH 800 -1F0BFF Blank - UnselectedFP: The UNPROTECT command is not available for the PFLASH flash module => Skipped.FP: The UNPROTECT command is not available for the PFLASH flash module => Skipped.FP: The UNPROTECT command is not available for the PFLASH flash module => Skipped.FP: The UNPROTECT command is not available for the PFLASH flash module => Skipped.FP: The UNPROTECT command is not available for the DFLASH flash module => Skipped.executing cmd\P&E_Multilink_USB_Vppon.cmd!// Before programming the flash, the commands written below will be executeddone cmd\P&E_Multilink_USB_Vppon.cmdVppon command file correctly executed.FP: Arm FLASH for loading.executing cmd\P&E_Multilink_USB_Vppon.cmd!// Before programming the flash, the commands written below will be executeddone cmd\P&E_Multilink_USB_Vppon.cmdVppon command file correctly executed.executing D:\Repozytoria\Code\Proj...
Then it continues with the rest of command files ending with:
executing cmd\P&E_Multilink_USB_Postload.cmd!// After load the commands written below will be executed done cmd\P&E_Multilink_USB_Postload.cmdPostload command file correctly executed. ^Error: Loading failed!
Again, no problems when using code with no usage of SEC bits.