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: Trying to flash program with deactivated BSL

Part Number: MSPM0G3507
Other Parts Discussed in Thread: , SYSCONFIG, UNIFLASH

Tool/software:

Hi TI-Experts,

I'm using CCS Theia with the Onboard XDS110 debug probe of the LP-MSPM0G3507 to flash my custom PCB with MSPM0G3507 (LQFP-48(PT) (Package)).

My code works totally fine and is debuggable as long as I don't deactivate bsl invocation in sysconfig - configuration NVM:

In Project  Properties I activated the main and nonmain erasing:

When I now try to debug/flash I get the following error message:

Fullscreen
1
2
File Loader: Memory write failed: Flash Programmer: Error, Attempting NONMAIN write without erasing!
GEL: File: C:\Users\MATTHI~1.HEI\AppData\Local\Temp\ti_cloud_storage\wi*********ft.out: Load failed.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When I try to verify the *****.out file by the "Verify Image"-Button in UniFlash I get the following error window popup message:

Fullscreen
1
2
Error!
File: C:/Users/m*****n/Documents/GIT/Wi****ft/Sandbox.wi***ft.sw.LP-MSPM0G3507/wi****ft/Debug/wi***ft.out: a data verification error occurred, file load failed.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

... and the console output says:

Fullscreen
1
2
[6.11.2024, 13:34:21] [INFO] CORTEX_M0P: GEL Output: Memory Map Initialization Complete
[6.11.2024, 13:34:21] [ERROR] CORTEX_M0P: File Loader: Verification failed: Values at address 0x41C0000A do not match Please verify target memory and memory map.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

But when I click the "Load Image"-Button it loads/flashes the firmware to my controller and everything works fine.

Please enlighten me, what's the problem with the verification and why I can't flash/debug by CCS Theia ;)

If there are any missing pieces of information - please feel free to ask!

I hope I gave you the full information that you need to help me.

Thanks a lot in advance!

Regards

