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.

CODECOMPOSER: Unable to change hwiStackSize using the projects' cfg file

Part Number: CODECOMPOSER
Other Parts Discussed in Thread: SYSBIOS, CC2640

I have a very long topic concerning this issue in the Bluetooth forum and it has been suggested that the source of the problem might be an issue with CCS rather than a project setting.

Hence I am starting this topic in this CCS forum as suggested.

Here is that Bluetooth forum topic: https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1060247/cc2640-how-to-change-hwistacksize-as-reported-in-rov

I wish I could summarize the issue here but I am way too confused about this issue and I think the above link should help anyone here that might be willing to lend a hand.

I can't even figure out which tags to attach to this post...

Thanks,

Dale

  • Hey Dale,

    Please allow me some time to find the right person to assist.

  • Dale,

    Ammar asked me to provide some comments about this issue and, if I was able to fully understand the scenario in the other thread, initially you were trying to re-use a workspace from another machine. This can cause problems in paths, for example, and it is recommended to actually create a new workspace in a new machine and only then import a saved project.

    With that out of the way, I think that using an example project to track down changes to the stack is the common denominator to start trying to figure out what may be going on with your project. I see you correctly created a copy of the cc2640cfg file into your project - did you remove the app_ble.cfg from it? I imagine so.

    Section 7.5.1 of the SYSBIOS 6.46.01 User's Guide (located in C:\ti\tirtos_cc13xx_cc26xx_2_20_01_08\products\bios_6_46_01_38\docs) says the HWI stack size is defined by the System Stack size - just as you are using. I don't see any other place where this can be changed apart from the Project Options --> ARM Linker options, but this is overriden by the .cfg settings.

    Just as a test, I changed my .cfg file from 1024 to 512 and the linker map file reflected that - it went from 0x400 to 0x200. Check the attached screenshot below of the linker .map file.



    If the ROV is reporting a different HWI stack size when compared to the linker map file, then I have a strong suspicion the ROV might be wrong here.

    An idea that might explain why you had your project magically break and work is that, as we talked before, the SDK has many files that are linked and not copied to the workspace thus, if one changes a specific file, it might get lost if the SDK is reinstalled.

    At this point I don't have many more ideas, but hopefully this helps give some context and hints to what may be going wrong.

    Hope this helps,

    Rafael

  • Hi Rafael,

    Thanks for jumping in here, I will address your suggestions a little out of order since this is the order I attempted them in...

    If the ROV is reporting a different HWI stack size when compared to the linker map file, then I have a strong suspicion the ROV might be wrong here.

    After a clean build of the whole workspace, ROV and my linker map file both report 0x400 (1024) when my app_ble_uartlog.cfg requests 512 as you can see in these 3 images:

    I have attached the whole linker map file if it could further help you:
    LinkerMapFile_HaloPod_10008.zip

    if I was able to fully understand the scenario in the other thread, initially you were trying to re-use a workspace from another machine. This can cause problems in paths, for example, and it is recommended to actually create a new workspace in a new machine and only then import a saved project.

    The project has had a lot of changes made to it since I was able to recover the the project from a corrupted hard drive. This is what I tried based on this suggestion of yous.

    1. I created a new workspace
    2. I did Project>Import CCS Projects with these options: 
    3. I did a clean build of entire workspace
    4. The linker map file still showed 0x400 (1024) for the relevant stack.
    I see you correctly created a copy of the cc2640cfg file into your project - did you remove the app_ble.cfg from it? I imagine so.

    For the above tests the cc2640.cfg was excluded from build and I was relying on app_ble_uartlog.cfg to request an hwiStackSize, here you can see it is excluded from build:

    FURTHER questions from my side:

    1. Does it matter that my Linked Resources does NOT show any links to .cfg files like cc2640.cfg or app_ble_uartlog.cfg ?
        
    2. Whats the weather like there? (ha ha)

    EDIT:

    I tried including cc2640.cfg from the build AND excluding app_ble_uartlog.cfg but I get a compile error in cc2640.cfg that says 'ti.sysbios.family.arm.cc26xx.Power: no property named 'standbyPolicy''.  If I then rem out the line 'Power.policyFunc = Power.standbyPolicy;', then I still get a compile error but it is not specific enough for me to debug further. That error is:

  • Dale,

    Please apologize for the huge delay; this slipped under my radar.

    After a clean build of the whole workspace, ROV and my linker map file both report 0x400 (1024) when my app_ble_uartlog.cfg requests 512 as you can see in these 3 images

    Indeed the stack is 1024 across the files. Thanks for sharing. 

    For the above tests the cc2640.cfg was excluded from build and I was relying on app_ble_uartlog.cfg to request an hwiStackSize, here you can see it is excluded from build:

    I don't necessarily know what is inside the <app_ble_uartlog.cfg> file, but your prior screenshot indicates it has a full .cfg configuration settings and not a simple utils.importFile() directive to the original .cfg. In this case, did you test simply setting 512 to the first conditional statement in this file (line 434)? I suspect you did this already, but wanted to check.

    I send below the project I used to build and successfully change the system stack size as shown in the picture below (Ble Stack 2.30 for CC2640R2, built with CCSv9.3). Perhaps it may help you with some ideas and things to check.

    Since the cc2640.cfg file is excluded, it won't be used by the builder, unless it is imported by another .cfg file. 

    Does it matter that my Linked Resources does NOT show any links to .cfg files like cc2640.cfg or app_ble_uartlog.cfg ?

    The Linked Resources list is only valid in the scope of the IDE - i.e., if the file is linked to the project using the IDE. If a file includes another file on its contents (just like the app_ble.cfg file and its utils.importFile() directive), the IDE does not "see" this and therefore it is not listed. Also, if the file is physically present on the project directory, the list will not show it. 

    Whats the weather like there? (ha ha)

    Hehehe... It was ok - typical winter in Dallas: one day of snow, three days of ice and slush. :)

    Hope this helps,

    Rafael

    simple_peripheral_CC2640R2_Stack512.zip

  • Rafael,

    Your comments have been VERY helpful and I think that I have now resolved the topic issue.

    1. I had to go back to a backup version of my code where the code was running well but still getting an hwiStackSize of 512 when I request 1024 in my app_ble_uartlog.cfg.
    2. I noticed that the cc2640.cfg I had in my HaloPod_10008 folder was only 5k long and almost all of the other cc2640.cfg's on my computer were 22k long.  I am not sure where the 5k cc2640.cfg came from but I attach it here for completeness sake.
    3. I replaced the 5k cc2640.cfg with the 22k version in my HaloPod_10008 folder.
    4. I edited this 22k cc2640.cfg to reflect some changes that I had made in app_ble_uartlog.cfg  (hardware exception handling and the important line 434 edit, which was not working in app_ble_uartlog.cfg)
    5. I 'excluded from build' app_ble_uartlog.cfg
    6. I 'included in build' this edited cc2640.cfg
    7. I did a clean build and WOW, hwiStackSize is now 512 Slight smile

    One further question:

    1. In the now excluded app_ble_uartlog.cfg file that was not being called for some reason (also attached here), there is some uartlogging code at the end (from line 684 onwards) that gobbles up about 6600 bytes of FLASH when I include those lines in my cc2640.cfg code.  I really would like to have access to those 6600 bytes of FLASH as well as the 512 bytes of SRAM I just got back.  Can you tell my why I would need that uart logging code in my project since it seems to work without it?

    Dale

    INEFFECTIVE_5k_version_of_cc2640.cfg              NOT_BEING_CALLED_app_ble_uartlog.cfg

  • Dale,

    Thank you for reporting the outcome of your scenario and I am glad the suggestions were useful.

    The LoggerCallback you mentioned is typically used to redirect the Log output of TI-RTOS to a specific sink such as UART - some details are explained in this page.

    In general you want to be able to log the TI-RTOS during development (which can also be done via regular JTAG and ROV by default) but remove some or all logging when going to production, thus it is an optional component.

    Regards,

    Rafael