Manual Version
Disclaimer
While every effort has been made to ensure accuracy in this document, errors or omissions may still exist. Users should carefully assess its applicability; we reserve the right to make revisions at any time and do not guarantee the validity of content from previous versions. For the latest product information, please regularly visit the official website of LCSC Dev Boards for updated materials. The copyright and final interpretation of this document belong to Shenzhen JLC Technology Group Co.,Ltd. Please take note of this disclaimer and assess the risks independently when making decisions. We are not responsible for any issues arising from the use of this document. Thank you for your understanding and support.
Introduction
A standard Android 11 system should be familiar to most of you, so here we will focus on explaining the hardware-related aspects specific to the Taishan RK3566 development board. This will help you quickly familiarize yourself with the onboard resources and understand the development process and important considerations for using the development board. This section is crucial for ensuring that your Taishan board functions properly.
Preparation
Before you begin, you need to do some preparatory work to ensure the smooth progress of the subsequent steps. I’ve listed them below:
- You will need a Windows 10 computer. Other operating systems may work theoretically, but I haven't tested them. For the purposes of this guide, I'll use my computer as an example, and unless otherwise specified, all environment setup and development compilation will assume this configuration.
- The computer must have ADB and serial debugging tools installed.
- LCSC Taishan-RK3566-Linux Dev Board must have the corresponding Android system firmware flashed.
- Logic analyzer and multimeter (optional, used for IO-related tasks).
Hardware Specifications
Precautions
- Use the correct power adapter that meets the development board's specifications, ensuring the voltage and current match. For example, when powered via the USB of a computer, the current is limited. If devices like a display are connected, the insufficient current may cause boot issues.
- Always disconnect the power before plugging or unplugging connectors to avoid operating while powered.
- When handling LCSC Taishan-RK3566-Linux Dev Board or any circuit board without a case, try to hold the edges of the board to minimize the risk of electrostatic damage. It's important to develop good habits.
- Be careful when inserting or removing connectors. Ensure they are properly aligned, and insert or remove them gently to avoid damaging the connectors or development board interfaces. Specifically, the GH1.25 sockets with locks need to have the latch pressed before removal; avoid using forceful methods like pulling the wires.
- The MicroHDMI port and its corresponding adapter board are very fragile. Do not apply excessive force to avoid damaging the solder pads.
- The RK3566 chip will generate noticeable heat under high load conditions. Ensure good ventilation to avoid overheating. If necessary, use a heatsink or fan to lower the temperature.
- LCSC Taishan-RK3566-Linux Dev Board's packaging is a metal box. Although there is foam inside, it still poses a risk of conductivity. Do not power on the board while it is inside the box.
- Wishing you success in your development work! If you have any other questions, feel free to consult.
ADB Debugging Tool
《LCSC Taishan-RK3566-Linux Dev Board Resource\Chapter 03. Documentation Manuals\【Tools】ADB installation and usage.md》
Terminal Tools
《LCSC Taishan-RK3566-Linux Dev Board Resource\Chapter 03. Documentation Manuals\【Tools】Usage of debugging tools.md》
System Testing
Image Flashing
Power-On Test
Power Supply Methods
LCSC Taishan-RK3566-Linux Dev Board has two power supply methods: via Type-C and external power jack. Note: Although there is a protection circuit, it is not recommended to use both Type-C (from the computer) and the external power jack simultaneously, as this could cause damage to the computer. Any resulting issues would be at your own risk.
Power Supply via Type-C
- Power Adapter: LCSC Taishan-RK3566-Linux Dev Board is usually powered through the Type-C interface. The recommended power supply should provide 5V and 2.5A to ensure the device runs properly.
- Computer Power Supply: The Type-C port on LCSC Taishan-RK3566-Linux Dev Board serves both as a power input and a USB interface. For example, code downloads and ADB debugging are done through this USB connection. However, the typical USB port on a computer provides only about 500mA, which can easily lead to insufficient power if too many resources are being used on the development board. If the system repeatedly fails to boot, you can try powering the board using an external power adapter. Note that if an EDP display needs to be powered, you should use the GH1.25 power jack and a small power board.
Power Supply via External Power Jack
- External Power Supply Connection: The external power supply is connected via a GH1.25 2P jack or 2.54 pin header. When connecting, make sure the positive and negative terminals are correctly aligned with the hardware. Do not reverse the polarity.
- Power Supply Adapter Requirements: Voltage: 12V, Current: 2A
- Note: The EDP screen backlight power is directly supplied from the GH1.25 jack. The backlight voltage for the provided EDP screen supports a range of 7V to 21V. Additionally, the external power circuit for LCSC Taishan-RK3566-Linux Dev Board converts to 5V, and supports an input voltage range of 5V to 18V. Considering this, we selected 12V for powering the board. If you use your own EDP screen, adjust the supply according to the manufacturer's power requirements, ensuring it falls within the 5V to 18V range and is compatible with the EDP voltage range.
Entering the System
If the hardware is functioning properly, the power indicator light on the development board will light up once powered. Following that, the working indicator light next to the USB port will start flashing with alternating colors.
The screen will display the Lichuang development board logo, and the development board will boot into the system normally.
Debugging Connection
There are two common debugging methods: serial port debugging and ADB debugging. Additionally, ADB can also be used for debugging over the network. Here, we will only cover the USB method. If you have not yet installed the serial debugging terminal and ADB, please refer to the following articles for installation.
- ADB Installation and Usage Tutorial (Click to Visit🚀)
- Debugging Tools Usage Tutorial(Click to Visit🚀)
Serial Terminal
- Before starting serial debugging, you need to prepare a USB to TTL tool, such as CH340.
- The debug port of the RK3566, UART2_RX_M0 and UART2_TX_M0, is connected through a GH1.25 4PIN jack and 2.54 header. For wiring, you only need to connect TX, RX, and GND. Note that the TX on LCSC Taishan-RK3566-Linux Dev Board connects to the RX of the tool, and the RX on LCSC Taishan-RK3566-Linux Dev Board connects to the TX of the tool.
- The debug serial port baud rate for LCSC Taishan-RK3566-Linux Dev Board is 1,500,000, with 8 data bits, 1 stop bit, and no parity bit.
- Once the connection is successful, press Enter repeatedly. Of course, you can also run Linux-related commands in this terminal.
ADB Debugging
- Insert the Type-C cable into the computer and ensure LCSC Taishan-RK3566-Linux Dev Board has successfully booted into the system.
- In the Android system, enable ADB debugging (enabled by default). You can check the ADB connection notification in the dropdown menu, and ensure that the ADB device is recognized in the computer's device manager.
DDR Check
- Get Memory Information
rk3566_tspi:/ # free -m #Display memory in MB
total used free shared buffers
Mem: 1956 1709 247 6 3
-/+ buffers/cache: 1705 251
Swap: 978 0 978
2
3
4
5
You can also use the following command to get more detailed information:
rk3566_r:/ # cat /proc/meminfo
MemTotal: 2004112 kB #Total memory size is 2004112 kB.
MemFree: 326532 kB #The current available free memory is 326532 kB.
MemAvailable: 1112884 kB #The current available memory is 1112884 kB. This includes both free memory and cached memory.
Buffers: 4516 kB
Cached: 884012 kB
SwapCached: 0 kB
Active: 593564 kB
Inactive: 622328 kB
Active(anon): 426744 kB
Inactive(anon): 3324 kB
Active(file): 166820 kB
Inactive(file): 619004 kB
Unevictable: 99624 kB
Mlocked: 99624 kB
SwapTotal: 1002052 kB
SwapFree: 1002052 kB
Dirty: 68 kB
Writeback: 0 kB
AnonPages: 427020 kB
Mapped: 497064 kB
Shmem: 3796 kB
KReclaimable: 96900 kB
Slab: 112960 kB
SReclaimable: 47268 kB
SUnreclaim: 65692 kB
KernelStack: 15888 kB
PageTables: 38256 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 2004108 kB
Committed_AS: 38875636 kB
VmallocTotal: 263061440 kB
VmallocUsed: 29748 kB
VmallocChunk: 0 kB
Percpu: 2544 kB
CmaTotal: 8192 kB
CmaAllocated: 2984 kB
CmaReleased: 5208 kB
CmaFree: 0 kB
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
For even more detailed memory information, you can use the following command, which is typically used for troubleshooting memory issues:
rk3566_tspi:/ # dumpsys meminfo
- To check the DDR frequency, you can use this command:
rk3566_tspi:/ # cat /sys/class/devfreq/dmc/cur_freq
324000000
2
EMMC Check
- To check the system storage:
- To check the storage space:
rk3566_tspi:/# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 978M 816K 977M 1% /dev
tmpfs 978M 0 978M 0% /mnt
/dev/block/mmcblk2p11 11M 144K 11M 2% /metadata
/dev/block/dm-0 934M 931M 2.8M 100% /
/dev/block/dm-5 676M 96K 676M 1% /mnt/scratch
overlay 676M 96K 676M 1% /system
overlay 676M 96K 676M 1% /vendor
overlay 676M 96K 676M 1% /odm
overlay 676M 96K 676M 1% /product
overlay 676M 96K 676M 1% /system_ext
tmpfs 978M 0 978M 0% /apex
tmpfs 978M 264K 978M 1% /linkerconfig
/dev/block/mmcblk2p10 356M 712K 355M 1% /cache
/dev/block/dm-6 3.0G 952M 2.1G 31% /data
tmpfs 978M 0 978M 0% /data_mirror
/dev/fuse 3.0G 952M 2.1G 31% /mnt/user/0/emulated
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
CPU Check
- To check the CPU frequency:
rk3566_tspi:/ # cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq
1608000
1608000
1608000
1608000
2
3
4
5
- To check the CPU temperature: First, find the CPU temperature corresponding node, then use cat to check it:
rk3566_r:/ # cat /sys/class/thermal/thermal_zone0/type
soc-thermal #cpu temperature
rk3566_r:/ # cat /sys/class/thermal/thermal_zone1/type
gpu-thermal #gpu temperature
rk3566_r:/ # cat /sys/class/thermal/thermal_zone2/type
test_battery #battery temperature
2
3
4
5
6
To check the CPU temperature, the value here is in millidegrees Celsius. To convert it to Celsius, divide by 1000. For example, if the output is 41875, the temperature would be 41.875°C.
rk3566_tspi:/ # cat /sys/class/thermal/thermal_zone0/temp
41875
2
NPU Check
- To check the NPU temperature, the value here is in millidegrees Celsius. To convert it to Celsius, divide by 1000. For example, a reading of 40,000 millidegrees Celsius equals 40°C.
rk3566_tspi:/ # cat /sys/class/thermal/thermal_zone1/temp
40000
2
LED Indicators
- The TaiShan Pi development board has an LED located on the lower-right side. After the board powers up for a while, the LED starts blinking, indicating that the system is running normally.
- The pin connections for the LED can be found in the schematic. For more details, you can refer to our open-source hardware project, where both the schematic and PCB are available.
- You can control these three LEDs by executing commands through ADB. First, check the nodes for the three LEDs: rgb-led-b corresponds to the blue LED, rgb-led-g corresponds to the green LED, and rgb-led-r corresponds to the red LED.
rk3566_tspi:/ # ls /sys/class/leds/
mmc2:: rgb-led-b rgb-led-g rgb-led-r
2
- Enter the rgb-led-x directory to view the related properties. Here, we'll use rgb-led-b as an example; the others are the same.
rk3566_tspi:/ # ls /sys/class/leds/rgb-led-b
brightness device invert max_brightness power subsystem trigger uevent
2
brightness
: This property controls the brightness of the LED. You can set the LED brightness level by reading and writing to this file.device
: This property shows the device path related to the LED.invert
: This property controls the LED's polarity inversion. When the value is 0, the LED behaves as expected. When the value is 1, the LED's behavior is inverted.max_brightness
: This property indicates the maximum brightness value that the LED can support. The brightness value can range from 0 to max_brightness.power
: This property shows the power status of the LED. It can be "on" to indicate the LED is on or "off" to indicate it is off.subsystem
: This property indicates which subsystem the LED device belongs to.trigger
: This property defines the LED's trigger. It controls the behavior of the LED, such as blinking or breathing effects. You can change the LED behavior by writing different trigger names. Here are some common trigger modes:none
: Disables the trigger, and the LED remains off.default-on
: The default-on trigger keeps the LED on when the system starts.heartbeat
: A heartbeat trigger makes the LED pulse like a heartbeat.timer
: A timer trigger causes the LED to blink at specified intervals.
uevent
: This property contains event information related to the LED device.Of course, you can also use cat trigger to check which modes are supported by the LED.
130|rk3566_tspi:/ # cat /sys/class/leds/rgb-led-b/trigger
[] rfkill-any rfkill-none test_ac-online test_battery-charging-or-full test_battery-charging test_battery-full test_bat
tery-charging-blink-full-solid test_usb-online mmc0 mmc1 mmc2 timer heartbeat backlight default-on rfkill0 rfkill1 rfkill2
2
3
none
: Disables the trigger, keeping the LED off.rfkill-any
: Triggers on any RFKill state change, such as when the Wi-Fi or Bluetooth switch changes.rfkill-none
: Triggers when RFKill is disabled.test_ac-online
: Triggers when the battery is charging or full.test_battery-charging-or-full
: : Triggers when the battery is charging or full.test_battery-charging
: Triggers when the battery is charging.test_battery-full
: Triggers when the battery is fully charged.test_battery-charging-blink-full-solid
: : Blinks during charging, then stays solid when full.test_usb-online
: Triggers when a USB device is plugged in.mmc0
,mmc1
,mmc2
: Triggers when the corresponding MMC device is in use.timer
: Triggers based on a set time interval.[]
: Heartbeat trigger, which creates a breathing light effect for the LED.backlight
: Backlight trigger, usually for controlling the display backlight LED.default-on
: Default trigger, keeps the LED on when powered on.rfkill0
,rfkill1
,rfkill2
: Triggers when the state of the corresponding RFKill device changes.turn off all the lights
# turn off the blue LED
rk3566_tspi:/ # echo "none" > /sys/class/leds/rgb-led-b/trigger
# turn off the green LED
rk3566_tspi:/ # echo "none" > /sys/class/leds/rgb-led-g/trigger
# turn off the red LED
rk3566_tspi:/ # echo "none" > /sys/class/leds/rgb-led-r/trigger
2
3
4
5
6
- keep all the lights on
# Keep the blue LED on
rk3566_tspi:/ # echo "default-on" > /sys/class/leds/rgb-led-b/trigger
# Keep the green LED on
rk3566_tspi:/ # echo "default-on" > /sys/class/leds/rgb-led-g/trigger
# Keep the red LED on
rk3566_tspi:/ # echo "default-on" > /sys/class/leds/rgb-led-r/trigger
2
3
4
5
6
- heartbeat
# Blue LED heartbeat
rk3566_tspi:/ # echo "heartbeat" > /sys/class/leds/rgb-led-b/trigger
# Green LED heartbeat
rk3566_tspi:/ # echo "heartbeat" > /sys/class/leds/rgb-led-g/trigger
# Red LED heartbeat
rk3566_tspi:/ # echo "heartbeat" > /sys/class/leds/rgb-led-r/trigger
2
3
4
5
6
- set a timed blinking effect
# Timed blink for blue LED
rk3566_tspi:/ # echo "timer" > /sys/class/leds/rgb-led-b/trigger
# Timed blink for green LED
rk3566_tspi:/ # echo "timer" > /sys/class/leds/rgb-led-g/trigger
# Timed blink for red LED
rk3566_tspi:/ # echo "timer" > /sys/class/leds/rgb-led-r/trigger
2
3
4
5
6
Feel free to experiment with other triggers, like rfkill-any, which will light up when Bluetooth is turned off, among others.
Buttons
- The development board includes three buttons, and the pin connections for these buttons can be checked in our open-source hardware project:
- PWR: Power button.
- RST: Reset button. Pressing this button resets the system hardware and restarts the development board. If you hold down the REC button and press RST, it will enter the Loader mode for flashing firmware.
- REC: Recovery button. Connected to SARADC_VIN0 with 10-bit resolution, this button enables entry into Loader flashing mode.
USB Host
- LCSC Taishan-RK3566-Linux Dev Board features a USB 2.0 HOST interface, supporting USB hubs, mice, keyboards, flash drives, and other USB slave devices.
- This is the schematic of the pin connection. More details are available in our open-source hardware documentation.
- USB HOST Mouse Test
- USB HOST Flash Drive Test
- USB Camera Test
WIFI & Bluetooth
- LCSC Taishan-RK3566-Linux Dev Board comes with an onboard dual-module for WIFI and Bluetooth. By default, it uses the AP6212 module.
- AP6212 Module Introduction:
- Link and Datasheet: https://item.szlcsc.com/2941698.html
- 802.11b/g/n single-band wireless
- Integrated Bluetooth V4.1 with Class 1.5 amplifier and low energy (BLE) support
- Supports simultaneous Bluetooth and WLAN operation
- Single antenna can receive both BT/WLAN signals simultaneously
- WLAN Host Interface Option: SDIO v2.0 — supports up to a 50 MHz clock frequency
- BT Host Digital Interface: UART (up to 4 Mbps)
- Built-in IEEE collaboration technology
- ECI (Enhanced Collaborative Interface) support, allowing for coordinated BT SCO transmissions to avoid WLAN reception conflicts
- The board’s hardware schematic and further details are available in the open-source project, with in-depth analysis covered in the subsequent driver tutorials.
- SDMMC1 interface is mapped to the module’s WIFI functionality
- UART1 interface is mapped to the module’s Bluetooth functionality
- I2S2 interface is designated for Bluetooth audio features, such as streaming music to a Bluetooth headset
WIFI
- Before using WIFI, attach the antenna. If an expansion board with a 4G module and Ethernet connection is connected, disconnect these to ensure accurate test data.
- WIFI Connection Test: Once successfully connected, you can browse the internet or use test software for further validation.
- WIFI Hotspot Test
Bluetooth
- Before using Bluetooth, attach the antenna. If testing Bluetooth audio functionality with an expansion board attached, ensure no headphones are plugged in.
- Bluetooth Connection Test: For example, connecting to a Bluetooth speaker is similar to standard mobile Bluetooth operations. You can also use Bluetooth for file transfer, controlling other devices, and more.
HDMI Screen
- The LCSC Taishan-RK3566-Linux Dev Board features an onboard Micro HDMI port, allowing for connection to an HDMI display.
- To maximize space and maintain a sleek design, the LCSC Taishan-RK3566-Linux Dev Board uses a Micro HDMI port. If your display requires a standard HDMI cable, you’ll need a Micro HDMI to HDMI adapter. Alternatively, you can simply use a Micro HDMI cable.
- The LCSC Taishan-RK3566-Linux Dev Board's default firmware supports HDMI output. If you’ve flashed other firmware, ensure it supports HDMI output before testing.
- With HDMI properly connected, powering on the board will display the logo and boot into the Android system.
- HDMI automatically detects screen resolution, supporting up to 4K at 60Hz. Fixed resolution settings will be covered in a later driver tutorial. HDMI also supports hot-swapping.
- The HDMI signal includes audio, so if your monitor has built-in speakers, audio will play through them.
- Within the system, you can adjust the HDMI resolution and screen scaling. If the display doesn’t fit the screen fully or extends beyond it, slight adjustments may be needed.
- To check the HDMI status using adb, if you see Connector: HDMI-A-1, it indicates that HDMI is functioning correctly. If the cat command doesn’t detect HDMI, it means the HDMI device is not properly connected. The issue could lie in the drivers, screen connection, or incorrect firmware flash.
rk3566_tspi:/ # cat /d/dri/0/summary
Video Port0: ACTIVE
Connector: HDMI-A-1
bus_format[]: RGB888_1X24
overlay_mode[] output_mode[] color_space[]
Display mode: 1920x1080p60
clk[] real_clk[] type[] flag[]
H: 1920 2008 2052 2200
V: 1080 1084 1089 1125
Esmart0-win0: ACTIVE
win_id: 3
format: AB24 little-endian (0x34324241) SDR[] color_space[] glb_alpha[]
rotate: xmirror: 0 ymirror: 0 rotate_90: 0 rotate_270: 0
csc: y2r[] r2y[] csc mode[]
zpos: 1
src: pos[] rect[]
dst: pos[] rect[]
buf[]: addr: 0x000000000168a000 pitch: 7680 offset: 0
Esmart0-win1: ACTIVE
win_id: 3
format: AB24 little-endian (0x34324241) SDR[] color_space[] glb_alpha[]
rotate: xmirror: 0 ymirror: 0 rotate_90: 0 rotate_270: 0
csc: y2r[] r2y[] csc mode[]
zpos: 1
src: pos[] rect[]
dst: pos[] rect[]
buf[]: addr: 0x000000000539e000 pitch: 7680 offset: 0
Cluster0-win0: ACTIVE
win_id: 4
format: AB24 little-endian (0x34324241)[] SDR[] color_space[] glb_alpha[]
rotate: xmirror: 0 ymirror: 0 rotate_90: 0 rotate_270: 0
csc: y2r[] r2y[] csc mode[]
zpos: 0
src: pos[] rect[]
dst: pos[] rect[]
buf[]: addr: 0x0000000004a78000 pitch: 7680 offset: 0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
EDP Screen
The LCSC Taishan-RK3566-Linux Dev Board has an onboard EDP interface located at the top of the board. It connects via a 30-pin 0.5mm pitch FPC cable and can be used to connect an EDP display. Most modern laptops use this type of interface.
Hardware Connection:
- The following diagram shows the pinout definition for the EDP screen (refer to the open-source project for more details). This 30-pin pinout is relatively common in the industry. Once you understand the Taishan-RK3566 development (screen adjustment), you can directly purchase a screen of your choice on platforms like Taobao or Xianyu to light it up. Alternatively, you can contact us for debugging. In the early stages, it’s recommended to test using screens that have been validated by us.
- In the schematic, pins 26, 27, 28, and 29 are the backlight pins, connected to VCC12V_DCIN. Therefore, to power the EDP screen, an additional power supply is required. Note that the backlight power for our EDP screen comes directly from the GH1.25 connector, and the backlight voltage supported by the EDP screen ranges from 7V to 21V. Additionally, the Taishan-RK3566 board's external 5V power circuit supports 5V-18V input. Based on these considerations, we selected 12V for power supply. If you're using an EDP screen purchased elsewhere, adjust according to the manufacturer's power supply requirements to avoid damaging the screen.
- For physical connection, we use our provided screen as an example. For other screens, please determine the cable sequence yourself. First, open the FPC with the gold contacts facing downward (since our FPC is a bottom connection). Insert the cable until you feel it firmly in place, then secure the FPC cover, as shown in the image below.
15.6-inch 1920x1080 Screen
Screen purchase link: item.taobao.com
Please note that this screen is purchased for testing purposes only. We do not provide after-sales support for this screen.
Before testing the screen, you need to flash the 15.6-inch screen firmware. The firmware can be found here:
Firmware Download
📌 Download Center (Click to Visit)
📌 Go to Download Center
->Baidu Netdisk Resource Content
->Chapter 06. System Images
->[Image] Android
->hdmi_edp1920X1080_20230912_update.img
.
- After connecting the screen, the screen can be lit normally with 12V external power supply, as shown below.
- Viewing edp screen status using adb
rk3566_tspi:/ # cat /d/dri/0/summary
Video Port1: ACTIVE
Connector: eDP-1
bus_format[]: RGB888_1X24
overlay_mode[] output_mode[] color_space[]
Display mode: 1920x1080p66
clk[] real_clk[] type[] flag[]
H: 1920 2070 2075 2080
V: 1080 1083 1084 1093
Cluster0-win0: ACTIVE
win_id: 4
format: XB24 little-endian (0x34324258)[] SDR[] color_space[] glb_alpha[]
rotate: xmirror: 0 ymirror: 0 rotate_90: 0 rotate_270: 0
csc: y2r[] r2y[] csc mode[]
zpos: 0
src: pos[] rect[]
dst: pos[] rect[]
buf[]: addr: 0x0000000001001000 pitch: 5120 offset: 0
Cluster0-win1: ACTIVE
win_id: 5
format: AB24 little-endian (0x34324241)[] SDR[] color_space[] glb_alpha[]
rotate: xmirror: 0 ymirror: 0 rotate_90: 0 rotate_270: 0
csc: y2r[] r2y[] csc mode[]
zpos: 1
src: pos[] rect[]
dst: pos[] rect[]
buf[]: addr: 0x00000000007e9000 pitch: 7680 offset: 0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
- Use ADB command to set backlight echo “0-255” > /sys/class/backlight/backlight/brightness
rk3566_tspi:/ # echo "16" > /sys/class/backlight/backlight/brightness
- The system backlighting test is used as in android phones, so we won't go into that again.
MIPI Screen
The Taishan-RK3566 development board is equipped with a MIPI DSI display interface located at the back of the board. It is connected via a 31-pin 0.3mm pitch FPC interface, allowing you to connect a MIPI display. This interface is commonly used in most smartphones and tablets.
Hardware Connection:
- The following diagram shows the pin definition for our MIPI screen (for detailed information, refer to the open-source project). This 31-pin pinout is quite common in the industry, which means once you master the Taishan development board (screen adjustment), you can directly buy your preferred screen from platforms like Taobao or Xianyu based on this pinout and light it up. Of course, you can also contact us for debugging, and for initial testing, you can base your work on the screen we have verified.
- For physical connection, we will use the screen provided by us as an example. For other screens, you will need to determine the pinout yourself. First, open the FPC and ensure the golden fingers of the flex cable are facing down (as our FPC connects from the bottom). Then, insert the FPC carefully, ensuring you feel a clear stop, and lock the FPC cover as shown in the image below.
8-inch 800x1280 Screen
- Screen purchase link:8寸液晶屏800*1280分辨率31/40Pmipi 接口高亮可贴合8寸触摸屏
- Before testing the screen, you need to burn the 8-inch screen firmware. The firmware location:
Chapter 06. System Images\ [Image] Android\mipi_800x1280q_20230912_update.img
- After connecting the screen, power on the board to light up the screen, as shown below. Note: If the power supply is insufficient, the system may fail to boot properly, resulting in a screen flickering loop.
- The system's backlight testing is similar to Android phones.
- Using adb to view mipi screen status
rk3566_tspi:/ # cat /d/dri/0/summary
Video Port1: ACTIVE
Connector: DSI-1
bus_format[]: RGB888_1X24
overlay_mode[] output_mode[] color_space[]
Display mode: 800x1280p59
clk[] real_clk[] type[] flag[]
H: 800 818 830 848
V: 1280 1304 1308 1320
Cluster0-win0: ACTIVE
win_id: 4
format: AB24 little-endian (0x34324241)[] SDR[] color_space[] glb_alpha[]
rotate: xmirror: 0 ymirror: 0 rotate_90: 0 rotate_270: 0
csc: y2r[] r2y[] csc mode[]
zpos: 0
src: pos[] rect[]
dst: pos[] rect[]
buf[]: addr: 0x00000000003e8000 pitch: 3200 offset: 0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- Use the ADB command to set the backlight echo “0-255” > /sys/class/backlight/backlight/brightness
rk3566_tspi:/ # echo "16" > /sys/class/backlight/backlight/brightness
10.1-inch 1200x1920 Screen
- Screen purchase link: Note: This screen is purchased for testing purposes only, and we do not provide after-sales support for this screen.
- Before testing, you need to burn the 10.1-inch screen firmware. The firmware location is:
Chapter 06. System Images\ [Image] Android\mipi_1200x1920j_20230912_update.img
- After connecting the screen, power on the board to light up the screen, as shown below. Note: If the power supply is insufficient, the system may fail to boot, resulting in a screen flickering loop.
- Below is the screen showing the system interface after normal power supply:
- System backlight adjustment is similar to Android phones.
- Using adb to view mipi screen status
rk3566_tspi:/ # cat /d/dri/0/summary
Video Port1: ACTIVE
Connector: DSI-1
bus_format[]: RGB888_1X24
overlay_mode[] output_mode[] color_space[]
Display mode: 1200x1920p61
clk[] real_clk[] type[] flag[]
H: 1200 1242 1252 1284
V: 1920 1955 1959 1989
Cluster0-win0: ACTIVE
win_id: 4
format: AB24 little-endian (0x34324241)[] SDR[] color_space[] glb_alpha[]
rotate: xmirror: 0 ymirror: 0 rotate_90: 0 rotate_270: 0
csc: y2r[] r2y[] csc mode[]
zpos: 0
src: pos[] rect[]
dst: pos[] rect[]
buf[]: addr: 0x0000000003ab4000 pitch: 4800 offset: 0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- Use the ADB command to set the backlight echo “0-255” > /sys/class/backlight/backlight/brightness
rk3566_tspi:/ # echo "16" > /sys/class/backlight/backlight/brightness
Dual Screen Display
HDMI and EDP Simultaneous Display
HDMI and MIPI Simultaneous Display
EDP and MIPI Simultaneous Display
USB/TF Card to Update Screen Parameters
The Taishan-RK3566 development board supports three types of screen interfaces: HDMI, EDP, and MIPI. However, apart from HDMI, the other interfaces require configuration of screen parameters in the code. Without these parameters, the screen may fail to light up or may display issues such as flickering, distortion, or color problems. Typically, when adapting a screen from a different manufacturer, you need to compile the entire Android SDK source, adjust the kernel screen parameters, and recompile before downloading the updated code. This process is time-consuming and complex. To simplify the debugging process, we offer a more convenient method for screen parameter configuration: use a USB drive or TF card to update the screen parameter files. Simply insert the USB drive or TF card into the development board, and the board will automatically restart and update the screen parameters.
Usage Method
- Download the USB/TF Card Screen Parameter Update Firmware
Download
📌 Download Center (Click to Visit)
📌 Go to Download Center
->Baidu Netdisk Resource Content
->Chapter 06. System Images
->[Image] Android
->udisk_screen_20231030.img
.
- Copy the screen parameter file to the USB drive or TF card. The screen parameter file must be named "rk3568_11_0_1_parameters.txt".
- Ensure the Taishan-RK3566 board has successfully booted into the system. Once the system is up and running, insert the USB drive or TF card into the board. The board will automatically detect the updated screen parameters. After a few seconds, the board will restart and apply the latest screen parameters.
- To clear screen parameters, press and hold the REC button while also pressing the RST button for reset. The system indicator will initially blink red, then fast flash green while erasing, and finally turn solid blue once the process is complete, entering upgrade mode. At this point, you can press reset to restore normal operation.
Screen Parameter
reference
unzip after downloading
Download
📌 Download Center (Click to Visit)
📌 Go to Download Center
->Baidu Netdisk Resource Content
->Chapter 04.Reference Materials
->ScreenParameter Folder
.
Screen Parameter Explanation
# wucaicheng update screen parameters versions 0.1
#【0:DSI】 1:eDP ;2:HDMI; 3:HDMI+EDP; 4:HDMI+DSI
panel-type = 0;
# panel info
unprepare-delay-ms = 20;
enable-delay-ms = 100;
disable-delay-ms = 60;
prepare-delay-ms = 20;
reset-delay-ms = 30;
init-delay-ms = 10;
width-mm = 217;
height-mm = 135;
# panel timing
clock-frequency = 71000000;
hactive = 800;
hfront-porch = 52;
hsync-len = 8;
hback-porch = 48;
vactive = 1280;
vfront-porch = 415;
vsync-len = 6;
vback-porch = 16;
hsync-active = 0;
vsync-active = 0;
de-active = 0;
pixelclk-active = 0;
# for dsi panel
dsi,flags = 2563;
dsi,format = 0;
dsi,lanes = 4;
# panel-type = 2 is valid 0:Single; 1:dual-link-odd-even-pixels; 2:ual-link-even-odd-pixels; 3:ual-link-even-odd-pixels; 4:ual-link-even-odd-pixels;
rockchip,link-type = 0;
# panel-type = 0 is valid with a value greater than zero
rockchip,lane-rate = 500;
# panel-type = 4 is valid with a value greater than zero
rockchip,division-mode = 0;
# panel-type = 4 is valid with a value greater than zero
rockchip,exchange-channel = 0;
panel-init-sequence =
05 78 01 11
05 14 01 29;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Display Types:
- panel-type = 0: MIPI screen
- panel-type = 1: eDP screen
- panel-type = 2: HDMI screen
- panel-type = 3: HDMI + eDP (dual display)
- panel-type = 4: HDMI + MIPI (dual display, caution: if one screen is in landscape and the other in portrait mode, the image will stretch due to the shared power source, so both screens need to have the same aspect ratio)
# 【0:DSI】 1:eDP ;2:HDMI; 3:HDMI+EDP; 4:HDMI+DSI
panel-type = 0;
2
- Setting Delays
unprepare-delay-ms = 20; // Set the power-off delay time to 20 milliseconds
enable-delay-ms = 100; // Set the display enable delay time to 100 milliseconds
disable-delay-ms = 60; // Set the display disable delay time to 60 milliseconds
prepare-delay-ms = 20; // Set the delay time for preparing and starting to receive video data to 20 milliseconds
reset-delay-ms = 30; // Set the reset delay time to 30 milliseconds
init-delay-ms = 10; // Set the delay from reset to sending the initialization sequence to 10 milliseconds
width-mm = 217; // Set the physical width of the screen to 217 millimeters
height-mm = 135; // Set the physical height of the screen to 135 millimeters
2
3
4
5
6
7
8
- Setting Timing
clock-frequency = 71000000; // Set the clock frequency to 71,000,000Hz
hactive = 800; // Set the number of horizontal active pixels to 800 (horizontal resolution)
hfront-porch = 52; // Set the horizontal front porch time to 52
hsync-len = 8; // Set the horizontal sync pulse width to 8
hback-porch = 48; // Set the horizontal back porch time to 48
vactive = 1280; // Set the number of vertical active pixels to 1280 (vertical resolution)
vfront-porch = 415; // Set the vertical front porch time to 415
vsync-len = 6; // Set the vertical sync pulse width to 6
vback-porch = 16; // Set the vertical back porch time to 16
hsync-active = 0; // Set the horizontal sync signal to active low
vsync-active = 0; // Set the vertical sync signal to active low
de-active = 0; // Set the DE signal to active low
pixelclk-active = 0; // Set the pixel clock signal to active low
2
3
4
5
6
7
8
9
10
11
12
13
- Panel Representation
dsi,flags = 2563; // Set the DSI flag information
dsi,format = 0; // Set the pixel format in DSI VIDEO mode
dsi,lanes = 4; // Set the number of lanes for the DSI interface
rockchip,link-type = 0; // Set the Rockchip link type to 0
# panel-type = 0 is valid with a value greater than zero
rockchip,lane-rate = 500; // Set the Rockchip lane rate to 500
2
3
4
5
6
7
- MIPI Screen Sequence, other screens do not need this parameter, MIPI only
panel-init-sequence // ery important MIPI screen initialization sequence. Some screen manufacturers have already initialized it, but most still require the initialization sequence to be executed.
Audio Interface
The Taishan development board provides microphone and speaker interfaces through a 4-pin GH1.25 header and 2.54 pads, as shown below: the front side has the GH1.25 header, and the back side has the 2.54 pads.
Hardware Connection:
- The following diagram shows the hardware connection schematic for the audio section (for more details, refer to the open-source project). It is mainly implemented by the RK809 chip. The RK809 integrates the functions for both speakers and headphones with an I2S interface. The speaker uses a high-efficiency stereo Class-D amplifier, which can output 1.3W of power to an 8-ohm BTL load from a 5V power supply. It also includes overcurrent protection. In simpler terms, this means it delivers low power for basic sound, but for high-quality audio, you'll need to use an expansion board with a better amplifier.
- The schematic of the 4-pin GH1.25 header is as follows:Pin 1 (MIC1P) is connected to the positive terminal of the microphone. Pin 2 is connected to the ground of the microphone. Pins 3 and 4 are connected to the speaker.
- To make debugging easier, we also provide 2.54mm spaced pads. The schematic is defined as follows, corresponding to the pads on the backside of the board shown above.
Audio Expansion Module Usage
- Pre-debugging Considerations:
- Before debugging, you need to flash the Android system firmware provided by us and then use the EDP or MIPI firmware for testing.
- If the GH1.25 external audio interface does not work when using the HDMI screen firmware, please disconnect the HDMI for testing. This is because the original system audio output scheme is set to output audio through HDMI after plugging in the HDMI cable, bypassing the external amplifier. We have modified the system to output audio to both HDMI and the external amplifier simultaneously.
- If you have connected our multimedia expansion board, make sure that the headphone jack is not inserted. You can check this by looking for the headphone icon in the top right corner of the system. If the headphone is plugged in, the audio output will not use the external amplifier route.
- The connection diagram between the development board and the expansion board is shown below:
Audio Recording Test
- Gif TODO
- Command TODO
Speaker Playback Test
- Gif TODO
- Command TODO
Camera
The Taishan-RK3566 development board has an onboard MIPI CSI camera interface, which can be used to drive MIPI-compatible cameras. It is located on the back of the development board, as shown in the image below:
Hardware Connection
- The following diagram illustrates the hardware connection for the MIPI CSI section (see the open-source project for more details). The necessary power supply circuit has been integrated into the development board, and the 30-pin connector on the board supports the pinout used by most manufacturers. You can directly purchase cameras with the same pinout from platforms like Taobao for compatibility, without needing an expansion board.
- Physical Connection Diagram
- The following example shows the camera we tested. If you want to use another camera, make sure to check the cable pinout and adapt the driver code accordingly. You can also contact us for debugging assistance.
OV5695 Test
Note: This camera model was purchased for testing, and we do not offer after-sales support for the camera itself.
- Basic Parameters:
- Model: OV5695
- Resolution: 5000,000
- Interface: MIPI 30P 0.5mm pitch FPC
Photo Test
- Open the Camera app.
- Click to take a photo. Afterward, you will see a gallery icon in the top right corner. Click it to view the photos.
Video Recording Test
- To test video recording, swipe right on the mouse to bring up the camera and video switch selection box.
MicroSD Card
The Taishan-RK3566 development board has an onboard MicroSD (TF) card slot located on the back of the board, which can be used for file storage or system image creation. Below, we primarily focus on the file storage function, as our system defaults to downloading files to the EMMC. For instructions on using the TF card for system boot, please refer to the flashing documentation.
Hardware Connection
The following diagram illustrates the hardware connection for the MicroSD section (refer to the open-source project for more details).
Usage Method
- Insert the MicroSD card with the metal connectors facing down (toward the PCB side) into the slot. Ensure the card aligns properly with the slot during insertion.
- Gently press the MicroSD card until it is fully inserted into the slot.
- After insertion, the card slot will lock in place, and you will hear a click indicating the card is securely in place.
- Once inserted, the system will display the TF card icon as shown below:
- Check the available storage capacity of the SD card and navigate to the SD card folder. (If the card has been formatted, you will see various Android-related folders.)
- Use ADB to perform a speed test:
# First, find your TF card device (in this case, it is 366E-1622). If you're unsure, unplug and plug the TF card again, and use `ls` to see which directory changes.
rk3566_tspi:/ # ls storage/
366E-1622 emulated self
# List the files in the TF card directory, which should match what you see in the system
rk3566_tspi:/ # ls storage/366E-1622/
Alarms Audiobooks Documents LOST.DIR Music Pictures Ringtones
Android DCIM Download Movies Notifications Podcasts
# Test the write speed (replace 366E-1622 with your device). Write speed: 10 M/s
rk3566_tspi:/ # dd if=/dev/zero of=/storage/366E-1622/testtf.txt bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (100 M) copied, 9.667978 s, 10 M/s
# Clear the cache. If you don't clear it, the test may show unusually high read speeds, like 800 M/s
rk3566_tspi:/ # echo 3 > /proc/sys/vm/drop_caches
# Test read speed (replace 366E-1622 with your device). Read speed: 18 M/s
rk3566_tspi:/ # dd if=/storage/366E-1622/testtf.txt of=/dev/null bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (100 M) copied, 5.593068 s, 18 M/s
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
- To eject the TF card, gently press the card in to hear a click, and the card will automatically pop out. The system icon will disappear once the card is removed.
4G Module
- Most 4G modules use a mini PCIe interface, but they are actually connected via USB. Therefore, we only need a mini PCIe to USB adapter board, which can then be plugged into the USB port on the Taishan-RK3566 development board to enable 4G internet access. If you feel that connecting via USB is not the most elegant solution, we will later discuss how to use a 4G module on an expansion board for internet functionality.
- mipiPCIE Purchase Link: (Note: We are not responsible for any after-sales issues related to the purchase, as it was simply tested and verified by us.)
- Below is an image showing how to insert the 4G module and SIM card. Note that the 4G module may require antennas depending on the actual model. For example, some modules with GPS functionality may need two antennas. Ensure the antennas are connected correctly to the matching ports.
Hardware Connection
- Since the Taishan-RK3566 only has one USB port, you will need to add a USB hub or use our Taishan multimedia expansion board to connect the 4G module, USB-to-4G adapter, and other peripherals like a mouse or light.
EC20
- Purchase Link:(Note: We are not responsible for any after-sales issues related to the purchase, as it was simply tested and verified by us.)
- The EC20 driver has already been configured in the Taishan-RK3566 Android system. Simply connect the module as shown in the image above. After powering on, you will see the signal icon in the system. Make sure to disconnect the Ethernet cable and disable Wi-Fi to ensure proper testing data.
- Enable cellular data to start testing the internet connection.
- You can use ADB to check the 4G network status with the ifconfig command. The 4G network interface is typically labeled as ppp0. If you enable airplane mode or disable cellular data, this interface will disappear.
rk3566_tspi:/ # ifconfig
dummy0 Link encap:Ethernet HWaddr 16:65:6a:52:af:54
inet6 addr: fe80::1465:6aff:fe52:af54/64 Scope: Link
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:700
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:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:100 TX bytes:100
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.133.172.244 P-t-P:10.64.64.64 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:980 errors:0 dropped:0 overruns:0 frame:0
TX packets:1173 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:650115 TX bytes:253027
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
- In ADB, to ping Baidu, the prerequisite is to enable cellular data to ensure the presence of ppp0.
rk3566_tspi:/ # ping www.baidu.com
PING www.a.shifen.com (120.232.145.144) 56(84) bytes of data.
64 bytes from 120.232.145.144: icmp_seq=1 ttl=53 time=20.1 ms
64 bytes from 120.232.145.144: icmp_seq=2 ttl=53 time=36.6 ms
64 bytes from 120.232.145.144: icmp_seq=3 ttl=53 time=43.3 ms
64 bytes from 120.232.145.144: icmp_seq=4 ttl=53 time=37.6 ms
64 bytes from 120.232.145.144: icmp_seq=5 ttl=53 time=25.6 ms
64 bytes from 120.232.145.144: icmp_seq=6 ttl=53 time=56.2 ms
64 bytes from 120.232.145.144: icmp_seq=7 ttl=53 time=41.8 ms
64 bytes from 120.232.145.144: icmp_seq=8 ttl=53 time=33.0 ms
64 bytes from 120.232.145.144: icmp_seq=9 ttl=53 time=24.2 ms
64 bytes from 120.232.145.144: icmp_seq=10 ttl=53 time=44.5 ms
64 bytes from 120.232.145.144: icmp_seq=11 ttl=53 time=30.9 ms
64 bytes from 120.232.145.144: icmp_seq=12 ttl=53 time=35.2 ms
64 bytes from 120.232.145.144: icmp_seq=13 ttl=53 time=35.1 ms
64 bytes from 120.232.145.144: icmp_seq=14 ttl=53 time=46.0 ms
64 bytes from 120.232.145.144: icmp_seq=15 ttl=53 time=34.4 ms
64 bytes from 120.232.145.144: icmp_seq=16 ttl=53 time=41.3 ms
^C64 bytes from 120.232.145.144: icmp_seq=17 ttl=53 time=44.2 ms
--- www.a.shifen.com ping statistics ---
17 packets transmitted, 17 received, 0% packet loss, time 28248ms
rtt min/avg/max/mdev = 20.196/37.114/56.250/8.700 ms
rk3566_tspi:/ #
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
RTC
The Taishan development board has the RTC module integrated into the RK809 chip, which is exposed on the back through a 2.54mm pitch header.
Hardware Connection
To test the RTC, you will need a coin cell battery and ensure that the battery has sufficient charge (around 3V when measured with a multimeter). Due to limited space on LCSC Taishan-RK3566-Linux Dev Board and for aesthetic purposes, we have opted not to include a coin cell holder. If you wish to use the RTC, you will need to solder the black wire of the battery to the GND pad and the red wire to the RTC pad using a soldering iron. Battery purchase link:https://item.szlcsc.com/5782992.html
RTC Testing
In Android systems, there are two types of clocks: the System time (Android system clock) and the hardware clock (RTC). Normally, when the device is connected to the internet, the system will synchronize its time from the network. However, if the device has no internet connection, such as when starting the Android system without a network, the system time will sync from the RTC hardware. This ensures that even without network connectivity, the Android system can still use the RTC hardware clock to provide accurate system time for basic device needs. Once the device connects to the internet, the system time will automatically sync from the network, ensuring time accuracy.
- Below is the demonstration of how to enable automatic network clock synchronization and manually adjust the clock in the Android system.
- Using ADB commands for time testing:
# Set Android system time
rk3566_tspi:/ # date "2002-01-01 11:22:33"
Tue Jan 1 11:22:33 CST 2002
# Check current Android system time
rk3566_tspi:/ # date
Tue Jan 1 11:23:39 CST 2002
# Check RK809 RTC hardware time
rk3566_tspi:/ # hwclock -f /dev/rtc0
Tue Aug 29 20:19:44 2023 0.000000 seconds
# Write system time to RK809 RTC
rk3566_tspi:/ # hwclock -f /dev/rtc0 -w
# Check RK809 RTC hardware time and confirm it's now synchronized with system time
rk3566_tspi:/ # hwclock -f /dev/rtc0
Tue Jan 1 11:24:16 2002 0.000000 seconds
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
40PIN Header Interface
The Taishan development board is equipped with a 40PIN 2.54mm pitch header, with pin definitions compatible with the classic 40PIN interface as shown below:
Pin Definitions
- Taishan development board 40PIN schematic (for detailed information, refer to the open-source project):
- Taishan development board 40PIN default function pinout diagram. This pinout is designed for Raspberry Pi compatibility, and the default firmware’s 40PIN GPIO driver follows this pinout:
- In addition to supporting the above-mentioned Raspberry Pi pin multiplexing, the Taishan development board 40PIN header also supports additional multiplexed functionalities like serial ports, PWM, audio, etc. However, this requires custom driver development, or you can contact us for adaptation.
Default Pin Definition Interface Testing
Next, based on the default IO pin definitions, we will proceed with testing the functionality of the 40PIN GPIO. Before starting, you need to flash the Android system firmware.
GPIO Testing
The Taishan development board’s 40PIN header has 28 IO pins, in addition to 12 power pins. These 28 IO pins can be used as general GPIO for input and output. However, some IO pins are already configured with multiplexing functions in the driver, so only the 14 IO pins marked in red are available for GPIO output/input testing.
Hardware Connection
Here, we take GPIO0_B7 as an example, and other IOs are similar.
- Use a logic analyzer or multimeter to check the high and low voltage output of the GPIO pin.
- Use two DuPont wires in series with a 10K resistor, one end connected to GPIO0_B7, and the other end to GND or 3.3V to simulate high and low voltage inputs (Note: The resistor should not be omitted, and do not connect it to 5V to avoid damaging the GPIO pin). This content can only be displayed in Lark documents.
GPIO Naming Rules and Pin ID Calculation
Next, we will use sysfs in adb to control GPIO0_B7 for input and output testing. Before using sysfs, we need to understand the GPIO naming rules for the RK3566, as pin IDs are required in sysfs parameters. Let's take the GPIO0_B7 example and break it down into three parts as follows:
- Bank: The RK3566 has 5 GPIO controllers, namely GPIO0 to GPIO4. Each controller contains multiple ports (A, B, C, D), and each port has 0-7 index numbers, so a controller can control 32 IO pins.
- Port: A, B, C, D correspond to numbers 0-3, so A=0, B=1, C=2, D=3. Fixed at 0-7, a total of 8 numbers. By applying this to GPIO0_B7, the pin ID can be calculated as follows:
- The bank is 0, which refers to the 0th group of controllers.
- The port is B, which indicates port number 1. The pin is 7. Using the formula: 32 x 0 + 1 x 8 + 7 = 15, we get the pin ID of 15.
GPIO Output Test
# Use root privileges
rk3566_tspi:/ # su
# Export pin number 15 as a GPIO pin so it can be accessed and controlled.
rk3566_tspi:/ # echo 15 > /sys/class/gpio/export
# Set the direction of pin number 15 to output mode, making it an output pin.
rk3566_tspi:/ # echo out > /sys/class/gpio/gpio15/direction
# Set the value of pin number 15 to 1, which sets the pin to high level.
rk3566_tspi:/ # echo 1 > /sys/class/gpio/gpio15/value
# Set the value of pin number 15 to 0, which sets the pin to low level.
rk3566_tspi:/ # echo 0 > /sys/class/gpio/gpio15/value
# Unexport pin number 15, cancelling GPIO control over pin number 15.
rk3566_tspi:/ # echo 15 > /sys/class/gpio/unexport
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
The following demonstrates how to use sysfs to control GPIO0_B7 to output high and low voltage levels, with the voltage changes captured by a logic analyzer.
GPIO Input Test
# Use root privileges
rk3566_tspi:/ # su
# Export pin 15 as a GPIO pin so it can be accessed and controlled.
rk3566_tspi:/ # echo 15 > /sys/class/gpio/export
# Set pin 15 direction to input mode, i.e., set it as an input pin.
rk3566_tspi:/ # echo in > /sys/class/gpio/gpio15/direction
# Read the pin's value, the result will be 1 or 0, depending on the actual level of the pin.
rk3566_tspi:/ # cat /sys/class/gpio/gpio15/value
# Unexport pin 15, i.e., cancel GPIO control over pin 15.
rk3566_tspi:/ # echo 15> /sys/class/gpio/unexport
2
3
4
5
6
7
8
9
10
11
12
13
14
The following demonstrates how to use sysfs to control GPIO0_B7 for high and low level input detection.
Note:
If the IO pin is multiplexed in the device driver, the export operation will fail, and gpiox will not be found.
Serial Port Test
Many IO pins in the user GPIO can be multiplexed to serial port functions (refer to the multiplexing definition table). However, here we perform a multiplex test only for pins 8 and 9, based on the default configuration. The pin definitions are shown in the figure below:
Hardware Connection
To test the serial port, we need a serial debugging tool. Here, we use the most commonly used CH340 as an example. From the pin definitions above, we can see that GPIO pins 8 and 9 correspond to UART3. We will use DuPont wires to connect UART3_TX_M1 to the RXD pin of the CH340, UART3_RX_M1 to the TXD pin of the CH340, and also ground them together. The connection diagram is as follows:
After inserting the CH340 into the computer, a serial device will appear in the Device Manager.
Open the serial debugging tool, electerm, set the port to COM34, the baud rate to 9600, and keep other settings default.
In ADB, locate the corresponding serial port node. Here, the UART3 corresponds to ttyS3.
rk3566_tspi:/ # ls /dev/
__properties__ fscklogs kmsg rga usb-ffs
ashmem full kmsg_debug rtc0 usb_accessory
ashmeme02e9dfb-e7c9-4b5a-93ea-453a4d62e115 fuse loop-control snd v4l-subdev0
binder gpiochip0 mali0 socket v4l-subdev1
binderfs gpiochip1 media0 spi_misc_test v4l-subdev2
blkio gpiochip2 memcg stderr vendor_storage
block gpiochip3 memory_bandwidth stdin video0
boringssl gpiochip4 mmcblk2rpmb stdout video1
bus gpiochip5 mpp_service stune video2
cgroup_info graphics net sw_sync video3
console hw_random network_latency tee0 video4
cpu_dma_latency hwbinder network_throughput teepriv0 video5
cpu_variant:arm i2c-0 null tty video6
cpu_variant:arm64 i2c-2 opteearmtz00 ttyFIQ0 video7
cpuctl i2c-3 pmsg0 ttyS1 video8
cpuset i2c-4 ppp ttyS3 vndbinder
device-mapper i2c-6 ptmx tun watchdog
dri iio:device0 pts uhid watchdog0
event-log-tags input random uinput zero
fd ion rfkill urandom
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Before starting the test, you need to set the serial parameters for ttyS3. These settings must match those in the serial communication tool to avoid issues such as garbled text or failure to display.
stty -F /dev/ttyS3 <baud rate> cs<data bits> <parity> <stop bits> <flow control>
<baud rate> common values include 9600, 115200, etc.
<data bits> refers to the number of data bits, common values are 5, 6, 7, 8, with 8 being the default.
<parity> specifies the parity type, possible values are -parity (no parity), even (even parity), and odd (odd parity).
<stop bits> refers to the number of stop bits, common values are cstopb=1、-cstopb=2, with the default being cstopb.
<flow control>crtscts:enable RTS/CTS hardware flow control.-crtscts:disable RTS/CTS hardware flow control.
2
3
4
5
6
Set the serial parameters for ttyS3, keeping all other settings default, and just set the baud rate.
rk3566_tspi:/ # stty -F /dev/ttyS3 9600
Send a data test by transmitting "lckfb-tspi" to ttyS3:
rk3566_tspi:/ # echo "lckfb-tspi" > /dev/ttyS3
The terminal will correctly display the content we just sent.
For receiving data, use cat on ttyS3 to wait for data:
rk3566_tspi:/ # cat /dev/ttyS3
In the serial console, enter any characters, such as "abcdefg1234567", and press Enter to send.
At this point, the development board has correctly received the data just sent.
Demonstration:
Infrared Remote Control Test
The GPIO pin 32 can be used to receive signals from an infrared remote control, as shown in the diagram below:
For this experiment, we need an infrared remote control and an infrared receiver module. You can purchase the infrared remote control from , but please note that we are only testing it and will not provide after-sales or technical support.
The infrared receiver module IRM-56384 can be purchased here https://item.szlcsc.com/73157.html
Hardware Connection
Use jumper wires to connect the IRM-56384 infrared receiver to the user GPIO. The connection diagram is shown below, please make sure the connections are correct and not reversed or wrong:
Testing
The button descriptions for the infrared remote control are shown below. Note that these button values are not fixed, and in the later driver tutorial, we will learn how to modify the button values.
During the remote control test, remember that the remote must be pointed at the raised side of the infrared receiver.
To view the remote control events in the system, use the getevent command:
rk3566_tspi:/ # getevent
add device 1: /dev/input/event2
name: "adc-keys"
add device 2: /dev/input/event0
name: "fe700030.pwm"
add device 3: /dev/input/event1
name: "rk805 pwrkey"
/dev/input/event0: 0001 0002 00000001
....................................
/dev/input/eventX: EV_TYPE CODE VALUE
/dev/input/eventX : The device path and number of the event.
EV_TYPE: The event type.
CODE : The event code used to identify different types of events or buttons.
VALUE : The event value, indicating the state or trigger method of the event.
2
3
4
5
6
7
8
9
10
11
12
13
14
Here, you'll see that every time I press a button on the remote, an event is reported. The getevent command will report all events, including those from touchscreens and mice. To ensure testing accuracy, you may want to disconnect other devices during testing.
IIC Testing
Our user GPIO exposes two sets of I2C, namely I2C2 and I2C3.
To test I2C, we need devices mounted on the I2C bus. The I/O pins require pull-up resistors, and the corresponding device driver must be written to perform normal testing. Here, I'll use a brute-force approach for testing. Since the development board does not have pull-up resistors connected to the I2C pins, I can only test I2C2. This is because the I2C2 port is by default in a pull-up state, as shown in the schematic. You can see that GPIO0_B5/6_u indicates a pull-up (UP), and GPIO3_B5/6_d indicates a pull-down (D).
Hardware Connection
Testing
Use ADB to list the I2C devices.
rk3566_tspi:/ # ls /sys/class/i2c-dev/
i2c-0/ i2c-2/ i2c-3/ i2c-4/ i2c-6/
2
Write arbitrary data to the I2C-2 bus.
rk3566_tspi:/ # echo -n " " > /dev/i2c-2
Use a packet capture tool to observe the waveform output.
SPI Testing
The user GPIO exposes a set of SPI interfaces, as shown in the diagram below:
Hardware Connection
Here, we connect to a logic analyzer to visually observe the SPI communication data. We will analyze how to drive the sensors in later driver tutorials.
Testing
Commands for SPI testing using ADB:
# echo type id loop_count transfer_length > /dev/spi_misc_test
echo write 0 10 255 > /dev/spi_misc_test
echo write 0 10 255 init.rc > /dev/spi_misc_test
echo read 0 10 255 > /dev/spi_misc_test
echo loop 0 10 255 > /dev/spi_misc_test
# echo setspeed id frequency (in Hz) > /dev/spi_misc_test
echo setspeed 0 1000000 > /dev/spi_misc_test
2
3
4
5
6
7
8
For the write test, first start the logic analyzer sampling, then execute the following write command via ADB:
# Perform a write test on ID 0, with 1 loop, sending 0-255
rk3566_tspi:/ # echo write 0 1 255 > /dev/spi_misc_test
2
After stopping the sampling, the logic analyzer successfully captures the data we sent, confirming that SPI is functioning correctly.
Demonstration:
PWM Testing
Many GPIO pins in the user GPIO can be multiplexed as PWM. You can refer to the multiplexing definition table, but here we follow the default configuration, so we will test pins 12, 33, and 35 for PWM functionality. The pin definitions are shown below:
Hardware Connection
Using a logic analyzer, we capture the output from the three PWM pins.
PWM Testing via ADB
Find the PWM device we want to test:
rk3566_tspi:/ # find . -name "pwm"
# pwm4: pwm@fe6e0000 edp screen backlight
./sys/devices/platform/fe6e0000.pwm/pwm
# pwm14: pwm@fe700020
./sys/devices/platform/fe700020.pwm/pwm
# pwm9: pwm@fe6f0010
./sys/devices/platform/fe6f0010.pwm/pwm
# pwm8: pwm@fe6f0000
./sys/devices/platform/fe6f0000.pwm/pwm
2
3
4
5
6
7
8
9
Here, we will test pwm8:
# Listing the pwm8 directory
rk3566_tspi:/ # ls /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/
device export npwm power subsystem uevent unexport
2
3
Enable the debugging channel:
# Channels start from 0, matching the pwmx_mx in the schematic. Here pwm8_m0 corresponds to channel 0
rk3566_tspi:/ # echo 0 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/export
# After enabling, you’ll see an additional pwm0 directory
rk3566_tspi:/ # ls /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/
device export npwm power pwm0 subsystem uevent unexport
2
3
4
5
6
Set the PWM period, frequency, and polarity:
# Set the period in nanoseconds, 1,000,000,000 nanoseconds equals one second
rk3566_tspi:/ # echo 1000000000 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/pwm0/period
# Set the duty cycle to 50%
rk3566_tspi:/ # echo 500000000 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/pwm0/duty_cycle
# Polarity options: normal and inverted. In "normal" mode, high level indicates the high part of the duty cycle,
# and low level indicates the low part. In "inverted" mode, this is reversed.
rk3566_tspi:/ # echo 'normal' > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/pwm0/polarity
2
3
4
5
6
7
8
9
Start and stop PWM:
# Start PWM
rk3566_tspi:/ # echo 1 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/pwm0/enable
# Stop PWM
rk3566_tspi:/ # echo 0 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/pwm0/enable
2
3
4
Disable the debugging channel:
rk3566_tspi:/ # echo 0 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/unexport
Testing
Output PWM signals simultaneously on channels PWM8, PWM9, and PWM10, and use a logic analyzer to capture the waveforms.
echo 0 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/export
echo 0 > /sys/devices/platform/fe6f0010.pwm/pwm/pwmchip2/export
echo 0 > /sys/devices/platform/fe700020.pwm/pwm/pwmchip3/export
echo 1000000000> /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/pwm0/period
echo 1000000000 > /sys/devices/platform/fe6f0010.pwm/pwm/pwmchip2/pwm0/period
echo 1000000000 > /sys/devices/platform/fe700020.pwm/pwm/pwmchip3/pwm0/period
echo 500000000 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/pwm0/duty_cycle
echo 250000000 > /sys/devices/platform/fe6f0010.pwm/pwm/pwmchip2/pwm0/duty_cycle
echo 100000000 > /sys/devices/platform/fe700020.pwm/pwm/pwmchip3/pwm0/duty_cycle
echo 'normal' > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/pwm0/polarity
echo 'normal' > /sys/devices/platform/fe6f0010.pwm/pwm/pwmchip2/pwm0/polarity
echo 'normal' > /sys/devices/platform/fe700020.pwm/pwm/pwmchip3/pwm0/polarity
echo 1 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip1/pwm0/enable
echo 1 > /sys/devices/platform/fe6f0010.pwm/pwm/pwmchip2/pwm0/enable
echo 1 > /sys/devices/platform/fe700020.pwm/pwm/pwmchip3/pwm0/enable
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Demonstration: