linux-embedded-examples/README.md

215 lines
5.4 KiB
Markdown
Raw Permalink Normal View History

2017-04-28 10:23:20 +02:00
##### Setup
2017-04-28 10:21:55 +02:00
[Aster Carrier Board](https://www.toradex.com/products/carrier-boards/aster-carrier-board)
[Colibri VF61](https://www.toradex.com/computer-on-modules/colibri-arm-family/nxp-freescale-vybrid-vf6xx)
[Pioneer600](http://www.waveshare.com/wiki/Pioneer600)
2018-09-04 08:26:57 +02:00
<img src="https://gitlab.com/SanchayanMaity/linux-embedded-examples/blob/master/images/aster-pioneer600.jpg" width="640" height="480">
2017-04-28 10:21:55 +02:00
##### Cloning this repository
```
2018-09-04 08:26:57 +02:00
git clone https://gitlab.com/SanchayanMaity/linux-embedded-examples.git
2017-04-28 10:21:55 +02:00
```
2017-10-27 12:57:01 +02:00
##### Patch used for Aster to work with Pioneer600
```
diff --git a/arch/arm/boot/dts/vf-colibri-aster.dtsi b/arch/arm/boot/dts/vf-colibri-aster.dtsi
index 5fee7cba0fee..ec9476a5d925 100644
--- a/arch/arm/boot/dts/vf-colibri-aster.dtsi
+++ b/arch/arm/boot/dts/vf-colibri-aster.dtsi
@@ -23,6 +23,7 @@
compatible = "edt,et057090dhu";
backlight = <&bl>;
power-supply = <&reg_3v3>;
+ status = "disabled";
};
extcon_usbc_det: usbc_det {
@@ -79,14 +80,14 @@
brightness-levels = <0 4 8 16 32 64 128 255>;
default-brightness-level = <6>;
power-supply = <&reg_3v3>;
- status = "okay";
+ status = "disabled";
};
&dcu0 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_dcu0_1>;
fsl,panel = <&panel>;
- status = "okay";
+ status = "disabled";
};
&dspi1 {
@@ -150,7 +151,7 @@
};
&uart2 {
- status = "okay";
+ status = "disabled";
};
&usbdev0 {
diff --git a/arch/arm/boot/dts/vf-colibri.dtsi b/arch/arm/boot/dts/vf-colibri.dtsi
index de1b1cb33f1a..7a2a65836819 100644
--- a/arch/arm/boot/dts/vf-colibri.dtsi
+++ b/arch/arm/boot/dts/vf-colibri.dtsi
@@ -127,7 +127,7 @@
&pwm1 {
pinctrl-names = "default";
- pinctrl-0 = <&pinctrl_pwm1_b &pinctrl_pwm1_d>;
+ pinctrl-0 = <&pinctrl_pwm1_b>;
};
&uart0 {
@@ -231,6 +231,8 @@
VF610_PAD_PTB28__GPIO_98 0x22ed
VF610_PAD_PTC30__GPIO_103 0x22ed
VF610_PAD_PTA7__GPIO_134 0x22ed
+ VF610_PAD_PTB9__GPIO_31 0x22ed
+ VF610_PAD_PTD3__GPIO_82 0x22ed
>;
};
```
2017-04-28 10:21:55 +02:00
##### Building and installing SDK
Build and install the OE-Core aka Yocto SDK, for instructions related to building and installing SDK, have a look at this knowledge base [article](http://developer.toradex.com/knowledge-base/linux-sdks).
2017-11-20 12:48:55 +01:00
The Linux image for Vybrid module being used for the workshop can be downloaded [here](https://share.toradex.com/o7qyni5c0lxt8k9) and flashed to the module as per [Flashing Embedded Linux to Vybrid Modules](http://developer.toradex.com/knowledge-base/flashing-linux-on-vybrid-modules) if required. To facilitate development, a sample SDK can be downloaded from this [link](https://share.toradex.com/3p6dbfnh7x8t5s3). Install the SDK by executing the following from the command line
2017-04-28 10:21:55 +02:00
```
2017-05-08 12:17:25 +02:00
chmod a+x angstrom-glibc-x86_64-armv7at2hf-neon-v2016.12-toolchain.sh
2017-04-28 10:21:55 +02:00
./angstrom-glibc-x86_64-armv7at2hf-neon-v2016.12-toolchain.sh
```
Please use the standard default /usr/local/oecore-x86_64 path for SDK installation. The Eclipse projects included in this repository assume that this path has been used for SDK installation. Any generated SDK and image used on the module must include "libsoc" library for the code samples to work. Additionally gtkmm code has dependency on gtkmm library.
##### Sourcing Environment Script and starting Eclipse
```
. /usr/local/oecore-x86_64/environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi
```
Note the space between the dot and rest of the command. Now start Eclipse from the same terminal from where the above script was sourced.
```
eclipse &
```
Import the projects in Eclipse and build the project. Transfer the binary executable which will be available in Debug directory to the module using scp as follows, for example
```
scp <binary> root@<module_ip_address>:/home/root
```
##### Sample Output
###### gpio interrupt
```
root@colibri-vf:~# ./gpio_interrupt
2017-09-04 11:35:38 +02:00
Enter the GPIO number to use as interrupt: 39
2017-04-28 10:21:55 +02:00
Enter the GPIO number used for LED output: 11
Waiting for interrupt. Press 'q' and 'Enter' at any time to exit
```
###### pcf8574
```
root@colibri-vf:~# ./pcf8574
2017-05-10 09:55:32 +02:00
Enter choice: 1. Joy stick status 2. Led2 On/Off 3. Buzzer On/Off 4. Exit
2017-04-28 10:21:55 +02:00
1
Key A pressed
2017-05-10 09:55:32 +02:00
Enter choice: 1. Joy stick status 2. Led2 On/Off 3. Buzzer On/Off 4. Exit
2017-04-28 10:21:55 +02:00
2
2017-05-10 09:55:32 +02:00
Enter choice: 1. Joy stick status 2. Led2 On/Off 3. Buzzer On/Off 4. Exit
2017-04-28 10:21:55 +02:00
2
2017-05-10 09:55:32 +02:00
Enter choice: 1. Joy stick status 2. Led2 On/Off 3. Buzzer On/Off 4. Exit
2017-04-28 10:21:55 +02:00
3
2017-05-10 09:55:32 +02:00
Enter choice: 1. Joy stick status 2. Led2 On/Off 3. Buzzer On/Off 4. Exit
2017-04-28 10:21:55 +02:00
3
2017-05-10 09:55:32 +02:00
Enter choice: 1. Joy stick status 2. Led2 On/Off 3. Buzzer On/Off 4. Exit
2017-04-28 10:21:55 +02:00
4
```
###### pcf8591
```
root@colibri-vf:~# ./pcf8591
PCF8591 ADC and DAC test code
1. ADC 2. DAC 3. Exit
2
Enter DAC value: 78
1. ADC 2. DAC 3. Exit
1
Enter ADC channel number 0-3: 3
ADC Channel 3: value: 128
1. ADC 2. DAC 3. Exit
1
Enter ADC channel number 0-3: 3
ADC Channel 3: value: 78
1. ADC 2. DAC 3. Exit
1
Enter ADC channel number 0-3: 3
ADC Channel 3: value: 78
1. ADC 2. DAC 3. Exit
3
```
###### pwm
```
root@colibri-vf:~# ./pwm
Enter PWM chip number: 0
Enter PWM number: 0
Disabling PWM
```
2017-05-22 07:27:58 +02:00
2017-09-04 11:35:38 +02:00
##### ssd1306
Connect CE0 on Pioneer600 shield to GND before executing the binary.
```
root@colibri-vf:~# ./ssd1306
```
2017-05-22 07:27:58 +02:00
###### alsa-audio
2017-10-27 12:57:01 +02:00
2017-05-22 07:27:58 +02:00
```
root@colibri-vf:~# ./alsa-audio Front_Center.wav colibri-vf
Module Name: colibri-vf
short read: read 1774 bytes
end of file on input
```
###### gtk & gtkmm
gtk and gtkmm examples requires a display to be connected.
###### cairo
cairo requires a display to be connected.
2017-10-27 12:57:01 +02:00
2017-05-22 07:27:58 +02:00
```
root@colibri-vf:~# ./cairo example.png
```