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.

MSP432E401Y: Bootloading over ethernet

Part Number: MSP432E401Y
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

I have followed the bootloading over etherent sdk in msp432e401y . I got the output in the serial terminal as "Device ready to accept magic packets on UDP port 9" , now how do i flash my required code(magic packet) over the ethernet . I used BSL scripter to achieve the above " Device is ready ...".  

Also is there any complete guide to flash a custom code over the ethernet apart from the BSL scripter SDK.

  • Hey, I have the exact same issue ,
    Please do post it here if you managed to figure it out.

  • First of all, did you run the examples by running the three scripts as follows. 

    I got the output in the serial terminal as "Device ready to accept magic packets on UDP port 9" ,

    If you have come this far then the boot_emac_flash_magicpacket_MSP_EXP432E401Y.txt example firmware has been loaded by running script 2.  The boot_emac_flash_magicpacket_MSP_EXP432E401Y is already an example firmware. You can reference this example to create your firmware to be loaded by the custom loader. 

    now how do i flash my required code(magic packet) over the ethernet

    If you look at the example firmware where you can find the full source code at C:\ti\simplelink_msp432e4_sdk_4_20_00_12\examples\nortos\MSP_EXP432E401Y\boot_loader\boot_emac_flash_app_magicpacket_update, it waits for a magic packet. By running script 3, the PC will send the magic packet to the MCU and once received, the firmware will jump to the bootloader again to program another firmware. In script 3, it will download a blinky example through the Ethernet port. You can use any application you want. 

  • I am getting invalid TFTP error once i run script 1 of this example . Please give the step by step by instruction on how to do this, starting with an MSP connected to a Router with DHCP alone. I am unsure on how to get a BLANK MSP as mentioned in this guide from ti. 

    The steps i used to reach the previous state where bootloader was configured 

    1) FLash serial_emac_flash example

    2) Use manual erase option in Uniflash

    3) Reset the MSP

    4) Run this script 

    LOG
    MODE Ethernet E4xx MAC=70:FF:76:1C:E5:73 IPClient=192.168.0.2 IPServer=192.168.0.3
    RX_DATA_BLOCK_32 boot_serial_emac_flash_MSP_EXP432E401Y_nortos_ccs.txt

    in BSL scripter 

    5)Reset the MSP 

    6) Run this script 

    LOG
    MODE Ethernet E4xx MAC=70:FF:76:1C:E5:73 IPClient=192.168.0.100 IPServer=192.168.0.3
    RX_DATA_BLOCK_32 boot_emac_flash_app_magicpacket_update_MSP_EXP432E401Y_nortos_ccs.txt

    I have both my laptop and MSP with the router.

  • 4) Run this script 

    LOG
    MODE Ethernet E4xx MAC=70:FF:76:1C:E5:73 IPClient=192.168.0.2 IPServer=192.168.0.3
    RX_DATA_BLOCK_32 boot_serial_emac_flash_MSP_EXP432E401Y_nortos_ccs.txt

    in BSL scripter 

    5)Reset the MSP 

    Here your Client IP is 192.168.0.2. Is this an used IP address?

    6) Run this script 

    LOG
    MODE Ethernet E4xx MAC=70:FF:76:1C:E5:73 IPClient=192.168.0.100 IPServer=192.168.0.3
    RX_DATA_BLOCK_32 boot_emac_flash_app_magicpacket_update_MSP_EXP432E401Y_nortos_ccs.txt

    Here your Client IP is 192.168.0.100. Why are you not using 192.168.0.2 like in script 1? 

  • I boarded reported having taken ip as 192.168.0.100 via DHCP , so i used that ip for the magic packet , even if I use the ip 192.168.0.2 it works for the first time after that I get the error INVALID TFTP READ REQUEST (in the image), please tell me why . I have to restart the pc for this error to go . Also using script 3 if I try to flash any code not only does it remove the bootloader but also the code that was flashed( timerled tirtos) doesn't run. One doubt I have is the magic packet format has only been based on no rtos , is there any way I can get this behaviour using rtos code ??

  • Hi,

      I cannot reproduce your problem. I run the examples on the MSP432E LaunchPad. See below where I run both script 1 and script 2. Before I run the script, I make sure the flash is fully erased. I also use the Wireshark to view the traffic. After the flash is first erased, I wait until I see a BOOTP request shown on Wireshark before I execute the script 1. After the custom bootloader is programmed to flash, I reset the board and again wait for a BOOTP request before execute Script 2. 

    Script 1 log:

    Script 2 log:

    Wireshark showing BOOTP, ARP and TFTP. 

  • We are able to replicate the above steps and arrive at the same state you have but after this we are encountering the following issues:

    1) Any code sent using script 3 is sent succesfully but does not run on the board for some reason , this also wipes the bootloader 

    2) When we attempted to ping the board after script 2 where it acquires an IP , the ping fails but this is the case for the example bootloader in BSL , when we attempt the same series of steps but using the Ti sdk bootloader and Magic packet the board does show up on ping 

    Doubts:

    1) How do we proceed to flash custom Ti-RTOS code after running script 2?

    2) On reading the source code , the comments mentioned a tool called LM flash which also when used after script2 didnt work , but does manage to program the msp when we use the Ti SDK but the same issue of the code not being executed and bootloader being wiped persists is this the right tool for this use case (MSP432E401Y launchpad).

  • The custom bootloader resides at 0x0 and the example firmware (boot_emac_flash_app_magicpacket_update) is built to reside at 0x4000. It can be other addresses too as long as it is a multiple of 1024 bytes. Check the .cmd file to understand. When you build your firmware for running Script 3, you need to make sure it is linked to 0x4000, not 0x0 for which it will overwrite the flash-based bootloader residing at 0x0. 

  • The above is the output when we used script 3 to flash a program "linked" to 0x4000 , we are not really sure what you meant by linked to 0x4000 but what we have done is modify the .txt file and increment the @location by 4000 so initally @0000 and @0040 are replaced with @4000 and @4040 

  • Look at the .cmd for boot_emac_flash_app_magicpacket_update example where the firmware will start at 0x4000 because the bootloader config file expects it to start at this address. As said, you can change it. You need to make sure you change the bl_config.h file for the flash bootloader and the .cmd file for the application. 

    #define APP_BASE 0x00004000

    MEMORY
    {
    FLASH (RX) : origin = APP_BASE, length = 0x000FC000
    SRAM (RWX) : origin = 0x20000000, length = 0x00040000
    }

  • i was able to change the start address of my application ( blinky NORTOS) by change the origin of flash and intVect of the .cmd file . The code got flashed , but i am not able to change the start address of my tirtos timer led code . Can i know how to do it ?

  • the image for above problem

  • Where should I add this , i referred to the link in the thread , I find a lot of .cfg files in the kernel . To what file exactly should i add m3Hwi.resetVectorAddress ?

  • In your TI-RTOS .cfg file, add:

    /* Set a non-zero reset vector address for this application, since is started by a bootloader placed at address zero.
    The FLASH memory region in the linker command file is set to start at this address, to avoid using any flash
    reserved for the bootloader. */
    m3Hwi.resetVectorAddress = 0x4000;

  • Do you mean the release.cfg file, I am not able to see any other .cfg file in this dir C:\ti\simplelink_msp432e4_sdk_4_20_00_12\kernel\tirtos. ?

  • Yes, it is the release.cfg file. There should be a dependency project in your workspace called tirtos_builds_MSP_EXP432E401Y_release_ccs in your worksapce on which all other TI-RTOS examples depend on. 

  • I have added it to the release.cfg file , now if I change the origin of flash in msp432e401y.cmd  i still get this error 

  • Thanks i have made the changes in the release .cfg in tirtos_builds_MSP_EXP432E401Y_release_ccs and then closed opened my ccs and built the project and it gave no error , which when flashed puts the code in 0x4000 in the Memory FLASH .