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/CC2630: use log.h in Z-Stack

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

Tool/software: TI-RTOS

Hello,

i recently stumbled upon the logging functionality in the bluetooth project_zero and was wondering if it's possible to use it in Z-Stack (end device) as well.

I've included log.h and it compiles successfully but using the various macros (log_info, log_error, log_warning) doesn't produce any output on the opened port in terminal.

Is there any information on how to enable this feature in z-stack?

Thanks in advance!

  • Hello Stephanie,

    Logging function is a TI-RTOS function and should be able to be used with any TI-RTOS project. Please follow the steps here: processors.wiki.ti.com/.../CC26xx_Ouput_TI-RTOS_Log_statements_over_UART

    This should be enough to get it working.

    Regards,
    AB
  • thank you for your reply!

    I've removed the global logging_disable symbol as well as added the uart_logs files and the UART-initialization as explained in the wiki.

    However, modifiying the TI-RTOS config file is somewhat tricky (for me). Any modifications to "app.cfg" within \zstack\HomeAutomation\SampleSwitch\CC2630\ causes "errors while running xdctools_3_30_06_67_core/xs" and i'm not sure exactly what went wrong. I've tried it with an unmodified app.cfg, which compiles perfectly, but there's no output on console.

         IAR Command Line Build Utility V7.2.7.3905
         Copyright 2002-2015 IAR Systems AB.
    
    Building configuration: SampleSwitch - SmartRF06
    Updating build tree...
    
    0  file(s) deleted.
    Updating build tree...
    Performing Pre-Build Action
    Error while running "C:\ti\xdctools_3_30_06_67_core/xs" --xdcpath="D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\tirtos\packages;D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\tirtos\products\bios_6_41_02_41\packages;D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\tirtos\products\cc26xxware_2_20_06_14829\inc;D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\tirtos\products\cc26xxware_2_20_06_14829\driverlib;D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\tirtos\products\cc26xxware_2_20_06_14829;D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\\tirtos\products\bios_6_41_02_41\packages\iar\tools\configuro\package" iar.tools.configuro -c "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.2\arm" --cc "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.2\arm\bin\iccarm.exe" --device "CC2630F128" --compileOptions "-D TQ_RADIOBUTTON -D xLIBIFY_RADIOBUTTON -D POWER_SAVING -D PA_LNA_CC2592 -D xNV_RESTORE -D xNV_INIT -D MODULE_CC26XX_5X5 -D xMODULE_CC26XX_7X7 -D ZSTACK_MANUAL_START -D ZCL_READ -D ZCL_WRITE -D ZCL_BASIC -D ZCL_ON_OFF -D ZCL_IDENTIFY -D ZCL_EZMODE -D xZCL_GROUPS -D xZCL_SCENES -D ZCL_STANDALONE -D ZG_SECURE_ENABLED -D ewarm -D USE_ICALL -D HEAPMGR_SIZE=4096 -D ICALL_HOOK_ABORT_FUNC=halAssertHandler -D _xdc_runtime_Log_DISABLE_ALL -D xdc_runtime_Assert_DISABLE_ALL -D xTI_DRIVERS_LCD_INCLUDED -D xDBG_TRACE --diag_suppress Pa050 -o D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\SmartRF06\Obj --debug --endian=little --cpu=Cortex-M3 -f D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\configPkg\compiler.opt.defs -f D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Projects\zstack\Core\Thread\CC26xx\Config\coreEndDevice.cfg -e --fpu=None --dlib_config \"C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.2\arm\INC\c\DLib_Config_Normal.h\" -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\.\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\..\..\Source\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Projects\zstack\common\CC26xx\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Projects\zstack\common\CC26xx\appport\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Projects\zstack\common\CC26xx\SmartRF06\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\applib\heap\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\mac\include\cc26xx\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\hal\include\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\hal\target\_common\cc26xx\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\hal\target\CC2650\rom\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\hal\target\CC2650TIRTOS\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\icall\include\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\osal\include\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\services\nv\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\services\nv\cc26xx\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\services\saddr\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\services\sdata\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\stack\icall\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\stack\icall\client\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\stack\zcl\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Components\mac\include\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\tirtos\products\cc26xxware_2_20_06_14829/\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\tirtos\products\cc26xxware_2_20_06_14829/inc\ -I D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\tirtos\products\cc26xxware_2_20_06_14829/driverlib\ -Ohz" --linkOptions "-o D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\SmartRF06\Exe\SampleSwitch.out --config_def CC2650=1 --config_def USE_SYSBIOS_IN_ROM=1 --map D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\SmartRF06\List\SampleSwitch.map --config D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\cc26xx_app.icf --keep __vector_table -f D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\configPkg\linker.cmd -f D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Projects\zstack\Core\Thread\CC26xx\Config\coreEndDevice.xcl --semihosting D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\tirtos\products\cc26xxware_2_20_06_14829/driverlib/bin/iar/driverlib.lib D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\core\Projects\common\TIMAC_ROM_Release\03282014\timac_rom_PATCH.symbols --entry __iar_program_start --vfe" --profile release --projFile "D:\sw\rf-plattform_radiobutton\Projects\zstack\HomeAutomation\SampleSwitch\CC2630\SampleSwitch.ewp"
    
    Total number of errors: 1
    Total number of warnings: 0

    within app.cfg i've added the lines given in the wiki and set Text.isLoaded to true - default was "false". Also i've set "BIOS.logsEnabled = false;" to true.

  • i must have made a mistake somewhere along the way. resetting my repo to a clean state and trying again following the instructions in the wiki worked now.
    Changing this: "BIOS.logsEnabled = false;" to true seems to break compilation process. but it works without changing it, so all good.

    Thanks for your help!