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.

AM4372: Issue with Uar2 after flashed the device

Part Number: AM4372
Other Parts Discussed in Thread: SYSBIOS

Hi everyone,

I am currently using Uart0 and Uart2 to communicate with 2 different devices.

This is the configuration of the Uarts:

off_board_uart0_pins_default: uart0_pins_default {
pinctrl-single,pins = <
AM4372_IOPAD(0x970, PIN_INPUT | MUX_MODE0) /* (K25) uart0_rxd.uart0_rxd */
AM4372_IOPAD(0x974, PIN_OUTPUT | MUX_MODE0) /* (J24) uart0_txd.uart0_txd */
>;
};

off_board_uart2_pins_default: uart2_pins_default {
pinctrl-single,pins = <
AM4372_IOPAD(0x92c, PIN_INPUT | MUX_MODE1) /* (D14) mii1_tx_clk.uart2_rxd */
AM4372_IOPAD(0x930, PIN_OUTPUT | MUX_MODE1) /* (D13) mii1_rx_clk.uart2_txd */
>;
};

During DEBUG mode, everything was working fine.

- Channel 0 (uart0_txd): sending out the requests

- Channel 1 (uart0_rxd): receiving the correct responses

- Channel 2 (uart2_txd): sending out the requests

- Channel 3 (uart2_rxd): receiving the correct responses

 

However, after I FLASHED the device with the same binary that I was using in Debug Mode, the second device received corrupted data packets from Uart2_txd

- Channel 0 (uart0_txd): sending out the requests

- Channel 1 (uart0_rxd): receiving the correct responses

- Channel 2 (uart2_txd): sending out the requests

- Channel 3 (uart2_rxd): receiving CRC error (since the packets got corrupted)

I could not find the issue of the Uart2_txd line; therefore, I decided to create a simple Uart project to test UART2 to make sure it is not about timing. The test was:

- I have one AM437x board running the Uart project test from FLASH which will send the command: "AM 12111111111111111111\r\n" to UART2_TXD Line

- I have the second AM437x board running the same project in DEBUG MODE (to set up breakpoints), and it will read the command from UART2_TXD at UART0_RXD

NOTE: Everything works fine in DEBUG MODE 

- To make sure Uart2_TXD sends out the correct data, I checked using Docklight as:

- However, after connecting UART2_TXD toUART0_RXD and setting up a breakpoint, I can see the corrupted data packet as:

I could not think up any reasons behind the issue of UART2 when everything ran just fine in DEBUG MODE but not after FLASHED the device.

Is there any chance that Uart2 needs to be set up differently in Firmware? Are any clocks set up that I missed?

Would you mind giving me some advice where the issues could be?

 

Thank you, 

Sincerely,

Minh Vo

  • Hi Minh,

    When you say "DEBUG" mode, is this for your Linux application which does UART communication?

    Have you used serialcheck program provided in the SDK rootfs to test the UART ports?

    What SDK version do you use?

  • Hi Bin,

    Thank you for the reply.

    I am not running in Linux, I am using Code Composer Studio and running the program as:

    I have not used serialcheck program before. I was checking Uart ports by either hooking it up to Docklight to print out and send data or directly to the other devices.

    One thing that I realize that is:

    In the Debug session, the center of each bit frame is always correct as shown (the bitrate is 1/(100us / 11.5) = 115000 (probably 115200bps)):

    However, running from Flash, the center of each bit frame is offset a little bit for Uart2 (12bit/100us, so the calculated bit rate is about 120000bps)

    Since the bit rate is different, I checked uart 2's Registers to make sure they have the correct Clock value between Debug and Flash (and the values are all the same for both):

    I am using SDK version: sysbios_ind_sdk_02.01.03.02

    and PDK version: pdk_am437x_1_0_17

  • Hi Minh,

    I am not an RTOS expert, but I am surprised to see the Linux device tree style of pinmux config is used.

    Anyway, I am routing your query to our RTOS expert for comments.

  • Hello Minh,

    We're sorry, but we can no longer support SYSBIOS based SW development for AM437x. Please refer to this announcement and find consolidated resources.

    Regards,

    Jianzhong