Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed the week of November 23.

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.

CC2652P: TiRTOS startup files

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

Hi there,

Where they are in the SDK startup and linker files ( filepath, filename ) for TIRTOS ( CC26x2 )

and what mean

_rom_data_start = 0x20000100;
_rom_data_size = DEFINED(ROM_DATA_SIZE) ? 12 : DEFINED(ROM_DATA_SIZE_NO_OAD) ? 0x108 : 0;

what is this data

I want to port SDK for PlatformIO ... for now work baremetal(only driverlib), nortos, freertos and C++ Arduino

left only tirtos...

  • info how to init ???

    xdcRomConstPtr  // 0x20000100
    xdcRomExternFuncPtr  // 0x20000104
    xdcRomStatePtr  // 0x20000108

  • Georgi,

    Startup files are in simplelink_cc13xx_cc26xx_sdk_xx_xx_xx/source/ti/devices/<device>/startup_files.

    Linker is defined in Project Settings > Build > Arm Linker

    _rom_data_start is the starting address of the device ROM. _rom_data_size is the size of the device ROM.

    You can read more about the ROM contents in the CC2652R TRM.

    For 

    xdcRomConstPtr  // 0x20000100
    xdcRomExternFuncPtr  // 0x20000104
    xdcRomStatePtr  // 0x20000108

    Please see linker.cmd in the tirtos_builds_<sdk>_release_ccs project , lines 620, 621, 622.

    SECTIONS
    {
        .data:xdcRomExternFuncPtr: LOAD > 0x20000104
        .data:xdcRomStatePtr: LOAD > 0x20000108
        .data:xdcRomConstPtr: LOAD > 0x20000100
    }
    

  • Hi Daniel

    I not use CCS and TI compiler

    I use VSCode/PlatformIO and GCC ... Project is there github.com/.../wizio-cc

    my linker script is OK and bootloader( startup ) is OK ... but there is function __TI_auto_init() -  where is ??? ( code, lib ??? )

    you will say - auto_init.asm ... but where is __TI_CINIT_Base __TI_Handler_Table_Base

    and where and who init the above functions ( xdcRomConstPtr  xdcRomExternFuncPtr xdcRomStatePtr ... it is only pointers to table structs )

  • __TI_auto_init() is part of the TI ARM compiler. You can view the source at /ccsXXXX/ccs/tools/compiler/ti-cgt-arm_XX.XX/lib/src/autoinit.c/.h. You can also find declarations of  __TI_CINIT_Base and  __TI_Handler_Table_Base in the autoinit.h file. GCC will have its own way to initialize the things that are handled by __TI_auto_init(). See this post for more info.

    xdcRomConstPtr,  xdcRomExternFuncPtr, and xdcRomStatePtr are pointers used internally by the RTOS kernel in ROM to locate functions, constants, and variables referenced by the ROM code. See this e2e post.

    -Daniel

  • Thanks ...

    but I not have TI ARM compiler

    btw: The SDK must contain all files

  • Some example how to start TI-RTOS with GCC compiler ( no TI ARM compiler ) ???

  • Georgi,

    As I mentioned above, GCC startup files for the device are located at <sdk>/source/devices/<device>/startup_files/startup_gcc.c.

    A good example would be the empty project, found at <sdk>/examples/rtos/<launchpad>/drivers/empty/tirtos/gcc/

    Regards,

    Daniel

  • Daniel

    This GCC startup files can not find __TI_auto_init() ... this function missing for GCC

    This function init static variables for xdcRomConstPtr, xdcRomExternFuncPtr, xdcRomStatePtr ----> tables from  CC26xx_pem4f.c

    and this file can not be compiled with GCC ... too committed to TI АРМ compiler

    Georgi

  • Georgi,

    Based on this e2e post I linked previously, GCC will have its own way to initialize these things since __TI_auto_init() is for the TI ARM compiler. Are you saying that you are getting errors that GCC cannot find this function?

    Have you looked at the example project I suggested to look at all the linked resources and libraries?

    Regards,

    Daniel

  • Daniel

    TI RTOS have static settings as FreeRtosConfig.h ... right?
    This settings is named:
    TROM__stateStruct ROM_stateStruct[] --> DATA_SECTION(ROM_stateStruct, ".data:ROM_stateStruct")
    const CT__constStruct ROM_constStruct[] --> DATA_SECTION(ROM_constStruct, ".const:ROM_constStruct")
    TI ARM compiler takes them "from somewhere" and puts them in .cinit section
    __TI_auto_init() just copy this values to static pointers...

    For GCC this linker sections, static and constant tables is missing
    I/He(gcc) will copy them, but they are not there, either as a source or in a library

    int main(void)
    {
    setup();
    Task_Params taskParams;
    Task_Params_init(&taskParams); // 0X1002EC09
    taskParams.stackSize = 1024;
    taskParams.priority = 1;
    Task_create(T1, &taskParams, Error_IGNORE); // 0X1002D529 Crash here...
    BIOS_start(); // 0X1002EAA5
    return -1;
    }

    Georgi

  • all this constants in .cinit missing for GCC

  • Georgi,

    It seems like the application is compiling and linking successfully since you are able to debug the application. Is that correct? I'm attaching a GCC + TI-RTOS project with .out and .map that you can look at and compare with yours.

    Have you tried using Task_construct() instead of task_create()? You can read more about the difference here.

    If you haven't yet, I would also recommend reading this guide, specifically section 2.4.3 on building Sys/BIOS applications with GCC: https://dev.ti.com/tirex/content/simplelink_cc13x2_26x2_sdk_5_20_00_52/docs/tirtos/sysbios/docs/Bios_User_Guide.pdf 

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/158/empty_5F00_CC26X2R1_5F00_LAUNCHXL_5F00_tirtos_5F00_gcc.map

  • thanks Daniel

    I let the project(GCC+TIROTS) "mature" for a while...

    I am currently trying to drive Z-Stack + FreeRTOS
    and I got here:
    [APP] BDB_COMMISSIONING_INITIALIZATION
    the switch/case from
    void sensor_processCommissioningStatus(bdbCommissioningModeMsg_t *bdbCommissioningModeMsg){ ... }

    I noticed something very strange, but it is difficult for me to find the mistake
    MAC(rom) or RF(lib) driver use no initialized timer ... handle NULL
    and I see some calls:
    void OsalPort_stopTimer(OsalPort_TimerID *pClockHandle = NULL)
    maybe have static initialized timer ... cant find it

    and if I call ( RF receives/transmits packets )
    ZDApp_JoinReq(12, 0x1A62, NULL, 0, 0, 2);
    or
    ZDApp_NetworkDiscoveryReq(0x00001000, 1);
    at the end, something stops the RTOS( interrupts is disabled )

    Georgi

  • Georgi,

    Z-Stack is not currently supported with FreeRTOS. Support is planned for a future SDK release.

    Regards,

    Daniel

  • yep...

    for now my port work at 99% ... have "small bug" ... and I can't find it Slight smile

    something is stopping freeRTOS ....

  • The next step is for the ZED to send a Data Request so that the ZC may transport the NWK key.  Technically the MAC is appearing to be operational but Zigbee APS/NWK/ZDP layers have yet to prove functionality.

    Regards,
    Ryan

  • as beginnig ( startup ) I "see" this ... OsalPort_stopTimer( NULL )

    I not see the start ....OsalPort_setTimer( ... ) ?!?! static  rom  MAC timer ??

    [APP] Z-Stack FreeRTOS 2021 Georgi Angelov
    [TASK] APP BLINK BEGIN
    [TASK] ZSTACK BEGIN
    [] OsalPort_stopTimer( 0x0 )
    [] OsalPort_stopTimer( 0x0 )
    [] OsalPort_stopTimer( 0x0 )
    [] OsalPortTimers_stopTimer( 0x0 )
    [] OsalPortTimers_registerCleanupEvent()
    [Z-STACK INIT]

    [TEST] z_test_join

    [Z] ID:0 EV:8000
    [] OsalPort_stopTimer( 0x0 )
    [] OsalPort_stopTimer( 0x0 )
    [Z] ID:0 EV:8010 /// ID & Events from mainStack process
    [Z] ID:0 EV:0001
    [Z] ID:0 EV:8010

    FreeRTOS - stop as HwiP_disable()

    BTW: FreeRTOS-OSAL is as TIRTOS-OSAL

  • I don't have any further ideas/recommendations based on the information provided.

    Regards,
    Ryan

  • Rian, Daniel

    I am little lamer about Z-Stack HI Level ( userware ) please help...

    1. I found where FreeRTOS assert ... now is OK

    2. I use zcl_sampletemperaturesensor.c ... so, how to config and make this: from reset, -> discovery channel for APN, join, zcl sensor go ....

    I LOG this

    [TASK] ZSTACK BEGIN
    [ZSTACK] INIT DONE
    [TASK] APP ZCL BEGIN
    [Z] ID:6 EV:8000
    [Z] ID:6 EV:8000
    [Z] ID:6 EV:8000
    [Z] ID:6 EV:8000
    [Z] ID:6 EV:8000
    [Z] ID:5 EV:8000
    [APP] sensor_init( DONE )
    [APP] zclAppInit( DONE )
    [A] ID:7 EV:8000
    [A] M:C5
    [APP] BDB_COMMISSIONING_INITIALIZATION
    [APP] sensor_RejoinTimeoutCallback()
    [A] ID:7 EV:0002
    [Z] ID:6 EV:8000

    but I can not see beacon, join .... etc packets

  • Even though your code does not crash or assert, initialization steps are missing at the MAC layer if beacons are not being transmitted or BDB_COMMISSIONING_INITIALIZATION does not contain the correct commissioning mode parameters, like formation and/or steering.

    Regards,
    Ryan

  • You don't help me like that... and the TI examples are "blah-blah"
    I ask what are the settings and logic ( for simple ED as ZCL termo-sensor ) to go automatically after reset
    I don't want to set menus and press buttons ( TI examples !!!  .... there is no one simple example )

    I have 2 tasks (+1 as blink) - main mac ZTack and ZCL sensor APP task
    Today, after ZCL APP init I call:
    bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING);  // get this from TI boards LCD menu examples 
    and ... beacon, join ... and stopped ... so, missing logic or settings ...
    but the documentation and examples do not provide information

    [TASK] APP BLINK BEGIN
    [TASK] ZSTACK BEGIN
    [ZSTACK] INIT DONE
    [TASK] APP ZCL BEGIN
    [APP] zclAppInit( ID: 7 )
    [APP] zclAppInit( DONE )
    [A] MSG:C5 // messages from ZCL App
    [APP] BDB_COMMISSIONING_INITIALIZATION
    [A] MSG:C5
    [ERROR] BDB_COMMISSIONING_NWK_STEERING
    [A] MSG:94
    [A] MSG:CB
    [A] MSG:94 // next repeat join 3 times
    [A] MSG:94
    [A] MSG:94
    [A] MSG:94
    [A] MSG:94
    [A] MSG:94
    [A] MSG:94
    [A] MSG:94
    [A] MSG:C5
    [ERROR] BDB_COMMISSIONING_NWK_STEERING
    [A] MSG:94

  • here is "example" code ... if anyone wants to help

    https://github.com/Wiz-IO/TEST

  • I notice in your code example that NVOCMP_loadApiPtrs is removed from the build.  NV memory items are essential for storing network configurations and not initializing the TI Driver properly could be involved in the startup issues.  Also, please make sure that the aExtendedAddress is stored in the MAC PIB with ZMacSetReq.

    If you do not want to use the CUI (i.e. UART menu, buttons, etc.) from the examples, define CUI_DISABLE inside Project Properties -> CCS Build -> Arm Compiler -> Predefined Symbols.  Then you can commence commissioning of the Zigbee device as preferred (ex. startup timer)

    Regards,
    Ryan

  • Thanks

    NV I stopped it on purpose
    aExtendedAddress, I see it in the RX/TX packets

    who should be the initiator for the transfer of security key coordinator or ED
    for coordinator I use zigbee2mqtt with TI USB "dongle"
    after join he say: unknown device ... will check device settings

    should i use bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING) ?

  • what I see
    ED send beacon
    STACK get PanID
    ED start JOIN and after Assoc is OK, I can not see message: get short address
    short address is not set and process cannot continue
    maybe missing setting or logic ???

  • I am not sure how long it has been since Z-Stack has been tested with the NV disabled.  The ZED should send a Data Request to receive a NWK key, at which point it would start the TC Link Key Update procedure.  The assigned short address is provided in the Association Response.  It almost appears that POLL_RATE_TYPE_JOIN_REJOIN was not set using nwk_SetCurrentPollRateType during bdb_tryNwkAssoc -> bdb_joinProcess.

    Regards,
    Ryan

  • NV is for next steps ... with/without is the same

    I see short addresa after Assoc ... 3 times

    not have command for TC Link Key ...

    [ZCL] INIT DONE
    [APP] BDB_COMMISSIONING_INITIALIZATION
    [Z] ID:5 EV:0004
    [Z] ID:5 EV:8000
    [ERROR] BDB_COMMISSIONING_NWK_STEERING
    [Z] ID:4 EV:0001
    [Z] ID:0 EV:8000
    [Z] ID:4 EV:0010
    [] ZDO_UpdateNwkStatus() SHORT ADDRESS: FFFE //////////// repeat 3 times from here to the short address
    [Z] ID:0 EV:8010
    [Z] ID:0 EV:0020
    [Z] ID:1 EV:8000
    [Z] ID:6 EV:C000
    [Z] ID:6 EV:4000
    [Z] ID:0 EV:0004
    [Z] ID:1 EV:8000
    [Z] ID:4 EV:8000
    [Z] ID:5 EV:8000
    [Z] ID:6 EV:8000
    [Z] ID:0 EV:8000
    [Z] ID:4 EV:0010
    [Z] ID:0 EV:8010
    [Z] ID:6 EV:8000
    [Z] ID:0 EV:0001
    [Z] ID:0 EV:8010
    [Z] ID:0 EV:0020
    [Z] ID:1 EV:8000
    [Z] ID:4 EV:8000
    [Z] ID:4 EV:0010
    [] ZDO_UpdateNwkStatus() SHORT ADDRESS: 38ED
    [Z] ID:5 EV:8000
    [Z] ID:6 EV:8000
    [Z] ID:5 EV:1000
    [Z] ID:5 EV:8000
    [Z] ID:0 EV:8000
    [Z] ID:4 EV:0010
    [] ZDO_UpdateNwkStatus() SHORT ADDRESS: FFFE
    [Z] ID:0 EV:8010
    .....
    [ERROR] BDB_COMMISSIONING_NWK_STEERING
    [Z] ID:5 EV:0004
    [Z] ID:6 EV:4000

    end....

  • Stack and application task sizes are 3000 in the Z-Stack examples, whereas your example has them at 1000.  How much memory is reserved for the heap?  Otherwise I am having difficulty to gather further debug information from the print logs.

    Regards,
    Ryan

  • Heap now is #define configTOTAL_HEAP_SIZE  ( ( size_t ) ( 0x8000 ) )

    but will be rest of RAM

    Stack for Z tasks is 1024 ... etc 4096 bytes

    This example ( ED Thermo )

    RAM: [== ] 20.6% (used 16884 bytes from 81920 bytes)
    Flash: [===== ] 49.2% (used 177321 bytes from 360360 bytes)

    log is from stack process - ID is task ID, EV is event 

    as ID = https://github.com/Wiz-IO/TEST/blob/main/z_startup.c#L36

    7 is last ZCL APP task

  • is just one "vrong" setting ..... Slight smile

  • Hi Ryan,

    Where to report bugs?

    example: binding_table.c - line 287 .... if( ( (dstAddr->addrMode != AddrGroup) .... [-Wparentheses]

    and IF tirtos-osal is OK, THEN nortos and freertos DPL have critical errors @ ClockP - create / delete ...

    Best Regards

    Georgi

  • Glad to hear that you are making progress.  You can report the bug on the forum and they will be passed along to Software Development, however can you explain the issue with bindAddEntry?  Not included in your description is that extended IEEE address modes are also considered.

      //Zigbee Spec 2.2.4.3.1.1
      //Cannot create an endpoint for invalid endpoint index, neither for non-Group
      //or Non-Extended IEEE Address modes
      if( (dstAddr->addrMode != AddrGroup) && (dstAddr->addrMode != Addr64Bit) ||
          (srcEpInt == 0) || (srcEpInt == 0xFF) )
      {
        return NULL;
      }

    Also, what problems are you specifically noticing when using ClockP?  Can you provide a replicable instance using TI example code?

    Regards,
    Ryan

  • Hi

    the expression:

    (dstAddr->addrMode != AddrGroup) && (dstAddr->addrMode != Addr64Bit) 

    must be in parentheses ... if(   (  (expression)  &&  (expression)  )  ) ||  .... and the warning is ok

    FreeRTOS BPL is OK ...  OSAL for FreeRTOS is "little" different ... 

    now z-stack is OK

  • Thanks for explaining, I see the bug now and will notify the Software Development Team accordingly.

    Regards,
    Ryan

  • Hi Ryean,

    for GCC, the compiler make 2 files ( release_pm4fg.om4fg  &  rom_sysbios.am4fg )

    The questiоn is: Does it contain all the functions of TIRTOS ?

    is ELF file
    ....simplelink_cc13x2_26x2_sdk_5_20_00_52\kernel\tirtos\builds\cc13x2_cc26x2\release\gcc\package\cfg\release_pm4fg.om4fg
    is LIB file
    ....simplelink_cc13x2_26x2_sdk_5_20_00_52\kernel\tirtos\builds\cc13x2_cc26x2\release\gcc\package\cfg\release_pm4fg.src\sysbios\rom_sysbios.am4fg

    and  ... What it is used for ?  ( the compilation does not search anything from this library )

    ....xdctools_3_62_00_08_core\packages\xdc\rov\runtime\lib\xdc.rov.runtime.am4fg



    Regards
    Georgi

  • ROM_sysbios is related to the TI-RTOS Kernel in ROM on the device.

    Release_pm4fg is also related to SysBIOS configuration. See /tirtos_builds_cc13x2_cc26x2_release_gcc/Debug/configPkg/package/cfg/release_pm4fg.c in your workspace for more information.

    xdc.rov.runtime.am4fg is related to enabling TI-RTOS to use the Runtime Object Viewer tool. See more here: https://software-dl.ti.com/ccs/esd/documents/rov_guide/html/src/rov.html 

  • Thanks


    Runtime Object View (ROV) - nice ... I not need this

    I know what is release_pm4fg.om4fg & rom_sysbios.am4fg


    My question is: Does it contain everything necessary for normal operation of TIRTOS for CC26x2 
    or need manual settings
    I want to make a precompiled library...

  • I've not tried making a precompiled library before, so that might be all you need. It will require testing on your side to make sure that is all you need. It would also depend on your .cfg and if you are using the kernel in ROM or compiling and running from flash.

    -Daniel

  • Thanks !

    BTW
    rom_sysbios.am4fg is library as rom_sysbios.a ( m4fg point to cortex type )
    release_pm4fg.om4fg is object file as release_pm4fg.o
    need and libraries
    drivers_cc26x2, dpl_cc26x2 and boot.am4fg
    and SYS/BIOS ROM "LIB" ... in linker file

    new question Slight smile

    How to disable in TIRTOS to use default stdio _impure_ptr
    this make printf() to be blocked without "\n"

    Georgi

  • I found "workaround" .... now printf( without "\n" ) is OK

    TIRTOS ReentSupport is disabled, but UART driver is locked ( semaphore dead lock )

  • Hi

    How to disable ReentSupport ?

    Georgi

  • The problem is: I use default stdio-printf ( for all platforms: arduino, baremetal, freertos, nortos .... all is OK ) but for TIRTOS printf make problems

    printf() is redirected to uart (any empty syscalls as open, close, etc) this solution is tested for many ARM-M0/M4 and with the listed platforms

    1. uart driver disable TX after transaction ... workaround work fine

    2. printf  wait for "\n" - stdio,err,in is setvbuf(stdout, NULL, _IONBF, 0); but TIRTOS change reent and printf wait for "\n" if is missing ... workaround fixes this

    3. float math ... printf send all string and integers normally, but if is used float ( "%f", floatVar ) - application crash .... crash when task yields

    note: release_pm4fg.om4fg is compiled with compiler libraries .... to make everything the same

    float math is tested with the listed platforms ... arduino, baremetal, freertos, nortos and is OK

    point 3 is the problem

  • The float math is OK -  cross compare with windows gcc and arm-m4-float hard nano baremetal & tirtos

    https://github.com/Wiz-IO/TEST/blob/main/math_test.c

    But if TIRTOS use printf( "%f" ) crash at task yield ?!?! 

  • Please make sure your stack size is able to compensate, as printf API and double/float values will require the most stack usage.  You can refer to the Debug Printing SLA for more guidelines.

    Regards,
    Ryan

  • AH Slight smile THANKS Ryan !!! work 

  • as info - the test example for all platforms is here: https://github.com/Wiz-IO/TEST

    The platform is ready, but is not shared yet .... testing