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/CC2650: UArt_write() stalling when writing a character array

Part Number: CC2650

Tool/software: TI-RTOS

Hello,

I am sending data from python to the CC2650 using the serial port. The serial port is working, I am able to transfer data from python and have it read using UArt_read() within the CC2650. The issue I am having is with UArt_write()

1. All calls to UArt_write() are from within a task function --> UArt is in BLOCKING mode

2. UArt_write() works on an array of size 4 chars with a call to UArt_write(handle, char_arr, sizeof(char_arr)-1) // sizeof(char_arr) - 1 to prevent sending the exit character '\0'

3. The call that does not fully work is UArt_write(handle, char_size_64, strlen(char_size_64)). Now, in this example, the sizeof char_size_64 is 64 characters (therefore 64 bytes). But there are only 14 used characters before the exit character '\0', so a call to strlen(char_size_64) yields 14. The call above can be rewritten to UArt_write(handle, char_size_64, 14). Now, python is receiving those 14 characters, but the CC2650 stalls during the call and never gets to the lines of code that follow call. I do not know how to proceed with this issue. One thing I can possibly think of is that perhaps there is an issue sending an array of size 64 but only telling uart to write 14 bytes... Or that the stack size is not large enough... The task stack size is set to 512 MAU and quite certain I have not exceeded that.

Whatever input/ideas you can share will help; this is an issue that is getting increasingly frustrating. Thank you for your help

  • Hi Anthony,

    I have a few questions:

    • Which IDE are you using?
    • Are you making calls to UART_Write from more than one task?
    • Can you show us some code so we can see where the problem occurs?
    • Have you tried to manually force 14 as the length of the write?
    • Have you tried to step through the code to check whether strlen does indeed return 14?
    • Have you checked the ROV to see where the task is stuck? The ROV is available under the Tools menu in CCS or TI-RTOS menu in IAR.
      You can check the tasks and bios sections to see if there are any errors.

    Regards,

    Michel

  • Fixed! Using the ROV as you suggested showed that the stackPeak was larger than my stackSize, and so increasing the stackSize fixed the problem! Thanks