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.

CC2630: Placing OS components like SYSBIOS at known flash locations

Part Number: CC2630
Other Parts Discussed in Thread: SYSBIOS, TIMAC, , Z-STACK

I'm writing for an application where using SYSBIOS in ROM isn't possible so I have to place a lot in flash. Unfortunately this has put me in a difficult situation resource wise, at the moment I do not have enough space to write my application in a way that can be updated over-the-air. A major factor is how much space is being taken by SYSBIOS and other IAR components.

I started by placing the stack image to the end of flash and applications will always reference it, that helped but wasn't enough. Looking at the map file:

    Module                      ro code  ro data  rw data
    ------                      -------  -------  -------
driverlib.lib: [6]
    aon_batmon.o                     40
    chipinfo.o                       36
    cpu.o                            24
    ddi.o                           162
    driverlib_ver.o                                     1
    flash.o                          32
    osc.o                           528                20
    setup.o                       1 168
    sys_ctrl.o                      492                 8
    -----------------------------------------------------
    Total:                        2 482                29
    
drivers_cc26xxware.arm3: [7]
    I2C.orm3                         80        2        4
    I2CCC26XX.orm3                1 128       20       20
    PINCC26XX.orm3                  956               220
    UART.orm3                        80
    UARTCC26XX.orm3               1 812       40       16
    -----------------------------------------------------
    Total:                        4 056       62      260

m7M_tl.a: [8]
    DblAdd.o                        232
    DblCmpEq.o                       32
    DblCmpGe.o                       46
    DblCmpLe.o                       46
    DblDiv.o                        598
    DblMul.o                        418
    DblSub.o                        384
    DblToI32.o                       88
    I32ToDbl.o                       48
    pow.o                         2 128
    xdint.o                         122
    xdnorm.o                         66
    xdscale.o                       268
    xdtest.o                         50
    xexp.o                          700
    xlog.o                          172
    -----------------------------------------------------
    Total:                        5 398

rt7M_tl.a: [9]
    ABImemclr.o                       6
    ABImemclr4.o                      6
    ABImemcpy_unaligned.o           118
    ABImemset.o                     102
    ABImemset48.o                    58
    I64DivMod.o                     238
    I64DivZer.o                       2
    XXexit.o                         12
    data_init.o                      40
    lz77_init.o                     450
    memcmp_unaligned.o               98
    strchr.o                         22
    strlen.o                         54
    zero_init3.o                     64
    -----------------------------------------------------
    Total:                        1 270

sysbios.arm3: [10]
    BIOS.o                       10 548                28
    m3_Hwi_asm_iar.obj              272
    m3_Hwi_asm_switch_iar.obj       104
    m3_TaskSupport_asm_iar.obj      108
    -----------------------------------------------------
    Total:                       11 032                28

Since these libraries aren't being actively developed anymore I think I could save some space by placing some of these outside my application. Is there any way to move some of this code to a fixed location in flash?

  • Hi Daniel,

    I do not have too much advice at the moment.  You could try placing drivers_cc26xxware (I2CCC26XX.c/h, PINCC26XX.c/h, UART.c/h from tirtos_cc13xx_cc26xx_2_21_01_08\products\tidrivers_cc13xx_cc26xx_2_21_01_01\packages\ti\drivers) and driverlib (setup files from tirtos_cc13xx_cc26xx_2_21_01_08\products\cc26xxware_2_24_03_17272\driverlib) resources into your application so that you can modify them to determine their flash location.  I have not further tested this as CC2630 TIMAC/Z-Stack solutions are deprecated.

    Regards,
    Ryan

  • This turned out to be way easier than I realized and is more of an IAR solution than a TIMAC/TIRTOS one. IARs linker supports the following syntax in the linker config (.icf) file:

    place in REGION { readonly object BIOS.o };

    This may not turn out to be workable for a long term project, particularly if the linker is optimizing functions out of these objects and new code in my app could change it. If that becomes the case the answer goes back to modifying the source like described here https://www.iar.com/knowledge/support/technical-notes/linker/how-do-i-place-a-group-of-functions-or-variables-in-a-specific-section/.

    In either case the linker does support this either by modifying the code and placing each function manually or by placing them file-by-file at link time (even the IAR supplied .a files work).