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.

CodeStart branch issue

Other Parts Discussed in Thread: TMS320F28377S, SYSBIOS

I am trying to move application in flash to accommodate a custom boot loader. f28377S

When I include the F2837xS_codeStartbranch.asm in my project and link I get a program will not fit in memory error. I copied this file directly from the

control suite directory for device support       F2837xS_common\source

"../TMS320F28377S.cmd", line 139: error #10099-D: program will not fit into available memory. placement with alignment/blocking fails for section "codestart" size 0x2 page 0. Available memory ranges:

I am using a command file that has the following in memory definition

/* Flash boot address */

BEGIN : origin = 0x080000, length = 0x000002

......

RESET : origin = 0x3FFFC0, length = 0x000002

In the SECTIONS definition section there is an entry for

codestart : > BEGIN PAGE = 0

My understanding is that on reset the app jumps to RESET address and then it does a branch to codestart.

The application links and load correctly when I exclude the code start assembly file.

In the map file it looks like it is trying to define another codestart section and has placed it at 00000

Here are the lines from map file.

output attributes/

section page origin length input sections

-------- ---- ---------- ---------- ----------------

codestart

* 0 00000000 00000002 FAILED TO ALLOCATE

.ti_catalog_c2800_initF2837x_begin

* 0 00080000 00000002

00080000 00000002 Boot.a28FP : Boot_asm.o28FP (.ti_catalog_c2800_initF2837x_begin)

.text:ti_catalog_c2800_initF2837x_flashfuncs

* 0 00080002 00000027 RUN ADDR = 0000b000

00080002 00000027 Boot.a28FP : Boot.o28FP (.text:ti_catalog_c2800_initF2837x_flashfuncs:_ti_catalog_c2800_initF2837x_Boot_initFlash)

Thanks

