This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0G3507: Unable to connect to target

Part Number: MSPM0G3507
Other Parts Discussed in Thread: SYSCONFIG

I am using MSPM0G3507 on a custom board and debugging it with a J-Link PLUS debugger.

Our board was designed by an idiot and among many other problems, BSL_Invoke pin is pulled-up by the surrounding circuity, resulting in the board starting in the bootloader instead of the main program.

I tried remedying this by moving the BSL_Invoke pin to PA2, which happens to have a pull-down on our board. I did this by first inspecting the memory in the NONMAIN flash section, copying the existing values and modifying only registers BSLCONFIG0 (0x41C0010C) and BSLCRC (0x41C00154). A new C source file was created:

#include <stdint.h>

__attribute__((section(".BCRConfig"))) __attribute__((retain))
const uint32_t bcr_config[] =
{
	0x00000001, /* 0x41C00000 - BCRCONFIGID */
	0xAABBAABB, /* 0x41C00004 - BOOTCFG0 */
	0xAABBAABB, /* 0x41C00008 - BOOTCFG1 */
	0xFFFFFFFF, /* 0x41C0000C - PWDDEBUGLOCK[0] */
	0xFFFFFFFF, /* 0x41C00010 - PWDDEBUGLOCK[1] */
	0xFFFFFFFF, /* 0x41C00014 - PWDDEBUGLOCK[2] */
	0xFFFFFFFF, /* 0x41C00018 - PWDDEBUGLOCK[3] */
	0xAABBFFFF, /* 0x41C0001C - BOOTCFG2 */
	0xAABBAABB, /* 0x41C00020 - BOOTCFG3 */
	0xFFFFFFFF, /* 0x41C00024 - PWDMASSERASE[0] */
	0xFFFFFFFF, /* 0x41C00028 - PWDMASSERASE[1] */
	0xFFFFFFFF, /* 0x41C0002C - PWDMASSERASE[2] */
	0xFFFFFFFF, /* 0x41C00030 - PWDMASSERASE[3] */
	0xFFFFFFFF, /* 0x41C00034 - PWDFACTORYRESET[0] */
	0xFFFFFFFF, /* 0x41C00038 - PWDFACTORYRESET[1] */
	0xFFFFFFFF, /* 0x41C0003C - PWDFACTORYRESET[2] */
	0xFFFFFFFF, /* 0x41C00040 - PWDFACTORYRESET[3] */
	0xFFFFFFFF, /* 0x41C00044 - FLASHSWP0 */
	0xFFFFFFFF, /* 0x41C00048 - FLASHSWP1 */
	0xFFFFFFFF, /* 0x41C0004C - BOOTCFG4 */
	0xFFFFFFFF, /* 0x41C00050 - APPCRCSTART */
	0xFFFFFFFF, /* 0x41C00054 - APPCRCLENGTH */
	0xFFFFFFFF, /* 0x41C00058 - APPCRC */
	0x1879DAC3  /* 0x41C0005C - BOOTCRC */
};

__attribute__((section(".BSLConfig"))) __attribute__((retain))
const uint32_t bsl_config[] =
{
	0x00000001, /* 0x41C00100 - BSLCONFIGID */
	0x02150216, /* 0x41C00104 - BSLPINCFG0 */
	0x03020301, /* 0x41C00108 - BSLPINCFG1 */
	0xFFFF0287, /* 0x41C0010C - BSLCONFIG0 - PA2, HIGH, IOMUX7 */
	0xFFFFFFFF, /* 0x41C00110 - BSLPW[0] */
	0xFFFFFFFF, /* 0x41C00114 - BSLPW[1] */
	0xFFFFFFFF, /* 0x41C00118 - BSLPW[2] */
	0xFFFFFFFF, /* 0x41C0011C - BSLPW[3] */
	0xFFFFFFFF, /* 0x41C00120 - BSLPW[4] */
	0xFFFFFFFF, /* 0x41C00124 - BSLPW[5] */
	0xFFFFFFFF, /* 0x41C00128 - BSLPW[6] */
	0xFFFFFFFF, /* 0x41C0012C - BSLPW[7] */
	0xFFFFFFFF, /* 0x41C00130 - BSLPLUGINCFG */
	0xFFFFFFFF, /* 0x41C00134 - BSLPLUGINHOOK[0] */
	0xFFFFFFFF, /* 0x41C00138 - BSLPLUGINHOOK[1] */
	0xFFFFFFFF, /* 0x41C0013C - BSLPLUGINHOOK[2] */
	0xFFFFFFFF, /* 0x41C00140 - BSLPLUGINHOOK[3] */
	0xFFFFFFFF, /* 0x41C00144 - PATCHHOOKID */
	0xFFFFFFFF, /* 0x41C00148 - SBLADDRESS */
	0xFFFFFFFF, /* 0x41C0014C - BSLAPPVER */
	0x0048FFFF, /* 0x41C00150 - BSLCONFIG1 */
	0x561226C8  /* 0x41C00154 - BSLCRC */
};

