world leader in high performance signal processing
Trace: » bfin_sport_uart

SPORT UART

This driver implements a UART using the Blackfin on-chip SPORT I/O interface. The hardware and software is described by EE-191 from ADI.

The diagram below shows the connection between a Blackfin serial port and the Tx (transmit) and Rx (receive) pins of a basic UART port on another device.

No additional logic is required in this interface; however, the Blackfin I/O are not 5V tolerant. Do not connect the Blackfin to a 5V RS-232 converter.

sport-uart-spi-irda-adf70xxdbx-v02-1-schematic.pdf

The receiver needs to know when the following data will arrive. In synchronous transmission, sender and receive can share a clock or the sender can provide a strobe or other timing signals. With the SPORT, a frame sync signal can achieve this. Asynchronous means data will be sent any time and special bits are added to every words to synchronize. The UART adds start and stop bit around bytes to mark a frame.

Enable SPORT UART in Kernel

To enable the SPORT UART driver, use these settings in the Linux kernel configuration:

Device Drivers --->
  Character devices --->
    Serial drivers --->
      <*> Blackfin SPORT emulate UART
      [*]   Console on Blackfin sport emulated uart (NEW)

Platform Resources

You also need to add a set of platform resources to your boards file for each SPORT that will be emulating a UART. You'll also have to link it into the stamp_devices array.

file: arch/blackfin/mach-bf537/boards/stamp.c

scm failed with exit code 1:
file does not exist in git

Test SPORT UART

The sport UART device node are /dev/ttySS0 and /dev/ttySS1. This is a standard UART, except parity check bit and flow control are not supported. The baud rate and stop bits can be configured by stty or on kernel boot command line.

As a Linux console

  1. Configure kernel bootargs in uboot
    set bootargs root=/dev/mtdblock0 rw earlyprintk=serial,uart0,57600 console=ttySS0,57600n8 ip=10.100.4.50
  2. Configure minicom on host to 8bit data,1 bit stop and 57600 baud rate
  3. Build and boot the kernel with SPORT UART driver on blackfin.
  4. You will get a console with welcome information in minicom as you boot from normal UART0.

As a communication port

  1. Build and boot the kernel with SPORT UART driver.
  2. Configure sport uart port on blackfin
    stty -F /dev/ttySS0 ispeed 57600 ospeed 57600 cs8 -icrnl -ixon igncr -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoke -hupcl -echoctl min 1 time 0
  3. Configure uart port on PC side
    stty -F /dev/tty0 ispeed 57600 ospeed 57600 cs8 -icrnl -ixon igncr -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoke -hupcl -echoctl min 1 time 0
  4. Send data from Blackfin to PC:
    pc/> cat /dev/ttyS0
    
    blackfin/> echo "some characters" > /dev/ttySS0
    blackfin/> cat filename > /dev/ttySS0
  5. Send data from PC to Blackfin:
    blackfin/> cat /dev/ttySS0
    
    pc/> echo "some characters" > /dev/tty0
    pc/> cat filename > /dev/tty0