Stepping through C code in CodeWarrior?

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

Stepping through C code in CodeWarrior?

979 Views
ras44
Contributor II

 I just recently started developing in codewarrior and currently navigating my way through the interface. For some reason I cant seem to step through c code when debugging. I do however believe that the issue may be linked to the secure/unsecure aspect of the project.

I'll try to explain as best I can.

Going into the debugger, the first message I receive is "Communication with the target failed: The target MCU has no clock or wrong BDM clock speed is used or derivative is secured".

To get around this, I simply set the correct derivative and unsecure it using a file that came with it. After unsecuring it, I'm able to flash the MCU. After flashing the MCU, everything is grayed out and it seems like it secured it again?

So I once again unsecure it, which makes all the interface/buttons active again but nothing to step through?

Thank You.

MCU: HCS12XE Family 

3 Replies

706 Views
ras44
Contributor II

Hi Jennie, Thank You for your prompt response.

I've been following the steps in the above link but unfortunately received another error message in the middle of debug.

I'm not sure if they are related or not but this what I get now:

After launching the debugger, a Dialog Box appears which erases and tries to flash the MCU. In the middle of that process it errors out with several messages(in red) displaying "FP: No Programming Voltage" and eventually a dialog box which read "Elf Loader. Error while writing to C000..C200".

Thank You.

Here's the Log File

FP: FLASH parameters loaded for MC9S12XEP100_V1(NVMIF2 rev 1,1,1,1) from C:\Program Files (x86)\Freescale\CWS12v5.2\prog\FPP\mcu02D3.fpp
FP: FLASH parameters loaded for MC9S12XEP100_V1(NVMIF2 rev 1,1,1,1) from C:\Program Files (x86)\Freescale\CWS12v5.2\prog\FPP\mcu02D3.fpp
executing .\cmd\P&E_Multilink_CyclonePro_preload.cmd

!// Before load the commands written below will be executed
done .\cmd\P&E_Multilink_CyclonePro_preload.cmd

Preload command file correctly executed.
executing .\cmd\P&E_Multilink_CyclonePro_reset.cmd

!// After reset the commands written below will be executed
done .\cmd\P&E_Multilink_CyclonePro_reset.cmd

Reset command file correctly executed.

      MCU clock speed: 16000 Hz
Block Module Name      Address Range   Status
   0  DFLASH             800 -1F0BFF   Blank - Unselected
   1  PFLASH            4000 -  7FFF   Blank - Unselected
   2  PFLASH            C000 -  FFFF   Blank - Unselected
   3  PFLASH          C08000 -FFBFFF   Blank - Unselected

FP: The UNPROTECT command is not available for the DFLASH 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.
executing .\cmd\P&E_Multilink_CyclonePro_vppon.cmd

!// Before programming the flash, the commands written below will be executed
done .\cmd\P&E_Multilink_CyclonePro_vppon.cmd

Vppon command file correctly executed.

FP: No programming voltage

FP: No programming voltage

FP: No programming voltage

FP: No programming voltage
executing .\cmd\P&E_Multilink_CyclonePro_vppoff.cmd

!// After programming the flash, the commands written below will be executed
done .\cmd\P&E_Multilink_CyclonePro_vppoff.cmd

Vppoff command file correctly executed.
FP: Arm FLASH for loading.
executing .\cmd\P&E_Multilink_CyclonePro_vppon.cmd

!// Before programming the flash, the commands written below will be executed
done .\cmd\P&E_Multilink_CyclonePro_vppon.cmd

Vppon command file correctly executed.

FP: No programming voltage.
executing .\cmd\P&E_Multilink_CyclonePro_vppoff.cmd

!// After programming the flash, the commands written below will be executed
done .\cmd\P&E_Multilink_CyclonePro_vppoff.cmd

Vppoff command file correctly executed.
FP: FLASH disarmed.
executing .\cmd\P&E_Multilink_CyclonePro_postload.cmd

!// After load the commands written below will be executed
done .\cmd\P&E_Multilink_CyclonePro_postload.cmd

Postload command file correctly executed.
Error: Loading failed!

0 Kudos

706 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

HI Husein.

Regarding to your error message "FP: No Programming Voltage" ,

Unfortunately there may be more reasons for this problem.
Possible reasons are:
1.)
MCU is NOT placed in Special Single chip mode.
Please check the MODA, MODB and MODC pin connections on your PCB.
For Special Single chip mode MODA=0, MODB=0, MODC=0.
MODC should be connected to Vdd via pull up resistor about 4k7 (BDM will drive the MODC line low during Reset sequence and put the MCU to special single chip mode).
MODB&MODA should be connected via pull-down to Vss or left not connected.(There is internal pull-down resistor during reset).
For example: When the MODC=unconnected (high during reset), MODB = 1, MODA = unconnected (low during reset) I have also got these error messages: FP: No programming voltage FP: No programming voltage FP: ALL_PPAGES flash module is bad or protected.
2.) MCU may be damaged, or there is cold-soldered joint on PCB.
3.) Wrong derivative is selected (check debugger menu "P&E MultilinkCyclonePro", "set derivative...")
4.) Another problem…

Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

706 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

Thank you for posting your question here.

This is a very typical question and was ever asked by customers before. See answer in this link

https://community.nxp.com/message/849101 

Hope this helps.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos