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.

RTOS: Flash based Applicaiton program uploading issue with SCI-A and flash kernel program

Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

I'm using F28377D with SYSBIOS.

I've made a flash based App and it is working by  loading it through JTAG.

Now, I would like to upload App program with using SCI-A port ( Boot ROM & F2837xD_sci_flash_kernels_cpu01.c) for field operation.

With reviewing F2837xD_sci_flash_kernels_cpu01.c,  the algorithm of the rogram & verify are based 4 words aligment.

But the section (.text:ti_catalog_c2800_initF2837x_flashfuncs)  of my app program is not aligned to 4 words so that I've encoutered the  program error during uploading

I'm attaching linker cmd & map file.  Are there merge two sections of (.ti_catalog_c2800_initF2837x_begin & .text:ti_catalog_c2800_initF2837x_flashfuncs) automatically or alignment of  4 words ?

6052.App_Map_LinkerCMD.zip

best regards,

JY Koh

  • Jae Yong,

    There are a few ways to do this.  

    One would be to modify ti/catalog/c2800/initF2837x/Boot.c to use a CODE_ALIGN pragma.  But this would require a rebuild of the Boot module itself, and offhand I don’t think there is an easy way to do this in your product installation.

    A second way is to modify a linker command template in your installation.  An alignment specification could be added to the file ti/catalog/c2800/initF2837x/linkcmd.xdt:

    SECTIONS {
        .text:ti_catalog_c2800_initF2837x_flashfuncs : ALIGN=0x4 LOAD = `Boot.loadSegment`,
                                                  RUN = `Boot.runSegment`,
                                                  table(BINIT)
    }

    This is probably the easiest, but if you move to later versions of the kernel or XDC tools this will be lost.

    A third option involves modifying the linker command file used for your app to create a special memory region that has the alignment you want, and explicitly place the flash functions there.  For example, splitting FLASHA to add a special MYFLASH region in the linker command file:

          /* Flash boot address */
          BEGIN   : origin = 0x080000, length = 0x000002

           /* Flash sectors */
    //  FLASHA     : origin = 0x080002, length = 0x001FFE  /* on-chip Flash */
          MYFLASH : origin = 0x080004, length = 0x000080  /* on-chip Flash */
          FLASHA     : origin = 0x080100, length = 0x001EFE  /* on-chip Flash */


    And then in your app configuration, tell the Boot module to place the flash functions in the special region.  For example, in the .cfg file I specified “MYFLASH PAGE = 0” as the “Load Segment For Flash Functions”.  This can be done in the graphical configuration tool, or by adding this to the .cfg file:

    Boot = xdc.useModule('ti.catalog.c2800.initF2837x.Boot');
    Boot.bootFromFlash = true;
    Boot.configureFlashController = true;
    Boot.loadSegment = "MYFLASH PAGE = 0";

    The Flash functions then get aligned according to the region definition:

     .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    00080004    00000027     RUN ADDR = 0000b000
                      00080004    00000027     Boot.a28FP : Boot.o28FP (.text:ti_catalog_c2800_initF2837x_flashfuncs:_ti_catalog_c2800_initF2837x_Boot_initFlash)

    .econst    0    00080100    00001d8f


    I don’t know which of these later two sound best for your use case, but I think both will work.

    Regards,
    Scott

  • Hi Scott,

    Thanks for your kind explanation.

    I think the third option is proper to this situation.

    Best Regsrds,

    JY Koh

  • 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.