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.

TM4C1294XL + TM4C129SDRAMNVM + bootlader + hex file

Other Parts Discussed in Thread: TM4C1294NCPDT

Hi everyone,

I'm stuck (yes .. again !) with the mix between the bootloader and the extansion card : http://www.ti.com/tool/TIDM-TM4C129SDRAMNVM

It's simple, this mix is working well with the example project and my personnal project but only when i'm loading all the program on the internal memory or all the program on the external memory. 

Now if i'm adding the bootloader, same : all is working when all project is on one memory. 

If i dislock my program on 2 parts and programming with CCS, it's working too.

My problem is when i want to bootload this dislocked program. Indeed, the size of my bin file is arround 1.5 Go because my internal memory is starting at 0x0000000 and the external is starting at 0x60000000 and as answered Robert on this topic : https://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/486809 , it's normal for a bin file.

I tried both of his solutions. After some trys i'm unable to separate the bin file on 2 bins file and bootload on both so i surrendered this solution.

Now i'm working with a .hex file but it's not working with the bootloader example and i didn't find a tool to program it without bootloader.

So there is my questions : Is it possible to solve my problem with the .hex file ? Do is exists a tool to program it ? I choose the Output TI-Tagged hex format option on the ARM utility option on the project properties, is that correct ? 

Best regards,

