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.

Dynamic module loading and position independent code

Other Parts Discussed in Thread: UNIFLASH, CC3200

Given that CC3200 has no internal user flash and a huge RAM, is the platform going to support dynamic loading? Is uniflash for CC3200 going to support programming multiple images? Would there be any loader API to load the external flash image into the RAM? 

  • Hi Aravind,

    Let me try to answer your query in 2 parts:

    1. Regarding loading of application image from external flash into the RAM

    One application image (/sys/mcuimg.bin) can be downloaded using Uniflash. After flashing the image and removing SOP2, on power cycling the device, the bootloader takes care of loading the external image into the RAM and then enables the application to execute.

    2. Regarding programming multiple images/Dynamic module loading

    Uniflash can aid flashing multiple images (as user files) to the external flash. However, the bootloader will only load one well known image (filename /sys/mcuimg.bin) to the RAM.

    I could suggest a possible approach you could consider to load modules dynamically:

    1. The application determines a predefined function pointer table to interface with the different modules. All modules could have the same interface.
    2. Identify a region in SRAM for the paging – REGION1
    3. Have the predefined function pointer table in the beginning of this section (REGION1).
    4. The code will follow in this region (REGION1).
    5. Before invoking any of the functions, load the contents from SFLASH (using NVMEM APIs and user files) to the identified region (REGION1).
    6. Application can use the predefined function pointer table to access the functions.

    Each of the binaries (modules) could be built separately with a dummy main and the linker file enabling the placement of the const table (fixed function pointer table) in the beginning of this section (REGION1) and code in the same section (REGION1).

    Each of these binaries are flashed as user files in the SFLASH.

     

    Best regards,

    Naveen

     

  • Thanks much for the quick reply Naveen,

    Could you mention, how to control the SFLASH area where the bin file / user file resides using uniflash. I would need this for main function to load other modules. Or should I check the address where the files get programmed first time and adjust the SFLASH module pointers on the main application image (/sys/mcuimg.bin). And if this is the case, would it work consistent for mass programming. I have already started. But I would like ti's recommendation for long run.

     

    If there is a document describing how to control the program/file SFLASH area, you could point me to that.

    Cheers,

    Aravind

  • Hi Aravind,

    Could you please share some more details on the usecase that you are developing/targetting? This is more to be sure that our recommendations fit your requirement well.

    To answer your query:

    You cannot control the placement (location where the file is placed) of the user file in SFLASH, but will be able to access (read in this case) it by refering to the filename. You may refer to the cc3200-sdk\example\file_operations example in the SDK to read files stored in the SFLASH using filenames.

    Best regards,

    Naveen