CC2340R5: Thread

Part Number: CC2340R5

CCS version : 12.2.0.00009 

SDK version : 7_10_00_35 


I create a thread for UART, but after I finished writing the code, I tested it and found that it would display like this

  • Hello Ryan Li,

    I hope you are doing well. Looks like CCS tried to open a file location that did not exist ( ... + 0x9de), could you detail to me how to setup your thread in the code? 

    Thanks,
    Alex F

  • I created two threads and moved the exact same Code to another thread. In Debug mode, pressing F6 (Step Over) can continue execution, but if I switch to pressing F5 (Step Into), the same situation will occur.

    I set my thread as shown below




    Or is it that my thread stack size is full, causing this to happen?


    As shown below, when I execute this step, the error on the right will pop up.


  • Hello Ryan Li,

    We can check the status of the Heap/memory usage to see if anything is filled, or about to be filled. 

    Memory Allocation View

    Introduction — Runtime Object View documentation

    If those two checks return that the device is working normally (IE not filled) then we could instead try to place the code for the two threads (if it's not too large) in an empty project to see if we can re-create the issue. 

    Thanks,
    Alex F

  • I check the status of the Memory usage as show below


  • Hello Ryan,

    Taking a look at your memory usage:

    -While the flash is little large it is not completely full, could you expand the "FLASH" section to see if any Indvidual array is overfilled?

    - - The other parameters in memory usage look fine (NVS and CCFG are supposed to be at 100 %). 

    The heap also looks ok, as long as it does not exceed the set size. 

    As a test, does the program work as expect (minus the functionally that we need to change/remove) if the if satement that contains the badly behaving code is changed or removed?

    Thanks,
    Alex F

  • Hello Alex ,

    I try to use the previous version of the project I wrote myself. This version has been tested and does not throw out the error message that the file location cannot be found when debugging.

    When I added the new version of the project content to the previous version step by step, I found the following situation

    When I add this line of code, a message that the file location cannot be found pops up. After removing it, it works normally again.

    g_tFFF1.pData[g_tFFF1.ucLen - 1] = Checksum_GetResult(g_tFFF1.pData , g_tFFF1.ucLen - 1);


    But I don’t think this is the root cause, because as shown in the picture, I also added the exact same Code above but there was no problem.
    So I did another test, I added the code above, and then I set the BreakPoint in two places, as shown in the picture below

    (1)The BreakPoint set in  judgment of if will also show that the file location cannot be found.

    (2)But I set BreakPoint in the if judgment, but it can be interrupted successfully, and the file location cannot be found will not pop up.




    Does this confirm that CCS has optimized certain codes during compilation? As a result, the file location cannot be found when debugging, and the breakpoint cannot be set?
    Or is there a problem when the IDE builds to .out?

  • Hello Ryan, 

    I also added the exact same Code above but there was no problem.

    -I wanted to check if setting ucLen = 5; may cause an issue, could you add this statement as a test to the if(...) statement that works fine to see if the issue occurs?

    Does this confirm that CCS has optimized certain codes during compilation? As a result, the file location cannot be found when debugging, and the breakpoint cannot be set?

    -Optimization can be an issue from time to time, and this could be a debugging issue (not runtime), if you let the program run normally without debugging (and let's say add some type of indicator like a GPIO toggle) does it run correctly? and do you see the GPIO toggle? 

    - - Changing the Optimization level as extra tests could help. 

    Thanks,
    Alex F

  • I checked ucLen and it was not the cause of the impact. I tried modifying Properties -> Configurations from Release to Debug and Optimization -> Select optimization levels: z to 1 . The message that the file location cannot be found will not pop up.

    I guessed that it might be caused by optimization issues, so I changed back to the original project for testing and tried level "0" to level "g" once. I found that using level "fast" gave the best results. However, it will still pop up a message when executing certain codes, or the following picture will pop up when setting a break point.




    Is it because I have access to the TIRTOS source code?

  • Hello Ryan,

    The "Breakpoint manager" issue is caused by using all the breakpoint resources (4 on the CC2340R5) so just remove the unused breakpoints and you will no longer see the error message.

    I tried modifying Properties -> Configurations from Release to Debug and Optimization -> Select optimization levels: z to 1 . The message that the file location cannot be found will not pop up.

    -So, in this case it seems like changing the optimization level alleviated some of the issues. 

    You can read more about optimization in our documentation in the SDK Optimization — SimpleLinkTm CC23xx SDK Proprietary RF User's Guide 7.40.00 documentation

    -Just to make sure but if you are not in debug mode is your code, and the previous problem statement, working? 

    - -Did you try to see if a GPIO toggle after where the program has the error works? (this will tell us if the program running normally can reach that statement and continue fine). 

    TIRTOS source code?

    -Your picture says FreeRTOS which is a different RTOS than TIRTOS, where is TIRTOS being used? 

    Thanks,
    Alex F

  • (1)I have confirmed that no other breakpoints are set, but this message will pop up in some codes.
    And when I was debugging before, this message also appeared when I set the third breakpoint. There was no way to set more than 2 breakpoints at the same time.

    What is the cause of this? Is it possible that this is the cause of the problems I mentioned above?

    (2)In Debug mode, when I do not set a break point or use F5 (step into)/F6 (step over), it can operate normally, and the GPIO is also switched successfully.
    This means that the above problems will only occur when setting a break point and using F5/F6

    (3)Sorry, I said it wrong. I am using FreeRTOS. Is it possible that when I try to enter the area where the original code of FreeRTOS is running, the file location cannot be found when setting a breakpoint?

  • Hello Ryan,

    1) As a personal experience before, I needed to reinstall CCS when my own breakpoints did not work, however I think this is a different situation (that situation was where breakpoints did not work on all projects, this was due to an installation issue on my end). Just to confirm when you enter into debug mode but do not press play, and click view -> breakpoints, you can see this menu and see that you have no breakpoints set (If you have not done this already). 

    -The image you included in the first point did not load for me.

    -Does setting four breakpoints work in other projects? 

    2) This is somewhat good to hear (minus the odd behavior), so without breakpoints the program works correctly but with there is an issue, I may need to inquire internally if we have noticed a similar issue before that only appears when breakpoints are triggered. 

    3) No problem! Sometimes I also open the wrong projects when debugging too, it does get a little confusing when you have many projects open. 

    -As an extra step the newer F3 SDK includes FreeRTOS with the projects automatically, so I wonder if you would have the same issue there or not. 

    Thanks,
    Alex F

  • Hello , Alex
    (1)
    The image contained in the first point was intended to show you that I did not set any breakpoints

    I have only used uartcallback and basic_ble projects so far. Neither of them can set more than 2 breakpoints. If I set the third one, the above message will appear.

    (2)Looking forward to your reply. I'm wondering if it has something to do with the CCS version or the compiler version. My current CCS and compiler versions are both old.

    (3) I will try to update to the latest SDK version in the near future. If these problems still occur, I will raise it again.thnaks

  • Hello Ryan,

    Yes it might be a good idea to try the new CCS (12.5 or newer) and the new SDK (7.40), with dependences that updated as well! 

    A good item to look into for further reference is the following webpage about CCS documentation: 7. Debug — Code Composer Studio 12.7.0 Documentation

    -The breakpoint section has some extra useful information pertaining to this thread. 

    -And it does seem like the optimizer can affect breakpoints following the statement from the picture: 

    Thanks,
    Alex F