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: How to execute code from external SPI NOR Flash or SDRAM.

Part Number: MSP432E401Y

Dear TI,

 The size of my executable .out file is more than 1MB. we have  external SDRAM & SPI NOR Flash in our design.

   So I need to implement code from external Memory. If it is possible provide steps to be followed for execution.

Regards,

Naga Narasimha Rao P

  • Hello Naga,

    Disregard most of these comments, they are incorrect.

    For the SPI Flash it is possible to do this.

    There is example code provided for SPI flash in the SimpleLink SDK under the nortos / driverlib folder for the MSP_EXP432E401Y.

    For SDRAM the device is not capable of executing code from SDRAM over the EPI bus.

    Best Regards,

    Ralph Jacobi

  • Dear TI,

        "There is example code provided for SPI flash in the SimpleLink SDK under the nortos / driverlib folder for the MSP_EXP432E401Y"

      The example does not contain anything related to code execution from external flash SPI NOR Flash memory. I need example program or steps to followed to execute code from external SPI NOR flash memory.

     Regards,

    Naga Narasimha Rao P

  • Hello Naga,

    Sorry I gave you incorrect information before. What is possible to execute is the opposite of what I said.

    The EPI bus allows for execution of external code via SDRAM, SRAM, or Flash Memory.

    The QSSI bus does not have the direct paths needed to support code execution external SPI Flash.

    That is why there is nothing for code execution as part of the example.

    For the EPI there are two examples in the same folder to get started with the fundamentals which are epi_sdram_basic and epi_sdram_dmareq.

    As far as executing from, for example, SDRAM - you would need to enable to EPI peripheral so that is possible to start reading SDRAM data from Address 0x6000.0000. From there it would depend how your application is setup but effectively you'd be executing from locations of the SDRAM just like if you were executing from Flash. So the program counter would just need to know which areas to access etc.

    That said I don't believe there is a dedicated example showing how to do that for these devices, so it's not something we will be able to provide example code for.

    Again my apologizes for the initial incorrect information. I hope these latest comments clear up the situation better.

    Best Regards,

    Ralph Jacobi

  • Dear Ralph Jacobi,

    To execute code from external SDRAM. there is any modification need to be done in linker script file or any other files. If yes explain the procedure and file locations. how to initiate code execution from SDRAM. 

     Regards,

    Naga Narasimha Rao P

  • Hello Naga,

    Do you plan to only execute from SDRAM or do you plan to use it for memory expansion?

    If you plan to use it for memory expansion, how do you plan to load the data initially?

    Best Regards,

    Ralph Jacobi

  • Dear Ralph Jacobi,

    We planned to only execute from SDRAM. Initially we planned to load the data to  External SPI flash and external flash to SDRAM using flash writer application which will be executed from internal flash. then start execution from SDRAM.

    if there is any different method is there other than this ?

     Regards,

    Naga Narasimha Rao P

  • Hi Naga,

    Just wanted to be sure on how you wanted to execute. I don't actually have experience with an alternate method than you described so I can't comment if there are different methods.

    As for what you would do, yes you would need to edit the linker command file then.

    You'd want to set your application start address based on external memory like so:

    /* The starting address of the application.  Normally the interrupt vectors  */
    /* must be located at the beginning of the application.                      */
    #define APP_BASE 0x60000000
    #define RAM_BASE 0x60000000
    
    /* System memory map */
    
    MEMORY
    {
        /* Application stored in and executes from internal flash */
        FLASH (RX) : origin = APP_BASE, length = 0x00100000
        /* Application uses internal RAM for data */
        SRAM (RWX) : origin = 0x60100000, length = 0x00040000
    }

    Best Regards,

    Ralph Jacobi

  • Dear Ralph Jacobi,

    System memory map : the memory location is address is belongs to SDRAM (origin = 0x60000000). but there it contains FLASH & SRAM .  I had following format  in my default  linker script. 

    1. there is any changes  need to be done in below other than what you said.

    > MEMORY  

    > SECTIONS / * Section allocation in memory */

    /*****Default linker script file*****************/

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

    /* Section allocation in memory */

    SECTIONS
    {
    #ifndef gen_crc_table
    .intvecs: > 0x00000000
    .text : > FLASH
    .const : > FLASH
    .cinit : > FLASH
    .pinit : > FLASH
    .rodata : > FLASH
    .init_array : > FLASH
    #else
    .intvecs: > 0x00000000, crc_table(crc_table_for_intvecs)
    .text : > FLASH, crc_table(crc_table_for_text)
    .const : > FLASH, crc_table(crc_table_for_const)
    .cinit : > FLASH, crc_table(crc_table_for_cinit)
    .pinit : > FLASH, crc_table(crc_table_for_pinit)
    .rodata : > FLASH, crc_table(crc_table_for_pinit)
    .init_array : > FLASH, crc_table(crc_table_for_init_array)
    .TI.crctab : > FLASH
    #endif

    .vtable : > 0x20000000
    .data : > SRAM
    .bss : > SRAM
    .sysmem : > SRAM
    .stack : > SRAM
    }

    __STACK_TOP = __stack + 512;

     Regards,

    Naga Narasimha Rao P

  • Hello Naga,

    You would need to adjust the .intvecs and .vtable addresses as well. The remaining linker file for the example I posted as is follows:

    /* Section allocation in memory */
    
    SECTIONS
    {
        .intvecs:   > APP_BASE
        .text   :   > FLASH
        .const  :   > FLASH
        .cinit  :   > FLASH
        .pinit  :   > FLASH
        .init_array : > FLASH
    
        .vtable :   > RAM_BASE
        .data   :   > SRAM
        .bss    :   > SRAM
        .sysmem :   > SRAM
        .stack  :   > SRAM
    }
    
    __STACK_TOP = __stack + 256;

    Best Regards,

    Ralph Jacobi