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.

MSPM0G3107: Question regarding BSL Flash-Based Plug-In Interface Sample Code

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

Tool/software:

Hello,

I am using MSPM0G3107 controller for my application. This involves performing firmware update via UART pins of the controller. Due to the use of UART to RS485 converter connected to these pins, direct use of ROM based BSL was not feasible. So to modify the UART communication interface as per RS-485 requirements, we decided to use the BSL flash plugin interface example more specifically the -

"bsl_uart_flash_interface_LP_MSPM0G3507_nortos_ticlang" example code given for MSP SDK version "mspm0_sdk_2_03_00_07"

I wanted to enquire about the following:

1. In the project, I could not find the main() function i.e. start of the program. So this project is only for modification of ROM based BSL or one can add the main application code in this project as well ??

2. We are planning to invoke BSL via a software request i.e. UART pins will receive certain data and invoke BSL. Is the code to implement this part present in this sample project or not ..? Or do we need to upload 2 programs i.e. ("bsl_uart_flash_interface" for modifying the ROM BSL interface and "bsl_software_invoke_app_demo_uart" for application code that receives software based BSL invoke and receives commands ..?)

Regards

  • Hi Raj,

    1. In the project, I could not find the main() function i.e. start of the program. So this project is only for modification of ROM based BSL or one can add the main application code in this project as well ??

    Yes, it only modify the interface of the ROM BSL, and it will process the ROM BSL with the interface defined in FLASH.

    If you still use UART0, then you can only modify the pinout defined in the NONMAIN:

    and no flash bsl required.

    Is the code to implement this part present in this sample project or not ..?

    No, this is not applied in example project.

    While, if you want to trigger BSL by software, we provide the option of a special reset:

    After you recieved a special command via UART, then you can trigger it by software.

    B.R.

    Sal

  • Hello,

    So when I try to individually upload the "bsl_uart_flash_interface_LP_MSPM0G3507_nortos_ticlang" example code, why does it give SWD request error inspite of performing factory reset and enabling the non-main and main write in the properties of the project ?
    I am uploading the project as it is...
    Can you tell me where am I going wrong ??

    Regards,
    Raj

  • Hi Raj,

    Which error it shows?

    Maybe you erase the NONMAIN without load new image, or you write NONMAIN without erase it.

    B.R.

    Sal

  • Hey Sal,

    Sorry for the delayed response. I get the following error:



    CORTEX_M0P: Error: (Error -1001 @ 0x0) Requested operation is not supported on this device. (Emulation package 12.7.0.00130)
    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 12.7.0.00130)
    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 12.7.0.00130)

    I am still able to perform factory reset on the controller i.e. Controller is not bricked.

    Secondly, I have also enabled the erase main and non-main sectors of the controller as well. (mentioned in BSL User Guide)


    Still I am unable to upload the program. 

    Regards,
    Raj

  • Hi Raj,

    The flash bsl interface demo only provide the BSL communication interface here. So there is no active image including main(void) and interrupt vector table in the flash. [I believe there is no frimware located in 0x0].

    Then after it runs, the CPU will entry fault status and lose the SWD connection.

    While, you can trigger BSL to do the programming at this moment.

    B.R.

    Sal

  • Hi Sal,

    I am trying to use software trigger to invoke BSL.

    On one controller I have uploaded the "bsl_host_mcu_to_mspm0" program which will send data via UART channel. Whereas for the other controller I have uploaded the UART flash plugin example code (with the error message shown above).

    The host controller is successfully sending the byte to initiate BSL (checked by LED). But the target controller is not responding to the UART requests. I tried to upload an application program to the target controller thinking that maybe the absence of application code is not able to invoke BSL. But it provides with the following error code:

    CORTEX_M0P: Error connecting to the target: (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 12.7.0.00130) 

    How can I resolve this issue ?

    Thanks and Regards,

  • Hi Raj,

    You can only use the hardware trigger to invoke BSL at this scenarios.

    You need check below demo for software invoke:

    B.R.

    Sal

  • Hello,

    So If I want to perform software invoke using the UART flash plugin interface example i.e. modifying the BSL, I won't be able to do so ? Because the software invoke example consists of standard ROM based BSL. 

    Or hardware invoke needs to be performed once (at the beginning) and after the code updation, one can perform software invoke ?

    Our requirement was to use UART flash plugin interface and use software invoke for modified BSL

    Regards

  • Hi Raj,,

    Because the software invoke example consists of standard ROM based BSL. 

    Software invoke requires there has a application code in MCU, which can handle the software reset with BSL entry. 

    The software invoke can not be used with a MCU without a proper application code.

    Our requirement was to use UART flash plugin interface and use software invoke for modified BSL

    The software invoke is process by the device, not the host. You need development a application code at fisrt, which can process software invoke.

    B.R.

    Sal

  • Hello Sal,

    Yes I completely agree and thanks for all the replies. But then how should I upload 2 programs in the target:

    1. UART flash plugin example for modifying BSL and
    2. The main application code which will consist of software invoke 

    Thanks and Regards

  • Hi Raj,

    1. UART flash plugin example for modifying BSL and

    You can put the flash plugin example at the higher unused memory address, for example 0x10000-0x20000.

    2. The main application code which will consist of software invoke 

    Then, you put the main application image located from 0x0-0x10000.

    When you load the program by UNIFLASH or CCS, select below to only erase the unsed flash memory:

    Or you manually define a fixed address range to erase and program.

    B.R.

    Sal

  • Hello Sal,

    This approach is not working. As mentioned I tried to change the addresses of UART plugin interface example code:

    Above modifications were performed in the .cmd file of the program and the project properties was as mentioned above

    Still I received the following warning and error in console:

    CORTEX_M0P: GEL Output: Memory Map Initialization Complete
    CORTEX_M0P: NONMAIN contents corrupted, restoring to default
    CORTEX_M0P: NON-MAIN contents restored correctly but MAIN flash was erased. Fix NON-MAIN contents before re-programming.
    CORTEX_M0P: Error: (Error -1001 @ 0x0) Requested operation is not supported on this device. (Emulation package 12.7.0.00130)
    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 12.7.0.00130)
    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 12.7.0.00130)

    And if I try to ignore the warnings and attempt to upload the BSL software invoke via UART example with the following settings:




    I get the following error:

    CORTEX_M0P: Error connecting to the target: (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 12.7.0.00130)


    In short, inspite of keeping different addresses, I am still not able to upload both the programs (i.e. one for BSL and other one as application code)

    Can you kindly provide solution to the above problem and the possible reasons for this issue.


    Regards
    Raj

  • Hi Raj,

    Below is what I suggest step:

    1. Using the UART plugin interface, with modifying it to the address you assigned. And try work with hardware invoke to finish the bsl communication and new image update.

    -> Please let me know if this not worked. I can also help verify it.

    2. Add the software invoke image in the device side, then try the software invoke to set up the BSL communication.

    B.R.

    Sal

  • Hello Sal,

    Yes I have tried using Hardware Invoke to try new image update but to no avail. Kept the BSL pin high, performed NRST reset and then tried to upload the code using BSL_UART_Host demo program but still failed. Can you verify this process once from your end.

    Regards,

    Raj

  • Hi Raj,

    okay, I will try once and update to you.

    B.R.

    Sal

  • Hello Sal,

    Have you tried it from your end ?

    Regards,
    Raj

  • Hi Raj,

    You need take care of several things for the modification:

    1.The MAIN FLASH static protection range should be modified according to your flash plug in interface memory range, in case your bsl flash loading behavior break the plug in interface:

    2. Then the flash plug in interface should be modified:

    3.Then  it should work with BSL hardware invoke.

    B.R.

    Sal

  • Hey Sal,

    Sorry for the delayed reply. Due to some component issue, we will check and l will test the same by tomorrow. Thanks a lot again for the guidance and prompt replies.

    Regards,
    Raj

  • Hi Raj,

    Never mind. Hope this would help you move on.

    B.R.

    Sal

  • Hello Sal,

    Tried setting the configuration as given. Still unable to perform the UART based firmware update (flash plugin interface based). Still am stuck on the same problem. 

    Regards,
    Raj

  • Hi Raj,

    You can share the whole project hrere (the project of UART pulg in interface), and I can take a try.

    B.R.

    Sal

  • Hey Sal,

    Currently I am using standard UART flash plugin interface project. I have not performed any modifications in the example code present. I have switched to version 2.0.4.00.06 (latest version).

    Regards,
    Raj

  • Hi Raj,

    Does it works with the standard flash plug in project? It is expected to work with the example project.

    If not, please check the hardware connection, and use a logic analyzer to capture the UART data.

    B.R.

    Sal

  • Hello Sal,

    I am now able to successfully perform UART based flash update using BSL hardware invoke. After uploading the program, I am able to use the software invoke option as well.

    Is there any chance so that I can sidestep the initial Hardware invoke option and perform Software invoke from the first trial itself ? Due to our application constraints we are unable to access that Hardware pin itself as we are planning to perform initial update also via UART.

    Regards,
    Raj

  • Hi Raj,

    we are planning to perform initial update also via UART.

    You can not process software invoke at the first stage. While if you already has the firmware in the device, then it is doable.

    You need do some customization. Something like below:

    1. The host transfer an message to inform device to start software invoke, this means the device should have an initial firmware to recieve command, and then process it. [The message could be the data sent by UART]

    2. After a certain time (device proceed the software invoke), then host start firmware upgrade.

    And, one thing is that, if it is a blank device (not flash any firmware at all), then it will automatically entry bsl mode and wait the host send the command after it power up.

    This might be helpful if you want to use bsl to flash a new device.

    B.R.

    Sal