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.

MSPM0G1519: password protected connection through target config

Part Number: MSPM0G1519
Other Parts Discussed in Thread: SHA-256

Tool/software:

Champs,

I have been testing password-protected SWD connection to the Launchpad and found that it seems to be working correctly while working with projects in CCS: I can flash the project with SWD password configured and it works fine, I can also change password and attempt debugging without flashing and it refuse connection. To me it seems to be working as expected.

What I would also want to do is to configure password in the target config file and test connection - this part does not seem to be functional. in the target config I see only 128-bit password field which makes me think this only applies to the older devices that stored 128-bit password directly (vs 256-bit hash). is this the case or I am doing something wrong?

if it is indeed not yet supported - when do we expect this support to be implemented?

thank you

Michael

  • What I would also want to do is to configure password in the target config file and test connection - this part does not seem to be functional. in the target config I see only 128-bit password field which makes me think this only applies to the older devices that stored 128-bit password directly (vs 256-bit hash). is this the case or I am doing something wrong?

    128bit SWD password in ccxml is plaintext password.

    256bit SWD password in syscfg is this 128bit plaintext pw's 256bit hash result.

  • Hi Helic,

    thank  you, I am able to setup a 128-bit plaintext password in .ccxml and I calculated its hash using this calculator (https://emn178.github.io/online-tools/sha256.html) and put it into .syscfg. I can flash the project and the start debugging with no issues. I also tried starting debugging of another project without security settings and it failed to connect as expected. So far so good. Now, in order to test further I created a standalone .ccxml that is not connected to any project. With this .ccxml I can start project-less debug but then when I try "connect target" in the debug view I still get connection error despite the fact that the .ccxml contains the right password.

    Could you please help me understand the mechanics of password verification and why I am not able to connect with the stand alone .ccxml?

    for reference: i used plain text password 0x000000000000000000000000deadbeef. 

    calculated hash is 0x9590b8e30aa535718b065de411d65112241818d2d714bdb852d1e340c95d3971 

    thank you

    Michael

  • upon further testing addition problem appeared: when SWD password protection enabled the debug connection only works until power cycle. i.e.

    the sequence Factory reset>flash project with SWD password protection -> Start debug session is successful

    After that Stop debugging -> disconnect/connect USB to power cycle the board -> start debug session is failing with 

    Texas Instruments XDS110 USB Debug Probe/CORTEX_M0P Error connecting to the target: Connection to MSPM0 core failed. Possible root causes: 1) Debug access within NONMAIN was disabled or enabled with password. 2) Peripheral mis-configuration (e.g improper watchdog or clock). To see a more detailed diagnostic of the issue, please press the 'Read boot diagnostic' button.

    Read Diagnostic returns:

    CS_DAP_0: Device diagnostic read = 0x00000007
    CS_DAP_0:
    Possible root causes from diagnostic reading:
    1) Nested exception (e.g double hard fault or NMI) can be caused by illegal CPU activity such as invalid address modification
    2) Debug access has been disabled

    will appreciate your guidance

    Michael

  • OK ~ Got it~
    I will try some test from my side.

  • Please refer to this guidance:

    You can open this guidance with syscfg - Configuration NVM - Boot Configuration Routine (BCR) Configuration - Debug Security Policy Configuration - Enable Application Debug Access [Enabled with password match] - SWD Password - ? button

    Use this webpage to convert the plaintest - SHA256 of password: hex format

    https://emn178.github.io/online-tools/sha256.html

    Input the SHA-256 password into BCR config.

    Input plaintext password in .ccxml file.

    After program the device, you can power off and on the device, password takes effect.

    Using MSPM0_Mailbox_DebugAccessPasswordAuthentication_Auto to unlock password.

    Using MSPM0_Mailbox_FactoryReset_Auto to remove password.

  • Hi Helic,

    i am now able to unlock the device using MSPM0_Mailbox_DebugAccessPasswordAuthentication_Auto - this was the missing step in the instructions. I am also able to load .out after rebuilding it to flash MAIN and DATA only leaving NONMAIN untouched. the .out seems to run fine, however it somehow lost its symbols, so I am able to do start/stop but I can not do step-by-step debugging. What could be missing for the step-by-step?

    thank you

    Michael

  • Not sure what happens from your side.

    For the common step, after unlock SWD password, you can try exit current debug session, then directly start debug session based on your project.

  • For the common step, after unlock SWD password, you can try exit current debug session, then directly start debug session based on your project.

    that does not work unfortunately. if I stop debug session the debugging is locked again. I managed to get proper debugging with symbols working when I removed NVM configuration from the project's syscfg altogether and also changed Flash properties to "Erase MAIN and DATA only". the resulting .out can then be loaded into M0 after it is unlocked with the MSPM0_Mailbox_DebugAccessPasswordAuthentication_Auto script.

    I think this is a major gap in our collaterals - the above process needs to be properly documented or better yet the CCS needs to support integrating unlocking script into the project, and invoke it automatically . 

    I'll appreciate your feedback on this 

    Michael

  • however it somehow lost its symbols
    that does not work unfortunately. if I stop debug session the debugging is locked again.

    From my side, unlock SWD, then start debug is OK.

    For any reset level that doesn't run ROM boot code (BCR), M0 won't lock SWD again.

    TRM Table 2-12. Reset Cause Encoding: a debug sysrst won't run BCR Execution.

    I managed to get proper debugging with symbols working when I removed NVM configuration from the project's syscfg altogether and also changed Flash properties to "Erase MAIN and DATA only". the resulting .out can then be loaded into M0 after it is unlocked with the MSPM0_Mailbox_DebugAccessPasswordAuthentication_Auto script.

    This is correct, nonmain region program one time is enough.