PhyCORE-Vybrid SCI2 does not Work Correctly
Introduction
The current phyCORE-Vybrid Linux PD13.1.0 release provides support for one UART interface (SCI1) as default console. There is a known issue with the UART driver that whenever an attempt to write to the UART port other than as the default console, the kernel gets into a continuous loop calling the uart_start() function, but does not succeed. A fix is in development, however in the meantime there is a workaround for the issue that will provide the following support:
- SCI1 used other than default console
- Simultaneous UART support (SCI1 and SCI2)
The following instructions assume:
- phyCORE-Vybrid RDK Linux BSP PD13.1.0
- Timesys Factory 20140113
Software
The workaround applies to the Linux kernel source. This consists of applying a patch set available on the Timesys Git Tree and enabling EDMA in the UART configuration. For convenience this has been incorporated into one patch that can be applied directly to the PD13.1.0 Linux kernel.
The patch set was obtained from the Timesys PCM052 linux-2.6-mx Git repository. The 20140113 Desktop factory applies up to patch 3.0-pcm052-ts2.6 (linux-3.0.15-pcm052-ts2.6.patch) to the Linux source. The patch applies all UART specific commits as well as some additional fixes including:
- (2014-02-25) 3.0-pcm052-ts2.93.0-pcm052Fixed a panic seen as soon as you type a character on the terminal when EDMA
kernel BUG at kernel/workqueue.c:1037! Unable to handle kernel NULL pointer dereference at virtual address 00000000
- (2014-02-25) Disabled EDMA in UART Configuration to prevent jumbled characters on serial p...
- (2014-02-25) Fixed the uart_tasklet_action NULL pointer deference panic in MVF Serial Driver
- (2014-02-25) Support for setting TX clear-to-send in set modem CTRL in MVF Serial Driver
- (2014-02-25) MVF Serial Driver Improvements to fix the sysvinit console hang issue
- (2014-02-25) Removed dead code, corrected comments, print uart settings in MVF Serial Driver
- (2014-01-23) Add missing header for __exception_irq_entry in global timer
- (2014-01-23) Add missing Global Timer source file
- (2014-01-23) Add Global Timer support to fix High Resolution Timer functionality
- (2013-11-21) Fix typo in DSPI2 and DSPI3 base address
- Download the patch from the PHYTEC FTP: ftp://ftp.phytec.com/
wget ftp://ftp.phytec.com/products/PCM-052_phyCORE-Vybrid/Linux/PD13.1.0/0004-pcm052-sci2-added-sci2-workaround-for-phyCORE-Vybrid.patch
- Apply the patch:
cd <factory_install_dir>/build-armv7l-timesys-linux-gnueabi/linux-3.0 patch -p1 < 0004-pcm052-sci2-added-sci2-workaround-for-phyCORE-Vybrid.patch
- Rebuild the kernel, please note that to do so you must be in the factory directory:
cd <factory_install_dir> make kernel-restage; make kernel-build; make kernel-install-image
After the build completes, the kernel image will be available in <factory_install_dir>/build_armv7l-timesys-linux-gnueabi/images/uImage-30.-ts-armv7l.
Usage and Verification
Using the pre-built kernel available on the PHYTEC FTP or built in the previous section, the following instructions can be used to verify UART functionality on the phyCORE-Vybrid Rapid Development kit.
Hardware Setup
Complete the following hardware setup:
- Connect a serial cable from a free serial port on your host PC to the DB9 connector X10 on the Carrier Board. This is the SCI_1 communication channel with the Vybrid at RS-232 levels.
- Connect a serial cable from a free serial port on your host PC to the 3-pin interface X31 on the Carrier Board. This is the SCI_2 communication channel with the Vybrid at RS-232 levels.
SSH can be used for terminal access. To connect by SSH you can setup eth0 from the command line either by ifconfig or editing /etc/network/interface (permanent)
Example
The following example assumes two serial ports are available on your Host PC to connect to both communication channels at RS-232 levels:
Interface | Device | Functionality |
---|---|---|
SCI1 | /dev/ttymxc1 | Used for default console |
SCI2 | /dev/ttymxc2 | Used to send/receive messages |
- Start two instances of your favorite terminal software (such as Minicom or TeraTerm) on your host PC configured for 115200 baud, 8 data bits, no parity, and 1 stop bit (8n1) with no handshake.
- Boot the board into Linux
- From the console, change the baudrate of SCI2:
stty -F /dev/ttymxc2 115200
- Send data over SCI2:
echo "hello world! (Vybrid SCI2)" > /dev/ttymxc2
- Receive data from SCI2:
cat /dev/ttymxc2
Related articles