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.

CC2640 simpleBLEPeripheral + UART issue (RTOS crashes)



I am using the SaBLE-X BLE module from LSR, which is based on the CC2640F128 (5x5). I'm trying to add UART communication, but ran into some issues. The simpleBLEPeripheral example works just fine as is, but when I add UART support the RTOS seems to be crashing (going into an endless loop) when it checks on a semaphore inside of the CC26XX_PIN.c function.

There are two examples online that show how to add UART on. The first one (http://processors.wiki.ti.com/index.php/CC2640_NPI_UART_ECHO_EXAMPLE) is a little outdated and has some issues. The second one (http://processors.wiki.ti.com/index.php/Cc2640_Adding_a_UART_or_SPI_driver_to_a_Sample_Project) is much better documented and the integration is much easier too. This second example is what I'm using to add UART functionality and it compiles just fine.

The issue I'm seeing is, like mentioned above, that the UART initialization causes the RTOS to hang. Using the debugger I traced the issue back to CC26XX_PIN.c. The problem seems to occur when it accesses the semaphore in Pin_Open. 

Does anyone have an idea what this could be or has seen something similar?

  • Hi Adrian,

    I have seen this issue happen if PIN_init in main() returned false which causes the semaphore in PIN_open to not be set up properly. This would happen if the argument to PIN_init contains pins that do not exist on your device.

    Regards,
    Svend
  • HI Adrian,

    This is a known issue with the 5x5 board file where it tries to force the UART object to be const, when it should not be.
    You can should change this line in the board file:

    #pragma DATA_SECTION(uartCC26XXObjects, ".const:uartCC26XXObjects")
    with:
    #pragma DATA_SECTION(uartCC26XXHWAttrs, ".const:uartCC26XXHWAttrs")

    Also regarding the NPI UART Echo example, you are correct, this wiki page has been depreciated, the second one you linked to is recommended.
  • Sean,

    That fixed it. Thanks!!!

    Since this is a "known issue", can this information be added to the UART example on the Wiki? My guess is that this would save a lot of people a lot of time.

    Thanks,
    Adrian
  • Adrian,

    Yes this is a great idea. We realize that it would be helpful to have this information published so we are currently working on a list of all known issues that affect our BLE SDK. Expect it to be posted on the main wiki page soon. I can also add a blurb on the UART page as well.