This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
products:sbc:common:applications:gpio:uart [2023/08/13 22:30] jacobe |
products:sbc:common:applications:gpio:uart [2024/08/06 08:27] (current) nick |
||
|---|---|---|---|
| Line 7: | Line 7: | ||
| ===== UART Information ===== | ===== UART Information ===== | ||
| - | | | + | | |
| - | ^ VIM1/ | + | ^ VIM1/ |
| - | | ::: | ::: | + | | ::: | ::: |
| - | ^ VIM3/ | + | ^ VIM3/ |
| - | | ::: | ::: | + | | ::: | ::: |
| - | ^ VIM4 | + | ^ VIM4 |
| - | | ::: | ::: | + | | ::: | ::: |
| - | ^ VIM1S | UART_C | + | ^ VIM1S | UART_C |
| - | | ::: | ::: | + | | ::: | ::: |
| ===== Enable UART ===== | ===== Enable UART ===== | ||
| + | |||
| + | ==== Linux ==== | ||
| + | |||
| In order to use the UART, you need to enable the UART function via [[products: | In order to use the UART, you need to enable the UART function via [[products: | ||
| Line 28: | Line 31: | ||
| ```shell | ```shell | ||
| overlays=pwm_ao_a pwm_f uart3 | overlays=pwm_ao_a pwm_f uart3 | ||
| + | ``` | ||
| + | |||
| + | After reboot, you will see the UART device node. | ||
| + | |||
| + | ```shell | ||
| + | $ ls /dev/ttyS3 | ||
| + | /dev/ttyS3 | ||
| + | ``` | ||
| + | |||
| + | <tabbox VIM3 with 5.15 kernel> | ||
| + | |||
| + | Edit ''/ | ||
| + | |||
| + | |||
| + | e.g. Enable '' | ||
| + | |||
| + | ```shell | ||
| + | fdt_overlays=uart3 | ||
| + | |||
| + | ``` | ||
| + | |||
| + | After reboot, you will see the UART device node. | ||
| + | |||
| + | ```shell | ||
| + | $ ls /dev/ttyS3 | ||
| + | /dev/ttyS3 | ||
| + | ``` | ||
| + | |||
| + | <tabbox VIM3L with 5.15 kernel> | ||
| + | |||
| + | Edit ''/ | ||
| + | |||
| + | |||
| + | e.g. Enable '' | ||
| + | |||
| + | ```shell | ||
| + | fdt_overlays=uart3 | ||
| + | |||
| ``` | ``` | ||
| Line 74: | Line 115: | ||
| /dev/ttyS2 | /dev/ttyS2 | ||
| ``` | ``` | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Android ==== | ||
| + | |||
| + | <tabbox VIM1S> | ||
| + | |||
| + | '' | ||
| + | |||
| + | |||
| + | <tabbox VIM4> | ||
| + | |||
| + | '' | ||
| + | |||
| + | <tabbox VIM3> | ||
| + | |||
| + | '' | ||
| </ | </ | ||
| Line 87: | Line 146: | ||
| // set correct serial path | // set correct serial path | ||
| - | #define SERIAL_PORT "/dev/ttyS4" | + | #define SERIAL_PORT "/dev/ttyS2" |
| int main() { | int main() { | ||
| Line 150: | Line 209: | ||
| Compile test code: | Compile test code: | ||
| - | '' | + | ``` |
| + | $ gcc uart.c -o uart | ||
| + | ``` | ||
| ===== Test demonstration ===== | ===== Test demonstration ===== | ||