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: Re-program IC problem

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

Tool/software:

Hi TI Teams,

I am currently assisting my customer in programming the MSPM0G3507 IC, but I have encountered some programming problems and would like to ask for advice.

The programming interface I use is SWD. For the burning process, please refer to Chapter 6 of the Technical Reference Manual.

The blocks that customers need to program include Code (Flash) and NVM (NONMAIN).

There was no problem when I programmed it for the first time. I can read and communicate with the IC without any problem after the first programming.

The process and sequence of the first programming were Erase, BlankCheck, Program and Verify.

I will first complete the programming and verification of Code(Flash) and then perform the programming and verification of NVM(NONMAIN).

And when I want to program the IC for the second time, any operation on the IC will fail after the Code(Flash) is erased.

Then if you try to communicate with the IC again through SWD, it will fail.

The settings of guest NVM (NONMAIN) are as follows. The rest are factory settings.

Is it possible that I erased Code (Flash) when NVM (NONMAIN) has been modified, causing the IC to fail to erase and fail to communicate.

If so, should I erase NVM(NONMAIN) first and write it back to the factory value during the subsequent programming process?

Regards,
Steve
  • Hello Yuxuan,

    Your M0 has been locked because maybe you made incorrect operations on the NONMAIN flash. 

    1). You can unlock your M0 by using "factory reset" through CCS first. If you don't know how to do it, you can refer to my response in this E2E post:

    (32) MSPM0G3507: PRSC Module Failed - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    2). It seems that customer just modify the BOOTCRC register (Offset = 41C0005Ch) of NONMAIN? Does customer write code which will modify the NONMAIN region in the main.c?

    3). You erasing the Main Flash region won't affect the NONMAIN region, but you should check whether the NONMAIN has been erased because of some operations.

    4). You can try to modify the NONMAIN region to all default set and mentioned in the user guide (can be download from ti.com) and try to program it twice. Because it seems that only the BOOTCRC region was modified.

    Best Regards,

    Janz Bai

  • Hi Janz,

    At present, I only have the programming circuit that I personally designed and the programming software process that I personally developed.

    So I currently do not have a development version and cannot operate the IC through CCS...

    I confirmed my customer's NONMAIN and found that the customer's modification was BOOTCFG2.

    The factory value was 0xAABBFFFF, but the customer's modification was 0xFFFFAABB.

    Therefore, the content of BOOTCRC will be modified accordingly.

     

    I'm not sure if my M0 is actually locked after programming?

    Because I can still read the IC after programming Main Flash and NONMAIN.

    But after the Main Flash and NONMAIN are programmed and then the Main Flash is erased, the IC seems to be locked.

     

    In addition, after the customer modifies BOOTCFG2, can I still perform Factory Reset on the IC through BSL?

    Thanks.

     

    Regards,

    Steve

  • Hello Steve,

    1). Yes, customer changed the BOOTCFG2, he enabled the fast boot mode and disable the BSL. In theory, these should not affect M0 to be locked. 

    2). After the first programming, you can still read the IC, it indicates that there is no problem with your operation of NONMAIN. But after you erase the MAIN flash, you can't connect with the IC, so I think you need to check your erase operation whether it erases the NONMAIN region.

    3). Because customer disables the BSL in the BOOTCFG2, so you can't perform factory reset through BSL, but you can try to do factory reset through DSSM mentioned in the e2e I shared with you.

    4). You can download the CCS from ti.com, and you can apply for a XDS110 or LaunchPad from ti.com if you are a FAE of TI or you company has its own FAE.

    Best Regards,

    Janz Bai

  • Hi Janz,

    I have confirmed that after erasing the MAIN flash, I did not erase the NONMAIN block.

    In addition, the attached file is a waveform file that failed to communicate with the IC after I erased the MAIN flash.

    I found that an exception occurred when initializing the SWD.

    3507_fail.zip

    Regards,

    Steve

  • Hello YUXUAN,

    Now there are two approaches to find the root cause of this issue and I think you need to do these and check the results:

    1). From software: what is the address range of MAIN Flash you erased at the second programming time.

    2). From Software: You can try to download an example in our SDK and check whether you can program your IC for more than one time. This method is for to ensure that whether this issue is caused by the application code.

    3). From Hardware: You mentioned that you use your own personal programming circuit. What is the interface you use? SWD or any other? If you use SWD or JTAG, I think you can apply for XDS110 or LP-MSPM0G3507 (which has on-board XDS110) on ti.com and use the debugger in your circuit.  This method is for to ensure that whether this issue is caused by the debugger / programming circuit.

    4). After you have the debugger such as XDS110, you can do factory reset through CCS which is for to ensure that whether your M0 has been locked and ensure whether it can be re-set to factory default state. 

    Best Regards,

    Janz Bai

  • And I am sorry that I accidentally clicked the "TI think resolved". If you have questions, you can still ask in this e2e post.

  • Hi Janz,

    The IC I'm currently testing is MSPM0G3507, so the range I erase is from 0x00000000 to 0x00020000.

    My customer used TI's tools to program the file, and it can be programmed repeatedly.

    The interface I use is SWD.

    Regards,

    Steve

  • Hello YUXUAN,

    1). If you use an example code in SDK (can be downloaded from ti.com: MSPM0-SDK Software development kit (SDK) | TI.com), will this issue occur too?

    2). What TI tool customer use? Can you tell me the name and version?

    3). If customer can use CCS, can you let customer try to do factory reset?

    4). If customer use other TI's tools, tell me the name and version and give me the code they want to download into the M0. I will try to do some tests on my side and find the root cause. 

    Best Regards,

    Janz Bai

  • Hi Janz,

    I have already asked the customer about the customer's programmer-related information and programming files, and I will provide it to you after the customer replies.

    I have checked the example code in the SDK, and my current programming process is completed by referring to the example code process.

    So I'm wondering why there is no problem with normal programming, but SWD communication fails after erasing the Code (Flash).

    I am also testing other programming files. There is no problem in programming and can be programmed repeatedly.

    At present, it seems that only the programming files provided by this customer will encounter this problem.

    Regards,

    Steve

  • Hi Janz,

    The software and version used by the customer is Uniflash 8.6.0.

    In addition, the customer is willing to provide programming file analysis, but due to NDA, can you provide an email for me to send the programming file? Thank you.

    Regards,

    Steve 

  • Hello YUXUAN,

    you can send email to janz-bai@ti.com.

    Best Regards,

    Janz Bai

  • Hi Janz,

    I have sent the customer's file to your email.

    The letter is titled "MSPM0G3507: Re-program IC problem".

    Regards,

    Steve 

  • Hello YUXUAN,

    just now I checked my email and I found it. I am sorry that this week I have too much things to do and I will help you to do some tests next week.

    Best Regards,

    Janz Bai

  • Hi Janz,

    I also tested to erase Code and NONMAIN together at the beginning of secondary programming, but the IC was still locked after erasing.

    But I also noticed that the IC didn't seem to be wiped clean.

    The one on the left is the address, and the one on the right is the value in the address.

    Regards,

    Steve

  • Hello Yuxuan,

    I have done some tests using Uniflash 8.7 and customer's hex file. I can download the file successfully twice. And I recommend you choose to erase MAIN and NONMAIN at the secondary time, not choose to erase MAIN memory only. Because the hex file includes the data of NONMAIN, if you only choose to erase the MAIN flash and there is NONMAIN code in your hex file which will be download using uniflash, maybe some error will occur.

    The setting of uniflash I used: 

     \

    And the download results I got: 

    Best Regards,

    Janz Bai

  • Hi Janz,

    Maybe my erase method is wrong.

    Can you tell me how to erase on Uniflash?

    I am currently using sector erase.

    Maybe I need to use entire flash bank erase instead?

    Regards,

    Steve

  • Hello YUXUAN,

    1). A Flash word is 64 bits (72 bits with ECC). A sector is 1 KB and a bank is up to 256 KB (Most devices implement a single flash bank (BANK0). And the BANK0 includes NONMAIN region, MAIN region and FACTORY region. 

    2). If your code file just has MAIN region, you should use the "erase MAIN memory only"

    if your code file includes MAIN region and NONMAIN region, you should use the "erase MAIN and NONMAIN memory" or "erase MAIN and NONMIAN necessary sectors only" (recommend use this)

    if you download code file including MAIN and NONMAIN first time, and you want to download code file just including MAIN, you should choose the "erase the MAIN memory only" and confirm your code file just includes MAIN region.

    3), if you use sector erase, you should write the address you want to erase at there: 

    4). I recommend you use the point 2) to prevent you from writing wrong address. And you should notice that if you want to erase NONMAIN region, you must confirm that your code file which you want to download must include NONMAIN.

    5). I don't recommend you erase the whole bank, because this will erase both NONMAIN and FACTORY region. If you want to use Uniflash to download code into M0, just see point 1) to point 4).

    Best Regards,

    Janz Bai