Other Parts Discussed in Thread: SYSCONFIG
Dear all,
I currently bricked some controllers caused by trying to debug a firmware not placed at address 0x0. We use a custom bootloader and hence placed the firmware at a different address. The memory layout is as follows:
- The bootloader is placed at the lower 8k flash memory (0x0000 - 0x1fff)
- The firmware is placed just behind the bootloader (0x2000 - 0xb7ff)
- After power-up/reset the bootloader is started and jumps to the firmware.
The following works fine:
- Install the firmware using an XDS110 and place it at address 0x0
- Install the bootloader using an XDS110 and place it at address 0x0
- Install the bootloader using an XDS110 and install the firmware to address 0x2000 using the bootloader (addresses are adjusted in the linker script and the firmware recompiled)
- -> After a reset our custom bootloader is started which in turn starts the firmware.
However, trying to debug our firmware while it is placed at address 0x2000 seems to brick the controller.
Steps to reproduce:
- Build and install our custom bootloader (address 0x0)
- Build firmware (linker script places the firmware at address 0x2000)
- Configure the debugger to NOT erase the bootloader
- Start debugging
I expect the following behavior:
- CCS/XDS110 erase the configured flash sectors and download the firmware
- CCS/XDS110 set a breakpoint at "main()" and issue a reset
- Upon reset our custom bootloader is started which in turn jumps to the firmware
- The firmware holds at "main" and CCS/XDS110 gain control
However, the actual behavior is as follows:
- CCS/XDS110 override the bootloader (line 7)
- CCS/XDS110 download the firmware (line 11-50)
- Debugging fails with errors -1001 and -2064 (lines 51 till the end).
CORTEX_M0P: GEL Output: Memory Map Initialization Complete
CORTEX_M0P: Flash Programmer: Verbose output enabled
CORTEX_M0P: Flash Programmer: DLL Version 1.4.1.0
CORTEX_M0P: Flash Programmer: FlashResetBeforeLoadSetting = 1
CORTEX_M0P: Flash Programmer: FlashResetType = Hard reset
CORTEX_M0P: Flash Programmer: Hard reset before programming
CORTEX_M0P: Writing Flash @ Address 0x00000000 of Length 0x00002988
CORTEX_M0P: Flash Programmer: Uploading RAM loader to device
CORTEX_M0P: Flash Programmer: RAM loader returned after 10 ms
CORTEX_M0P: Flash Programmer: Device init finished
CORTEX_M0P: Flash Programmer: Erasing main memory by sectors
CORTEX_M0P: Flash Programmer: Start Erase from = 0x2000 to 0xb7ff
CORTEX_M0P: Flash Programmer: RAM loader returned after 10 ms
CORTEX_M0P: Flash Programmer: RAM loader returned after 10 ms
[...]
CORTEX_M0P: Flash Programmer: RAM loader returned after 10 ms
CORTEX_M0P: Flash Programmer: RAM loader returned after 10 ms
CORTEX_M0P: Flash Programmer: RAM loader returned after 10 ms
CORTEX_M0P: Error: (Error -1001 @ 0x0) Requested operation is not supported on this device. (Emulation package 9.12.0.00150)
CORTEX_M0P: Trouble Halting Target CPU: (Error -2064 @ 0x0) Unable to read device status. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.12.0.00150)
CORTEX_M0P: Error: (Error -614 @ 0x0) The target indicates there is an error condition from a previous SWD request. Clear the error the condition, and try the SWD request again. (Emulation package 9.12.0.00150)
CORTEX_M0P: Trouble Halting Target CPU: (Error -2064 @ 0x0) Unable to read device status. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.12.0.00150)
CORTEX_M0P: Error: (Error -614 @ 0x0) The target indicates there is an error condition from a previous SWD request. Clear the error the condition, and try the SWD request again. (Emulation package 9.12.0.00150)
[...]
CORTEX_M0P: Trouble Halting Target CPU: (Error -2064 @ 0x0) Unable to read device status. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.12.0.00150)
CORTEX_M0P: Error: (Error -614 @ 0x0) The target indicates there is an error condition from a previous SWD request. Clear the error the condition, and try the SWD request again. (Emulation package 9.12.0.00150)
CORTEX_M0P: Trouble Halting Target CPU: (Error -2064 @ 0x0) Unable to read device status. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.12.0.00150)
CORTEX_M0P: Unable to determine target status after 20 attempts
CORTEX_M0P: Failed to remove the debug state from the target before disconnecting. There may still be breakpoint op-codes embedded in program memory. It is recommended that you reset the emulator before you connect and reload your program before you continue debugging
CORTEX_M0P: File Loader: Memory write failed: Could not read 0x20200014: target is not connected
CORTEX_M0P: GEL: File: /home/sinotech/crypto_win/Firma/Projects-Embedded/workspace-ccs12/BDC_firmware/MyTest/Firmware_A02/MyTest.out: Load failed.
CORTEX_M0P: Flash Programmer: Hard reset after programming
After that the controller can no longer be accessed. Any attempt to to access the controller fails with error -614. I tried to ...
- Reset the controller
- Re-powering the controller
- Start debugger while controller is under reset
- Start debugger while controller is not powered and only power it after the debugger mentions no valid supply voltage has been detected
We are using the following configuration:
- CCS 12.4
- MSPM0 SDK 1.10.0.5
- XDS 110 (stand-alone as well as the Launchpad)
- SWD interface for debugging
Any help is appreciated.
Kind regards,
Thomas