Matze

  • Hi Matze,

    What versions of Sysconfig, CCS Theia, and the MSPM0 SDK are you using? Your steps shown here are the correct steps to disable BSL, I wouldn't expect this one simple change to cause these errors. The checkbox for BSL Enable is the only thing you change that causes this error?

  • CCS Theia Version: 1.4.1.1

    Default VS Code API: 1.85.1

    Where can I find the versions of sysconfig and MSPM0 SDK?

    Yes, this checkbox is the only thing that I changed. (And the nonmain erase in the project properties.)

  • These versions can each be found if you right-click on your project name, navigate to properties, then view the "Dependencies" tab.

    Your CCS Theia version looks fine, thanks for the info so far.

  • Thank you so far!

  • No problem. 

    So far I am not seeing an issue here, your SDK, Theia, and Sysconfig versions are all new. I just tried this on my end with a launchpad and it worked, the only difference is that I am using CCS Theia 1.5.0, but your version should not have any problems with this.

    The error message you are getting also really only comes up when you haven't instructed the debugger to erase MAIN and NONMAIN, but you've indicated that you are doing this. This sounds super simple but - you are choosing to apply and close when you change this setting, right?

    In the device view in the top right corner of Sysconfig, have you updated the device to your current target (48 pin LQFP)?

  • I just updated to CCS Theia 1.5.1.3 and tried again.

    And also tried with LP-MSPM03507 an onboard MSPM03507 64 Pin controller, connected via J101  .

    And I exactly get the same errors. Regardless of whether I have activated the "erase MAIN and NONMAIN" checkbox in the project properties or not.

    you are choosing to apply and close when you change this setting, right?

    Yes I choose "save and close" in the project properties after activating the "erase MAIN and NONMAIN" checkbox.

    In the device view in the top right corner of Sysconfig, have you updated the device to your current target (48 pin LQFP)?

    Yes, I chose my controller like it is on my PCB:

    This is the only place where I have to chose the controller/package, right?

  • Hmm... 

    Yes this is the only place that you need to change the package. 

    Could you try taking an example from our SDK, ideally something simple like GPIO toggle output, flash it to ensure its working, then update ONLY this setting by adding the Configuration NVM instance and disabling BSL, and seeing if you get the same error? At this point I am wondering if I am missing something in the application code that could be causing this.

    Another question is what exactly are you currently using software-wise, is it one of our driverlib examples or is it custom software that you've made some changes to?

  • GPIO toggle output from the driverlib examples with pins changed to my PCB, added Configuration NVM instance and disabled BSL does work totally fine and still toggle the LED.

    My custom code is a blank ticlang project with some custom modifications.

    I'm gonna try to add the same modifications step by step by step again.

  • But when I do the same steps for my source code I get the following error message in the debug output:

    Fullscreen
    1
    2
    File Loader: Memory write failed: Flash Programmer: Error, Attempting NONMAIN write without erasing!
    GEL: File: C:\Users\MATTHI~1.HEI\AppData\Local\Temp\ti_cloud_storage\wiproiii_facelift.out: Load failed.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    ... even though I activated the nonmain erasing in the debug options of the project properties.

    But ... maybe this helps to find the problem..

    I am surprised that the .out file is called from 

    C:\Users\m****n\AppData\Local\Temp\ti_cloud_storage

    and not from the Debug-Folder of my project directory.. maybe this helps..

  • Okay... now it worked once.. and I don't know why.. then I tried to take the same steps again and it does not work any more.

    I took 3 mini-steps:

    1. Check "erase main and nonmain necessary sectors only" in project properties.
      1. Build, Debug, everything works
    2. Add "Configuration NVM" to sysconfig and check "accept config risks"
      1. Build, Debug, everything works
    3. Uncheck "Enable BSL"
      1. Build, Debug, everything works

    BUT... as written above.. when I take all these steps again I always get the error message:

    Fullscreen
    1
    2
    File Loader: Memory write failed: Flash Programmer: Error, Attempting NONMAIN write without erasing!
    GEL: File: C:\Users\M****I\AppData\Local\Temp\ti_cloud_storage\wi****ft.out: Load failed.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    please help me!!!

  • And now I'm facing another issue!

    I imported the gpio_toggle_output_LP_MSPM0G3507_nortos_ticlang

    When I ...

    1. check "erase main and nonmain necessary sectors only" in project properties,
    2. save and close the project properties
    3. Open the project properties again.

    The "erase main memory only" is checked again.

  • Hi Matze,

    About the .out file shown in your earlier screenshot, the does the one shown have the same name as your project? I want to go back and confirm that CCS is flashing the incorrect .out file to your device, because you are right it should be flashing the one from your debug folder to the device.

    I will need to check how to force it to use the one from the debug folder, and am surprised that isnt happening automatically. For now what you could do is start a project-less debug session then manually flash the correct .out file to your device and see if this enables the correct behavior.

    Also, the fact that this only occurs when disabling BSL is weird. Can you enable BSL to check which .out file is used here, then disable again to check that only then the wrong one is being used?

  • Hi Matze,

    Secondary follow up - I am beginning to suspect that this is an IDE level issue rather than MSP. I asked around and have been told that in some recent versions of CCS, after changing a setting you need to press the enter key after changing. Please try doing this and then saving.

    Additionally, this should be fixed in our next CCS release, so you once that is out you should be able to stop hitting enter constantly.

    I'd also like to perform another check, could you go to your ARM Hex utility tab in the project properties, then generate the TI-TXT output file for the project. Then can you please paste the memory region 0x41C00000 here so I can check it? Important note here: if you are using an SWD password, you should change it before pasting your memory map in here as I wouldn't want it to accidentally be exposed.

  • Hi Dylan!

    Thanks a lot for your answers!

    About the .out file shown in your earlier screenshot, the does the one shown have the same name as your project? I want to go back and confirm that CCS is flashing the incorrect .out file to your device, because you are right it should be flashing the one from your debug folder to the device.

    It does have the same name and when I put it into a diff-tool like "WinMerge" together with the one from the debug-folder both files are identical.

    start a project-less debug session then manually flash the correct .out file to your device

    When I try the project-less debug and "run" - "load" - "load program" - "correct .out file" I get the following error message:

    GEL: Target must be connected before calling the function
    Target must be connected before calling the function

    Should the 'old program' still be running on my MSP, when I do projectless debug? My LED is still blinking when I do so..

    I tried with FactoryReset_Auto in between, LED is not blinking anymore but I get the same error message as before:

    GEL: Target must be connected before calling the function
    Target must be connected before calling the function

    ... and this error message appears regardless of whether I build with or without “configuration NVM” in the syscfg.

    But when I end the projectless-debug sessing and simply debug/flash my sourcecode (without configuration NVM) it works fine. So the connection must be okay.

    Can you enable BSL to check which .out file is used here, then disable again to check that only then the wrong one is being used?

    I only see the file/directory that is used when I get the error message in the "debug output"-Tab. When the debug/flash does not go wrong (because I remove the configuration NVM in syscfg) the IDE does not show, which file was used. where can I see, which file from which directory is used?

     

  • I am beginning to suspect that this is an IDE level issue rather than MSP.

    That's what I am assuming too.

    press the enter key after changing. Please try doing this and then saving.

    Pressing "Enter" saves and closes the project properties automatically. No changes concerning my issues.

    I'd also like to perform another check, could you go to your ARM Hex utility tab in the project properties, then generate the TI-TXT output file for the project. Then can you please paste the memory region 0x41C00000 here so I can check it? Important note here: if you are using an SWD password, you should change it before pasting your memory map in here as I wouldn't want it to accidentally be exposed.

    I will do that later and post my results in a separate posting.

  • I'd also like to perform another check, could you go to your ARM Hex utility tab in the project properties, then generate the TI-TXT output file for the project. Then can you please paste the memory region 0x41C00000 here so I can check it? Important note here: if you are using an SWD password, you should change it before pasting your memory map in here as I wouldn't want it to accidentally be exposed.

    Hi Dylan,

    I'm sorry but I don't know, how to paste the exact memory region so I post the full .txt-file:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    @0000
    00 80 20 20 F1 0E 00 00 E5 0E 00 00 D9 0E 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 FD 0E 00 00
    00 00 00 00 00 00 00 00 E9 0E 00 00 01 0F 00 00
    D5 0E 00 00 B5 0C 00 00 19 0F 00 00 29 0F 00 00
    C1 0E 00 00 0D 0E 00 00 C9 0E 00 00 CD 0E 00 00
    00 00 00 00 F5 0E 00 00 F9 0E 00 00 00 00 00 00
    00 00 00 00 21 0F 00 00 25 0F 00 00 1D 0F 00 00
    09 0F 00 00 11 0F 00 00 05 0F 00 00 4D 0E 00 00
    15 0F 00 00 0D 0F 00 00 00 00 00 00 00 00 00 00
    DD 0E 00 00 E1 0E 00 00 00 00 00 00 00 00 00 00
    C5 0E 00 00 00 00 00 00 ED 0E 00 00 D1 0E 00 00
    FC B4 01 24 E4 07 63 40 02 E0 FC B4 01 24 E4 07
    08 B4 1D 03 ED 08 D6 0D 35 43 56 02 5F 00 7F 0D
    06 D1 2C 00 34 43 00 D0 AE E0 01 B0 FC BC 70 47
    A4 08 25 43 07 24 24 02 FF 34 A7 42 05 D1 00 20
    19 0D 09 05 01 B0 FC BC 70 47 00 2B 03 D5 00 24
    A6 1B AC 41 25 00 0B 03 DB 08 C2 0D 13 43 42 02
    48 00 40 0D 07 D1 1C 00 14 43 00 D0 8C E0 0E BC
    10 00 F0 BC 70 47 01 24 64 07 23 43 07 24 24 02
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I hope this helps and this is also okay for you!

    Maybe you can nonetheless explain to me how to identify an explicit memory region ;)

    Matze

  • Hi Matze,

    Couple of things to go through here - 

    1) Yes the same project should continue running on a device when you start a projectless debug - so if you had a blinking LED, it should continue to blink once you press play in the projectless debug

    2) If the two files are identical, I guess that means somehow you are placing the newly generated output file there and using that. This is fine but you may want to double check that the output file is correctly changing each time you rebuild - you can compare the output file in your CCS project debug tab to the one that you can see is being flashed ton your device.

    3) The error you get when you attempt to start a project-less debug indicates that your target device is not connected - please ensure that you have connected your target device to your pc using the debugger when you attempt this. I see you mention you can successfully flash the device without changing the configuration, this is also very strange.

    4) To check which file is being flashed to the device, you can watch the CDT build console (which does disappear after the build is complete but you can see the .out file name appear in the log), or you can hit the dropdown arrow next to the flash button in CCS, and choose the ,out file to load to your device to make sure you are loading the one you intend.

    5) As an alternative to exporting memory you could also connect to the device with the debugger, then hit view->memory browser. Enter the address 0x41C00000, and then you can copy paste starting from there. Or you could use this window to specify to save a range of addresses to a file on your computer. There are a few options for this.

    Generally with all of the strange issues you are getting, I am leaning towards saying you should try to reinstall CCS Theia and re-import your project. Many of the functionalities we've tried are not working as expected, despite using a recent version of all of our tools. If possible please give this a try as well, as these very common functionalities are not working for us.

  • Hi Dylan,

    thanks for your answers!

    1) Yes the same project should continue running on a device when you start a projectless debug - so if you had a blinking LED, it should continue to blink once you press play in the projectless debug

     :) that's at least one thing that works, as is to be expected

    2) If the two files are identical, I guess that means somehow you are placing the newly generated output file there and using that. This is fine but you may want to double check that the output file is correctly changing each time you rebuild - you can compare the output file in your CCS project debug tab to the one that you can see is being flashed ton your device.

    But why is this file placed somewhere else? Is there any place where I can see or change the directories or stuff like that?

    Please explain to me, how I can compare the .out-files by using the CCS project debug tab.. i guess you mean this debug tab:

    3) The error you get when you attempt to start a project-less debug indicates that your target device is not connected - please ensure that you have connected your target device to your pc using the debugger when you attempt this. I see you mention you can successfully flash the device without changing the configuration, this is also very strange.

    As I can successfully flash without changing anything I guess that my target device is connected properly.. yes.. strange..

    4) To check which file is being flashed to the device, you can watch the CDT build console (which does disappear after the build is complete but you can see the .out file name appear in the log), or you can hit the dropdown arrow next to the flash button in CCS, and choose the ,out file to load to your device to make sure you are loading the one you intend.

    Do you mean this window by CDT build console?

    I do not know any flash button in CCS Theia.. are you talking about the "old" eclipse ccs 12? or are you talking about Run-load-load program in ccs theia?

    5) As an alternative to exporting memory you could also connect to the device with the debugger, then hit view->memory browser. Enter the address 0x41C00000, and then you can copy paste starting from there. Or you could use this window to specify to save a range of addresses to a file on your computer. There are a few options for this.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    @41C00000
    01 00 00 00 BB AA BB AA BB AA BB AA FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF BB AA
    BB AA BB AA FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    @41C00050
    FF FF FF FF FF FF FF FF FF FF FF FF C3 DA 79 18
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    @41C000A0
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    q
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I copy pasted 3 lines. is that enough? I can copy paste more if you need more ;)

    Generally with all of the strange issues you are getting, I am leaning towards saying you should try to reinstall CCS Theia and re-import your project. Many of the functionalities we've tried are not working as expected, despite using a recent version of all of our tools. If possible please give this a try as well, as these very common functionalities are not working for us.

    Yes, I will try and do this!

    Thanks a lot for your help by now!

  • To continue for item number two, the only setting I can think of to deliberately do this would be in project properties under build -> post build steps. You could check here but by default this is not included and you'd need to manually apply this. You can check the setting above to see. Additionally to clarify further what I mean by compare in the debug tab, I meant to compare the .out file thats contained in the debug folder of your project with the one that is being placed at C:\Users\M****I\AppData\Local\Temp\ti_cloud_storage\. I was saying to compare these using something like beyondcompare. The debug folder inside of your project is the one that SHOULD be referenced by your project, and flashed to your device.

    For number 4, in CCS theia this looks like it is just labeled "Output". By bad here. Additionally for the flash button you're right this isn't in CCS theia. An equivalent would be to start proejctless debug, then go to the tabs run->load->load program

    For number 5, the section you pasted is sufficient for now, this looks fine in my view. Thanks for this.

    For number 6 please let me know if this issue persists after reinstalling, there are a lot of strange behaviors we are seeing here.

  • 2.

    project properties under build -> post build steps

    There is no custom build step entered and everything in blank default state.

    For number 4, in CCS theia this looks like it is just labeled "Output". By bad here. Additionally for the flash button you're right this isn't in CCS theia. An equivalent would be to start proejctless debug, then go to the tabs run->load->load program

    It shows and uses the app-data-folder and not the debug folder..

    For number 6 please let me know if this issue persists after reinstalling, there are a lot of strange behaviors we are seeing here.

    I re-installed CCS Theia 1.5.1 and I am facing the same issues as before.

    I will now switch back to CCSv12 and hope that it works better there.

  • Hi Matze,

    From my view you are doing everything the same as I would expect, and are still getting some strange errors. Nothing I have thought to check is resolving the issue so far. I am going to transfer this to our software tools organization to see if they have some help here, maybe they can point to something in your installation or your device that could be causing your settings not to work correctly.

  • I installed CCSv20 and everything works out fine. Looks like CCS Theia is being discontinued or postponed. And it seems to be the right thing as I am facing so strange issues.

  • The "Theia" branding was being used while we were supporting both CCS eclipse and CCS based on VSCode. CCSv20 is the first major release of the VSCode based CCS after the discontinuation of CCS Eclipse, so now the branding is moving back to just CCS. Future releases of CCS will still have the Theia removed, but it is the same VScode based environment.

    Thanks for posting that you were able to resolve the issue, I did switch this over to the tools organization but they may leave this alone as you have found a resolution.

  • Thank you very much for your efforts and your help!