After flashing, I tried power cycling the microcontroller several times and I could see it jumping straight into the main program.

I then excluded this C source file from build, so that I would not be rewriting the NONMAIN section on every start of a debugging session. I have successfully reprogrammed the MCU several times after this.

This is where it gets confusing. I had to work on something else and upon returning to it a couple of hours later, it would no longer allow me to connect to it.

When trying to connect to it within CCS, the following would be reported:
Error connecting to the target:
Could not connect to target.

I tried connecting to it through the J-Link Commander console. This is the output:

Connecting to target via SWD
InitTarget() start
DAP initialized successfully.
No PWR-AP detected.
InitTarget() end - Took 11.3ms
Found SW-DP with ID 0x6BA02477
DPIDR: 0x6BA02477
CoreSight SoC-400 or earlier
Scanning AP map to find all available APs
AP[0]: Stopped AP scan as end of AP map seems to be reached
Iterating through AP map to find AHB-AP to use
Attach to CPU failed. Executing connect under reset.
DPIDR: 0x6BA02477
CoreSight SoC-400 or earlier
Scanning AP map to find all available APs
AP[0]: Stopped AP scan as end of AP map has been reached
Iterating through AP map to find AHB-AP to use
Could not find core in Coresight setup
InitTarget() start
DAP initialized successfully.
No PWR-AP detected.
InitTarget() end - Took 11.3ms
Found SW-DP with ID 0x6BA02477
DPIDR: 0x6BA02477
CoreSight SoC-400 or earlier
Scanning AP map to find all available APs
AP[0]: Stopped AP scan as end of AP map seems to be reached
Iterating through AP map to find AHB-AP to use
Attach to CPU failed. Executing connect under reset.
DPIDR: 0x6BA02477
CoreSight SoC-400 or earlier
Scanning AP map to find all available APs
AP[0]: Stopped AP scan as end of AP map has been reached
Iterating through AP map to find AHB-AP to use
Could not find core in Coresight setup
Cannot connect to target.

I found a similar thread on this forum which suggested running the MSPM0_Mailbox_FactoryReset_Auto() script, but as I don't have an XDS110, this is unfortunately not an option.

And ideas how I might be able to salvage this chip? I'm hoping to avoid having to transplant a new IC onto this board.

  • Hi,

    You configuration does not look correct to me. I am using sysconfig to generate the BSL configuration with PA2 High invoke level. The BSLCONFIG0 is 0xFFFF02AA from my side. 

    However, even though the SWD interface should still working because the BCR configuration is default value. I am not sure why you could not connect to the MCU in this case. So, a factory reset is needed in this case. If you do not have a XDS110, the debugger on the EVM board can also work. 

    Best regards,

    Cash Hao

  • Hello Cash,

    I didn't use sysconfig, but rather wrote the values manually.

    0xFFFF02AA would mean that the BSLIVK_PAD_NUM field would be set to 0x2A or PINCM42, which corresponds to PA20. PA2 is located in PINCM7, which is what I have set my register to. There must either be a mistake in the Technical Reference Manual (SLAU846A) or in the sysconfig tool.

    I don't have the EVM. Is there no way to perform the same reset procedure with a J-Link debugger?

    Kind regards,
    Dave

  • Hi,

    There must either be a mistake in the Technical Reference Manual (SLAU846A) or in the sysconfig tool.

    I am going to check with the team on this. But I am going on a vocation tomorrow and will be back on Apr 15th. If you are urgent, you can post another post next week. There will be other supporters work on your new thread. 

    Currently, the factory reset only support on XDS110 tool. 

    Best regards,

    Cash Hao 

  • Disregard everything. As it turns out, the culprit was a floating power supply which has a significant common mode voltage on the output. When reconnecting the debugger, one of the signal pins must have come into contact first and the microcontroller got blown. The debugging pins on this board have no protection diodes on them.