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.

MSPM0L1306: Using UART with RX only

Part Number: MSPM0L1306
Other Parts Discussed in Thread: SYSCONFIG,

Hello everyone,

I am having trouble with the UART module. The UART module works fine for me as long as I configure it to operate it in Transmit-AND-Receive-Mode.

When I configure the UART to operate in Receive-only-mode, I cannot build the code in CCS as the generated function SYSCONFIG_WEAK void SYSCFG_DL_GPIO_init(void) contains the following line:  DL_GPIO_initPeripheralOutputFunction(GPIO_UART2Rotor_IOMUX_TX, GPIO_UART2Rotor_IOMUX_TX_FUNC). I need to do this as I need the TX pin for another purpose.

Why is this function called anyway? I cannot build because the symbols GPIO_UART2Rotor_IOMUX_TX and GPIO_UART2Rotor_IOMUX_TX_FUNC are nowhere defined.

I circumvent this problem by defining the symbols in the build settings. I copy the function SYSCFG_DL_GPIO_init(void) to another file and deletethe call: DL_GPIO_initPeripheralOutputFunction(GPIO_UART2Rotor_IOMUX_TX, GPIO_UART2Rotor_IOMUX_TX_FUNC). The weak function is then no more called.

However, If I do this, the reception of characters does not work anymore. Though the UART bit stream is still present at the RX Pin, the RXData register stays empty though RX and UART are enabled.

 My CCS version is Version: 12.0.0.00009

Sysconfig version is 1.13.0.2553

Best regards and thank you very much for your help in advance

Samuel

  • Hey Samuel,

    Where are you getting this code from? If you have the SDK downloaded you can look at the uart_rx_multibyte_fifo_dma_interrupts_LP_MSPM0L1306_nortos_ticlang project for UART initializations.

    Amruta

  • Hey Amruta,

    thank you very much for your quick reply. 

    The code is generated from the sysconfig-tool provided by TI. I could get rid of the "build problem" by updating SDK and Sysconfig to the latest versions.

    Yet, when I set "Communication Direction" to "RX only", receiving still does not work no more. It worked perfectly with "Communication Direction" set to "TX and RX".

    Do you have any idea on how to debug this problem?

    Do you have an example project where the UART is configured in Receive-only mode such that I can compare the register entries?

    Best regards and thank you very much for you help

    Samuel

  • Hi Samuel,

    One way you can debug this is by using a logic analyzer/oscilloscope on the RX pin and seeing the bits received. You can send a screenshot if you see issues with this.

    While there is no example we have with just RX, another way you can debug this is by checking the RXDATA buffer under "Registers > uart0 (or uart1) > RXDATA" while debugging to see what data is being received.

    Also, I see that you are using "UART2"; just to clarify, M0L only has uart0 and uart1 so I am not sure what this is referring to.

    Let me know if you have any follow up questions.

    Amruta 

  • Hi Amruta,

    thank you very much for your response. In fact, it is not Uart2 but I labeled the UART "UART2Rotor". It is using UART0. You can see the received message here:

    The signal is measured at the RX pin and it is independent of the UART mode ("RX only" OR "TX and RX").

    The RXDATA register stays empty:

    When UART mode is set to "TX and RX", the registers look like this and data is received as expected:

    Would additional register entries be helpful for you?

    Best regards

    Samuel

  • Hi Samuel,

    Where are you receiving data from? If you monitor the source of the RXDATA, is it being transmitted correctly?

    Amruta

  • Hi Amruta,

    I am receiving data from another MCU. The bits are transferred correctly - as the serial decoding shows. I have measured the waveforms above directly at the RX pin. I am quite sure that the data stream is not corrupted. Even if it was, I should see some kind of UART error when receiving, shouldn't I?

    Can you check whether you are facing the same problem when you set the UART to "RX only"?

    I am now using Sysconfig 1.15 and SDK 0.56.

    Best regards

    Samuel

  • Hi Samuel,

    I see the issue you are talking about. Let me do some troubleshooting and get back to you by tomorrow.

    Amruta

  • Hi Samuel,

    For now, you will have to use a workaround; it seems like the TXE bit has to be enabled for RX only to work, but you should still be able to use the TX pin for other purposes. 

    Above your main function, try initializing:

    static const DL_UART_Main_Config gUART_1Config = {
        .mode        = DL_UART_MAIN_MODE_NORMAL,
        .direction   = DL_UART_MAIN_DIRECTION_TX_RX,
        .flowControl = DL_UART_MAIN_FLOW_CONTROL_NONE,
        .parity      = DL_UART_MAIN_PARITY_NONE,
        .wordLength  = DL_UART_MAIN_WORD_LENGTH_8_BITS,
        .stopBits    = DL_UART_MAIN_STOP_BITS_ONE
    };

    and in your main function, calling (change UART_0_INST to whatever your UART instance is defined as):

        DL_UART_Main_init(UART_0_INST, (DL_UART_Main_Config *) &gUART_1Config);

    Keep the rest of the configurations the same (RX only in SysConfig, etc.).

    I will escalate this issue and keep you updated on the resolution timeline, but for now this workaround should work. Let me know if you have any questions implementing it or otherwise.

    Best,
    Amruta 

  • Hello, your proposal seems to work. Thank you very much for your suggestion. I am happy when you inform me when this issue is resolved.

    Best regards

    Samuel