John

  • Hi John,

    I've forwarded your post to one of our experts with the TMS129SDRAMNVM design. They should get back with you soon.
  • Hello John,

    There are 2 components to the design

    1. The boot loader that resides in the internal flash
    2. The application code that resides in the SD Card/NVM Serial Flash and is copied over to the SDRAM for execution.

    Can you give a clear picture of
    1. What is in the internal flash
    2. What is stored in the NVM/SD Carrd
    3. How have you modified the base address of the application code
    4. Have you used the binary file format?

    Regards
    Amit
  • Hi,

    Thank you Chuck Davenport and Amit about your answers.

    Sorry, i had to mention that before.
    My program is a web server like the example "enet_lwip". I put it on the external SDRAM but seems to be to slow : i never get the IP et the time to link is arround 1 min (I think the routeur is making timeout).

    1.2. So I want to put the exective program on the internal flash and only the page's file (~95% of the size of my program) on the external SDRAM. Like that I should (in theory) have a good time response and a working project. The size's project is to important for the internal memory.

    3. To do that is used pragma before each tab in the enet_fsdata.h : #pragma DATA_SECTION (data_wall1_jpg,"miqro")
    On the cmd i have :
    #define APP_BASE 0x00010000
    #define RAM_BASE 0x20000000

    /* System memory map */

    MEMORY
    {
    /* Application stored in and executes from internal flash */
    FLASH (RX) : origin = APP_BASE, length = (0x00100000-APP_BASE)
    //Web page in external memory
    FLASHEXT (RX) : origin = 0x60000000, length = 0x00200000
    /* Application uses internal RAM for data */
    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

    miqro : > FLASHEXT

    .vtable : > RAM_BASE
    .data : > SRAM
    .bss : > SRAM
    .sysmem : > SRAM
    .stack : > SRAM
    }

    __STACK_TOP = __stack + 2048;


    The memory browser of the project put fine the page on the external SDRAM memory and the main program on the internal flash.


    4. I tried but i got a 1.5Gb .bin file. Huge size because the "gap" in memory between the internal and the external flash (from 0x00010000 to 0x60200000 ~1500 Mb). I tried to bootload it on the SDcard but here i have an other problem : I'm unable to make the bootloader works with the function ROM_FlashProgram().
    Anyway the bin file is to important comparate at the size of the program and in have no idea how to make 2 bin files.

    The hex file format supports the gap and i have a 1.5Mb hex file but i don't know which format take for this hex file and how to program it.


    I hope i was enought clear on my explinations.

    Best regards,
    John

  • Hi,

    So is there someone who found one way to program a hex file on the TM4C1294NCPDT with or without the memory extansion ? Really stuck at this way but seems to me impossible. Should I try an other way ?

    Thank by advance.

    Best regards,
    John
  • Hello John,

    No, since the hex file requires parsing compared to bin file, we have never tried the same to keep the code size minimum.

    Regards
    Amit
  • Hi Amit,

    Thanks about your annwer, do you think it's possible with the tools i have (CCS,TM4C1294XL + memory extansion) to make this work with a hex file ?

    This question should seems obvious to poeples but it doesn't to me, i'm just at the student skill.

    Best regards,
    John
  • Hello John,

    It should be possible. The embedded firmware in TM4C129x would still need to convert the hex file into bin. I am not sure why you want to add that overhead to the TM4C129 device?

    Regards
    Amit
  • Hi Amit,

    I want to add that overhead because i want to separate my program on two parts, one part on the internal memory and the other part on the TM4C129SDRAMNVM extansion. When i make the bin file of the project like that i have a bin file with a size of 1.5GB. This size is normal because i have a big gap of memory between the internal memory (0x00000) and the external memory (0x60000000). 

    The format .hex is supporting gap like that. So with the same project i have a hex file with a size of 1.5MB and a bin file with a size of 1.5GB.

    The bootloader doesn't supports this big bin file and that's not good anyway. So i wanted to bypass that problem on programming with hex file but ... as you said

    Amit Ashara said:
    The embedded firmware in TM4C129x would still need to convert the hex file into bin.

    So i guess that will not solve my problem because my hex file will be convert on huge bin file again and will not work.

    Your point on it should be usefull :)

    Plus this kind of project should be usefull to other developpers i guess.

    Best regards,

    John

  • Hello John

    If you run a hex-2-bin on the device it will bloat up. However since the information is concise in the the hex file, knowing that certain region is to be pre-fill, you can skip that line in hex to avoid a 1.5G file.

    Regards
    Amit
  • Thank you to answer (again :) )

    I'm a bit confused here. If I understood well, if I erase the ligne on the hex file which contains the regions of memory, it should work.
    But .... How can i find this line ? i oppenned it with a textreader but seems understable. Maybe i took the wrong output format (i tried with the TI's formats).
    And, if i do it, the program will not be separate, it will be on one bloc then no ?

    Regards,
    John

  • Hello John,

    Eventually the hex file needs to be programmed as a binary file. Since you do not want to incur the download penalty on the bin file, you still download the hex file and the let the TM4C do the conversion.

    Regards
    Amit
  • Hi,

    Do you have a battery for your SDRAM? if so you can expect to load the SDRAM only once; otherwise the data for SDRAM should be kept also in flash and you want to move it to SDRAM every time you power on your board. Then prepare your data as a big aligned array (no matter where it is placed), then, move it to SDRAM since the starting address is fixed and known. Use a small trick to move: if the array is aligned, read four bytes at the time in a long word and drop it to the SDRAM as you need - word or byte can be obtained by shifting and masking without time penalty.

    Take into account the EPI read involves at minimum three EPI clock cycles, which are ½ of CPU clock, so it is very slow (running from flash would be faster). 

  • Hello Amit,

    I think I just understood what you propose to me. If i'm right, you are proposing to me to cut my hex file on two hex file and then to program the TM4C with them and he will be able to do the convertion on two bin files. Am I right ?

    If I'm right i will have some more questions. What output format of hex file should I ask at the ARM hex utility (on project's properties) ? How to program these hex file, i didn't find any tool for hex, only for bin.


    Best regards,
    John

  • Hi Petrei,

    Thank you to answer me specially with all of these informations.

    The battery solution will be the last solution to me, anyway that's a good idea, i tdidn't think about it.

    The idea to write the code like you said seems to be a great idea, I want to try it but unfortunately, I don't know how to check if the array is aligned.

    It's because of this account I want to separate my program, the TCP/IP stack seems to slow when i load it on SDRAM and seems to make timeout on the router (Never get the IP adress).

    Best regards,
    John
  • Hello John,

    I would have to disagree on the SDRAM being slow to cause a Timeout on the router. If you run the enet_lwip example on the SDRAM, you would see it is working all too well.

    Regards
    Amit
  • Hello Amit,

    When i'm programming my lwip project on the internal flash, it's working well, but when i program the same project on the external SDRAM, the "link" step is seriously longer and after that the IP adress is never find. It's why I said it seems to be timeout but it's working well to you so .... i don't understand where can be my problem ... I tried the same with the example code and didn't work too. I have 1 minute on waiting for a link and after that i'm always on waiting for IP with both project.

    The leds seems working well so the program isn't stuck.

    Do you confirm it's all working with the example 2.1.2.111 ?

    Regards,

    John

  • Hello John,

    I found the issue in the original code. The Ethernet MAC does not have a mapping to EPI memory and hence the descriptors do not work as expected. This was an oversight on my part when doing the test code. To be able to get around the issue, I have mapped the SRAM from external memory to internal SRAM while keeping code in external SDRAM.

    After doing so, it works well now. Attached is my cmd file that you may want to use as reference.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/enet_5F00_lwip_5F00_ccs.cmd

    Regards

    Amit

  • Hello Amit,

    You are right it's now working on my side too. Thank you about your explanations and the fix ! I'm grateful about that. 

    Best regards,

    John