CC2340R5: UART receive interrupt not entered

Part Number: CC2340R5
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello.


I am using the CC2340R5 and the UART module.
When we upgraded from SDK 8.20 to 8.40, we discovered that UART receive interrupts were no longer possible.


Although it was still under analysis, the UART itself was enabled and NONBLOKING transmission was possible.
Reception uses callback with FIFO.
It is implemented exactly like the example in the driver manual.


It seems that when the SDK was changed, a factor was introduced that caused the receive interrupt to not be received, but even after spending several days, the problem has not been resolved.
I would like your support.


Thank you very much.

  • Hello,

    Thank you for reaching out! I will look into this and get back to you. In the mean time, you said you were using the drivers example. Which example are you using?

    Best Regards,

    Tarek

  • Hello.


    The SDK example is not used.
    It was created by accessing docs > drivers > tidriversAPIs.html in the SDK and referring to the UART2.h File Reference Detailed Description.

    Thanks.

  • Hello,

    I am working through this, expect me to reply by Monday (03-10) . I appreciate your patience.

    Regards,

    Tarek

  • Hello,

    Thank you for your patience! I was unable to recreate the issue, even though I tried all possible modes. Could you please provide a code snippet, to help me better understand what is going on?

    Best Regards,

    Tarek

  • Hello.


    Thank you for your confirmation.
    I will send you the code snippet.
    I omitted explaining this, but one UART module is used to switch between two communication lines.
    The communication lines used are as shown in the table below.

    Comm \ Port RX TX
    UART 0 DIO 12 DIO 13
    UART1 DIO 16 DIO 17

    This is a code snippet that switches UART at any timing/condition.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    static void Callback_UART(UART2_Handle Handle, void *Buffer, size_t Count, void *UserArg, int_fast16_t Status);
    static void Callback_UART1(UART2_Handle Handle, void *Buffer, size_t Count, void *UserArg, int_fast16_t Status);
    void UART_InitUART( void );
    void UART_InitUART1( void );
    UART_StopUART( void );
    UART_StopUART1( void );
    UART2_Handle Handle;
    UART2_Handle Handle1;
    static uchar UartState = 0U;
    static uchar Uart1State = 0U;
    static uchar UartRDataBuf[UART_DATA_BUF_SIZE];
    void switchUART()
    {
    UART_StopUART1();
    UART_Init();
    }
    void switchUART1()
    {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hello Kei,

    Thank you for providing the code! This code seems fine to me. UART is fully functional in the SDK, so I still don't understand what is causing this problem. What is the callback function doing? Could you provide a description of the function or possibly a code snippet?

    Best Regards,

    Tarek

  • Hello.

    The callback function receives data and checks for errors.


    Callback_UART
    UART2_read(Handle, &UartRDataBuf, UART_DATA_BUF_SIZE, NULL);


    Callback_UART1
    UART2_read(Handle1, &UartRDataBuf, UART_DATA_BUF_SIZE, NULL);

    Thank you.

  • Hello Kei,

    Thank you for providing the function! Just to clarify, you're saying that the callback function is never being called?

    Best Regards,

    Tarek

  • Hello,

    yes.
    Your understanding is correct.

    Best Regards,

  • Hello Kei,

    I really appreciate your patience! I was unable to recreate the issue, as the UART callback worked fine on my end. Could you please try testing the uart2callback example provided in the SDK, and see if that works for you? The project is located inside the SDK in:

    examples -> rtos -> LP_EM_CC2340R5 ->drivers -> uart2callback

    Please test this and let me know if it works.

    Best Regards,

    Tarek

  • Hello,

    I see.
    What is the point of revisiting a phenomenon using an example?
    I would like to try it, but I don't have enough time to implement it.


    Is there another way to address the problem?
    For example, were there any changes made in simplelink_lowpower_f3_sdk 8.20 and 8.40 that could cause this problem?

    Best Regards,

  • Hello Kei,

    Upon looking further into this, you're right! There were some changes made to the new SDK (8.40). I've attached a project that does UART switching. I believe it will be very helpful to structure your UART calls based on it! Please let me know if you have any more questions.

    uart2switching_echo_CC2340R53.zip

    Best Regards,

    Tarek

  • Thank you for your help.

    I would like to know the source code to change from the SWD pin to UART1.

    Also, is the source code to change from the UART1 pin to the SWD pin correct?
    If there is a problem, please fix it.

    Below is the source code.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    #define UART1_RX 16
    #define UART1_TX 17
    void SetPortUART( void );
    void SetPortSWD( void );
    // Change from SWD to UART1
    void SetPortUART( void )
    {
    GPIO_resetConfig(UART1_RX);
    GPIO_resetConfig(UART1_TX);
    (void)GPIO_setConfig(UART1_RX, GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_NONE );
    (void)GPIO_setConfig(UART1_TX, GPIO_CFG_OUTPUT_INTERNAL | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_HIGH);
    HWREG(DBGSS_BASE + DBGSS_O_DBGCTL) = 0U;
    }
    // Change from UART1 to SWD
    void SetPortSWD( void )
    {
    GPIO_resetConfig(UART1_RX);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Best Regards,

  • Hello,

    As seen in the example attached, gpio configuration should be as follows:

    Fullscreen
    1
    2
    GPIO_setConfigAndMux(newTxPin, GPIO_CFG_OUTPUT_INTERNAL | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_HIGH, newTxMux);
    GPIO_setConfigAndMux(newRxPin, GPIO_CFG_INPUT_INTERNAL | GPIO_CFG_IN_INT_NONE | GPIO_CFG_PULL_DOWN_INTERNAL, newRxMux);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    UART 1 -> DIO13 and DIO12
    UART 2 -> DIO20 and DIO22

    Upon setting the pins as mentioned,, switching should be working.

    Best Regards,

    Tarek

  • Hello Tarek,

    I have checked your advice and the source code.
    We conducted a reproduction test on a custom board.
    Unfortunately, the problem was not solved.


    Is there anything else I can look into to try to resolve this?

    Upon looking further into this, you're right! There were some changes made to the new SDK (8.40). I've attached a project that does UART switching. I believe it will be very helpful to structure your UART calls based on it! Please let me know if you have any more questions.

    uart2switching_echo_CC2340R53.zip

  • Hello Kei,

    I'm sorry for the delay. I'm looking into this!

    Best Regards,

    Tarek

  • Hello Kei,

    Thank you for your patience. Is this behavior seen on a launchpad? If you haven't tested, could you please test the example I attached earlier and let me know?

    Best regards,

    Tarek

  • Hello Tarek,

    Thank you for your consideration.
    I made the changes in the thread below and the problem was resolved.
    There was a change that was missed when sysconfig was upgraded from 1.20 to 1.22.

    https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1491981/cc2340r5-swdio-and-swdck-are-also-used-as-uart/5731021#5731021

    thank you.