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: using bootloader with NDK and RTOS

Part Number: MSP432E401Y


I've been working through the example uses of the bootloader, currently sourced from SDK v.3.20.00.10.   Primarily I am interested in developing applications that will make use of the ethernet bootloader over tftp.   

I've been able to successfully deploy the boot_serial_emac_flash examples, all of which use lwip and are without any RTOS implementation.

I would now like to develop an example that uses FreeRTOS and also incorporates the NDK as opposed to lwip for TCP/IP set up, but I'm having difficulty getting it to function.    What are the problem areas here that I need to be aware of to add this functionality, or is it not possible?

For example, what primary steps would I need to take to adapt the FreeRTOS flavor of the 'tcpecho' example for deployment over the ethernet bootloader?

Thanks

  • H iPatrick,

    So you want a FreeRTOS + NDK based bootloader that

    1, uses tftp to get an application image and place it into non-volatile memory.

    2. jump to the new application

    Correct? 

    Does the new application image also use FreeRTOS and NDK?

    Why not use the existing boot_serial_emac_flash example and then have the new application image simply be FreeRTOS and NDK based?

    Todd

  • Hi Todd, Thanks for the reply.

    You are correct on both points!

    I have tried as you suggested. I used the tcpecho (freeRTOS) example as my application image and attempted to load this application image into non-volatile memory using the bootloader, but it seemed to not work out of the box, so I'm assuming some changes were necessary to the tcpecho source code to make it compatible.

    Here's what I did.

    1. I compiled the following programs from Resource Exp. boot_serial_emac_flash_MSP_EXP432E401Y_nortos_gcc tcpecho_MSP_EXP432E401Y_freertos_gcc

    2. I used the output settings to build srec versions of both and then used srec_cat to create TI-txt versions of each.

    3. I then used the bsl_scripter to first load the boot_serial_emac_flash image to an erased MSP432E401Y development board via BOOTP and TFTP. No issues with this step.

    4. I next use a script to attempt TFTP transfer of the tcpecho image, basically by just changing the file in the previous script to point to the tcpecho image.

    This final step appears to load the image correctly, however the board then appears to not function. Resetting does not seem to help, and any attempt to then upload any other image fails. It basically appears that loading the stock tcpecho image breaks the boatloader, and I'm not sure as to why this behavior results.

  • Did you make sure the tcpEcho linker file is set so it does not overlap with the boot_serial_emac_flash image (both in FLASH and RAM)? 

    Which .out did you use to confirm the example worked?

    Did the following line get executed in the BOOTPThread() function in the bl_emac.c file?

        //
        // Perform a software reset request.  This will cause the microcontroller
        // to reset; no further code will be executed.
        //
        SCB->AIRCR = NVIC_APINT_VECTKEY | NVIC_APINT_SYSRESETREQ;
    

    Where is the vector table on the tcpecho image?

    Todd

  • I'm not sure exactly at to what you are referring when you ask which .out I used to confirm the example worked?   But to constrain some variables I went in and pulled the CCS compiled versions for both boot_serial_emac_flash_MSP_EXP432E401Y_nortos_ccs and boot_emac_flash_app_magicpacket_update_MSP_EXP432E401Y_nortos_ccs to test the bootloader examples.   I used the "ARM Hex Utility" to create an output file in TI-TXT hex format.   And then used these to test the functionality.   

    For the tcpecho example, I used the tcpecho_MSP_EXP432E401Y_freertos_ccs example, and again created a TI-TXT file.  That is what I loaded using the bootloader.    I also loaded the program to the dev board using the xds110, but this was done using the generated .out file and CCS.    tcpecho worked when loaded using the XDS110 but not when served via tftp and the ethernet bootloader.

    //Did the following line get executed in the BOOTPThread() function in the bl_emac.c file?

    //

    //1
    //2
    //3
    //4
    //5
    //
    // Perform a software reset request.  This will cause the microcontroller 
    // to reset; no further code will be executed.
    //
    SCB->AIRCR = NVIC_APINT_VECTKEY | NVIC_APINT_SYSRESETREQ;

    I'm not certain it did.   I can't relly figure out how to run the boatloader in the debugger to ensure execution of that line.  

    I'm thinking the most likely culprit here then is my memory allocations.   unfortunately I don't have a lot of knowledge regarding the linker files and I'm having difficulty finding info.   Same goes with the vector table.   

    I did try to update the .cmd file to change memory allocations but was unsuccessful as I kept receiving compile errors

    DEFAULT memory range overlaps existing memory range SRAM
    DEFAULT memory range overlaps existing memory range FLASH

    here is the .cmd file found with boot_serial_emac_flash_MSP_EXP432E401Y_nortos_ccs:

    --retain=Vectors
    
    /* System memory map */
    
    MEMORY
    {
        FLASH (RX) : origin = 0x00000000, length = 0x00010000
        SRAM (RWX) : origin = 0x20000000, length = 0x00010000
    }
    
    /* Section allocation in memory */
    
    SECTIONS
    {
        GROUP
        {
            .intvecs
            .text
            .const
            .data
        } load = FLASH, run = 0x20000000, LOAD_START(init_load), RUN_START(init_run), SIZE(init_size)
    
        GROUP
        {
            .bss
            .stack
        } run = SRAM, RUN_START(bss_run), RUN_END(bss_end), SIZE(bss_size), RUN_END(__STACK_TOP)
    
    }
    

    And here is the .cmd file in tcpecho after my edits (which provide the above errors)

    --stack_size=1024   /* C stack is also used for ISR stack */
    --retain=interruptVectors
    
    #define APP_BASE 0x00004000
    
    HEAPSIZE = 0x20000;  /* Size of heap buffer used by HeapMem */
    
    MEMORY
    {
        FLASH (RX) : origin = APP_BASE, length = 0x000FC000
        SRAM (RWX) : origin = 0x20000000, length = 0x00040000
    }
    
    /* Section allocation in memory */
    
    SECTIONS
    {
    	.intvecs:   > APP_BASE
        .text   :   > FLASH
        .const  :   > FLASH
        .cinit  :   > FLASH
        .pinit  :   > FLASH
        .init_array : > FLASH
    
    	.vtable :   > 0x20000000
        .TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT)
        .data   :   > SRAM
        .bss    :   > SRAM
        .sysmem :   > SRAM
    
        /* Heap buffer used by HeapMem */
        .priheap   : {
            __primary_heap_start__ = .;
            . += HEAPSIZE;
            __primary_heap_end__ = .;
        } > SRAM align 8
    
        .stack  :   > SRAM (HIGH)
    }
    
    __STACK_TOP = __stack + 512;

    Originally FLASH was listed with origin = 0x00000000, length = 00100000.   And no .vtable was initialized in SECTIONS.

    Like I said though, I have very little familiarity editing these files and am having difficulty finding information.

  • Well, I fixed the compile errors.  I just needed to define a memory space DEFAULT which I gave origin = 0x00000000 and length = 0x00010000

    This still didn't fix the issue with the program not running if loaded through TFTP, however.  

  • Continuing this discussion here and closing this thread.

    -Seong

**Attention** This is a public forum