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.

CCS/TMS320F28377D: How do I copy all data from Flash to RAM?

Part Number: TMS320F28377D

Tool/software: Code Composer Studio

Dear expert.

I want to copy all data from Flash to RAM and use it.

I used the Flash_programming example.

I have also referenced the document below, but an error occurs.
www.ti.com/.../spraau8a.pdf

I modified my code as follows:
1.Add DSP28xxx_SectionCopy_nonBIOS.asm file
2. Modify F2837xD_CodeStartBranch.asm to use SectionCopy
3. In F2837xD_SysCtrl.c #pragma CODE_SECTION (InitFlash, ".TI.ramfunc"); Annotation
4. Comment out .sect ".TI.ramfunc" and .sect "ramfuncs" in F2837xD_usDelay.asm

By the way, I don't know how to modify the Command file.
How do I modify the Command file so it works?

please refer to my files

2437.files.zip

  • Hi,

    Please clarify a few questions before we jump in to further discussion:

    1) Why are you trying to copy entire application in to RAM (instead of a few functions etc. which need 0-wait performance)?  Any particular reason?  Does your entire application need 0-wait performance?

    2) Are you aware that the RAM available is 82KW, while the Flash size is 256KW.  If you want to copy your entire application to RAM, your application size should not exceed 82KW.  Is this fine with you?

    Thanks and regards,

    Vamsi

  • Dear Vamsi

    Thanks for reply

    1) Why are you trying to copy entire application in to RAM (instead of a few functions etc. which need 0-wait performance)?  Any particular reason?  Does your entire application need 0-wait performance?

     -> I'm sorry. I want to create a remote firmware upload bootloader. This does not copy the entire flash. Probably the code area is about 131kb. So, when the power is turned on for the first time, all code areas of Flash are copied to RAM. Then, when the firmware is uploaded while operating in RAM, the Flash area is erased/written.

     

    2) Are you aware that the RAM available is 82KW, while the Flash size is 256KW.  If you want to copy your entire application to RAM, your application size should not exceed 82KW.  Is this fine with you?

     -> Booting into Flash and working, I later wanted to erase/write Flash by jumping to the Bootloader, but it failed. So I want to copy the entire code into RAM and change it to work. What should I do?

     

    Please give me advice.

    Thanks and regards,

    Edward

  • Edward,

    Please correct me whether I understood your requirement correctly or not.

    You plan to have a custom bootloader and an application, both programmed in to Flash.

    (1) After a power-up, the custom bootloader will decide whether the application in Flash needs to be updated or not. If it decides to update the application in Flash, it has to copy the application in Flash to RAM and keep running the application from RAM, while the bootloader streams the new application image and programs it in to Flash.  Is this correct?

    OR 

    (2) Same as above except that the application does not need to be running while the Flash is being updated? 

    Which option are you looking for?

    If my understanding is incorrect, please explain your requirement clearly.

    Thanks and regards,

    Vamsi

  • Dear Vamsi

    Really thanks for the reply.

    The first my plan was to create a custom bootloader(not TI bootloader) and an application. then application programmed into Flash.

    But it was so difficult because it occurred ITRAP error when the erase application area.(including .econst, .cinit and so on)

    So I changed the plan. I plan to have a custom bootloader and an application. then application programmed into Flash using RAM.

    So the point is your (1) is correct.

    I already referred to SCI_Kernel_example.
    but the SCI_Kernel_example needs .exe program. right?
    I don't want to use the .exe program.

    I want to erase/write Flash without the .exe program. Ask for help.

    Thanks and regards,

    Edward

  • Edward,

    Ok, looks like live Firmware update:  You want to update the Flash image using your custom loader while the existing application is copied to RAM and running live from RAM.  And once the image is updated, your application will start executing the new image in Flash.  Is that correct? 

    This means all of your current application and Flash API and the streamed image buffer should fit in the available RAM. 

    Also, do you plan to copy the current application to RAM and execute from there only when the bootloader wants to update the image? OR Do you want to copy the application from Flash to RAM and execute from there always?

    Note that live firmware update with a single bank is tough to implement:  It would be easy if your application has some offline time to update the Flash image - Meaning a firmware update but not live. Is this a possible option for your application?

    Serial Flash kernels take a hex input and not exe.

    Thanks and regards,
    Vamsi

  • Dear Vamsi

    Thanks for the reply.

    I'm really really sorry about the late answer.

    Yes. I want to make a live Firmware update.

    My first plan is to copy the current application to RAM and execute from there only when the bootloader wants to update the image.
    But it was difficult, right?

    So I try to copy the application from Flash to RAM and execute from there always.
    It is more simple, right?

    I referred "Copying Compiler Sections From Flash to RAM on the TMS320F28xxx DSCs" documents.

    I followed the same thing, but it didn't work.

    Thanks and regards,
    Edward

  • Edward,

    I understand your requirement.

    Let me check with our live firmware update team.  I know they have a solution for devices that have two banks per core - where in application executes from one bank while the image in the other bank is updated.

    I don't think they have a solution for single bank devices.

    If they have, it would be easy for you.

    If they don't have it, then I will help you debug the failure that you mentioned in this post.

    Thanks and regards,
    Vamsi

  • Edward,

    I checked with our team and we don't have an example to show live firmware upgrade in devices where there is only one bank per core.

    In your first post in this thread, you asked for linker cmd file edit help.  Let us start from there.

    Please look at this workshop: https://training.ti.com/c2000-f2837xd-microcontroller-workshop

    Step #2 is Programming Development Environment -- Lab: Linker command file.

    Thanks and regards,
    Vamsi