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.

AM4379: RS485 lockup

Part Number: AM4379
Other Parts Discussed in Thread: AM4372

I am running linux version 4.9.119 and sending/receiving data over RS485 port. Once RS485 data communication is started, after some time (Within hour) everything freezes, debug terminal, SSH terminal nothing is spitting on screen nothing in dmesg. May be stuck in a lockup with interrupts disabled. Any information to resolve/debug is welcome. 

  • Hi Sameer,

    Is this on your custom board or TI EVM?

    Which UART port do you use? Please post what you modified in device tree for this UART port including pinmux.

    Please test with the kernel in the latest Processor SDK v6.3 to see if the issue still happens.

  • Hi Bin,

    Yes, this is a custom board. I am using UART1. Please see a snap of device tree

    I could not get a chance to test with the latest kernel so far but I have some more information to share about the observations and debugging.

    I am using a 4 wire cable to communicate. If communicated in full-duplex (configured for full-duplex RS-485 by flag SER_RS485_RX_DURING_TX) then it works perfectly. The problem is only in half-duplex mode. 

    Enabling CONFIG_DEBUG_SPINLOCK & CONFIG_DEBUG_MUTEXES and some other debugging flag in Kernel configuration threw an error "[ 3840.099704] NMI watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [swapper:0]" on the debug terminal. Tried to debug further and enabled lockdep; after enabling lockdep I never see any lockup. Even adding some printk statements in the er causes delayed crash. 

    Any suggestions/possibilities to address this issue. 

    Testing with the latest kernel is on my todo list. 

    Thanks!

  • Hi Sameer,

    We recently had a customer having the similar CPU stuck issue on AM437x with 4.14 kernel. After some test, the issue is solved with the following changes.

    - using Processor SDK 6.3 kernel v4.19;
    - ensure kernel option CONFIG_PREEMPT is enabled;
    - ensure the CM3 firmware is loaded during kernel boot;

    Can you please try if this combination works for you?

  • Hi Bin,

    Thanks for your quick response!

    I am very new to TI/processor SDK.

    Is CM3 firmware just a configuration in Linux kernel and DT or some firmware to download and build? Could you please share some documents/links for the same and how can I make sure that it is being loaded.

    Thanks!

  • Sameer,

    The CM3 firmware is a power management firmware running on the M3, it is provided in the Processor SDK root filesystem, which is /lib/firmware/am335x-pm-firmware.elf. It will be automatically loaded to M3 during kernel boot process. The following document has some details, please search for "CM3 Firmware" in the page.

  • Hi Bin,

    I downloaded & build CM3 firmware and followed the instructions to make it a part of the kernel (copied am335x-pm-firmware.elf to firmware folder and added file name in the configuration). I could see the significant jump is uImage size, so I guess firmware was build as a part of the kernel. However, I did not see any statement like "PM: CM3 Firmware Version = 0x191" while booting. How can I make sure that CM3 firmware running? Did not see anything in processes and dmesg.

  • Sameer,

    I assume you use the TI Processor SDK Linux release for AM437x. The firmware binary is already in /lib/firmware/ folder of the root filesystem. And it is specified in am4372.dtsi file, so you don't have to change any kernel configuration for the firmware, of cause not build it into uImage. The kernel message '...... = 0x191' is from the older Processor SDK. Now the kernel message should be "...... CM3 Firmware Version = 0x192".

  • Kernel 4.19 resolved my issue!

    Thanks for your help!

  • I am glad the issue is solved. Thanks for the update.