Maury

  • Maury,

    It looks like you have a conflict with that Boot_asm file. Are you using TIRTOS?

    Best Regards
    Chris
  • YEs we are using SYSBIOS, is there a different start file for TIBIOS if so where is it located?
    thanks
    maury
  • TI-RTOS experts will know best how to resolve your conflict. I'll move your post over to their forum.

    Best Regards
    Chris
  • I might be asking the wrong question here.
    In the past we used the cstart....asm file to move the location of the app in flash.
    I would rather not have to rebuild OS is I can avoid that Should I be able to move the application just by changing my linker command file so that the BEGIN, codestart section is at the new location in Flash?
    Maury
  • I have changed just the linker command file so the application BEGIN is at 0x84000 with length of 2 and set code start to BEGIN.
    In MEMORY description
    /* Flash boot address */
    BEGIN : origin = 0x084000, length = 0x000002
    /* Flash sectors */
    //FLASHA : origin = 0x080002, length = 0x001FFE /* on-chip Flash */
    //FLASHB : origin = 0x082000, length = 0x002000 /* on-chip Flash */
    FLASHC : origin = 0x084002, length = 0x001FFE /* on-chip Flash */

    In SECTIONS
    codestart : > BEGIN PAGE = 0

    I then modified the appcfg to not use FLASHA or B for flash functions.
    I can build the app and load it with the debugger but when I power cycle it does not execute.

    Hints as to what is not hooked up correctly
    Thanks
    maury
  • Looking at the map files it looks like the begin and app are being placed in the correct locations along with the begin and flash funcs
    .ti_catalog_c2800_initF2837x_begin
    * 0 00084000 00000002
    00084000 00000002 Boot.a28FP : Boot_asm.o28FP (.ti_catalog_c2800_initF2837x_begin)

    .text:ti_catalog_c2800_initF2837x_flashfuncs
    * 0 00084002 00000027 RUN ADDR = 0000b000
    00084002 00000027 Boot.a28FP : Boot.o28FP (.text:ti_catalog_c2800_initF2837x_flashfuncs:_ti_catalog_c2800_initF2837x_Boot_initFlash)

    However I see that _RamfuncsRunStart is at 00008000
    Where is this value set?
    Thanks
    Maury
  • If I compare the map of link that works with this one that fails I see that the real issue is that these are trying to be in page 0 not page 1

    From map does not run from power up

    0 00084039 _RamfuncsLoadEnd

    abs 00000010 _RamfuncsLoadSize

    0 00084029 _RamfuncsLoadStart

    0 00008010 _RamfuncsRunEnd

    abs 00000010 _RamfuncsRunSize

    0 00008000 _RamfuncsRunStart

    From link map that works prior to moving app

    1     00008000  _RamfuncsLoadEnd                                                                                                                                                          
    abs   00000000  _RamfuncsLoadSize                                                                                                                                                         
    1     00008000  _RamfuncsLoadStart                                                                                                                                                        
    1     00008000  _RamfuncsRunEnd                                                                                                                                                           
    abs   00000000  _RamfuncsRunSize                                                                                                                                                          
    1     00008000  _RamfuncsRunStart                                                                                                                                                         

    here is the linker command file Modified after moving location. I had removed the inclusion of FLASHA and B from LOAD=

    ramfuncs : LOAD = FLASHC | FLASHD | FLASHE |

    FLASHF | FLASHG | FLASHH | FLASHI | FLASHJ |

    FLASHK | FLASHL | FLASHM | FLASHN | FLASHO |

    FLASHP | FLASHQ | FLASHR | FLASHS | FLASHT |

    FLASHU | FLASHV | FLASHW | FLASHX | FLASHY |

    FLASHZ | FLASHAA | FLASHAB PAGE = 0

    RUN = LS05SARAM PAGE = 1

    LOAD_START(_RamfuncsLoadStart),

    LOAD_SIZE(_RamfuncsLoadSize),

    LOAD_END(_RamfuncsLoadEnd),

    RUN_START(_RamfuncsRunStart),

    RUN_SIZE(_RamfuncsRunSize),

    RUN_END(_RamfuncsRunEnd)

     

    How do I get RAM FUNCS into ram segment?

    Thanks

    maury


  • Maury,

    I tried to read through and understand what you were saying and looking at your last post,
    The one that works has LOAD/RUN address at the same address 8000
    The one that doesn't work has LOAD at address 00084029 and RUN ad address 00008000.

    I mean if you got enough RAM then just set the LOAD/RUN address to be the the RUN address (this address is meant to be in RAM). At least this can probably get you going for now.

    Typically, when you boot from FLASH, you may have some function that is in flash that you want to copy to RAM either because it is required or it runs faster from RAM.

    Judah
  • Judah,

    Sorry I was trying to get this to work and was posting updates to what I tried and maybe it was unclear what had been done.

    I am trying to move a SYSBIOS application in flash for the f28377S.

    I modified the linker command file see the attached file TMS320F28377S1.txt I

    I moved app to start in FLASHC by doing the following:

    BEGIN : origin = 0x084000, length = 0x000002

    previous it was in FLASHA

    BEGIN : origin = 0x080000, length = 0x000002

    I removed FLASHA and B from being referenced in the MEMORY definition section

    Changed  the ram funcs load to start in FLASHC previously started in A. I did not change the  RUN=

    ramfuncs : LOAD = FLASHC | FLASHD | FLASHE |

    FLASHF | FLASHG | FLASHH | FLASHI | FLASHJ |

    FLASHK | FLASHL | FLASHM | FLASHN | FLASHO |

    FLASHP | FLASHQ | FLASHR | FLASHS | FLASHT |

    FLASHU | FLASHV | FLASHW | FLASHX | FLASHY |

    FLASHZ | FLASHAA | FLASHAB PAGE = 0

    RUN = LS05SARAM PAGE = 1

    LOAD_START(_RamfuncsLoadStart),

    LOAD_SIZE(_RamfuncsLoadSize),

    LOAD_END(_RamfuncsLoadEnd),

    RUN_START(_RamfuncsRunStart),

    RUN_SIZE(_RamfuncsRunSize),

    RUN_END(_RamfuncsRunEnd)

    The other modification I made was in appcfg in cfg script to the following it was flash A, B , C

    Boot.loadSegment = "FLASHC | FLASHD | FLASHE PAGE = 0";

    The map file I get is nGen Controller 1.txt. what I do not understand is why it shows the following with these locations in FLASH and NOT RAM and why the RamFuncs load and run are not the same address as the linker command file did not change. When I loaded app into flasha the page was 1 not 0 and all the addresses were the same 8000

    0 00084039 _RamfuncsLoadEnd

    abs 00000010 _RamfuncsLoadSize

    0 00084029 _RamfuncsLoadStart

    0 00008010 _RamfuncsRunEnd1538.TMS320F28377S1.txt

    abs 00000010 _RamfuncsRunSize8446.nGen Controller 1.txt

    0 00008000 _RamfuncsRunStart

  • 3580.TMS320F28377S2.txt1832.nGen Controller2.txtI made a mistake and the map file I was comparing was a link into RAM so hence the difference in putting into ram instead of flash.

    However now when I compare it appears that all the addresses have moved correctly by 0x4000 but yet the app does not start from a power up but will run from debugger load.

    I have attached the initial linker coammdn file and map file generated nGenController2.txt and TMS....2.txt.

    Thanks Maury

  • Yeah the RAM thing did not make sense but glad you cleared that up.

    Do you have any info where the program is when you boot from flash? Like did it get to main()? Or did it not start at all?
    You might need to interject a first function or even a boot function so that you can connect the debugger.
    Make sure the flash wait states are setup correctly. Let me know what version of SYSBIOS you are on cause I remember there being a bug in programming the flash wait states in some earlier version of SYSBIOS.

    Judah
  • Judah,

    SYSBIOS is   bios_6_42_03_35.

    It appears the application does not execute at all but I can try and verify that.

    It is not clear how to try and connect to a running app with CCS 6.1.1. Can you provide some info.

    Things to note:

    The application will run when I load with the debugger and I have checked memory window locations for boot entry and ramfuncs and the data there appears to be correct.

    If I leave the app starting location in FLASHA then it will run from a power cycle.

    The question I have is in the application linker command file I moved the BEGIN to the new location and code_start is set to BEGIN. In the past versions there was a codeStartBranch that used this section and the boot vector jumped here and this module ran the c init functions.

    I tried to include the codestart branch for this processor but was getting and error and someone indicate there was a conflict between that file and the sysbios boot sequence.

    What file in sysbios contains this code that the boot vector jump to?

    Do I need to modify the SYSBIOS or is there a linker command file for the sysbios like my app where I can move the code_start  location?

    Thanks

    Maury

  • Sorry for the delay, I was looking into the flash boot on this device. I found out that the flash entry point address is fixed at 0x80000 for this device and cannot be changed as it is burned into the boot ROM. So all this is to say...If you leave BEGIN at 0x80000 your program should work.

    Judah
  • Judah,
    Let me go back to what I am trying to accomplish overall.
    I need to add a custom boot loader to be able to download new code to the device.
    I want to move the application location in flash as I have done and add a custom boot loader that will have a code_start/Begin at 0x80000.
    The boot loader will jump to the application that was moved in memory to the code_start location for the application.
    Is this scenario doable?
    Thanks
    Maury
  • Maury,

    I don't know for sure but I can already see issues that you might run into. It sort of depends on what your boot loader does and what it needs. I'll just share some of the issues I foresee with this method:

    1. The Boot module provided by SYSBIOS does a bunch of boot initialization (like setup the flash wait state), you need to do this in your bootloader and probably disable it from the SYSBIOS boot module.

    2. I don't even know if its possible to flash that particular section of flash with one program and the rest of flash with your real app.

    Why does this need to run as a boot loader?

    Judah
  • Judah,
    The application needs to be upgraded in the field where the code is downloaded from another device using serial port. The apploader downloads the code and erases the app and reprograms the application. The bootloader always starts and it jumps to the applications startup code if it detect an application is loaded.
    We have done this in the past using earlier versions of sysbios on the 2812 and the 28333 devices.
    Is the 28377S that much different from the 28333 that this will not be possible?
    It sounds like there may not be much support available for doing this type of operation.
    I agree the boot loader needs to do the system initialization for these global operations, is the a flag in the app to turn of this initialization or can just do it twice if it is the same?
    Thanks
    Maury
  • SYSBIOS does have a ROM for the 28377S device but you could choose to not use the ROM which means those devices are similar.

    So I assume you tried what you have stated and its not working? Which part is not working cause I would assume that if you put your boot loader at the base of Flash it will boot into that code no?

    Judah
  • Judah,
    I expect that to be the case when I get the apploader ported.
    Now that I understand a little more In the interim I would like to include a module in the application that gets loaded at the boot vector and jumps to the application startup.
    So temporarily it sounds like if I link with the codestart at x080000 and my application at x84000 that the boot vector should jump to start address in my application does that sound correct?
    Down the road when I get the apploader ported I need it to jump to the c initialization address. ON prior devices this was at _c_int00:
    Can you point me to the asm file where this location is defined for the 28377s?
    Thanks
    Maury
  • 1. So temporarily it sounds like if I link with the codestart at x080000 and my application at x84000 that the boot vector should jump to start address in my application does that sound correct?

    -Yes that sounds right to me.

    2. Can you point me to the asm file where this location is defined for the 28377s?

    -Its located in your installation in a directory like the following:
    C:\ti\ccsv6.1.0.104\bios_6_45_01_29\packages\ti\targets\rts2800\boot_cg.asm

    Judah
  • There was a suggested answer and since there has been no active on this thread for more than a week, the suggested answer was marked as verify. Please feel free to select the "Reject Answer" button and reply with more details.