Test all the RB interfaces in 10 mins in command Line
Refer the Hardware and System reference manual to check out the PIN Numbers and PORT numbers etc. of respective interfaces.
Hardware manual
In case of any doubts you can Ask questions in RuggedBoard forum.
Targeted Hardware | SOM Version: PICM-001-A1 CB : RuggedBoard-A5D2x CB Version : RB-A5D2x-V1.1 |
Targeted Software | RBNR-20.0.0/RBSD-20.0.0 - AT91Bootstrap-3.8.12 - Uboot-2018-07 - Linux Kernel v4.9.151 - Yocto 2.5.2 (sumo HEAD commit 623b77885051) |
Description
To test GPIO let us use the On-board LED on RuggedBoard. For this demonstration let's use LED_1 which is connected to GPIO PC13 (Refer hardware manual for more information).
Required Hardware
RuggedBoard-A5D2x
Test Case:
Boot the board from NOR/MMC. After booting check toggling of USER LED.
Step 1:
Type the following commands in a sequence to toggle led.
echo 77 > /sys/class/gpio/export
echo out > /sys/class/gpio/PC13/direction
echo 1 > /sys/class/gpio/PC13/value
echo 0 > /sys/class/gpio/PC13/value
echo 1 > /sys/class/gpio/PC13/value
echo 0 > /sys/class/gpio/PC13/value
Expected o/p
root@ruggedboard-a5d2x:~# echo 77 > /sys/class/gpio/export
root@ruggedboard-a5d2x:~# echo out > /sys/class/gpio/PC13/direction
root@ruggedboard-a5d2x:~# echo 1 > /sys/class/gpio/PC13/value
root@ruggedboard-a5d2x:~# echo 0 > /sys/class/gpio/PC13/value
Try the above steps again replacing 77 with 81 & 83 respectively to toggle other two LEDs present on the board.
You can use remaining two user LED or any GPIO PIN mentioned in the Hardware manual with the same method. In case of any doubt post your detailed question into the RuggedBoard forum.
Description:
To check UART 3 node in /dev/.
To test the UART3 Port functionality in Kernel by shorting Transmitter and receiver pins.
To test the UART3 Port funcationaly in Kernel by connecting Transmitter pin of first board to receiver pin of second board and connect Receiver pin of first board to transmitter pin of second board using patch cards.
Required Hardware
UART PORT .
PATCH CORDS
Test Case 1 (Check the UART node in /dev/)
Boot the board from NOR/MMC.
Check weather the node is created in /dev
$ ls /dev/ttyS3
Expected o/p
root@ruggedboard-a5d2x:~# ls /dev/ttyS3
/dev/ttyS3
Test Case 2 (Loop back test)
Boot the board from NOR/MMC, Check the Log file whether node is created or not.
Open the microcom and enter some random data, to open microcom type the command given below.
$ microcom -s <baud-rate> /dev/ttyS3
Expected o/p
root@ruggedboard-a5d2x:~# microcom -s 9600 /dev/ttyS3
atmel_usart_serial atmel_usart_serial.3.auto: using dma0chan0 for rx DMA transfers
atmel_usart_serial atmel_usart_serial.3.auto: using dma0chan1 for tx DMA transfers
Welcome to phytec
Test Case 3 (Check the UART communication between 2 devices)
Boot the board from NOR/MMC, Check the Log file whether node is created or not.
Open microcom on both the boards and send data.
$ microcom -s <baud-rate> /dev/ttyS3
Expected o/p
RB-Device-1:
root@ruggedboard-a5d2x:~# microcom -s 115200 /dev/ttyS3
atmel_usart_serial atmel_usart_serial.3.auto: using dma0chan0 for rx DMA transfers
atmel_usart_serial atmel_usart_serial.3.auto: using dma0chan1 for tx DMA transfers
helloooo....................
RB-Device-2:
root@ruggedboard-a5d2x:~# microcom -s 115200 /dev/ttyS3
atmel_usart_serial atmel_usart_serial.3.auto: using dma0chan0 for rx DMA transfers
atmel_usart_serial atmel_usart_serial.3.auto: using dma0chan1 for tx DMA transfers
ruggedboard......
Description
To test the read and write functionality of i2c based eeprom
Required Hardware
phyCORE-A5d2x System on Module
phyCORE-A5d2 Rugged Board
USB cable
Step-by-step guide
Boot the board from NOR/MMC.
Give the below command to write the data on eeprom
$echo phytec > /sys/class/i2c-adapter/i2c-0/0-0050/eeprom
Please give the below command to read the data from eeprom.
$cat /sys/class/i2c-adapter/i2c-0/0-0050/eeprom
Expected Output
root@rugged-board-a5d2x:~# echo phytec > /sys/class/i2c-adapter/i2c-0/0-0050/eeprom
root@rugged-board-a5d2x:~# cat /sys/class/i2c-adapter/i2c-0/0-0050/eeprom
phytec
Description
To test the USB1 Port functionality using the dmesg in Kernel with Pen-drive.
To test the USB1 Port functionality in Kernel with Pen-drive to read and write the data.
To test the USB1 Port functionality in Kernel with USB host performance test.
Required Hardware
USB PORT/Hub. -USB Stick.
Prerequisite
USB-STICK should be detected.
Test Case 1 (Insert Pen drive check the dmesg log)
Boot the board from NOR/MMC. After booting insert the USB Stick into Board USB port/USB-HUB, Check the Log file whether node is created or not.
Type the command given below for getting the log.
$ dmesg | tail
Expected o/p
root@ruggedboard-a5d2x:~# dmesg | tail
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1:1.0
scsi 0:0:0:0: Direct-Access SanDisk Cruzer Blade 1.00 PQ: 0 ANSI: 6
sd 0:0:0:0: [sda] 61341696 512-byte logical blocks: (31.4 GB/29.3 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sda:
sd 0:0:0:0: [sda] Attached SCSI removable disk
Test Case 2 (Mount the Pen-drive and read and write the data)
Boot the board from NOR/MMC. After booting insert the USB Stick into Board USB port/USB-HUB, Check the Log file whether node is creadted or not using dmesg.
Once the node is detected, mount the node and do the read and write by typing the command given below.
$ mount /dev/mmcblk1p1 /mnt/
Expected o/p
root@ruggedboard-a5d2x:~# mount /dev/mmcblk1p1 /mnt/
FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
root@ruggedboard-a5d2x:~# cd /mnt/
root@ruggedboard-a5d2x:/mnt# ls
BOOT.BIN u-boot.bin
a5d2x-rugged_board.dtb zImage
at91-sama5d27_som1_ek.dtb
root@ruggedboard-a5d2x:/mnt# cd
root@ruggedboard-a5d2x:~# mount usb 1-1: USB disconnect, device number 2
usb 1-1: new full-speed USB device number 3 using at91_ohci
usb 1-1: New USB device found, idVendor=0781, idProduct=5567
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: Cruzer Blade
usb 1-1: Manufacturer: SanDisk
usb 1-1: SerialNumber: 4C530001280707107415
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1:1.0
scsi 0:0:0:0: Direct-Access SanDisk Cruzer Blade 1.00 PQ: 0 ANSI: 6
sd 0:0:0:0: [sda] 61341696 512-byte logical blocks: (31.4 GB/29.3 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sda:
sd 0:0:0:0: [sda] Attached SCSI removable disk
/dev/root on / type ext4 (rw,relatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=27004k,nr_inodes=6751,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /var/volatile type tmpfs (rw,relatime)
/dev/mmcblk1p1 on /mnt type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
root@ruggedboard-a5d2x:~# mount /dev/sda /mnt/
FAT-fs (sda): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
root@ruggedboard-a5d2x:~# cd /mnt/
root@ruggedboard-a5d2x:/mnt# ls
adc i2c spidev_test read
root@ruggedboard-a5d2x:/mnt# vi hello.c
root@ruggedboard-a5d2x:/mnt# ls
adc i2c spidev_test read hello.c
root@ruggedboard-a5d2x:/mnt# ./read
Test Case 3 (USB host performance test)
Boot the board from NOR/MMC
After booting run the script file and insert the USB Stick into Board USB port/USB-HUB.
$ sh usb_host_test.sh
Expected o/p
root@sama5d27-a5d2x:~# sh usb_host_test.sh
insert usb flash stick
usb 1-1: new full-speed USB device number 3 using at91_ohci
usb 1-1: New USB device found, idVendor=0781, idProduct=5567
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: Cruzer Blade
usb 1-1: Manufacturer: SanDisk
usb 1-1: SerialNumber: 4C530001280707107415
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1:1.0
scsi 0:0:0:0: Direct-Access SanDisk Cruzer Blade 1.00 PQ: 0 ANSI: 6
sd 0:0:0:0: [sda] 61341696 512-byte logical blocks: (31.4 GB/29.3 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sda:
sd 0:0:0:0: [sda] Attached SCSI removable disk
dmesg -c
hdparm -t /dev/sda
hdparm -T /dev/sda
dd if=/dev/urandom bs=1M count=32 of=/tmp/test.img
mount -o rw,uid=1000 /dev/sda1 /mnt
time cp /tmp/test.img /mnt/test.img
time sync
md5sum -c /tmp/test.md5
time cp /mnt/test.img /tmp/test.img
md5sum -c /tmp/test.md5
mount -o rw,uid=1000,remount,sync /dev/sda1
time cp /tmp/test.img /mnt/test.img
md5sum -c /tmp/test.md5
umount /dev/sda1
Description
To test the Ethernet ping functionality in Kernel.
Required Hardware
Ethernet Switch / Hub / Router, Ethernet cable.
Test Case 1 (Ping Test)
Make sure the network configuration & connection between Host & Target is established, connected to same switch / router.
Boot the board with NOR/MMC.
Before the ping test for Ethernet in Linux,we need to set the ip address by using below command on the target board. Make sure both the Target and Host are in the same sub-net
$ ifconfig eth0 192.168.1.11 up
4.Next ping to your host ip address by using below command.
$ ping 192.168.1.12
Expected o/p
root@ruggedboard-a5d2x:~# ping 192.168.1.12
PING 192.168.1.12 (192.168.1.12): 56 data bytes
64 bytes from 192.168.1.12: seq=0 ttl=64 time=0.791 ms
64 bytes from 192.168.1.12: seq=1 ttl=64 time=0.533 ms
64 bytes from 192.168.1.12: seq=2 ttl=64 time=0.468 ms
64 bytes from 192.168.1.12: seq=3 ttl=64 time=0.503 ms
64 bytes from 192.168.1.12: seq=4 ttl=64 time=0.487 ms
64 bytes from 192.168.1.12: seq=5 ttl=64 time=0.510 ms
^C
--- 192.168.1.12 ping statistics ---
6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max = 0.468/0.548/0.791 ms
Note : Use the working IP address of your LAN. Ping command is used to test net connectivity between two IP based devices. Here 192.168.1.12 is general IP address of server ip
Description
To test the CAN Device functionality in Kernel.
Required Hardware
CAN Phy should be mounted on Board.
P CAN-USB Adapter
Prerequisite
CAN Adapter Driver , can-utils on host.
Test Case 1 (Test with PCAN device)
Boot the board from MMC.Due to size issue we are not providing can utils package for NOR flash,so please boot from SD card.
After booting,check the interface is available or not by giving the below command.
$ ifconfig can0
To Transmit packets from board to PC
Target side:
$ ip link set can0 down
$ ip link set can0 type can bitrate 50000
$ ip link set can0 up
$ cansend can0 123#1232
Host side:
$ sudo ip link set can0 down
$ sudo ip link set can0 type can bitrate 50000
$ sudo ip link set can0 up
$ candump can0
$ can0 123 [2] 12 32
To Transmit packets from PC to Board
Host side :
sudo ip link set can0 down
sudo ip link set can0 type can bitrate 50000
sudo ip link set can0 up
sudo cansend can0 123#1232
Target side :
ip link set can0 down
ip link set can0 type can bitrate 50000
ip link set can0 up
candump can0
can0 123 [2] 12 32
Expected o/p :
To Transmit packets from board to PC
Target side:
root@ruggedboard-a5d2x:~# ip link set can0 down
root@ruggedboard-a5d2x:~# ip link set can0 type can bitrate 50000
root@ruggedboard-a5d2x:~# ip link set can0 up
root@ruggedboard-a5d2x:~# cansend can0 123#1232
Host side:
USER@ubuntudesk:~$ sudo ip link set can0 down
USER@ubuntudesk:~$ sudo ip link set can0 type can bitrate 50000
USER@ubuntudesk:~$ sudo ip link set can0 up
USER@ubuntudesk:~$ sudo candump can0
can0 123 [2] 12 32
To Transmit packets from PC to Board
Host side :
USER@ubuntudesk:~$ sudo ip link set can0 down
USER@ubuntudesk:~$ sudo ip link set can0 type can bitrate 50000
USER@ubuntudesk:~$ sudo ip link set can0 up
USER@ubuntudesk:~$ sudo cansend can0 123#1232
Target side:
root@ruggedboard-a5d2x:~# ip link set can0 down
root@ruggedboard-a5d2x:~# ip link set can0 type can bitrate 50000
root@ruggedboard-a5d2x:~# ip link set can0 up
root@ruggedboard-a5d2x:~# candump can0
can0 123 [2] 12 32
Test Case 2 (Board to Board)
Take 2 boards and Boot the boards from NOR/MMC.
After booting,check the interface is available or not by giving the below command.
$ ifconfig can0
Test the CAN in 2 Cases.
Case1: Test the CAN through commands.
To Transmit packets from Board1 to Board2
Board1 side:
ip link set can0 down
ip link set can0 type can bitrate 50000
ip link set can0 up
cansend can0 123#1232
Board2 side:
ip link set can0 down
ip link set can0 type can bitrate 50000
ip link set can0 up
candump can0
can0 123 [2] 12 32
To Transmit packets from Board2 to Board1
Board2 side :
ip link set can0 down
ip link set can0 type can bitrate 50000
ip link set can0 up
cansend can0 123#1232
Board1 side :
ip link set can0 down
ip link set can0 type can bitrate 50000
ip link set can0 up
candump can0
can0 123 [2] 12 32
Case2: Test the CAN through the application
After booting,run the cansend application in board1 and canreceive in board2 and vice versa by using like below commands.
./cansend
./canrecv
Expected o/p
Case1 :
To Transmit packets from Board1 to Board2
Board1 side:
root@ruggedboard-a5d2x:~# ip link set can0 down
root@ruggedboard-a5d2x:~# ip link set can0 type can bitrate 50000
root@ruggedboard-a5d2x:~# ip link set can0 up
root@ruggedboard-a5d2x:~# cansend can0 123#1232
Board2 side:
root@ruggedboard-a5d2x:~# ip link set can0 down
root@ruggedboard-a5d2x:~# ip link set can0 type can bitrate 50000
root@ruggedboard-a5d2x:~# ip link set can0 up
root@ruggedboard-a5d2x:~# candump can0
can0 123 [2] 12 32
To Transmit packets from Board2 to Board1
Board2 side :
root@ruggedboard-a5d2x:~# ip link set can0 down
root@ruggedboard-a5d2x:~# ip link set can0 type can bitrate 50000
root@ruggedboard-a5d2x:~# ip link set can0 up
root@ruggedboard-a5d2x:~# cansend can0 123#1232
Board1 side :
root@ruggedboard-a5d2x:~# ip link set can0 down
root@ruggedboard-a5d2x:~# ip link set can0 type can bitrate 50000
root@ruggedboard-a5d2x:~# ip link set can0 up
root@ruggedboard-a5d2x:~# candump can0
can0 123 [2] 12 32
Case2 :
To Transmit packets from Board1 to Board2
Board1 side :
root@ruggedboard-a5d2x:~# ip link set can0 down
root@ruggedboard-a5d2x:~# ip link set can0 type can bitrate 50000
root@ruggedboard-a5d2x:~# ip link set can0 up
root@ruggedboard-a5d2x:~# ./cans
Can Send Test
can0 at index 2
Wrote 16 bytes
Board2 side :
root@ruggedboard-a5d2x:~# ip link set can0 down
root@ruggedboard-a5d2x:~# ip link set can0 type can bitrate 50000
root@ruggedboard-a5d2x:~# ip link set can0 up
root@ruggedboard-a5d2x:~# ./canr
Can Recieve Test
can0 at index 2
Can frames recieved
<0x123> [2] 11 22
To Transmit packets from Board2 to Board1
Board1 side :
root@ruggedboard-a5d2x:~# ip link set can0 down
root@ruggedboard-a5d2x:~# ip link set can0 type can bitrate 50000
root@ruggedboard-a5d2x:~# ip link set can0 up
root@ruggedboard-a5d2x:~# ./canr
Can Recieve Test
can0 at index 2
Can frames recieved
<0x123> [2] 11 22
Board2 side :
root@ruggedboard-a5d2x:~# ip link set can0 down
root@ruggedboard-a5d2x:~# ip link set can0 type can bitrate 50000
root@ruggedboard-a5d2x:~# ip link set can0 up
root@ruggedboard-a5d2x:~# ./cans
Can Send Test
can0 at index 2
Wrote 16 bytes
Description
To test the digital input pin on the carrier board.
Required Hardware
phyCORE-A5d2x System on Module
phyCORE-A5d2 Rugged Board
USB cable
Patch card
Step-by-step guide
Boot the board from NOR/MMC
Carrier board having 4 digital input pins on P5 connector.Fifth pin of P5 connector is ground.
After completion of board booting, connect the one end of patch card to first pin of P5 connector and other end to input voltage pin.
Give the below commands to test the digital inputs.
$ echo 84 > sys/class/gpio/export
$ echo in > /sys/class/gpio/PC20/direction
$ cat /sys/class/gpio/PC20/value
Remove the patch card and give the below command
$ cat /sys/class/gpio/PC20/value
The value of digital pin is changed one to zero.
Meanwhile we can check the rest of the digital pins on P5 connector.Please have a look on below expected output for all digital input pins on P5 connector.
Expected Output
root@ruggedboard-a5d2x:~# echo 84 > /sys/class/gpio/export
root@ruggedboard-a5d2x:~# echo in > /sys/class/gpio/PC20/direction
root@ruggedboard-a5d2x:~# cat /sys/class/gpio/PC20/value
0
root@ruggedboard-a5d2x:~# cat /sys/class/gpio/PC20/value
1
root@ruggedboard-a5d2x:~# echo 88 > /sys/class/gpio/export
root@ruggedboard-a5d2x:~# echo in > /sys/class/gpio/PC24/direction
root@ruggedboard-a5d2x:~# cat /sys/class/gpio/PC24/value
1
root@ruggedboard-a5d2x:~# cat /sys/class/gpio/PC24/value
0
root@ruggedboard-a5d2x:~# echo 79 > /sys/class/gpio/export
root@ruggedboard-a5d2x:~# echo in > /sys/class/gpio/PC15/direction
root@ruggedboard-a5d2x:~# cat /sys/class/gpio/PC15/value
0
root@ruggedboard-a5d2x:~# cat /sys/class/gpio/PC15/value
1
root@ruggedboard-a5d2x:~# echo 86 > /sys/class/gpio/export
root@ruggedboard-a5d2x:~# echo in > /sys/class/gpio/PC22/direction
root@ruggedboard-a5d2x:~# cat /sys/class/gpio/PC22/value
1
root@ruggedboard-a5d2x:~# cat /sys/class/gpio/PC22/value
0
Description
To test the digital output pins on carrier board
Required Hardware
phyCORE-A5d2x System on Module
phyCORE-A5d2 Rugged Board
USB cable
External LED
Step-by-step guide
Boot the board from NOR/MMC
Carrier board having 4 digital outpins on P6 connector.Please refer the schematic to p6 connector pins.
After booting connect the External LED postive to 5th pin of P6 connector and other end to Ground.
Please give a below commands and observe the led status.
$echo 97 > /sys/class/gpio/export
$echo out > /sys/class/gpio/PD1/direction
$echo 1 > /sys/class/gpio/PD1/value
$echo 0 > /sys/class/gpio/PD1/value
Please have a look on below expected output for testing rest of gpios in P6 connector.
Expected Output
root@ruggedboard-a5d2x:~# echo 17 > /sys/class/gpio/export
root@ruggedboard-a5d2x:~# echo out > /sys/class/gpio/PA17/direction
root@ruggedboard-a5d2x:~# echo 0 > /sys/class/gpio/PA17/value
root@ruggedboard-a5d2x:~# echo 1 > /sys/class/gpio/PA17/
root@ruggedboard-a5d2x:~# echo 14 > /sys/class/gpio/export
root@ruggedboard-a5d2x:~# echo out > /sys/class/gpio/PA14/direction
root@ruggedboard-a5d2x:~# echo 0 > /sys/class/gpio/PA14value
root@ruggedboard-a5d2x:~# echo 1 > /sys/class/gpio/PA14/value
root@ruggedboard-a5d2x:~# echo 16 > /sys/class/gpio/export
root@ruggedboard-a5d2x:~# echo out > /sys/class/gpio/PA16/direction
root@ruggedboard-a5d2x:~# echo 0 > /sys/class/gpio/PA16/value
root@ruggedboard-a5d2x:~# echo 1 > /sys/class/gpio/PA16/value
root@ruggedboard-a5d2x:~# echo 97 > /sys/class/gpio/export
root@ruggedboard-a5d2x:~# echo out > /sys/class/gpio/PD1/direction
root@ruggedboard-a5d2x:~# echo 1 > /sys/class/gpio/PD1/value
root@ruggedboard-a5d2x:~# echo 0 > /sys/class/gpio/PD1/value
Description
To test the SD card Port functionality in Kernel with SD card.
To test the SD card Port functionality in Kernel with SD card and read the data from SD card.
To test the SD card Port functionality in Kernel with SD card and write the data to SD card.
Required Hardware
SD card.
Prerequisite
SD card should be detected.
Test Case 1 (Insert the SD card check the log)
Boot the board from NOR/MMC. After booting or while booting insert the SD card into Board MMC slot, Check the Log file whether node is created or not.
Expected o/p
Poky (Yocto Project Reference Distro) 2.5.2 ruggedboard-a5d2x /dev/ttyS0
ruggedboard-a5d2x login:
mmc1: Problem switching card into high-speed mode!
mmc1: new SDHC card at address 0001
mmcblk1: mmc1:0001 SD 7.44 GiB
mmcblk1: p1 p2
Test Case 2 (Read the data from SD card)
Boot the board from NOR/MMC. After booting or while booting insert the SD card into Board MMC slot, Check the Log file whether node is created or not.
Mount the SD-Card using the mount command.
$ mount /dev/mmcblkp1 /mnt/
Expected o/p
root@ruggedboard-a5d2x:~# mount /dev/mmcblk1p1 /mnt/
FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
root@ruggedboard-a5d2x:~# cd /mnt/
root@ruggedboard-a5d2x:/mnt# ls
BOOT.BIN u-boot.bin
a5d2x-rugged_board.dtb zImage
at91-sama5d27_som1_ek.dtb read.c
root@ruggedboard-a5d2x:/mnt# vi read.c
Test Case 3 (Write the data in SD card)
Boot the board from NOR/MMC. After booting or while booting insert the SD card into Board MMC slot, Check the Log file whether node is creadted or not.
mount /dev/mmcblkp1 /mnt/
Expected o/p
root@ruggedboard-a5d2x:~# mount /dev/mmcblk1p1 /mnt/
FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
root@ruggedboard-a5d2x:~# cd /mnt/
root@ruggedboard-a5d2x:/mnt# ls
BOOT.BIN u-boot.bin
a5d2x-rugged_board.dtb zImage
at91-sama5d27_som1_ek.dtb read.c
root@ruggedboard-a5d2x:/mnt# vi write.c
root@ruggedboard-a5d2x:/mnt# ls
BOOT.BIN u-boot.bin
a5d2x-rugged_board.dtb zImage
at91-sama5d27_som1_ek.dtb read.c
write.c
Description
To test the ADC functionality with Potentio meter
Required Hardware
phyCORE-A5d2x System on Module
phyCORE-A5d2 Rugged Board
USB cable
Potentiometer
Step-by-step guide
Boot the board from NOR/MMC. After board booting connect the Potentiometer signal pin to Analog signal pin.
Give the below command to read the digital value of ADC.
cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
Expected Output
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/
buffer/ in_voltage6-voltage7_raw
current_timestamp_clock in_voltage6_raw
dev in_voltage7_raw
in_voltage-voltage_scale in_voltage8-voltage9_raw
in_voltage0-voltage1_raw in_voltage8_raw
in_voltage0_raw in_voltage9_raw
in_voltage10-voltage11_raw in_voltage_scale
in_voltage10_raw name
in_voltage11_raw of_node/
in_voltage1_raw power/
in_voltage2-voltage3_raw sampling_frequency
in_voltage2_raw scan_elements/
in_voltage3_raw subsystem/
in_voltage4-voltage5_raw trigger/
in_voltage4_raw uevent
in_voltage5_raw
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
4095
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
3500
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
2337
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
1222
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
1094
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
878
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
779
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
671
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
173
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
73
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
33
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
28
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
18
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
0
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage6_raw
0
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage7_raw
497
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage7_raw
493
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage8_raw
2452
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage8_raw
2449
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage8_raw
2453
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage9_raw
2389
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage9_raw
2385
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage9_raw
2386
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage10_ra
w
8
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage10_ra
w
13
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage10_ra
w
18
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage10_ra
w
19
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage11_ra
w
2463
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage11_ra
w
2461
root@ruggedboard-a5d2x:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage11_ra
w
2462
Description
To test the debug console on carrier board.
Required Hardware
phyCORE-A5d2x System on Module
phyCORE-A5d2 Rugged Board
USB cable
Step-by-step guide
Connect the USB cabel to board to PC.
Follow the RB-Quick start guide to set the minicom settings.
Please give the below commands to open the debug console in PC.
$ sudo minicom
Expected Output
U-Boot 2018.07-linux4sam_6.0-00025-g3bff827-dirty (Dec 02 2019 - 01:35:03 +0530)
CPU: SAMA5D27 512M bits DDR2 SDRAM
Crystal frequency: 24 MHz
CPU clock : 492 MHz
Master clock : 164 MHz
DRAM: 64 MiB
MMC: sdio-host@a0000000: 0, sdio-host@b0000000: 1
Loading Environment from SPI Flash... SF: Detected mx25l25645g with page size 256 Bytes, erase size 64 KiB, total 32 MiB
*** Warning - bad CRC, using default environment
Failed (-5)
In: serial@f8020000
Out: serial@f8020000
Err: serial@f8020000
Net: eth0: ethernet@f8008000
Hit any key to stop autoboot: 0
Unknown command 'console=ttyS0,115200' - try 'help'
SF: Detected mx25l25645g with page size 256 Bytes, erase size 64 KiB, total 32 MiB
device 0 offset 0xa6000, size 0x500000
SF: 5242880 bytes @ 0xa6000 Read: OK
device 0 offset 0x96000, size 0x10000
SF: 65536 bytes @ 0x96000 Read: OK
## Flattened Device Tree blob at 21000000
Booting using the fdt blob at 0x21000000
Loading Device Tree to 23b6b000, end 23b763d9 ... OK
Starting kernel ...
Booting Linux on physical CPU 0x0
Linux version 4.9.151-linux4sam_5.8+-04814-g499d99b-dirty (ganesh@phytec) (gcc version 7.3.0 (GCC) ) #3 Wed Jan 29 16:06:33 IST 2020
CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: RUGGED BOARD A5D2X
cma: Failed to reserve 64 MiB
Memory policy: Data cache writeback
CPU: All CPU(s) started in SVC mode.
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 16240
Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mtdblock5 rw rootwait rootfstype=squashfs
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 54004K/65536K available (7168K kernel code, 215K rwdata, 1188K rodata, 1024K init, 220K bss, 11532K reserved, 0K cma-reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xc4800000 - 0xff800000 ( 944 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc0800000 (8160 kB)
.init : 0xc0a00000 - 0xc0b00000 (1024 kB)
.data : 0xc0b00000 - 0xc0b35fc8 ( 216 kB)
.bss : 0xc0b35fc8 - 0xc0b6d208 ( 221 kB)
NR_IRQS:16 nr_irqs:16 16
L2C-310 ID prefetch enabled, offset 2 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 128 kB
L2C-310: CACHE_ID 0x410000c9, AUX_CTRL 0x36020000
clocksource: pit: mask: 0x7ffffff max_cycles: 0x7ffffff, max_idle_ns: 11654027029 ns
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
Console: colour dummy device 80x30
Calibrating delay loop... 326.86 BogoMIPS (lpj=1634304)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x20100000 - 0x20100058
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
AT91: PM: standby: standby, suspend: ulp0
clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 186464433812 ns
at_xdmac f0010000.dma-controller: 16 channels, mapped at 0xc4883000
at_xdmac f0004000.dma-controller: 16 channels, mapped at 0xc4885000
AT91: Detected SoC family: sama5d2
AT91: Detected SoC: sama5d27c 64MB SiP, revision 2
VDDANA: supplied by VDDIN_3V3
advref: supplied by VDDANA
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
at91_i2c f8028000.i2c: could not find pctldev for node /ahb/apb/pinctrl@fc038000/i2c0_default, deferring probe
media: Linux media interface: v0.10
Linux video capture interface: v2.00
Advanced Linux Sound Architecture Driver Initialized.
Bluetooth: Core ver 2.22
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
clocksource: Switched to clocksource tcb_clksrc
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
workingset: timestamp_bits=14 max_order=14 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
JFS: nTxBlock = 421, nTxLock = 3375
io scheduler noop registered (default)
pinctrl-at91-pio4 fc038000.pinctrl: atmel pinctrl initialized
[drm] Initialized
brd: module loaded
loop: module loaded
atmel_usart_serial.0.auto: ttyS1 at MMIO 0xf801c000 (irq = 33, base_baud = 5125000) is a ATMEL_SERIAL
atmel_usart_serial.1.auto: ttyS0 at MMIO 0xf8020000 (irq = 34, base_baud = 5125000) is a ATMEL_SERIAL
console [ttyS0] enabled
atmel_usart_serial.2.auto: ttyS2 at MMIO 0xf8024000 (irq = 35, base_baud = 5125000) is a ATMEL_SERIAL
atmel_usart_serial.3.auto: ttyS3 at MMIO 0xfc008000 (irq = 39, base_baud = 5125000) is a ATMEL_SERIAL
atmel_usart_serial.4.auto: ttyS4 at MMIO 0xfc00c000 (irq = 40, base_baud = 5125000) is a ATMEL_SERIAL
atmel_qspi f0024000.spi: mx25l25645g (32768 Kbytes)
7 ofpart partitions found on MTD device f0024000.spi
Creating 7 MTD partitions on "f0024000.spi":
0x000000000000-0x000000006000 : "at91bootstrap"
0x000000006000-0x000000016000 : "bootloader env"
0x000000016000-0x000000096000 : "bootloader"
0x000000096000-0x0000000a6000 : "device tree"
0x0000000a6000-0x0000005a6000 : "kernel"
0x0000005a6000-0x0000019a6000 : "rootfs"
0x0000019a6000-0x000002000000 : "data"
atmel_spi fc018400.spi: DMA TX channel not available, SPI unable to use DMA
atmel_spi fc018400.spi: Atmel SPI Controller using PIO only
atmel_spi fc018400.spi: Using FIFO (16 data)
atmel_spi fc018400.spi: Atmel SPI Controller version 0x311 at 0xfc018400 (irq 178)
libphy: Fixed MDIO Bus: probed
CAN device driver interface
m_can fc050000.can: m_can device registered (irq=48, version=31)
libphy: MACB_mii_bus: probed
random: fast init done
Micrel KSZ8081 or KSZ8091 f8008000.ethernet-ffffffff:07: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=f8008000.ethernet-f)
macb f8008000.ethernet eth0: Cadence GEM rev 0x00020203 at 0xf8008000 irq 28 (80:1f:12:4e:24:9e)
usbcore: registered new interface driver asix
usbcore: registered new interface driver ax88179_178a
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver net1080
usbcore: registered new interface driver cdc_subset
usbcore: registered new interface driver zaurus
usbcore: registered new interface driver sierra_net
usbcore: registered new interface driver cdc_ncm
usbcore: registered new interface driver qmi_wwan
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-atmel: EHCI Atmel driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-atmel: OHCI Atmel driver
at91_ohci 400000.ohci: USB Host Controller
at91_ohci 400000.ohci: new USB bus registered, assigned bus number 1
at91_ohci 400000.ohci: irq 18, io mem 0x00400000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: USB Host Controller
usb usb1: Manufacturer: Linux 4.9.151-linux4sam_5.8+-04814-g499d99b-dirty ohci_hcd
usb usb1: SerialNumber: at91
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver cdc_wdm
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver option
usbserial: USB Serial support registered for GSM modem (1-port)
usbcore: registered new interface driver pl2303
usbserial: USB Serial support registered for pl2303
usbcore: registered new interface driver qcaux
usbserial: USB Serial support registered for qcaux
usbcore: registered new interface driver qcserial
usbserial: USB Serial support registered for Qualcomm USB modem
rtc rtc0: invalid alarm value: 1900-1-1 0:0:0
at91_rtc f80480b0.rtc: rtc core: registered f80480b0.rtc as rtc0
at91_rtc f80480b0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
AT91: Starting after general reset
sama5d4_wdt f8048040.watchdog: initialized (timeout = 16 sec, nowayout = 0)
usbcore: registered new interface driver bfusb
usbcore: registered new interface driver btusb
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
sdhci-at91 a0000000.sdio-host: update clk mul to 39 as gck rate is 480000000 Hz
mmc0: SDHCI controller on a0000000.sdio-host [a0000000.sdio-host] using ADMA
sdhci-at91 b0000000.sdio-host: update clk mul to 39 as gck rate is 480000000 Hz
mmc1: SDHCI controller on b0000000.sdio-host [b0000000.sdio-host] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
atmel_aes f002c000.aes: version: 0x500
atmel_aes f002c000.aes: Atmel AES - Using dma0chan0, dma0chan1 for DMA transfers
atmel_sha f0028000.sha: version: 0x510
atmel_sha f0028000.sha: using dma0chan2 for DMA transfers
atmel_sha f0028000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
atmel_tdes fc044000.tdes: version: 0x703
atmel_tdes fc044000.tdes: using dma0chan3, dma0chan4 for DMA transfers
atmel_tdes fc044000.tdes: Atmel DES/TDES
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
at91-sama5d2_adc fc030000.adc: setting up trigger as external_rising
at91-sama5d2_adc fc030000.adc: version: 800
NET: Registered protocol family 10
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20161123 t)
can: netlink gateway (rev 20130117) max_hops=1
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
Bluetooth: HIDP socket layer initialized
at91_i2c f8028000.i2c: can't get DMA channel, continue without DMA support
at91_i2c f8028000.i2c: Using FIFO (16 data)
at24 0-0050: 256 byte 24c02 EEPROM, writable, 8 bytes/write
at91_i2c f8028000.i2c: AT91 i2c bus driver (hw version: 0x704).
at91_rtc f80480b0.rtc: setting system clock to 2012-01-01 00:00:10 UTC (1325376010)
ALSA device list:
No soundcards found.
atmel_usart_serial atmel_usart_serial.1.auto: using dma0chan5 for rx DMA transfers
atmel_usart_serial atmel_usart_serial.1.auto: using dma0chan6 for tx DMA transfers
VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
starting pid 112, tty '': '/bin/mount -t proc proc /proc'
starting pid 113, tty '': '/bin/mount -t sysfs sysfs /sys'
starting pid 114, tty '': '/bin/mount -t devtmpfs devtmpfs /dev'
mount: mounting devtmpfs on /dev failed: Resource busy
starting pid 115, tty '': '/bin/mount -o remount,rw /'
starting pid 116, tty '': '/bin/mkdir -p /dev/pts'
starting pid 117, tty '': '/bin/mount -t devpts devpts /dev/pts'
starting pid 118, tty '': '/bin/mount -a'
starting pid 119, tty '': '/etc/init.d/rcS'
starting pid 123, tty '/dev/ttyS0': '/sbin/getty 115200 ttyS0'
Poky (Yocto Project Reference Distro) 2.5.2 ruggedboard /dev/ttyS0
ruggedboard login: root
-sh: command: not found
root@ruggedboard:~#
root@ruggedboard:~#
root@ruggedboard:~#
root@ruggedboard:~#
Description
To test the Expansion Header GPIOs functionality in Kernel whether they are toggling.
Required Hardware
External LED.
Prerequisite
External LED should glow.
Test Case 1 (Connect the LED and toggle the GPIOs)
Boot the board from NOR/MMC. After booting check whether Expansion Header GPIOs are toggling or not.
$ echo <gpiono> sys/class/gpio/export
$ echo out > /sys/class/gpio/<gpiopinno>/direction
$ echo 1 > /sys/class/gpio/<gpiopinno>/value
$ echo 0 > /sys/class/gpio/<gpiopinno>/value
Expected o/p
root@ruggedboard-a5d2x
root@ruggedboard-a5d2x:~# echo 115 > /sys/class/gpio/export
root@ruggedboard-a5d2x:~# echo out > /sys/class/gpio/PD19/direction
root@ruggedboard-a5d2x:~# echo 1 > /sys/class/gpio/PD19/value
root@ruggedboard-a5d2x:~# echo 0 > /sys/class/gpio/PD19/value
root@ruggedboard-a5d2x:~# echo 116 > /sys/class/gpio/export
root@ruggedboard-a5d2x:~# echo out > /sys/class/gpio/PD20/direction
root@ruggedboard-a5d2x:~# echo 1 > /sys/class/gpio/PD20/value
root@ruggedboard-a5d2x:~# echo 0 > /sys/class/gpio/PD20/value
Description
To test the mini pcie connector on the carrier board.
Required Hardware
phyCORE-A5d2x System on Module
phyCORE-A5d2 Rugged Board
USB cable
PCIE Module
Step-by-step guide
Boot the board from NOR/MMC. After booting insert the mPCIe module to the mPCIe connector.
After inserting module ,log will appear on shell.Please have a look on below expected output.
Expected Output
root@ruggedboard-a5d2x:~# usb 1-2: new full-speed USB device number 2 using at91_ohci
|usb 1-2: config 1 has an invalid interface number: 8 but max is 3
usb 1-2: config 1 has no interface number 1
usb 1-2: New USB device found, idVendor=1199, idProduct=68c0
usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-2: Product: Sierra Wireless WP7608
usb 1-2: Manufacturer: Sierra Wireless, Incorporated
usb 1-2: SerialNumber: XG85120024011021
qcserial 1-2:1.0: Qualcomm USB modem converter detected
usb 1-2: Qualcomm USB modem converter now attached to ttyUSB0
qcserial 1-2:1.2: Qualcomm USB modem converter detected
usb 1-2: Qualcomm USB modem converter now attached to ttyUSB1
qcserial 1-2:1.3: Qualcomm USB modem converter detected
usb 1-2: Qualcomm USB modem converter now attached to ttyUSB2
qmi_wwan 1-2:1.8: cdc-wdm0: USB WDM device
qmi_wwan 1-2:1.8 wwan0: register 'qmi_wwan' at usb-at91-2, WWAN/QMI device, 9a:c1:df:e1:6f:18
Description
To test the PWM functionality in Kernel with External LED.
Required Hardware
phyCORE-A5d2x System on Module
phyCORE-A5d2 Rugged Board
USB cable
External LED
Step-by-step guide
Boot the board from NOR/MMC.
Please connect the positive pin of LED to the 16 th pin of the M1 connector.And connect the other pin of led to ground.
Give the below commands the and observe the brightness of LED pin.
$echo 0 > /sys/class/pwm/pwmchip0/export
$echo 50000 > /sys/class/pwm/pwmchip0/pwm0/period
$echo 4000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
$echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
$echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable
Expected Output
root@ruggedboard-a5d2x:~# cat /sys/class/pwm/pwmchip0/npwm
4
root@ruggedboard-a5d2x:~# echo 0 > /sys/class/pwm/pwmchip0/export
root@ruggedboard-a5d2x:~# cat /sys/class/pwm/pwmchip0/pwm0/polarity
normal
root@ruggedboard-a5d2x:~# echo 50000 > /sys/class/pwm/pwmchip0/pwm0/period
root@ruggedboard-a5d2x:~# echo 4000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
root@ruggedboard-a5d2x:~# echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
root@ruggedboard-a5d2x:~# echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable
root@ruggedboard-a5d2x:~# echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
Description
To test the reset switch in carrier board.
Required Hardware
phyCORE-A5d2x System on Module
phyCORE-A5d2 Rugged Board
USB cable
Step-by-step guide
Boot the board from NOR/MMC.
After completion of board booting press the reset switch.
Please check the board is whether reboot or not.
Expected Output
U-Boot 2018.07-linux4sam_6.0-00025-g3bff827-dirty (Dec 02 2019 - 01:35:03 +0530)
CPU: SAMA5D27 512M bits DDR2 SDRAM
Crystal frequency: 24 MHz
CPU clock : 492 MHz
Master clock : 164 MHz
DRAM: 64 MiB
MMC: sdio-host@a0000000: 0, sdio-host@b0000000: 1
Loading Environment from SPI Flash... SF: Detected mx25l25645g with page size 256 Bytes, erase size 64 KiB, total 32 MiB
*** Warning - bad CRC, using default environment
Failed (-5)
In: serial@f8020000
Out: serial@f8020000
Err: serial@f8020000
Net: eth0: ethernet@f8008000
Hit any key to stop autoboot: 0
Unknown command 'console=ttyS0,115200' - try 'help'
SF: Detected mx25l25645g with page size 256 Bytes, erase size 64 KiB, total 32 MiB
device 0 offset 0xa6000, size 0x500000
SF: 5242880 bytes @ 0xa6000 Read: OK
device 0 offset 0x96000, size 0x10000
SF: 65536 bytes @ 0x96000 Read: OK
## Flattened Device Tree blob at 21000000
Booting using the fdt blob at 0x21000000
Loading Device Tree to 23b6b000, end 23b763d9 ... OK
Starting kernel ...
Booting Linux on physical CPU 0x0
Linux version 4.9.151-linux4sam_5.8+-04814-g499d99b-dirty (ganesh@phytec) (gcc version 7.3.0 (GCC) ) #3 Wed Jan 29 16:06:33 IST 2020
CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: RUGGED BOARD A5D2X
cma: Failed to reserve 64 MiB
Memory policy: Data cache writeback
CPU: All CPU(s) started in SVC mode.
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 16240
Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mtdblock5 rw rootwait rootfstype=squashfs
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 54004K/65536K available (7168K kernel code, 215K rwdata, 1188K rodata, 1024K init, 220K bss, 11532K reserved, 0K cma-reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xc4800000 - 0xff800000 ( 944 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc0800000 (8160 kB)
.init : 0xc0a00000 - 0xc0b00000 (1024 kB)
.data : 0xc0b00000 - 0xc0b35fc8 ( 216 kB)
.bss : 0xc0b35fc8 - 0xc0b6d208 ( 221 kB)
NR_IRQS:16 nr_irqs:16 16
L2C-310 ID prefetch enabled, offset 2 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 128 kB
L2C-310: CACHE_ID 0x410000c9, AUX_CTRL 0x36020000
clocksource: pit: mask: 0x7ffffff max_cycles: 0x7ffffff, max_idle_ns: 11654027029 ns
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
Console: colour dummy device 80x30
Calibrating delay loop... 326.86 BogoMIPS (lpj=1634304)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x20100000 - 0x20100058
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
AT91: PM: standby: standby, suspend: ulp0
clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 186464433812 ns
at_xdmac f0010000.dma-controller: 16 channels, mapped at 0xc4883000
at_xdmac f0004000.dma-controller: 16 channels, mapped at 0xc4885000
AT91: Detected SoC family: sama5d2
AT91: Detected SoC: sama5d27c 64MB SiP, revision 2
VDDANA: supplied by VDDIN_3V3
advref: supplied by VDDANA
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
at91_i2c f8028000.i2c: could not find pctldev for node /ahb/apb/pinctrl@fc038000/i2c0_default, deferring probe
media: Linux media interface: v0.10
Linux video capture interface: v2.00
Advanced Linux Sound Architecture Driver Initialized.
Bluetooth: Core ver 2.22
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
clocksource: Switched to clocksource tcb_clksrc
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
workingset: timestamp_bits=14 max_order=14 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
JFS: nTxBlock = 421, nTxLock = 3375
io scheduler noop registered (default)
pinctrl-at91-pio4 fc038000.pinctrl: atmel pinctrl initialized
[drm] Initialized
brd: module loaded
loop: module loaded
atmel_usart_serial.0.auto: ttyS1 at MMIO 0xf801c000 (irq = 33, base_baud = 5125000) is a ATMEL_SERIAL
atmel_usart_serial.1.auto: ttyS0 at MMIO 0xf8020000 (irq = 34, base_baud = 5125000) is a ATMEL_SERIAL
console [ttyS0] enabled
atmel_usart_serial.2.auto: ttyS2 at MMIO 0xf8024000 (irq = 35, base_baud = 5125000) is a ATMEL_SERIAL
atmel_usart_serial.3.auto: ttyS3 at MMIO 0xfc008000 (irq = 39, base_baud = 5125000) is a ATMEL_SERIAL
atmel_usart_serial.4.auto: ttyS4 at MMIO 0xfc00c000 (irq = 40, base_baud = 5125000) is a ATMEL_SERIAL
atmel_qspi f0024000.spi: mx25l25645g (32768 Kbytes)
7 ofpart partitions found on MTD device f0024000.spi
Creating 7 MTD partitions on "f0024000.spi":
0x000000000000-0x000000006000 : "at91bootstrap"
0x000000006000-0x000000016000 : "bootloader env"
0x000000016000-0x000000096000 : "bootloader"
0x000000096000-0x0000000a6000 : "device tree"
0x0000000a6000-0x0000005a6000 : "kernel"
0x0000005a6000-0x0000019a6000 : "rootfs"
0x0000019a6000-0x000002000000 : "data"
atmel_spi fc018400.spi: DMA TX channel not available, SPI unable to use DMA
atmel_spi fc018400.spi: Atmel SPI Controller using PIO only
atmel_spi fc018400.spi: Using FIFO (16 data)
atmel_spi fc018400.spi: Atmel SPI Controller version 0x311 at 0xfc018400 (irq 178)
libphy: Fixed MDIO Bus: probed
CAN device driver interface
m_can fc050000.can: m_can device registered (irq=48, version=31)
libphy: MACB_mii_bus: probed
random: fast init done
Micrel KSZ8081 or KSZ8091 f8008000.ethernet-ffffffff:07: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=f8008000.ethernet-f)
macb f8008000.ethernet eth0: Cadence GEM rev 0x00020203 at 0xf8008000 irq 28 (80:1f:12:4e:24:9e)
usbcore: registered new interface driver asix
usbcore: registered new interface driver ax88179_178a
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver net1080
usbcore: registered new interface driver cdc_subset
usbcore: registered new interface driver zaurus
usbcore: registered new interface driver sierra_net
usbcore: registered new interface driver cdc_ncm
usbcore: registered new interface driver qmi_wwan
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-atmel: EHCI Atmel driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-atmel: OHCI Atmel driver
at91_ohci 400000.ohci: USB Host Controller
at91_ohci 400000.ohci: new USB bus registered, assigned bus number 1
at91_ohci 400000.ohci: irq 18, io mem 0x00400000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: USB Host Controller
usb usb1: Manufacturer: Linux 4.9.151-linux4sam_5.8+-04814-g499d99b-dirty ohci_hcd
usb usb1: SerialNumber: at91
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver cdc_wdm
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver option
usbserial: USB Serial support registered for GSM modem (1-port)
usbcore: registered new interface driver pl2303
usbserial: USB Serial support registered for pl2303
usbcore: registered new interface driver qcaux
usbserial: USB Serial support registered for qcaux
usbcore: registered new interface driver qcserial
usbserial: USB Serial support registered for Qualcomm USB modem
rtc rtc0: invalid alarm value: 1900-1-1 0:0:0
at91_rtc f80480b0.rtc: rtc core: registered f80480b0.rtc as rtc0
at91_rtc f80480b0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
AT91: Starting after general reset
sama5d4_wdt f8048040.watchdog: initialized (timeout = 16 sec, nowayout = 0)
usbcore: registered new interface driver bfusb
usbcore: registered new interface driver btusb
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
sdhci-at91 a0000000.sdio-host: update clk mul to 39 as gck rate is 480000000 Hz
mmc0: SDHCI controller on a0000000.sdio-host [a0000000.sdio-host] using ADMA
sdhci-at91 b0000000.sdio-host: update clk mul to 39 as gck rate is 480000000 Hz
mmc1: SDHCI controller on b0000000.sdio-host [b0000000.sdio-host] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
atmel_aes f002c000.aes: version: 0x500
atmel_aes f002c000.aes: Atmel AES - Using dma0chan0, dma0chan1 for DMA transfers
atmel_sha f0028000.sha: version: 0x510
atmel_sha f0028000.sha: using dma0chan2 for DMA transfers
atmel_sha f0028000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
atmel_tdes fc044000.tdes: version: 0x703
atmel_tdes fc044000.tdes: using dma0chan3, dma0chan4 for DMA transfers
atmel_tdes fc044000.tdes: Atmel DES/TDES
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
at91-sama5d2_adc fc030000.adc: setting up trigger as external_rising
at91-sama5d2_adc fc030000.adc: version: 800
NET: Registered protocol family 10
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20161123 t)
can: netlink gateway (rev 20130117) max_hops=1
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
Bluetooth: HIDP socket layer initialized
at91_i2c f8028000.i2c: can't get DMA channel, continue without DMA support
at91_i2c f8028000.i2c: Using FIFO (16 data)
at24 0-0050: 256 byte 24c02 EEPROM, writable, 8 bytes/write
at91_i2c f8028000.i2c: AT91 i2c bus driver (hw version: 0x704).
at91_rtc f80480b0.rtc: setting system clock to 2012-01-01 00:00:10 UTC (1325376010)
ALSA device list:
No soundcards found.
atmel_usart_serial atmel_usart_serial.1.auto: using dma0chan5 for rx DMA transfers
atmel_usart_serial atmel_usart_serial.1.auto: using dma0chan6 for tx DMA transfers
VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
starting pid 112, tty '': '/bin/mount -t proc proc /proc'
starting pid 113, tty '': '/bin/mount -t sysfs sysfs /sys'
starting pid 114, tty '': '/bin/mount -t devtmpfs devtmpfs /dev'
mount: mounting devtmpfs on /dev failed: Resource busy
starting pid 115, tty '': '/bin/mount -o remount,rw /'
starting pid 116, tty '': '/bin/mkdir -p /dev/pts'
starting pid 117, tty '': '/bin/mount -t devpts devpts /dev/pts'
starting pid 118, tty '': '/bin/mount -a'
starting pid 119, tty '': '/etc/init.d/rcS'
starting pid 123, tty '/dev/ttyS0': '/sbin/getty 115200 ttyS0'
Poky (Yocto Project Reference Distro) 2.5.2 ruggedboard /dev/ttyS0
ruggedboard login: root
-sh: command: not found
root@ruggedboard:~# RomBOOT
AT91Bootstrap 3.8.12-dirty (Sun Dec 1 22:45:37 IST 2019)
SF: Got Manufacturer and Device ID: c22019
SF: WARNING: can't read above 16MiB
SF: Copy 0x80000 bytes from 0x16000 to 0x22000000
SF: Done to load image
<debug_uart>
U-Boot 2018.07-linux4sam_6.0-00025-g3bff827-dirty (Dec 02 2019 - 01:35:03 +0530)
CPU: SAMA5D27 512M bits DDR2 SDRAM
Crystal frequency: 24 MHz
CPU clock : 492 MHz
Master clock : 164 MHz
DRAM: 64 MiB
MMC: sdio-host@a0000000: 0, sdio-host@b0000000: 1
Loading Environment from SPI Flash... SF: Detected mx25l25645g with page size 256 Bytes, erase size 64 KiB, total 32 MiB
*** Warning - bad CRC, using default environment
Failed (-5)
In: serial@f8020000
Out: serial@f8020000
Err: serial@f8020000
Net: eth0: ethernet@f8008000
Hit any key to stop autoboot: 0
Unknown command 'console=ttyS0,115200' - try 'help'
SF: Detected mx25l25645g with page size 256 Bytes, erase size 64 KiB, total 32 MiB
device 0 offset 0xa6000, size 0x500000
SF: 5242880 bytes @ 0xa6000 Read: OK
device 0 offset 0x96000, size 0x10000
SF: 65536 bytes @ 0x96000 Read: OK
## Flattened Device Tree blob at 21000000
Booting using the fdt blob at 0x21000000
Loading Device Tree to 23b6b000, end 23b763d9 ... OK
Starting kernel ...
Booting Linux on physical CPU 0x0
Linux version 4.9.151-linux4sam_5.8+-04814-g499d99b-dirty (ganesh@phytec) (gcc version 7.3.0 (GCC) ) #3 Wed Jan 29 16:06:33 IST 2020
CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: RUGGED BOARD A5D2X
cma: Failed to reserve 64 MiB
Memory policy: Data cache writeback
CPU: All CPU(s) started in SVC mode.
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 16240
Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mtdblock5 rw rootwait rootfstype=squashfs
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 54004K/65536K available (7168K kernel code, 215K rwdata, 1188K rodata, 1024K init, 220K bss, 11532K reserved, 0K cma-reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xc4800000 - 0xff800000 ( 944 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc0800000 (8160 kB)
.init : 0xc0a00000 - 0xc0b00000 (1024 kB)
.data : 0xc0b00000 - 0xc0b35fc8 ( 216 kB)
.bss : 0xc0b35fc8 - 0xc0b6d208 ( 221 kB)
NR_IRQS:16 nr_irqs:16 16
L2C-310 ID prefetch enabled, offset 2 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 128 kB
L2C-310: CACHE_ID 0x410000c9, AUX_CTRL 0x36020000
clocksource: pit: mask: 0x7ffffff max_cycles: 0x7ffffff, max_idle_ns: 11654027029 ns
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
Console: colour dummy device 80x30
Calibrating delay loop... 326.86 BogoMIPS (lpj=1634304)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x20100000 - 0x20100058
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
AT91: PM: standby: standby, suspend: ulp0
clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 186464433812 ns
at_xdmac f0010000.dma-controller: 16 channels, mapped at 0xc4883000
at_xdmac f0004000.dma-controller: 16 channels, mapped at 0xc4885000
AT91: Detected SoC family: sama5d2
AT91: Detected SoC: sama5d27c 64MB SiP, revision 2
VDDANA: supplied by VDDIN_3V3
advref: supplied by VDDANA
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
at91_i2c f8028000.i2c: could not find pctldev for node /ahb/apb/pinctrl@fc038000/i2c0_default, deferring probe
media: Linux media interface: v0.10
Linux video capture interface: v2.00
Advanced Linux Sound Architecture Driver Initialized.
Bluetooth: Core ver 2.22
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
clocksource: Switched to clocksource tcb_clksrc
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
workingset: timestamp_bits=14 max_order=14 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
JFS: nTxBlock = 421, nTxLock = 3375
io scheduler noop registered (default)
pinctrl-at91-pio4 fc038000.pinctrl: atmel pinctrl initialized
[drm] Initialized
brd: module loaded
loop: module loaded
atmel_usart_serial.0.auto: ttyS1 at MMIO 0xf801c000 (irq = 33, base_baud = 5125000) is a ATMEL_SERIAL
atmel_usart_serial.1.auto: ttyS0 at MMIO 0xf8020000 (irq = 34, base_baud = 5125000) is a ATMEL_SERIAL
console [ttyS0] enabled
atmel_usart_serial.2.auto: ttyS2 at MMIO 0xf8024000 (irq = 35, base_baud = 5125000) is a ATMEL_SERIAL
atmel_usart_serial.3.auto: ttyS3 at MMIO 0xfc008000 (irq = 39, base_baud = 5125000) is a ATMEL_SERIAL
atmel_usart_serial.4.auto: ttyS4 at MMIO 0xfc00c000 (irq = 40, base_baud = 5125000) is a ATMEL_SERIAL
atmel_qspi f0024000.spi: mx25l25645g (32768 Kbytes)
7 ofpart partitions found on MTD device f0024000.spi
Creating 7 MTD partitions on "f0024000.spi":
0x000000000000-0x000000006000 : "at91bootstrap"
0x000000006000-0x000000016000 : "bootloader env"
0x000000016000-0x000000096000 : "bootloader"
0x000000096000-0x0000000a6000 : "device tree"
0x0000000a6000-0x0000005a6000 : "kernel"
0x0000005a6000-0x0000019a6000 : "rootfs"
0x0000019a6000-0x000002000000 : "data"
atmel_spi fc018400.spi: DMA TX channel not available, SPI unable to use DMA
atmel_spi fc018400.spi: Atmel SPI Controller using PIO only
atmel_spi fc018400.spi: Using FIFO (16 data)
atmel_spi fc018400.spi: Atmel SPI Controller version 0x311 at 0xfc018400 (irq 178)
libphy: Fixed MDIO Bus: probed
CAN device driver interface
m_can fc050000.can: m_can device registered (irq=48, version=31)
libphy: MACB_mii_bus: probed
Micrel KSZ8081 or KSZ8091 f8008000.ethernet-ffffffff:07: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=f8008000.ethernet-f)
macb f8008000.ethernet eth0: Cadence GEM rev 0x00020203 at 0xf8008000 irq 28 (80:1f:12:4e:24:9e)
usbcore: registered new interface driver asix
usbcore: registered new interface driver ax88179_178a
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver net1080
usbcore: registered new interface driver cdc_subset
usbcore: registered new interface driver zaurus
usbcore: registered new interface driver sierra_net
usbcore: registered new interface driver cdc_ncm
usbcore: registered new interface driver qmi_wwan
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-atmel: EHCI Atmel driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-atmel: OHCI Atmel driver
at91_ohci 400000.ohci: USB Host Controller
at91_ohci 400000.ohci: new USB bus registered, assigned bus number 1
at91_ohci 400000.ohci: irq 18, io mem 0x00400000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: USB Host Controller
usb usb1: Manufacturer: Linux 4.9.151-linux4sam_5.8+-04814-g499d99b-dirty ohci_hcd
usb usb1: SerialNumber: at91
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver cdc_wdm
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver option
usbserial: USB Serial support registered for GSM modem (1-port)
usbcore: registered new interface driver pl2303
usbserial: USB Serial support registered for pl2303
usbcore: registered new interface driver qcaux
usbserial: USB Serial support registered for qcaux
usbcore: registered new interface driver qcserial
usbserial: USB Serial support registered for Qualcomm USB modem
rtc rtc0: invalid alarm value: 1900-1-1 0:0:0
at91_rtc f80480b0.rtc: rtc core: registered f80480b0.rtc as rtc0
at91_rtc f80480b0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
AT91: Starting after user reset
sama5d4_wdt f8048040.watchdog: initialized (timeout = 16 sec, nowayout = 0)
usbcore: registered new interface driver bfusb
usbcore: registered new interface driver btusb
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
sdhci-at91 a0000000.sdio-host: update clk mul to 39 as gck rate is 480000000 Hz
mmc0: SDHCI controller on a0000000.sdio-host [a0000000.sdio-host] using ADMA
sdhci-at91 b0000000.sdio-host: update clk mul to 39 as gck rate is 480000000 Hz
random: fast init done
mmc1: SDHCI controller on b0000000.sdio-host [b0000000.sdio-host] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
atmel_aes f002c000.aes: version: 0x500
atmel_aes f002c000.aes: Atmel AES - Using dma0chan0, dma0chan1 for DMA transfers
atmel_sha f0028000.sha: version: 0x510
atmel_sha f0028000.sha: using dma0chan2 for DMA transfers
atmel_sha f0028000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
atmel_tdes fc044000.tdes: version: 0x703
atmel_tdes fc044000.tdes: using dma0chan3, dma0chan4 for DMA transfers
atmel_tdes fc044000.tdes: Atmel DES/TDES
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
at91-sama5d2_adc fc030000.adc: setting up trigger as external_rising
at91-sama5d2_adc fc030000.adc: version: 800
NET: Registered protocol family 10
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20161123 t)
can: netlink gateway (rev 20130117) max_hops=1
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
Bluetooth: HIDP socket layer initialized
at91_i2c f8028000.i2c: can't get DMA channel, continue without DMA support
at91_i2c f8028000.i2c: Using FIFO (16 data)
at24 0-0050: 256 byte 24c02 EEPROM, writable, 8 bytes/write
at91_i2c f8028000.i2c: AT91 i2c bus driver (hw version: 0x704).
at91_rtc f80480b0.rtc: setting system clock to 2012-01-01 00:00:29 UTC (1325376029)
ALSA device list:
No soundcards found.
atmel_usart_serial atmel_usart_serial.1.auto: using dma0chan5 for rx DMA transfers
atmel_usart_serial atmel_usart_serial.1.auto: using dma0chan6 for tx DMA transfers
VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
starting pid 112, tty '': '/bin/mount -t proc proc /proc'
starting pid 113, tty '': '/bin/mount -t sysfs sysfs /sys'
starting pid 114, tty '': '/bin/mount -t devtmpfs devtmpfs /dev'
mount: mounting devtmpfs on /dev failed: Resource busy
starting pid 115, tty '': '/bin/mount -o remount,rw /'
starting pid 116, tty '': '/bin/mkdir -p /dev/pts'
starting pid 117, tty '': '/bin/mount -t devpts devpts /dev/pts'
starting pid 118, tty '': '/bin/mount -a'
starting pid 119, tty '': '/etc/init.d/rcS'
starting pid 123, tty '/dev/ttyS0': '/sbin/getty 115200 ttyS0'
Poky (Yocto Project Reference Distro) 2.5.2 ruggedboard /dev/ttyS0
ruggedboard login: root
-sh: command: not found
root@ruggedboard:~#
Description
To test the RS485/UART Device functionality using two boards.
Required Hardware
RS485 Phy should be mounted on Board.
Patch cords
Prerequisite
PinMuxing for uart signals should be done in Board file.
Uart pins should be available in Expansion.
Test Case 1(Test RS485 with 2 boards)
Boot the board from NOR/MMC.
check the Device nodes are available or not in /dev by using below command
$ ls /dev/ttyS2
Take two boards in two different terminals and open microcom with the respective node and read and write to the node, connect the Rx and Tx pins of uart2 of board1 to Rx and Tx pins of uart2 of board2.
Type the Tx command in one terminal and Rx command in another terminal.Those Rx and Tx commands are given below
Board1_TX:
microcom -s 115200 /dev/ttyS2
Board2_RX:
microcom -s 115200 /dev/ttyS2
Expected o/p
ruggedboard-a5d2x login: root
-sh: command: not found
root@ruggedboard-a5d2x:~# ls /dev/ttyS
ttyS0 ttyS1 ttyS2 ttyS3 ttyS4
root@ruggedboard-a5d2x:~# ls /dev/ttyS2
Board1_Tx:
root@ruggedboard-a5d2x:~# microcom -s 115200 /dev/ttyS2
atmel_usart_serial atmel_usart_serial.2.auto: using dma0chan7 for rx DMA transfers
atmel_usart_serial atmel_usart_serial.2.auto: using dma0chan8 for tx DMA transfers
Board2_Rx:
root@ruggedboard-a5d2x:~# microcom -s 115200 /dev/ttyS2
atmel_usart_serial atmel_usart_serial.2.auto: using dma0chan7 for rx DMA transfers
atmel_usart_serial atmel_usart_serial.2.auto: using dma0chan8 for tx DMA transfers
Good Morning!!!
Description
To test the microbus sensor tag on carrier board
Required Hardware
phyCORE-A5d2x System on Module
phyCORE-A5d2 Rugged Board
USB cable
Microbus Sensor Tag
Step-by-step guide
Connect the microbus sensor connector to M1 connector
Boot the board with Sdcard or NOR
Run the below programs in after the board booting.
vi lsm6sdl.py
from __future__ import print_function
import time, sys, atexit
from upm import pyupm_lsm6dsl as sensorObj
def main():
# Instantiate a BMP250E instance using default i2c bus and address
sensor = sensorObj.LSM6DSL(2,0x6b,-1)
# For SPI, bus 0, you would pass -1 as the address, and a valid pin for CS:
#LSM6DSL(0, -1, 10);
# now output data every 250 milliseconds
while (1):
sensor.update()
data = sensor.getAccelerometer()
print("Accelerometer x:", data[0], end=' ')
print(" y:", data[1], end=' ')
print(" z:", data[2], end=' ')
print(" g")
data = sensor.getGyroscope()
print("Gyroscope x:", data[0], end=' ')
print(" y:", data[1], end=' ')
print(" z:", data[2], end=' ')
print(" dps")
# we show both C and F for temperature
print("Compensation Temperature:", sensor.getTemperature(), "C /", end=' ')
print(sensor.getTemperature(True), "F")
print()
time.sleep(.250)
if __name__ == '__main__':
main()
vi mcp9808.py
#!/usr/bin/env python
from __future__ import print_function
import time, sys, atexit
from upm import pyupm_mcp9808 as MCP9808
def main():
# Instantiate the Infrared-Thermopile Sensor on I2C on bus 1
mySensor = MCP9808.MCP9808(2,0x18)
while(1):
print("Temperature : "+str(mySensor.getTemp()))
time.sleep(.5)
# Print out temperature value and config-reg in hex every 0.5 seconds
if __name__ == '__main__':
main()
vi bme280.py
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
from __future__ import print_function
import time, sys,atexit
from upm import pyupm_bmp280 as sensorObj
def main():
# Instantiate a BME280 instance using default i2c bus and address
sensor = sensorObj.BME280(2,0x76,-1)
# For SPI, bus 0, you would pass -1 as the address, and a valid pin for CS:
#BME280(3, -1, 60)
while (1):
sensor.update()
print("Compensation Temperature:", sensor.getTemperature(), "C /", end=' ')
print(sensor.getTemperature(True), "F")
print("Pressure: ", sensor.getPressure(), "Pa")
print("Computed Altitude:", sensor.getAltitude(), "m")
print("Humidity:", sensor.getHumidity(), "%RH")
print()
time.sleep(1)
if __name__ == '__main__':
main()
To get the temparature reading please give the below commands
$python3 mcp9808.py
To get the prassure,humadity and computed Altitude readings,please give the below command
$python3 bme280.py
To get the 3D Accelerometer and 3D Gyroscope sensor readings please give the below commands.
$python3 lsm6dsl.py
Expected Output
root@ruggedboard-a5d2x:/mnt# python3 bme280.py
random: python3: uninitialized urandom read (24 bytes read)
libmraa[128]: libmraa version v2.0.0 initialised by user 'root' with EUID 0
libmraa[128]: gpio: platform doesn't support chardev, falling back to sysfs
libmraa[128]: libmraa initialised for platform 'Atmel SAMA5' of type 20
libmraa[128]: i2c_init: Selected bus 2
Compensation Temperature: 24.940000534057617 C /
Pressure: 68838.75 Pa
Computed Altitude: 3142.17626953125 m
Humidity: 24.5361328125 %RH
Compensation Temperature: 30.420000076293945 C /
Pressure: 91305.078125 Pa
Computed Altitude: 869.25738525390625 m
Humidity: 32.8759765625 %RH
Compensation Temperature: 30.540000915527344 C /
Pressure: 91306.65625 Pa
Computed Altitude: 869.114501953125 m
Humidity: 32.875 %RH
Compensation Temperature: 30.579999923706055 C /
Pressure: 91308.1875 Pa
Computed Altitude: 868.97589111328125 m
Humidity: 32.8681640625 %RH
^CTraceback (most recent call last):
File "bme280.py", line 37, in <module>
main()
File "bme280.py", line 34, in main
time.sleep(1)
root@ruggedboard-a5d2x:/mnt# python3 mcp9808.py
libmraa[130]: libmraa version v2.0.0 initialised by user 'root' with EUID 0
libmraa[130]: gpio: platform doesn't support chardev, falling back to sysfs
libmraa[130]: libmraa initialised for platform 'Atmel SAMA5' of type 20
libmraa[130]: i2c_init: Selected bus 2
libmraa[130]: MCP9808: I2c.frequency(I2C_FAST) failed, using default speed
Temperature : 30.625
Temperature : 30.5625
Temperature : 30.625
Temperature : 30.5625
Temperature : 30.625
Temperature : 30.625
Temperature : 30.6875
Temperature : 30.8125
Temperature : 30.875
Temperature : 30.9375
Temperature : 30.875
Temperature : 30.9375
Temperature : 31.0
Temperature : 31.0625
Temperature : 31.4375
Temperature : 31.625
Temperature : 32.3125
Temperature : 32.8125
Temperature : 32.875
Temperature : 32.875
Temperature : 32.875
Temperature : 32.9375
Temperature : 32.6875
Temperature : 32.5
Temperature : 32.375
^CTraceback (most recent call last):
File "mcp9808.py", line 20, in <module>
main()
File "mcp9808.py", line 15, in main
time.sleep(.5)
root@ruggedboard-a5d2x:~# python3 lsm6dsl.py
random: python3: uninitialized urandom read (24 bytes read)
libmraa[130]: libmraa version v2.0.0 initialised by user 'root' with EUID 0
libmraa[130]: gpio: platform doesn't support chardev, falling back to sysfs
libmraa[130]: libmraa initialised for platform 'Atmel SAMA5' of type 20
libmraa[130]: i2c_init: Selected bus 2
Accelerometer x: 0.71211403608322144 y: -0.58724701404571533 z: 0.42596301436424255 g
Gyroscope x: -0.21500000357627869 y: -0.21600000560283661 z: -0.10999999940395355 dps
Compensation Temperature: 25.004379272460938 C / 77.007881164550781 F
Accelerometer x: 0.29932698607444763 y: -0.39009499549865723 z: 0.83008801937103271 g
Gyroscope x: 17.12299919128418 y: 27.13599967956543 z: -0.41499999165534973 dps
Compensation Temperature: 25.004364013671875 C / 77.007858276367188 F
Accelerometer x: -0.36465799808502197 y: 0.0088450005277991295 z: 0.91768401861190796 g
Gyroscope x: 7.1449999809265137 y: 10.666999816894531 z: 1.0060000419616699 dps
Compensation Temperature: 25.004364013671875 C / 77.007858276367188 F
Accelerometer x: -0.63769400119781494 y: 0.11248400062322617 z: 0.92195403575897217 g
Gyroscope x: 2.4489998817443848 y: 5.2210001945495605 z: 0.60399997234344482 dps
Compensation Temperature: 25.004409790039062 C / 77.0079345703125 F
Accelerometer x: -0.058072000741958618 y: -0.77482199668884277 z: 0.63135004043579102 g
Gyroscope x: -1.9639999866485596 y: -0.60199999809265137 z: -0.40400001406669617 dps
Compensation Temperature: 25.004318237304688 C / 77.007774353027344 F
Accelerometer x: 0.47494602203369141 y: -0.7088809609413147 z: 0.43212398886680603 g
Gyroscope x: -3.7339999675750732 y: -14.078000068664551 z: -9.0010004043579102 dps
Compensation Temperature: 25.004531860351562 C / 77.008155822753906 F
Accelerometer x: 0.79263401031494141 y: -0.56644600629806519 z: 0.40717500448226929 g
Gyroscope x: 0.36000001430511475 y: -1.3760000467300415 z: -1.3530000448226929 dps
Compensation Temperature: 25.004531860351562 C / 77.008155822753906 F
Accelerometer x: 0.87199497222900391 y: -0.51355904340744019 z: 0.055936999619007111 g
Gyroscope x: -0.62999999523162842 y: 0.032999999821186066 z: -0.7160000205039978 dps
Compensation Temperature: 25.004501342773438 C / 77.008102416992188 F
^CTraceback (most recent call last):
File "lsm6dsl.py", line 37, in <module>
main()
File "lsm6dsl.py", line 34, in main
time.sleep(.250)
Description
To test the SOM health LED on carrier board SOM.
Required Hardware
phyCORE-A5d2x System on Module
phyCORE-A5d2 Rugged Board
USB cable
Step-by-step guide
Boot the board from NOR/MMC. After booting check whether green led is blinking on som Module.
Expected Output
LED is blinking on som Module in green colour.
Description
To test the spi with loop back in carrier board
Required Hardware
phyCORE-A5d2x System on Module
phyCORE-A5d2 Rugged Board
USB cable
Patch cable
Step-by-step guide
Boot the board and check the spidev3.0 present or not.Please follow the below command.
$ cd /dev/
$ ls
Short the miso (5th pin of microbus connector) and mosi (6th pin of microbus connector) pins with patch card.
Cross compile the below code with ruged board sdk.
/*
* SPI testing utility (using spidev driver)
*
* Copyright (c) 2007 MontaVista Software, Inc.
* Copyright (c) 2007 Anton Vorontsov <avorontsov@ru.mvista.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License.
*
* Cross-compile with cross-gcc -I/path/to/cross-kernel/include
*/
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/ioctl.h>
#include <sys/stat.h>
#include <linux/types.h>
#include <linux/spi/spidev.h>
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
static void pabort(const char *s)
{
perror(s);
abort();
}
static const char *device = "/dev/spidev1.1";
static uint32_t mode;
static uint8_t bits = 8;
static char *input_file;
static char *output_file;
static uint32_t speed = 500000;
static uint16_t delay;
static int verbose;
uint8_t default_tx[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x40, 0x00, 0x00, 0x00, 0x00, 0x95,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x0D,
};
uint8_t default_rx[ARRAY_SIZE(default_tx)] = {0, };
char *input_tx;
static void hex_dump(const void *src, size_t length, size_t line_size,
char *prefix)
{
int i = 0;
const unsigned char *address = src;
const unsigned char *line = address;
unsigned char c;
printf("%s | ", prefix);
while (length-- > 0) {
printf("%02X ", *address++);
if (!(++i % line_size) || (length == 0 && i % line_size)) {
if (length == 0) {
while (i++ % line_size)
printf("__ ");
}
printf(" | "); /* right close */
while (line < address) {
c = *line++;
printf("%c", (c < 33 || c == 255) ? 0x2E : c);
}
printf("\n");
if (length > 0)
printf("%s | ", prefix);
}
}
}
/*
* Unescape - process hexadecimal escape character
* converts shell input "\x23" -> 0x23
*/
static int unescape(char *_dst, char *_src, size_t len)
{
int ret = 0;
int match;
char *src = _src;
char *dst = _dst;
unsigned int ch;
while (*src) {
if (*src == '\\' && *(src+1) == 'x') {
match = sscanf(src + 2, "%2x", &ch);
if (!match)
pabort("malformed input string");
src += 4;
*dst++ = (unsigned char)ch;
} else {
*dst++ = *src++;
}
ret++;
}
return ret;
}
static void transfer(int fd, uint8_t const *tx, uint8_t const *rx, size_t len)
{
int ret;
int out_fd;
struct spi_ioc_transfer tr = {
.tx_buf = (unsigned long)tx,
.rx_buf = (unsigned long)rx,
.len = len,
.delay_usecs = delay,
.speed_hz = speed,
.bits_per_word = bits,
};
if (mode & SPI_TX_QUAD)
tr.tx_nbits = 4;
else if (mode & SPI_TX_DUAL)
tr.tx_nbits = 2;
if (mode & SPI_RX_QUAD)
tr.rx_nbits = 4;
else if (mode & SPI_RX_DUAL)
tr.rx_nbits = 2;
if (!(mode & SPI_LOOP)) {
if (mode & (SPI_TX_QUAD | SPI_TX_DUAL))
tr.rx_buf = 0;
else if (mode & (SPI_RX_QUAD | SPI_RX_DUAL))
tr.tx_buf = 0;
}
ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
if (ret < 1)
pabort("can't send spi message");
if (verbose)
hex_dump(tx, len, 32, "TX");
if (output_file) {
out_fd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (out_fd < 0)
pabort("could not open output file");
ret = write(out_fd, rx, len);
if (ret != len)
pabort("not all bytes written to output file");
close(out_fd);
}
if (verbose || !output_file)
hex_dump(rx, len, 32, "RX");
}
static void print_usage(const char *prog)
{
printf("Usage: %s [-DsbdlHOLC3]\n", prog);
puts(" -D --device device to use (default /dev/spidev1.1)\n"
" -s --speed max speed (Hz)\n"
" -d --delay delay (usec)\n"
" -b --bpw bits per word\n"
" -i --input input data from a file (e.g. \"test.bin\")\n"
" -o --output output data to a file (e.g. \"results.bin\")\n"
" -l --loop loopback\n"
" -H --cpha clock phase\n"
" -O --cpol clock polarity\n"
" -L --lsb least significant bit first\n"
" -C --cs-high chip select active high\n"
" -3 --3wire SI/SO signals shared\n"
" -v --verbose Verbose (show tx buffer)\n"
" -p Send data (e.g. \"1234\\xde\\xad\")\n"
" -N --no-cs no chip select\n"
" -R --ready slave pulls low to pause\n"
" -2 --dual dual transfer\n"
" -4 --quad quad transfer\n");
exit(1);
}
static void parse_opts(int argc, char *argv[])
{
while (1) {
static const struct option lopts[] = {
{ "device", 1, 0, 'D' },
{ "speed", 1, 0, 's' },
{ "delay", 1, 0, 'd' },
{ "bpw", 1, 0, 'b' },
{ "input", 1, 0, 'i' },
{ "output", 1, 0, 'o' },
{ "loop", 0, 0, 'l' },
{ "cpha", 0, 0, 'H' },
{ "cpol", 0, 0, 'O' },
{ "lsb", 0, 0, 'L' },
{ "cs-high", 0, 0, 'C' },
{ "3wire", 0, 0, '3' },
{ "no-cs", 0, 0, 'N' },
{ "ready", 0, 0, 'R' },
{ "dual", 0, 0, '2' },
{ "verbose", 0, 0, 'v' },
{ "quad", 0, 0, '4' },
{ NULL, 0, 0, 0 },
};
int c;
c = getopt_long(argc, argv, "D:s:d:b:i:o:lHOLC3NR24p:v",
lopts, NULL);
if (c == -1)
break;
switch (c) {
case 'D':
device = optarg;
break;
case 's':
speed = atoi(optarg);
break;
case 'd':
delay = atoi(optarg);
break;
case 'b':
bits = atoi(optarg);
break;
case 'i':
input_file = optarg;
break;
case 'o':
output_file = optarg;
break;
case 'l':
mode |= SPI_LOOP;
break;
case 'H':
mode |= SPI_CPHA;
break;
case 'O':
mode |= SPI_CPOL;
break;
case 'L':
mode |= SPI_LSB_FIRST;
break;
case 'C':
mode |= SPI_CS_HIGH;
break;
case '3':
mode |= SPI_3WIRE;
break;
case 'N':
mode |= SPI_NO_CS;
break;
case 'v':
verbose = 1;
break;
case 'R':
mode |= SPI_READY;
break;
case 'p':
input_tx = optarg;
break;
case '2':
mode |= SPI_TX_DUAL;
break;
case '4':
mode |= SPI_TX_QUAD;
break;
default:
print_usage(argv[0]);
break;
}
}
if (mode & SPI_LOOP) {
if (mode & SPI_TX_DUAL)
mode |= SPI_RX_DUAL;
if (mode & SPI_TX_QUAD)
mode |= SPI_RX_QUAD;
}
}
static void transfer_escaped_string(int fd, char *str)
{
size_t size = strlen(str);
uint8_t *tx;
uint8_t *rx;
tx = malloc(size);
if (!tx)
pabort("can't allocate tx buffer");
rx = malloc(size);
if (!rx)
pabort("can't allocate rx buffer");
size = unescape((char *)tx, str, size);
transfer(fd, tx, rx, size);
free(rx);
free(tx);
}
static void transfer_file(int fd, char *filename)
{
ssize_t bytes;
struct stat sb;
int tx_fd;
uint8_t *tx;
uint8_t *rx;
if (stat(filename, &sb) == -1)
pabort("can't stat input file");
tx_fd = open(filename, O_RDONLY);
if (fd < 0)
pabort("can't open input file");
tx = malloc(sb.st_size);
if (!tx)
pabort("can't allocate tx buffer");
rx = malloc(sb.st_size);
if (!rx)
pabort("can't allocate rx buffer");
bytes = read(tx_fd, tx, sb.st_size);
if (bytes != sb.st_size)
pabort("failed to read input file");
transfer(fd, tx, rx, sb.st_size);
free(rx);
free(tx);
close(tx_fd);
}
int main(int argc, char *argv[])
{
int ret = 0;
int fd;
parse_opts(argc, argv);
fd = open(device, O_RDWR);
if (fd < 0)
pabort("can't open device");
/*
* spi mode
*/
ret = ioctl(fd, SPI_IOC_WR_MODE32, &mode);
if (ret == -1)
pabort("can't set spi mode");
ret = ioctl(fd, SPI_IOC_RD_MODE32, &mode);
if (ret == -1)
pabort("can't get spi mode");
/*
* bits per word
*/
ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits);
if (ret == -1)
pabort("can't set bits per word");
ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits);
if (ret == -1)
pabort("can't get bits per word");
/*
* max speed hz
*/
ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed);
if (ret == -1)
pabort("can't set max speed hz");
ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed);
if (ret == -1)
pabort("can't get max speed hz");
printf("spi mode: 0x%x\n", mode);
printf("bits per word: %d\n", bits);
printf("max speed: %d Hz (%d KHz)\n", speed, speed/1000);
if (input_tx && input_file)
pabort("only one of -p and --input may be selected");
if (input_tx)
transfer_escaped_string(fd, input_tx);
else if (input_file)
transfer_file(fd, input_file);
else
transfer(fd, default_tx, default_rx, sizeof(default_tx));
close(fd);
return ret;
}
After cross compiling above code copy the binary into your carrier board.
Please run the the binary with below command
./spidevbinary -D /dev/spidev3.0
Expected Output
root@rugged-board-a5d2x:~# ./spidevbinary -D /dev/spidev3.0
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
RX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@....�..................�.
Description
To test the USER LED's functionality in Kernel whether they are toggling.
Required Hardware
-NA-
Test Case 1 (Toggle the Respective led’s observe LED's weather glow Or not)
Boot the board from NOR/MMC. After booting check toggling of USER LEDs
$ echo <gpiono> sys/class/gpio/export
$ echo out > /sys/class/gpio/<gpiopinno>/direction
$ echo 1 > /sys/class/gpio/<gpiopinno>/value
$ echo 0 > /sys/class/gpio/<gpiopinno>/value
Expected o/p
root@ruggedboard-a5d2x:~# echo 77 > /sys/class/gpio/export
root@ruggedboard-a5d2x:~# echo out > /sys/class/gpio/PC13/direction
root@ruggedboard-a5d2x:~# echo 1 > /sys/class/gpio/PC13/value
root@ruggedboard-a5d2x:~# echo 0 > /sys/class/gpio/PC13/value
root@ruggedboard:~# echo 81 > /sys/class/gpio/export
root@ruggedboard:~# echo out > /sys/class/gpio/PC17/direction
root@ruggedboard:~# echo 1 > /sys/class/gpio/PC17/value
root@ruggedboard:~# echo 0 > /sys/class/gpio/PC17/value
root@ruggedboard:~# echo 83 > /sys/class/gpio/export
root@ruggedboard:~# echo out > /sys/class/gpio/PC19/direction
root@ruggedboard:~# echo 1 > /sys/class/gpio/PC19/value
root@ruggedboard:~# echo 0 > /sys/class/gpio/PC19/value
Description
To test the USER Switch functionality in Kernel with application.
Required Hardware
-NA-
Test Case 1(Test with Application)
Boot the board from NOR/MMC. After booting run the application and check USER Switch
Expected o/p
root@ruggedboard-a5d2x:~# ./btngpio
libmraa[138]: libmraa version v2.0.0 initialised by user 'root' with EUID 0
libmraa[138]: gpio: platform doesn't support chardev, falling back to sysfs
libmraa[138]: libmraa initialised for platform 'Atmel SAMA5' of type 20
gpio 83
gpio pin 83
gpio 76
gpio pin 76
STATUS = 1..
LED ON
STATUS = 1..
LED ON
STATUS = 1..
LED ON
STATUS = 0..
LED OFF
STATUS = 1..
LED ON
STATUS = 1..
LED ON
STATUS = 1..
LED ON
Description
To test the wifi on carrier board
Required Hardware
phyCORE-A5d2x System on Module
phyCORE-A5d2 Rugged Board
USB cable
WIFi module
Step-by-step guide
Boot the board give the below command
$ modprobe wilc-sdio
Create the wpa_supplicant.conf file in mnt partition. Please follow the below command to create file in mnt partition.
$ vi /mnt/wpa_supplicant.conf
Write the below content in above file.
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
network={
ssid="PHYTEC_777VR1"
proto=WPA2
key_mgmt=WPA-PSK
psk="777vr1@phytec"
}
Give the wifi name in above file in place of PHYTEC_777VR1.
Give the password of your wifi in place of 777vr1@phytec.
Give the below command to connect the wifi network.
$ wpa_supplicant -B -Dnl80211 -i wlan0 -c /mnt/wpa_supplicant.conf
Give the below command to assign the ip address to wifi node.
$udhcpc -i wlan0
To test the internet give the below command.
$ping google.com
Expected Output
root@sama5d27-som1-ek-sd:~#
root@sama5d27-som1-ek-sd:~# dmesg | grep mmc
Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk1p2 rw rootwait
mmc0: SDHCI controller on a0000000.sdio-host [a0000000.sdio-host] using ADMA
mmc0: new high speed SDIO card at address 0001
mmc1: SDHCI controller on b0000000.sdio-host [b0000000.sdio-host] using ADMA
mmc1: Problem switching card into high-speed mode!
mmc1: new SDHC card at address 0001
mmcblk1: mmc1:0001 SD 7.44 GiB
mmcblk1: p1 p2
EXT4-fs (mmcblk1p2): mounting ext3 file system using the ext4 subsystem
EXT4-fs (mmcblk1p2): recovery complete
EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
EXT4-fs (mmcblk1p2): re-mounted. Opts: data=ordered
root@sama5d27-som1-ek-sd:~#
root@sama5d27-som1-ek-sd:~#
root@sama5d27-som1-ek-sd:~# modprobe wilc-sdio
wilc_sdio: module is from the staging directory, the quality is unknown, you have been warned.
Registering wifi device
Max scan ids= 10,Max scan IE len= 1000,Signal Type= 1,Interface Modes= 844
Initializing Locks ...
wifi_pm : 0
wilc_sdio mmc0:0001:1: failed to get Reset GPIO, try default
wifi_pm : 1
wilc_sdio mmc0:0001:1: failed to get Reset GPIO, try default
wilc_sdio mmc0:0001:1: Driver Initializing success
root@sama5d27-som1-ek-sd:~# cat wifi.sh
ifconfig eth0 down
ifconfig wlan0 down
ifconfig wlan0 192.168.0.15
root@sama5d27-som1-ek-sd:~# wpa_supplicant -B -Dnl80211 -i wlan0 -c /mnt/wpa_supplicant.conf
Successfully initialized wpa_supplicant
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mgmt_frame_register]Return since mac is closed
rfkill: winnot open RFKILL control devicelc_sdio mmc0:0001:1 wlan0: INFO [wilc_mac_open]MAC OPEN[c2358000] wlan0
WILC POWER UP
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_init_host_int]Host[c2358000][c2359460]
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mac_open]*** re-init ***
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_wlan_init]Initializing WILC_Wlan
wilc_sdio mmc0:0001:1: SDIO speed: 50000000
wilc_sdio mmc0:0001:1: chipid 003000d0
wilc_sdio mmc0:0001:1 wlan0: INFO [init_chip]Bootrom sts = d
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_wlan_initialize]WILC Initialization done
wilc_sdio mmc0:0001:1 wlan0: INFO [wlan_initialize_threads]Initializing Threads ...
wilc_sdio mmc0:0001:1 wlan0: INFO [wlan_initialize_threads]Creating kthread for transmission
wilc_sdio mmc0:0001:1 wlan0: INFO [wlan_initialize_threads]Creating kthread for Debugging
wilc_sdio mmc0:0001:1: failed to get IRQ GPIO, load default
wilc_sdio mmc0:0001:1 wlan0: INFO [init_irq]IRQ request succeeded IRQ-NUM= 139
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_wlan_get_firmware]Detect chip WILC3000
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_wlan_get_firmware]loading firmware mchp/wilc3000_wifi_firmware.bin
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_wlan_get_firmware]WLAN firmware: mchp/wilc3000_wifi_firmware.bin
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_firmware_download]Downloading Firmware ...
wilc_wlan_firmware_downloadDownloading firmware size = 136336
wilc_wlan_firmware_download Offset = 119508
wilc_wlan_firmware_download Offset = 136336
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_firmware_download]Download Succeeded
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_start_firmware]Starting Firmware ...
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_start_firmware]Waiting for FW to get ready ...
cfg_indicate_rx: Info message received
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_start_firmware]Firmware successfully started
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_wlan_initialize]WILC Firmware Ver = WILC_WIFI_FW_REL_15_3 Build: 11616
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_init_fw_config]Start configuring Firmware
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_mac_open]Mac address: f8:f0:05:d9:38:74
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_set_multicast_list]Setting mcast List with count = 1.
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_set_multicast_list]Entry[0]: 33:33:00:00:00:01
wilc_sdio mmc0:0001:1 wlan0: INFO [set_power_mgmt]dev [wlan0]
wilc_sdio mmc0:0001:1 wlan0: INFO [set_power_mgmt] Power save Enabled= 1 , TimeOut = -1
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_set_multicast_list]Setting mcast List with count = 2.
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_set_multicast_list]Entry[0]: 33:33:00:00:00:01
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_set_multicast_list]Entry[1]: 01:00:5e:00:00:01
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_set_multicast_list]Setting mcast List with count = 3.
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_set_multicast_list]Entry[0]: 33:33:00:00:00:01
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_set_multicast_list]Entry[1]: 01:00:5e:00:00:01
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_set_multicast_list]Entry[2]: 33:33:ff:d9:38:74
wilc_sdio mmc0:0001:1 wlan0: INFO [flush_pmksa]Flushing PMKID key values
root@sama5d27-som1-ek-sd:~# wilc_sdio mmc0:0001:1 wlan0: INFO [scan]Requested num of channel 14
wilc_sdio mmc0:0001:1 wlan0: INFO [scan]Scan Request IE len = 126
wilc_sdio mmc0:0001:1 wlan0: INFO [scan]Number of SSIDs 1
wilc_sdio mmc0:0001:1 wlan0: INFO [scan]Trigger Scan Request
cfg_indicate_rx: Scan Notification Received
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_scan_complete_received]Scan notification received
wilc_sdio mmc0:0001:1 wlan0: INFO [cfg_scan_result]Scan Done[c2358000]
wilc_sdio mmc0:0001:1 wlan0: INFO [connect]Connecting to SSID [test] on netdev [c2358000] host if [c3d9ce00]
wilc_sdio mmc0:0001:1 wlan0: INFO [connect]Adding key with cipher group fac04
wilc_sdio mmc0:0001:1 wlan0: INFO [connect]Authentication Type = 0
wilc_sdio mmc0:0001:1 wlan0: INFO [connect]In OPEN SYSTEM
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_wlan_set_bssid]set bssid [d8:32:e3:34:8f:86]
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_send_connect_wid]send HOST_IF_WAITING_CONN_RESP
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_send_connect_wid]set HOST_IF_WAITING_CONN_RESP
cfg_indicate_rx: Info message received
wilc_sdio mmc0:0001:1 wlan0: INFO [handle_rcvd_gnrl_async_info]Current State = 3,Received state = 1
wilc_sdio mmc0:0001:1 wlan0: INFO [cfg_connect_result]Connection response received=1 connect_stat[0]
wilc_sdio mmc0:0001:1 wlan0: INFO [cfg_connect_result]Connection Successful: BSSID: d832e3348f86
wilc_sdio mmc0:0001:1 wlan0: INFO [cfg_connect_result]Association request info elements length = 22
wilc_sdio mmc0:0001:1 wlan0: INFO [cfg_connect_result]Association response info elements length = 97
NOHZ: local_softirq_pending 08
wilc_sdio mmc0:0001:1 wlan0: INFO [add_key]Adding key with cipher suite = fac04
wilc_sdio mmc0:0001:1 wlan0: INFO [add_key]c3d8a180 c2358000 0
wilc_sdio mmc0:0001:1 wlan0: INFO [add_key]key 68 f1 36
wilc_sdio mmc0:0001:1 wlan0: INFO [add_key]Adding key with cipher suite = fac04
wilc_sdio mmc0:0001:1 wlan0: INFO [add_key]c3d8a180 c2358000 1
wilc_sdio mmc0:0001:1 wlan0: INFO [add_key]key 29 ce 65
root@sama5d27-som1-ek-sd:~#
root@sama5d27-som1-ek-sd:~#
root@sama5d27-som1-ek-sd:~# udhcpc -i wlan0
udhcpc: started, v1.27.2
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_set_multicast_list]Setting mcast List with count = 2.
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_set_multicast_list]Entry[0]: 33:33:00:00:00:01
wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_set_multicast_list]Entry[1]: 01:00:5e:00:00:01
udhcpc: sending discover
udhcpc: sending select for 192.168.43.83
udhcpc: lease of 192.168.43.83 obtained, lease time 3600
/etc/udhcpc.d/50default: Adding DNS 192.168.43.1
root@sama5d27-som1-ek-sd:~#
root@sama5d27-som1-ek-sd:~#
root@sama5d27-som1-ek-sd:~#
root@sama5d27-som1-ek-sd:~#
root@sama5d27-som1-ek-sd:~# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr f8:f0:05:d9:38:74
inet addr:192.168.43.83 Bcast:192.168.43.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1126 (1.0 KiB) TX bytes:1964 (1.9 KiB)
root@sama5d27-som1-ek-sd:~# ping google.com
PING google.com (172.217.26.206): 56 data bytes
64 bytes from 172.217.26.206: seq=0 ttl=54 time=40.510 ms
64 bytes from 172.217.26.206: seq=1 ttl=54 time=40.565 ms
64 bytes from 172.217.26.206: seq=2 ttl=54 time=50.549 ms
64 bytes from 172.217.26.206: seq=3 ttl=54 time=42.379 ms
64 bytes from 172.217.26.206: seq=4 ttl=54 time=56.464 ms
64 bytes from 172.217.26.206: seq=5 ttl=54 time=189.331 ms
64 bytes from 172.217.26.206: seq=6 ttl=54 time=41.802 ms
64 bytes from 172.217.26.206: seq=7 ttl=54 time=36.771 ms
64 bytes from 172.217.26.206: seq=8 ttl=54 time=65.930 ms
64 bytes from 172.217.26.206: seq=9 ttl=54 time=42.998 ms
64 bytes from 172.217.26.206: seq=10 ttl=54 time=55.471 ms
64 bytes from 172.217.26.206: seq=11 ttl=54 time=52.683 ms
64 bytes from 172.217.26.206: seq=12 ttl=54 time=61.580 ms
64 bytes from 172.217.26.206: seq=13 ttl=54 time=49.698 ms
64 bytes from 172.217.26.206: seq=14 ttl=54 time=47.361 ms
64 bytes from 172.217.26.206: seq=15 ttl=54 time=76.849 ms
64 bytes from 172.217.26.206: seq=16 ttl=54 time=37.855 ms
^C
--- google.com ping statistics ---
Description
To test the RTC node functionality in Kernel.
Required Hardware
-NA-
Test Case 1 (Check the RTC Node)
Boot the board from NOR/MMC.Check how many nodes are there in /dev directory for rtc
$ ls /dev/rtc0
Expected o/p
root@ruggedboard-a5d2x:~# ls /dev/rtc0
/dev/rtc0
Test Case 2 (set the date and time and check it whether it set or not along With RTC battery (Check with multiple reboots))
Boot the board from NOR/MMC
Set the date to board in kernel # date mmddhhminyyyy.sec (e.g 021811582020.12 ) is the syntax
Set the time and check by using below command to rtc.
# hwclock -w -f /dev/rtcX
# hwclock -r -f /dev/rtcX ( # here 'X' is available node numbers ).
Reboot the board, wait few minutes. Check date and time both are same or not.
Expected o/p
oot@ruggedboard-a5d2x:~# date
Sun Jan 1 00:00:15 UTC 2012
root@ruggedboard-a5d2x:~# date 021917202020.13
Wed Feb 19 17:20:13 UTC 2020
root@ruggedboard-a5d2x:~# hwclock -w -f /dev/rtc0
root@ruggedboard-a5d2x:~# hwclock -r -f /dev/rtc0
Wed Feb 19 17:20:27 2020 0.000000 seconds
root@ruggedboard-a5d2x:~# date
Wed Feb 19 17:20:28 UTC 2020
root@ruggedboard-a5d2x:~# reboot
starting pid 128, tty '': '/etc/init.d/rcK'
starting pid 129, tty '': '/sbin/swapoff -a'
starting pid 130, tty '': '/bin/umount -a -r'
umount: devtmpfs busy - remounted read-only
The system is going down NOW!
Sent SIGTERM to all processes
Requesting system rebootesses
�RomBOOTRestarting system
AT91Bootstrap 3.8.12-dirty (Sun Dec 1 22:45:37 IST 2019)
SF: Got Manufacturer and Device ID: c22019
SF: WARNING: can't read above 16MiB
SF: Copy 0x80000 bytes from 0x16000 to 0x22000000
SF: Done to load image
<debug_uart>
U-Boot 2018.07-linux4sam_6.0-00025-g3bff827-dirty (Dec 02 2019 - 01:35:03 +0530)
CPU: SAMA5D27 512M bits DDR2 SDRAM
Crystal frequency: 24 MHz
CPU clock : 492 MHz
Master clock : 164 MHz
DRAM: 64 MiB
MMC: sdio-host@a0000000: 0, sdio-host@b0000000: 1
Loading Environment from SPI Flash... SF: Detected mx25l25645g with page size 256 Bytes, erase size 64 KiB, total 32 MiB
*** Warning - bad CRC, using default environment
Failed (-5)
In: serial@f8020000
Out: serial@f8020000
Err: serial@f8020000
Net: eth0: ethernet@f8008000
Hit any key to stop autoboot: 0
Unknown command 'console=ttyS0,115200' - try 'help'
SF: Detected mx25l25645g with page size 256 Bytes, erase size 64 KiB, total 32 MiB
device 0 offset 0xa6000, size 0x500000
SF: 5242880 bytes @ 0xa6000 Read: OK
device 0 offset 0x96000, size 0x10000
SF: 65536 bytes @ 0x96000 Read: OK
## Flattened Device Tree blob at 21000000
Booting using the fdt blob at 0x21000000
Loading Device Tree to 23b6b000, end 23b763d9 ... OK
Starting kernel ...
Booting Linux on physical CPU 0x0
Linux version 4.9.151-linux4sam_5.8+-04814-g499d99b-dirty (ganesh@phytec) (gcc version 7.3.0 (GCC) ) #3 Wed Jan 29 16:06:33 IST 2020
CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: RUGGED BOARD A5D2X
cma: Failed to reserve 64 MiB
Memory policy: Data cache writeback
CPU: All CPU(s) started in SVC mode.
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 16240
Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mtdblock5 rw rootwait rootfstype=squashfs
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 54004K/65536K available (7168K kernel code, 215K rwdata, 1188K rodata, 1024K init, 220K bss, 11532K reserved, 0K cma-reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xc4800000 - 0xff800000 ( 944 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc0800000 (8160 kB)
.init : 0xc0a00000 - 0xc0b00000 (1024 kB)
.data : 0xc0b00000 - 0xc0b35fc8 ( 216 kB)
.bss : 0xc0b35fc8 - 0xc0b6d208 ( 221 kB)
NR_IRQS:16 nr_irqs:16 16
L2C-310 ID prefetch enabled, offset 2 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 128 kB
L2C-310: CACHE_ID 0x410000c9, AUX_CTRL 0x36020000
clocksource: pit: mask: 0x7ffffff max_cycles: 0x7ffffff, max_idle_ns: 11654027029 ns
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
Console: colour dummy device 80x30
Calibrating delay loop... 326.86 BogoMIPS (lpj=1634304)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x20100000 - 0x20100058
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
AT91: PM: standby: standby, suspend: ulp0
clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 186464433812 ns
at_xdmac f0010000.dma-controller: 16 channels, mapped at 0xc4883000
at_xdmac f0004000.dma-controller: 16 channels, mapped at 0xc4885000
AT91: Detected SoC family: sama5d2
AT91: Detected SoC: sama5d27c 64MB SiP, revision 2
VDDANA: supplied by VDDIN_3V3
advref: supplied by VDDANA
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
at91_i2c f8028000.i2c: could not find pctldev for node /ahb/apb/pinctrl@fc038000/i2c0_default, deferring probe
media: Linux media interface: v0.10
Linux video capture interface: v2.00
Advanced Linux Sound Architecture Driver Initialized.
Bluetooth: Core ver 2.22
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
clocksource: Switched to clocksource tcb_clksrc
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
workingset: timestamp_bits=14 max_order=14 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
JFS: nTxBlock = 421, nTxLock = 3375
io scheduler noop registered (default)
pinctrl-at91-pio4 fc038000.pinctrl: atmel pinctrl initialized
[drm] Initialized
brd: module loaded
loop: module loaded
atmel_usart_serial.0.auto: ttyS1 at MMIO 0xf801c000 (irq = 33, base_baud = 5125000) is a ATMEL_SERIAL
atmel_usart_serial.1.auto: ttyS0 at MMIO 0xf8020000 (irq = 34, base_baud = 5125000) is a ATMEL_SERIAL
console [ttyS0] enabled
atmel_usart_serial.2.auto: ttyS2 at MMIO 0xf8024000 (irq = 35, base_baud = 5125000) is a ATMEL_SERIAL
atmel_usart_serial.3.auto: ttyS3 at MMIO 0xfc008000 (irq = 39, base_baud = 5125000) is a ATMEL_SERIAL
atmel_usart_serial.4.auto: ttyS4 at MMIO 0xfc00c000 (irq = 40, base_baud = 5125000) is a ATMEL_SERIAL
atmel_qspi f0024000.spi: mx25l25645g (32768 Kbytes)
7 ofpart partitions found on MTD device f0024000.spi
Creating 7 MTD partitions on "f0024000.spi":
0x000000000000-0x000000006000 : "at91bootstrap"
0x000000006000-0x000000016000 : "bootloader env"
0x000000016000-0x000000096000 : "bootloader"
0x000000096000-0x0000000a6000 : "device tree"
0x0000000a6000-0x0000005a6000 : "kernel"
0x0000005a6000-0x0000019a6000 : "rootfs"
0x0000019a6000-0x000002000000 : "data"
atmel_spi fc018400.spi: DMA TX channel not available, SPI unable to use DMA
atmel_spi fc018400.spi: Atmel SPI Controller using PIO only
atmel_spi fc018400.spi: Using FIFO (16 data)
atmel_spi fc018400.spi: Atmel SPI Controller version 0x311 at 0xfc018400 (irq 178)
libphy: Fixed MDIO Bus: probed
CAN device driver interface
m_can fc050000.can: m_can device registered (irq=48, version=31)
libphy: MACB_mii_bus: probed
Micrel KSZ8081 or KSZ8091 f8008000.ethernet-ffffffff:07: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=f8008000.ethernet-f)
macb f8008000.ethernet eth0: Cadence GEM rev 0x00020203 at 0xf8008000 irq 28 (80:1f:12:4e:24:9e)
usbcore: registered new interface driver asix
usbcore: registered new interface driver ax88179_178a
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver net1080
usbcore: registered new interface driver cdc_subset
usbcore: registered new interface driver zaurus
usbcore: registered new interface driver sierra_net
usbcore: registered new interface driver cdc_ncm
usbcore: registered new interface driver qmi_wwan
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-atmel: EHCI Atmel driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-atmel: OHCI Atmel driver
at91_ohci 400000.ohci: USB Host Controller
at91_ohci 400000.ohci: new USB bus registered, assigned bus number 1
at91_ohci 400000.ohci: irq 18, io mem 0x00400000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: USB Host Controller
usb usb1: Manufacturer: Linux 4.9.151-linux4sam_5.8+-04814-g499d99b-dirty ohci_hcd
usb usb1: SerialNumber: at91
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver cdc_wdm
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver option
usbserial: USB Serial support registered for GSM modem (1-port)
usbcore: registered new interface driver pl2303
usbserial: USB Serial support registered for pl2303
usbcore: registered new interface driver qcaux
usbserial: USB Serial support registered for qcaux
usbcore: registered new interface driver qcserial
usbserial: USB Serial support registered for Qualcomm USB modem
rtc rtc0: invalid alarm value: 1900-1-1 0:0:0
at91_rtc f80480b0.rtc: rtc core: registered f80480b0.rtc as rtc0
at91_rtc f80480b0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
AT91: Starting after software reset
sama5d4_wdt f8048040.watchdog: initialized (timeout = 16 sec, nowayout = 0)
usbcore: registered new interface driver bfusb
usbcore: registered new interface driver btusb
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
sdhci-at91 a0000000.sdio-host: update clk mul to 39 as gck rate is 480000000 Hz
mmc0: SDHCI controller on a0000000.sdio-host [a0000000.sdio-host] using ADMA
sdhci-at91 b0000000.sdio-host: update clk mul to 39 as gck rate is 480000000 Hz
random: fast init done
mmc1: SDHCI controller on b0000000.sdio-host [b0000000.sdio-host] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
atmel_aes f002c000.aes: version: 0x500
atmel_aes f002c000.aes: Atmel AES - Using dma0chan0, dma0chan1 for DMA transfers
atmel_sha f0028000.sha: version: 0x510
atmel_sha f0028000.sha: using dma0chan2 for DMA transfers
atmel_sha f0028000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
atmel_tdes fc044000.tdes: version: 0x703
atmel_tdes fc044000.tdes: using dma0chan3, dma0chan4 for DMA transfers
atmel_tdes fc044000.tdes: Atmel DES/TDES
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
at91-sama5d2_adc fc030000.adc: setting up trigger as external_rising
at91-sama5d2_adc fc030000.adc: version: 800
NET: Registered protocol family 10
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20161123 t)
can: netlink gateway (rev 20130117) max_hops=1
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
Bluetooth: HIDP socket layer initialized
at91_i2c f8028000.i2c: can't get DMA channel, continue without DMA support
at91_i2c f8028000.i2c: Using FIFO (16 data)
at24 0-0050: 256 byte 24c02 EEPROM, writable, 8 bytes/write
at91_i2c f8028000.i2c: AT91 i2c bus driver (hw version: 0x704).
at91_rtc f80480b0.rtc: setting system clock to 2020-02-19 17:20:42 UTC (1582132842)
ALSA device list:
No soundcards found.
atmel_usart_serial atmel_usart_serial.1.auto: using dma0chan5 for rx DMA transfers
atmel_usart_serial atmel_usart_serial.1.auto: using dma0chan6 for tx DMA transfers
VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
starting pid 112, tty '': '/bin/mount -t proc proc /proc'
starting pid 113, tty '': '/bin/mount -t sysfs sysfs /sys'
starting pid 114, tty '': '/bin/mount -t devtmpfs devtmpfs /dev'
mount: mounting devtmpfs on /dev failed: Resource busy
starting pid 115, tty '': '/bin/mount -o remount,rw /'
starting pid 116, tty '': '/bin/mkdir -p /dev/pts'
starting pid 117, tty '': '/bin/mount -t devpts devpts /dev/pts'
starting pid 118, tty '': '/bin/mount -a'
starting pid 119, tty '': '/etc/init.d/rcS'
starting pid 123, tty '/dev/ttyS0': '/sbin/getty 115200 ttyS0'
Poky (Yocto Project Reference Distro) 2.5.2 ruggedboard /dev/ttyS0
ruggedboard login: root
-sh: command: not found
root@ruggedboard-a5d2x:~#
root@ruggedboard-a5d2x:~#
root@ruggedboard-a5d2x:~# date
Wed Feb 19 17:20:48 UTC 2020
root@ruggedboard-a5d2x:~#
Last updated