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.

BLE stack 2.1.1 - Code compiles without including Queue and Seconds module

Other Parts Discussed in Thread: SYSBIOS, CC2650, BLE-STACK

Hi,


I am using BLE stack v2.1.1 (with TI RTOS 2.13) in my project.

In stack v2.0 (with TI RTOS v2.11), I included

var Queue = xdc.useModule('ti.sysbios.knl.Queue');

var Seconds = xdc.useModule('ti.sysbios.hal.Seconds');

in appBLE.cfg

While porting to new stack, code compiles and works as expected as before without Queue and seconds modules included explicitly.

Is it included by default in new stack ? Kindly guide me on this.

Thanks in advance !

  • Hello,

    The Queue module should be in ROM unless you are building the flash-only RTOS configuration. Did you rebuild the RTOS when you ported, i.e., delete the old RTOS build directory?

    Best wishes
  • Hi JXS,

    Yes. RTOS is been rebuilt.

    Application code with queue has -  38 161 bytes of readonly  code memory

    Application code without queue has -   38 165 bytes of readonly  code memory


    Other values remain same. 

    And these modules are included in ROM by using the following lines in appBLE.cfg

    var ROM = xdc.useModule('ti.sysbios.rom.ROM');
    ROM.romName = ROM.CC2650;

    Can you kindly guide me on this.

    Thanks in Advance !

  • Yes, the ROM has support for these modules. If you include something in your RTOS config and there is no ROM support, you will get a build failure.

    If they are getting into the build, as confirmed by your map file, then I don't see a problem.

    Best wishes
  • Hi JXS,

    Thank you for the reply.

    Seconds module was not used anymore in the project and wasn't removed from the appBLE.cfg


    So the .map file with and without queue (seconds completely removed) is the same : 38 165 bytes of readonly  code memory


    I am not sure why by including Seconds, which gives 38 161 bytes of readonly  code memory , has a decrease of 4 bytes.

    Kindly guide me on this.

    Thanks in Advance.

  • Hi Krithiga,

    I wasn't able to reproduce this in CCS with the simpleBLEperipheral example.

    I diff'ed the .map files with and without the Seconds moduled added to the appBLE.cfg and didn't see any codesize change. I didn't see the Seconds module being included to begin with either.

    The Queue module is already being pulled in because of the Kernel in ROM, but that doesn't have any effect in increasing code size.

    What toolchain (+ version) and example are you seeing this behavior? Do you have any sort of compiler optimization enable as well?

    Can you post both .map files (before and after) showing the change in code size? It would be good to know exactly where the change is happening.

  • Hi Tom,

    Thank you for the reply.

    I am using IAR version V7.40.2.8542.

    I have attached the .map files with and without Seconds module added to appBLE.cfg

    With Seconds module included :

    With Seconds.txt

    Without Seconds module included :

    Without Seconds.txt

  • Hi,

    Kindly reply to the above query.

    Thank you.

  • Hello,

    The size difference comes from the BIOS lib:

    .text ro code 0x00000664 0xdac mangled__BIOS_lib.obj [31]
    vs
    .text ro code 0x00000664 0xdb0 mangled__BIOS_lib.obj [31]

    As Tom suggests, neither map file has a reference to the Seconds module.
    Did you remove the BIOS build directory prior to rebuilding the RTOS?

    EDIT: Your OP states you are using BLE-Stack 2.1.1 + TI-RTOS 2.13, however your map files reference TI-RTOS 2.11:

    C:\TDL\tdl\Libraries\Ti_simplelink_tirtos\tirtos_simplelink\tirtos_simplelink_2_11_01_09\products\bios_6_41_02_41\packages\iar\targets\arm\rts\lib\release\boot.arm3.

    Is that intentional?

    Best wishes

  • Hi JXS,

    Thank you for the reply.

    Yes. I removed the BIOS build directory prior to rebuilding the RTOS.

    I made the wrong attachment here. But I am able to see the decrease in 4 bytes of readonly code memory with BLE stack 2.1.1 + TI RTOS 2.13 and also with BLE stack 2.0.0 + TI RTOS 2.11


    I tried the IAR example BLE projects SimpleBLEPeripheral and SimpleBLECentral with stack 2.0.0 ( TI RTOS 2.11 ) and stack 2.1.1 ( TI RTOS 2.13 )

    Observation made is :

    I am able to see the same size of readonly code memory with queue and without queue in appBLE.cfg

    When Seconds module is included, there is a decrease of 4 bytes.

    I did a Clean and Rebuild All for every build.

    Kindly let me know if you observe the same.

    Many thanks in Advance !

     

     

  • Hello,

    Yes, I can observe the same 4 byte different. Although probably not material in overall size impact, I'll need to consult with colleagues on the RTOS side to better understand the discrepancy.

    Best wishes
  • Hi,

    The 4 bytes difference is the mangled__BIOS_lib.obj file. This contains the non-ROM code for SYS/BIOS. I expect by explicitly doing the useModule of Seconds in the .cfg, the order of things pulled in the build are different. This could result in better packing of the code. Could you send me both mangled__BIOS_lib.obj files so I could look at them more closely or is this educated hypothesis good enough :).

    Todd