https://wiki.dh-electronics.com/api.php?action=feedcontributions&user=Mholzner&feedformat=atomWiki-DB - User contributions [en]2024-03-29T12:11:39ZUser contributionsMediaWiki 1.41.0https://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3419Avenger962021-07-08T11:28:54Z<p>Mholzner: /* DSI Display Adaptor Board */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on '''kernel 5.10.x''' and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/5r74b7ybbnq1998/2021-02-09-dh-image-demo-dh-stm32mp1-dhcor-common-avenger96.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image 2021-02-09 (based on 5.10 kernel)]<br />
* [[DHCOR_STM32MP1_Linux| Linux and bootloader documentation]]<br />
:<span style="color:#008000">'''NEW How to start with custom DHCOR design?'''</span> <br />
:The patch below is an example patch which applies on top of u-boot v2021.01 and implements a custom board derived from 3V3 option of DHCOR STM32MP1 SoM. That's pretty much all you have to change to implement the board. But, please tweak the DTs esp. where there are the FIXME comments.<br />
:[https://www.dropbox.com/s/zg6f9h1vms6lxdg/0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch?dl=0 '''NEW''' 0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.1<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/hii15mbft3p4qyu/Avenger96_v6.9_2020-03-28.img.zip?dl=0 OpenSTLinux-2.1 based on Yocto Dunfell LTS and Linux 5.4.56 - v6.9 Starter Image] (Supported by Arrow Electronics) [[Starter Image Changelog]]<br />
: This Image includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change them.]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Mezzanine Boards by DH electronics ==<br />
<br />
==== DSI Display Adaptor Board ====<br />
[[File:DSI Display Adaptor Board.jpg|thumb|DSI Display Adaptor Board]]<br />
You can easily add an DSI display to your Avenger96 with the help of the DSI Display Adaptor Board. <br />
The display can be activated easily on our Mainline Image with a device tree overlay as described [[DHCOR_STM32MP1_Linux| here]]. <br />
To get one of the boards, simply reach out to us and we'll prepare one for you.<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3418Avenger962021-07-08T11:24:37Z<p>Mholzner: /* Mezzanine Boards by DH electronics */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on '''kernel 5.10.x''' and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/5r74b7ybbnq1998/2021-02-09-dh-image-demo-dh-stm32mp1-dhcor-common-avenger96.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image 2021-02-09 (based on 5.10 kernel)]<br />
* [[DHCOR_STM32MP1_Linux| Linux and bootloader documentation]]<br />
:<span style="color:#008000">'''NEW How to start with custom DHCOR design?'''</span> <br />
:The patch below is an example patch which applies on top of u-boot v2021.01 and implements a custom board derived from 3V3 option of DHCOR STM32MP1 SoM. That's pretty much all you have to change to implement the board. But, please tweak the DTs esp. where there are the FIXME comments.<br />
:[https://www.dropbox.com/s/zg6f9h1vms6lxdg/0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch?dl=0 '''NEW''' 0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.1<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/hii15mbft3p4qyu/Avenger96_v6.9_2020-03-28.img.zip?dl=0 OpenSTLinux-2.1 based on Yocto Dunfell LTS and Linux 5.4.56 - v6.9 Starter Image] (Supported by Arrow Electronics) [[Starter Image Changelog]]<br />
: This Image includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change them.]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Mezzanine Boards by DH electronics ==<br />
<br />
==== DSI Display Adaptor Board ====<br />
[[File:DSI Display Adaptor Board.jpg|thumb|DSI Display Adaptor Board]]<br />
You can easily add an DSI display to your Avenger96 with the help of the DSI Display Adaptor Board. <br />
The display can easily be activated on our Mainline Image with an device tree overlay as described [[DHCOR_STM32MP1_Linux| here]]. <br />
To get one of the boards, simply reach out to us and we'll prepare one for you.<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3417Avenger962021-07-08T11:24:28Z<p>Mholzner: /* Mezzanine Boards by DH electronics */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on '''kernel 5.10.x''' and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/5r74b7ybbnq1998/2021-02-09-dh-image-demo-dh-stm32mp1-dhcor-common-avenger96.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image 2021-02-09 (based on 5.10 kernel)]<br />
* [[DHCOR_STM32MP1_Linux| Linux and bootloader documentation]]<br />
:<span style="color:#008000">'''NEW How to start with custom DHCOR design?'''</span> <br />
:The patch below is an example patch which applies on top of u-boot v2021.01 and implements a custom board derived from 3V3 option of DHCOR STM32MP1 SoM. That's pretty much all you have to change to implement the board. But, please tweak the DTs esp. where there are the FIXME comments.<br />
:[https://www.dropbox.com/s/zg6f9h1vms6lxdg/0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch?dl=0 '''NEW''' 0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.1<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/hii15mbft3p4qyu/Avenger96_v6.9_2020-03-28.img.zip?dl=0 OpenSTLinux-2.1 based on Yocto Dunfell LTS and Linux 5.4.56 - v6.9 Starter Image] (Supported by Arrow Electronics) [[Starter Image Changelog]]<br />
: This Image includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change them.]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Mezzanine Boards by DH electronics ==<br />
<br />
==== DSI Display Adaptor Board ====<br />
[[File:DSI Display Adaptor Board.jpg|thumb|DSI Display Adaptor Board|left]]<br />
You can easily add an DSI display to your Avenger96 with the help of the DSI Display Adaptor Board. <br />
The display can easily be activated on our Mainline Image with an device tree overlay as described [[DHCOR_STM32MP1_Linux| here]]. <br />
To get one of the boards, simply reach out to us and we'll prepare one for you.<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3416Avenger962021-07-08T11:24:08Z<p>Mholzner: /* Mezzanine Boards by DH electronics */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on '''kernel 5.10.x''' and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/5r74b7ybbnq1998/2021-02-09-dh-image-demo-dh-stm32mp1-dhcor-common-avenger96.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image 2021-02-09 (based on 5.10 kernel)]<br />
* [[DHCOR_STM32MP1_Linux| Linux and bootloader documentation]]<br />
:<span style="color:#008000">'''NEW How to start with custom DHCOR design?'''</span> <br />
:The patch below is an example patch which applies on top of u-boot v2021.01 and implements a custom board derived from 3V3 option of DHCOR STM32MP1 SoM. That's pretty much all you have to change to implement the board. But, please tweak the DTs esp. where there are the FIXME comments.<br />
:[https://www.dropbox.com/s/zg6f9h1vms6lxdg/0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch?dl=0 '''NEW''' 0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.1<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/hii15mbft3p4qyu/Avenger96_v6.9_2020-03-28.img.zip?dl=0 OpenSTLinux-2.1 based on Yocto Dunfell LTS and Linux 5.4.56 - v6.9 Starter Image] (Supported by Arrow Electronics) [[Starter Image Changelog]]<br />
: This Image includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change them.]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Mezzanine Boards by DH electronics ==<br />
<br />
==== DSI Display Adaptor Board ====<br />
[[File:DSI Display Adaptor Board.jpg|thumb|DSI Display Adaptor Board]]<br />
You can easily add an DSI display to your Avenger96 with the help of the DSI Display Adaptor Board. <br />
The display can easily be activated on our Mainline Image with an device tree overlay as described [[DHCOR_STM32MP1_Linux| here]]. <br />
To get one of the boards, simply reach out to us and we'll prepare one for you.<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3415Avenger962021-07-08T11:23:58Z<p>Mholzner: /* DSI Display Adaptor Board */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on '''kernel 5.10.x''' and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/5r74b7ybbnq1998/2021-02-09-dh-image-demo-dh-stm32mp1-dhcor-common-avenger96.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image 2021-02-09 (based on 5.10 kernel)]<br />
* [[DHCOR_STM32MP1_Linux| Linux and bootloader documentation]]<br />
:<span style="color:#008000">'''NEW How to start with custom DHCOR design?'''</span> <br />
:The patch below is an example patch which applies on top of u-boot v2021.01 and implements a custom board derived from 3V3 option of DHCOR STM32MP1 SoM. That's pretty much all you have to change to implement the board. But, please tweak the DTs esp. where there are the FIXME comments.<br />
:[https://www.dropbox.com/s/zg6f9h1vms6lxdg/0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch?dl=0 '''NEW''' 0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.1<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/hii15mbft3p4qyu/Avenger96_v6.9_2020-03-28.img.zip?dl=0 OpenSTLinux-2.1 based on Yocto Dunfell LTS and Linux 5.4.56 - v6.9 Starter Image] (Supported by Arrow Electronics) [[Starter Image Changelog]]<br />
: This Image includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change them.]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Mezzanine Boards by DH electronics ==<br />
<br />
==== DSI Display Adaptor Board ====<br />
[[File:DSI Display Adaptor Board.jpg|thumb|DSI Display Adaptor Board]]<br />
You can easily add an DSI display to your Avenger96 with the help of the DSI Display Adaptor Board. <br />
The display can easily be activated on our Mainline Image with an device tree overlay as described * [[DHCOR_STM32MP1_Linux| here]]. <br />
To get one of the boards, simply reach out to us and we'll prepare one for you.<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3414Avenger962021-07-08T11:21:34Z<p>Mholzner: </p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on '''kernel 5.10.x''' and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/5r74b7ybbnq1998/2021-02-09-dh-image-demo-dh-stm32mp1-dhcor-common-avenger96.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image 2021-02-09 (based on 5.10 kernel)]<br />
* [[DHCOR_STM32MP1_Linux| Linux and bootloader documentation]]<br />
:<span style="color:#008000">'''NEW How to start with custom DHCOR design?'''</span> <br />
:The patch below is an example patch which applies on top of u-boot v2021.01 and implements a custom board derived from 3V3 option of DHCOR STM32MP1 SoM. That's pretty much all you have to change to implement the board. But, please tweak the DTs esp. where there are the FIXME comments.<br />
:[https://www.dropbox.com/s/zg6f9h1vms6lxdg/0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch?dl=0 '''NEW''' 0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.1<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/hii15mbft3p4qyu/Avenger96_v6.9_2020-03-28.img.zip?dl=0 OpenSTLinux-2.1 based on Yocto Dunfell LTS and Linux 5.4.56 - v6.9 Starter Image] (Supported by Arrow Electronics) [[Starter Image Changelog]]<br />
: This Image includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change them.]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Mezzanine Boards by DH electronics ==<br />
<br />
==== DSI Display Adaptor Board ====<br />
[[File:DSI Display Adaptor Board.jpg|thumb]]<br />
You can easily add an DSI display to your Avenger96 with the help of the DSI Display Adaptor Board. <br />
The display can easily be activated on our Mainline Image with an device tree overlay as described * [[DHCOR_STM32MP1_Linux| here]]. <br />
To get one of the boards, simply reach out to us and we'll prepare one for you. <br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=File:DSI_Display_Adaptor_Board.jpg&diff=3413File:DSI Display Adaptor Board.jpg2021-07-08T11:21:27Z<p>Mholzner: </p>
<hr />
<div>DSI Display Adaptor Board for 96Boards</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3412DHCOR STM32MP1 Linux2021-07-08T09:49:32Z<p>Mholzner: /* Activating Device Tree Overlays */</p>
<hr />
<div>== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN support:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp15xx-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp15xx-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp15xx-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 port (96Boards name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the second UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
:After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the home directory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finally connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART0 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all block devices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format the new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
=== Read out the ADC Pins ===<br />
:The GPIOs G and H are mapped as ADC pins. These pins can meassure a value from 0 V to 2,9 V. This reference voltage of 2,9 V is driven by the LDO1 of the PMIC. <br />
:The value measured is calculated as followed:<br />
::''<tt>Umeassured = ( RAW + OFFSET ) * SCALE</tt>''<br />
<br />
:You can read out the values as followed:<br />
<br />
:'''GPIO G:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device0</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage6_raw</tt><br />
|}<br />
<br />
<br />
:'''GPIO H:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device1</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage2_raw</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1 (Standard UART)<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (mapped as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (mapped as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}<br />
<br />
== Linux Kernel ==<br />
<br />
<!-- === Sources: Look at page [[DHCOM iMX6ULL-D2#BSP Sources|i.MX6ULL BSP Sources]] === --><br />
<br />
=== How to build a Kernel ===<br />
{| class="wikitable" align="center" | style="width: 98%; background: #f3f3f3;" valign="top" |<br />
|<br />
Get sources from Github<br />
{| class="wikitable" style="width: 100%; color: #000000; background: #ffffff;" |<br />
|<br />
1. Start the Console on Linux<br/><br />
2. <tt>''git clone https://github.com/dh-electronics/linux-stm32mp1.git --branch dev/5.4.69_dhsom''</tt><br/><br />
3. <tt>''cd linux-stm32mp1''</tt><br />
|}<br />
Configure and build the Device Tree + Kernel<br />
{| class="wikitable" style="width: 100%; color: #000000; background: #ffffff;" |<br />
| <br />
4. <tt>''ARCH=arm CROSS_COMPILE=/opt/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make stm32mp1_dhsom_defconfig''</tt><br/><br />
5. <tt>''ARCH=arm CROSS_COMPILE=/opt/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make menuconfig''</tt> (optional: If you want to add/remove Kernel features)<br/><br />
6. <tt>''ARCH=arm CROSS_COMPILE=/opt/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make dtbs''</tt><br/><br />
7. <tt>''ARCH=arm CROSS_COMPILE=/opt/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make zImage</tt><br />
|}<br />
Create the FIT-image with our script ([https://www.dropbox.com/s/0jtyget66cxgq30/dh-create-fitimage_1.0_all.deb?raw=1 Download link])<br />
{| class="wikitable" style="width: 100%; color: #000000; background: #ffffff;" |<br />
|-<br />
| '''Interactive mode for selecting device trees'''<br />
| '''Device trees are set as parameter'''<br />
|-<br />
|<br />
8. <tt>''create_fitimage''</tt><br/><br />
Enter the numbers (space seperated) of the device trees to include (e.g. if you want to include the device tree for the Avenger96 include the number of <tt>''./arch/arm/boot/dts/stm32mp157a-avenger96.dtb''</tt> (usually 1).<br/><br />
Enter the numbers (space seperated) of the device trees overlays to include (e.g. for the Avenger96 enter the files which contain <tt>''Avenger96''</tt> (usually 0 1 2 3 4 5 6 7).<br />
|<br />
(Example is for the Avenger96) <br><br />
8. <tt>''create_fitimage --dtb ./arch/arm/boot/dts/stm32mp157a-avenger96.dtb --dtbo ./arch/arm/boot/dts/stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo,./arch/arm/boot/dts/stm32mp157a-avenger96-overlay-644-100-x6-rpi7inch.dtbo,./arch/arm/boot/dts/stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo,./arch/arm/boot/dts/stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo,./arch/arm/boot/dts/stm32mp157a-avenger96-overlay-i2c1-eeprom-x6.dtbo,./arch/arm/boot/dts/stm32mp157a-avenger96-overlay-i2c2-eeprom-x6.dtbo,./arch/arm/boot/dts/stm32mp157a-avenger96-overlay-ov5640-x7.dtbo,./arch/arm/boot/dts/stm32mp157a-avenger96-overlay-spi2-eeprom-x6.dtbo''</tt><br />
|}<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3274Avenger962021-04-09T16:01:13Z<p>Mholzner: /* OpenSTLinux */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on '''kernel 5.10.x''' and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/5r74b7ybbnq1998/2021-02-09-dh-image-demo-dh-stm32mp1-dhcor-common-avenger96.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image 2021-02-09 (based on 5.10 kernel)]<br />
* [[DHCOR_STM32MP1_Linux| Linux and bootloader documentation]]<br />
:<span style="color:#008000">'''NEW How to start with custom DHCOR design?'''</span> <br />
:The patch below is an example patch which applies on top of u-boot v2021.01 and implements a custom board derived from 3V3 option of DHCOR STM32MP1 SoM. That's pretty much all you have to change to implement the board. But, please tweak the DTs esp. where there are the FIXME comments.<br />
:[https://www.dropbox.com/s/zg6f9h1vms6lxdg/0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch?dl=0 '''NEW''' 0001-ARM-dts-stm32-Add-DHCOR-based-FOO-board-u-boot-v2021.01.patch]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.1<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/hii15mbft3p4qyu/Avenger96_v6.9_2020-03-28.img.zip?dl=0 OpenSTLinux-2.1 based on Yocto Dunfell LTS and Linux 5.4.56 - v6.9 Starter Image] (Supported by Arrow Electronics) [[Starter Image Changelog]]<br />
: This Image includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change them.]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Starter_Image_Changelog&diff=3273Starter Image Changelog2021-04-09T15:57:47Z<p>Mholzner: /* OpenSTLinux-4.19-thud Image Changelog */</p>
<hr />
<div>== OpenSTLinux Image Changelog ==<br />
'''Changelog v6.5.0 to v6.9.0:'''<br />
* Added PPP support for the Quectel EC-25 module on the LTE-Sensors mezzanine board. <br />
* Added a Python-based application for demonstrating how to connect to the Azure IoT Hub and send telemetrie data. This demo also works through an LTE connection. <br />
<br />
'''Changelog v6.0.0 to v6.5.0:'''<br />
* upgraded to use OpenSTLinux v2.1<br />
* Linux kernel 5.4.56<br />
* support added for D3 camera mezzanine<br />
* Docker 19.03.8-ce added<br />
* static IP address fixed on usb0 interface<br />
* headless boot fixed<br />
<br />
'''Changelog v5.0.0 to v6.0.0:'''<br />
* upgrade to OpenSTLinux v2.0 which is the latest distro from ST and is based on Yocto Dunfell LTS and Linux 5.4<br />
* direct support for the Shiratech 96B-MEZ-CAM1 board which demonstrates the OnSemi AR1337 image sensor and the OnSemi AP1302 ISP https://www.shiratech-solutions.com/products/cam1/<br />
:Other features and issues<br />
:The standard uSD image created by the BSP now contains 4 different boot modes:<br />
:* plain Avenger96 without any mezzanine cards<br />
:* support for Tresor TPM2 board with tpm2-tools: https://www.96boards.org/product/tresor/<br />
:* support for Shiratech 96B-MEZ-CAM1 board<br />
:* support and demo for Shiratech LTE and Sensors mezzanine: https://www.96boards.org/product/shiratech-lte/<br />
:The boot mode can be selected in U-Boot menu during startup.<br />
:One remaining minor issue of the BSP is that STM32CubeProgrammer can’t initialize the uSD card when the selected boot media is NOR+SDCARD. It can initialize the NOR flash and with separately written uSD card the whole NOR+SDCARD boot process works. Later I will try to fix the BSP so that STM32CubeProgrammer can do the whole initialization in a single step.<br />
<br />
'''Changelog v4.1.0 to v5.0.0:'''<br />
* tf-a now supports pure eMMC boot on silicon revision 2.1, rev Z<br />
* init script moved to meta-av96-scripts repo, manifest file moved to manifest-av96 repo. meta-av96 layer is now totally independent of the manifest and init scripts.<br />
* meta-av96 now uses STM32MP15-Ecosystem-v1.2.0<br />
* meta-av96 and av96-5.0.img uSD card image now support the “apt-get” feature of STM32MP15-Ecosystem-v1.2.0<br />
<br />
'''Changelog v3.2.0 to v4.1.0:'''<br />
* STMIPID02 and D3 camera mezzanine patches added, OV5640 camera can be tested with the default Weston GUI.<br />
* Source folder structure reworked. meta-av96 now uses a ‘repo’ manifest-based setup. ‘thud’ branch created and folder structure resembles more the ST way.<br />
<br />
'''Changelog v2.1.0 to v3.2.0:'''<br />
* U-Boot sets ethernet MAC address from 24AA02 EEprom<br />
* mmc0 now supports switching to 1.8V, UHS-I cards speeded up<br />
* HW version 1 added to U-Boot device tree, U-Boot now checks HW version of the actual Avenger96 board<br />
* Flashlayout file generation fixed, no need to change Flashlayout files manually before programming nor+emmc<br />
<br />
'''Changelog v2.0.3 to v2.1.0:'''<br />
* HDMI max resolution fixed, it’s 1280x720@60Hz again<br />
* DRAM size in U-Boot fixed, Linux now sees the whole 1GB<br />
* UART0 and SPI now supported on low-speed extension connector<br />
* tpm2-tools and tpm2-tss-engine for openssl added, TPM2.0 chip on Tresor board supported by openssl<br />
<br />
'''Changelog v2.0.2 to v2.0.3:'''<br />
* DHCP server running at usb0 network interface<br />
<br />
'''Changelog v2.0.1 to v2.0.2:'''<br />
* Supported features in U-Boot: UART, DDR3, QSPI, uSD, eMMC, ethernet<br />
* PRODUCT_BELOW_2V5 fix in U-Boot<br />
* Supported features in Linux: UART, uSD, eMMC, USB host, USB OTG, HDMI, GPU, WiFi, Bluetooth, Gbit ethernet<br />
* STM32CubeProgrammer can initialize NOR, eMMC, uSD<br />
* Avenger96 can boot from uSD or NOR+eMMC<br />
* BSP contains a single meta-av96 layer and a readme.txt<br />
* BSP builds the whole uSD or NOR+eMMC image in a single step, no extra file operations are needed<br />
* Standard STM32MP157C-DK2 demo runs on Avenger96: WiFi hotspot, video playback with sound, 3D demo<br />
Improvements compared to av96 v2.0.1:<br />
* SDMMC1,2,3 order fixed, build process simplified<br />
* WiFi fixed<br />
* Sound over HDMI, GPU support (there was no GPU in v2.0.1 because of EULA issues during build)<br />
* Bluetooth support, dummy soundcard added for BT (not tested yet)<br />
* QSPI, eMMC in U-Boot, PRODUCT_BELOW_2V5 programming added -> Gbit ethernet<br />
* STM32CubeProgrammer can initialize NOR, eMMC, uSD (a single manual modification of flashlayout files is still needed for NOR+eMMC boot -> needs to be documented yet)<br />
<br />
'''Changelog v1.2 to v2.0.1:'''<br />
* Switch to ST v1.0.0 SDK with 4.19 kernel<br />
* Till now, not all features of v1.2 (based on beta1 release of ST with 4.14 kernel support) are supported with v2.0.1 release<br />
* NOT working: QSPI in U-Boot and Linux, eMMC in U-Boot, WiFi, … <br />
* Working interfaces: HDMI, Ethernet, USB, uSD card and Gigabit ethernet (on board with programmed PRODUCT_BELOW_2V5 fuse)<br />
'''Changelog v1.1 to v1.2:'''<br />
* /home/root folder contains simple OpenAMP demo<br />
* HSLVEN_QSPI fix (from ST) was added to make QSPI boot work again with PRODUCT_BELOW_2V5 programmed<br />
'''Changelog v1.0 to v1.1:'''<br />
* Updated U-Boot which programs the PRODUCT_BELOW_2V5 fuse if necessary and reboots the board<br />
* BUCK3 voltage changed to 2.5V which enables Gbit ethernet support<br />
* Icon added in Weston for starting glmark2-es2-wayland<br />
* /etc/issue contains version info<br />
* Reduced display resolution of HDMI<br />
<br />
'''Old Images and Yocto releases:'''<br />
* [https://www.dropbox.com/s/9xqwirt8t48atvw/Avenger96_v6.5_2020-12-16.img.zip?dl=0 OpenSTLinux-4.19-thud v6.5.0 Starter Image]<br />
* [https://www.dropbox.com/s/viyqhcyiumt9kzg/Avenger96_v6.0_2020-11-09.zip?dl=0 OpenSTLinux-4.19-thud v6.0.0 Starter Image]<br />
* [https://www.dropbox.com/s/i29htstp35awt3m/Avenger96_v5.0.0_2020-07-08.zip?dl=0 OpenSTLinux-4.19-thud v5.0.0 Starter Image]<br />
* [https://www.dropbox.com/s/ygjzu52syc63fi4/Avenger96_v4.1.0_2020-02-12.zip?dl=0 OpenSTLinux-4.19-thud v4.1.0 Starter Image]<br />
* [https://www.dropbox.com/s/3r52ld1f5zl09jb/Avenger96_v3.2.0_2019-08-09.zip?dl=0 OpenSTLinux-4.19-thud v3.2.0 Starter Image]<br />
* [https://www.dropbox.com/s/4x0olkqv3g983d7/Avenger96_v2.1.0_2019-05-22.zip?dl=0 Avenger96 v2.1.0 Starter Image]<br />
* [https://www.dropbox.com/s/ypv15rpe5a6wze4/Avenger96_v2.0.3_2019-05-03.zip?dl=0 Avenger96 v2.0.3 Starter Image]<br />
* [https://www.dropbox.com/s/wm1faek37u8c9v9/Avenger96_v2.0.2_2019-04-25.zip?dl=0 Avenger96 v2.0.2 Starter Image]<br />
* [https://www.dropbox.com/s/bevx8wv1fpf2ir8/Avenger96_v2.0.1_2019-04-12.zip?dl=0 Avenger96 v2.0.1 Starter Image]<br />
* [https://www.dropbox.com/s/6x484idku2youbw/meta-av96.thud.e11d35a1_2019-04-12.zip?dl=0 Avenger96 Yocto meta layer (based on v2.0.1 image from 2019-04-12)]<br />
* [https://www.dropbox.com/s/6oe6r1w3ig1vhep/Avenger96_v1.2_2019-03-29.zip?dl=0 Avenger96 v1.2 Starter Image]<br />
* [https://www.dropbox.com/s/c30rbj1z4wijpx4/Avenger96_v1.1_2019-03-15.zip?dl=0 Avenger96 v1.1 Starter Image]<br />
* [https://www.dropbox.com/s/cu3ivdukcp1x40g/Avenger96_EW_v1.0_2019-02-15.zip?dl=0 Avenger96 Embedded World v1.0 Starter Image]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3224Avenger962020-12-18T17:06:59Z<p>Mholzner: /* OpenSTLinux */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform '''NEW''' Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/nffk6xgm91ysqf3/dh-image-demo-dh-stm32mp1-dhcor-common-avenger96_2020-09-04.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image]<br />
* [[DHCOR_STM32MP1_Linux|'''NEW''' Linux and bootloader documentation]]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.1<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/9xqwirt8t48atvw/Avenger96_v6.5_2020-12-16.img.zip?dl=0 OpenSTLinux-2.1 based on Yocto Dunfell LTS and Linux 5.4.56 - v6.5 Starter Image] (Supported by Arrow Electronics) [[Starter Image Changelog]]<br />
: This Image includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change them.]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Starter_Image_Bootmode&diff=3223Starter Image Bootmode2020-12-18T17:02:15Z<p>Mholzner: </p>
<hr />
<div>With the Version v6.0 (and newer) of the Starter Image you can easily switch between four bootmodes:<br />
:* plain Avenger96 without any mezzanine boards<br />
:* support for Tresor TPM2 board with tpm2-tools: https://www.96boards.org/product/tresor/<br />
:* support for Shiratech 96B-MEZ-CAM1 board<br />
:* support and demo for Shiratech LTE and Sensors mezzanine: https://www.96boards.org/product/shiratech-lte/<br />
<br />
<br><br />
<br />
:The bootmode can be selected in U-Boot menu during startup.<br />
:To do so, wait during the first seconds of startup untill you are asked to selecte a boot mode:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>Select the boot mode <br>1: Avenger96 without mezzanines<br>2: Tresor TPM + UART board<br>3: Shiratech 96B-MEZ-CAM1 camera<br>4: M4-core demo on LTE-sensors board<br>Enter choice: </tt><br />
|}<br />
<br />
:After seeing these lines, simple add you number of choice and hit enter to continue the boot process. <br />
<br />
<br><br />
<br />
:If you want to change the settings permanently, please modify this file:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>/boot/mmc0_extlinux/stm32mp157a-av96_extlinux.conf</tt><br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Starter_Image_Changelog&diff=3222Starter Image Changelog2020-12-18T17:01:39Z<p>Mholzner: /* OpenSTLinux-4.19-thud Image Changelog */</p>
<hr />
<div>== OpenSTLinux-4.19-thud Image Changelog ==<br />
'''Changelog v6.0.0 to v6.5.0:'''<br />
* upgraded to use OpenSTLinux v2.1<br />
* Linux kernel 5.4.56<br />
* support added for D3 camera mezzanine<br />
* Docker 19.03.8-ce added<br />
* static IP address fixed on usb0 interface<br />
* headless boot fixed<br />
<br />
'''Changelog v5.0.0 to v6.0.0:'''<br />
* upgrade to OpenSTLinux v2.0 which is the latest distro from ST and is based on Yocto Dunfell LTS and Linux 5.4<br />
* direct support for the Shiratech 96B-MEZ-CAM1 board which demonstrates the OnSemi AR1337 image sensor and the OnSemi AP1302 ISP https://www.shiratech-solutions.com/products/cam1/<br />
:Other features and issues<br />
:The standard uSD image created by the BSP now contains 4 different boot modes:<br />
:* plain Avenger96 without any mezzanine cards<br />
:* support for Tresor TPM2 board with tpm2-tools: https://www.96boards.org/product/tresor/<br />
:* support for Shiratech 96B-MEZ-CAM1 board<br />
:* support and demo for Shiratech LTE and Sensors mezzanine: https://www.96boards.org/product/shiratech-lte/<br />
:The boot mode can be selected in U-Boot menu during startup.<br />
:One remaining minor issue of the BSP is that STM32CubeProgrammer can’t initialize the uSD card when the selected boot media is NOR+SDCARD. It can initialize the NOR flash and with separately written uSD card the whole NOR+SDCARD boot process works. Later I will try to fix the BSP so that STM32CubeProgrammer can do the whole initialization in a single step.<br />
<br />
'''Changelog v4.1.0 to v5.0.0:'''<br />
* tf-a now supports pure eMMC boot on silicon revision 2.1, rev Z<br />
* init script moved to meta-av96-scripts repo, manifest file moved to manifest-av96 repo. meta-av96 layer is now totally independent of the manifest and init scripts.<br />
* meta-av96 now uses STM32MP15-Ecosystem-v1.2.0<br />
* meta-av96 and av96-5.0.img uSD card image now support the “apt-get” feature of STM32MP15-Ecosystem-v1.2.0<br />
<br />
'''Changelog v3.2.0 to v4.1.0:'''<br />
* STMIPID02 and D3 camera mezzanine patches added, OV5640 camera can be tested with the default Weston GUI.<br />
* Source folder structure reworked. meta-av96 now uses a ‘repo’ manifest-based setup. ‘thud’ branch created and folder structure resembles more the ST way.<br />
<br />
'''Changelog v2.1.0 to v3.2.0:'''<br />
* U-Boot sets ethernet MAC address from 24AA02 EEprom<br />
* mmc0 now supports switching to 1.8V, UHS-I cards speeded up<br />
* HW version 1 added to U-Boot device tree, U-Boot now checks HW version of the actual Avenger96 board<br />
* Flashlayout file generation fixed, no need to change Flashlayout files manually before programming nor+emmc<br />
<br />
'''Changelog v2.0.3 to v2.1.0:'''<br />
* HDMI max resolution fixed, it’s 1280x720@60Hz again<br />
* DRAM size in U-Boot fixed, Linux now sees the whole 1GB<br />
* UART0 and SPI now supported on low-speed extension connector<br />
* tpm2-tools and tpm2-tss-engine for openssl added, TPM2.0 chip on Tresor board supported by openssl<br />
<br />
'''Changelog v2.0.2 to v2.0.3:'''<br />
* DHCP server running at usb0 network interface<br />
<br />
'''Changelog v2.0.1 to v2.0.2:'''<br />
* Supported features in U-Boot: UART, DDR3, QSPI, uSD, eMMC, ethernet<br />
* PRODUCT_BELOW_2V5 fix in U-Boot<br />
* Supported features in Linux: UART, uSD, eMMC, USB host, USB OTG, HDMI, GPU, WiFi, Bluetooth, Gbit ethernet<br />
* STM32CubeProgrammer can initialize NOR, eMMC, uSD<br />
* Avenger96 can boot from uSD or NOR+eMMC<br />
* BSP contains a single meta-av96 layer and a readme.txt<br />
* BSP builds the whole uSD or NOR+eMMC image in a single step, no extra file operations are needed<br />
* Standard STM32MP157C-DK2 demo runs on Avenger96: WiFi hotspot, video playback with sound, 3D demo<br />
Improvements compared to av96 v2.0.1:<br />
* SDMMC1,2,3 order fixed, build process simplified<br />
* WiFi fixed<br />
* Sound over HDMI, GPU support (there was no GPU in v2.0.1 because of EULA issues during build)<br />
* Bluetooth support, dummy soundcard added for BT (not tested yet)<br />
* QSPI, eMMC in U-Boot, PRODUCT_BELOW_2V5 programming added -> Gbit ethernet<br />
* STM32CubeProgrammer can initialize NOR, eMMC, uSD (a single manual modification of flashlayout files is still needed for NOR+eMMC boot -> needs to be documented yet)<br />
<br />
'''Changelog v1.2 to v2.0.1:'''<br />
* Switch to ST v1.0.0 SDK with 4.19 kernel<br />
* Till now, not all features of v1.2 (based on beta1 release of ST with 4.14 kernel support) are supported with v2.0.1 release<br />
* NOT working: QSPI in U-Boot and Linux, eMMC in U-Boot, WiFi, … <br />
* Working interfaces: HDMI, Ethernet, USB, uSD card and Gigabit ethernet (on board with programmed PRODUCT_BELOW_2V5 fuse)<br />
'''Changelog v1.1 to v1.2:'''<br />
* /home/root folder contains simple OpenAMP demo<br />
* HSLVEN_QSPI fix (from ST) was added to make QSPI boot work again with PRODUCT_BELOW_2V5 programmed<br />
'''Changelog v1.0 to v1.1:'''<br />
* Updated U-Boot which programs the PRODUCT_BELOW_2V5 fuse if necessary and reboots the board<br />
* BUCK3 voltage changed to 2.5V which enables Gbit ethernet support<br />
* Icon added in Weston for starting glmark2-es2-wayland<br />
* /etc/issue contains version info<br />
* Reduced display resolution of HDMI<br />
<br />
'''Old Images and Yocto releases:'''<br />
* [https://www.dropbox.com/s/i29htstp35awt3m/Avenger96_v5.0.0_2020-07-08.zip?dl=0 OpenSTLinux-4.19-thud v5.0.0 Starter Image]<br />
* [https://www.dropbox.com/s/ygjzu52syc63fi4/Avenger96_v4.1.0_2020-02-12.zip?dl=0 OpenSTLinux-4.19-thud v4.1.0 Starter Image]<br />
* [https://www.dropbox.com/s/3r52ld1f5zl09jb/Avenger96_v3.2.0_2019-08-09.zip?dl=0 OpenSTLinux-4.19-thud v3.2.0 Starter Image]<br />
* [https://www.dropbox.com/s/4x0olkqv3g983d7/Avenger96_v2.1.0_2019-05-22.zip?dl=0 Avenger96 v2.1.0 Starter Image]<br />
* [https://www.dropbox.com/s/ypv15rpe5a6wze4/Avenger96_v2.0.3_2019-05-03.zip?dl=0 Avenger96 v2.0.3 Starter Image]<br />
* [https://www.dropbox.com/s/wm1faek37u8c9v9/Avenger96_v2.0.2_2019-04-25.zip?dl=0 Avenger96 v2.0.2 Starter Image]<br />
* [https://www.dropbox.com/s/bevx8wv1fpf2ir8/Avenger96_v2.0.1_2019-04-12.zip?dl=0 Avenger96 v2.0.1 Starter Image]<br />
* [https://www.dropbox.com/s/6x484idku2youbw/meta-av96.thud.e11d35a1_2019-04-12.zip?dl=0 Avenger96 Yocto meta layer (based on v2.0.1 image from 2019-04-12)]<br />
* [https://www.dropbox.com/s/6oe6r1w3ig1vhep/Avenger96_v1.2_2019-03-29.zip?dl=0 Avenger96 v1.2 Starter Image]<br />
* [https://www.dropbox.com/s/c30rbj1z4wijpx4/Avenger96_v1.1_2019-03-15.zip?dl=0 Avenger96 v1.1 Starter Image]<br />
* [https://www.dropbox.com/s/cu3ivdukcp1x40g/Avenger96_EW_v1.0_2019-02-15.zip?dl=0 Avenger96 Embedded World v1.0 Starter Image]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Starter_Image_Changelog&diff=3221Starter Image Changelog2020-12-18T17:01:16Z<p>Mholzner: /* OpenSTLinux-4.19-thud Image Changelog */</p>
<hr />
<div>== OpenSTLinux-4.19-thud Image Changelog ==<br />
'''Changelog v6.0.0 to v6.5.0:'''<br />
* upgraded to use OpenSTLinux v2.1<br />
* Linux kernel 5.4.56<br />
<br />
:* support added for D3 camera mezzanine<br />
:* Docker 19.03.8-ce added<br />
:* static IP address fixed on usb0 interface<br />
:* headless boot fixed<br />
<br />
'''Changelog v5.0.0 to v6.0.0:'''<br />
* upgrade to OpenSTLinux v2.0 which is the latest distro from ST and is based on Yocto Dunfell LTS and Linux 5.4<br />
* direct support for the Shiratech 96B-MEZ-CAM1 board which demonstrates the OnSemi AR1337 image sensor and the OnSemi AP1302 ISP https://www.shiratech-solutions.com/products/cam1/<br />
:Other features and issues<br />
:The standard uSD image created by the BSP now contains 4 different boot modes:<br />
:* plain Avenger96 without any mezzanine cards<br />
:* support for Tresor TPM2 board with tpm2-tools: https://www.96boards.org/product/tresor/<br />
:* support for Shiratech 96B-MEZ-CAM1 board<br />
:* support and demo for Shiratech LTE and Sensors mezzanine: https://www.96boards.org/product/shiratech-lte/<br />
:The boot mode can be selected in U-Boot menu during startup.<br />
:One remaining minor issue of the BSP is that STM32CubeProgrammer can’t initialize the uSD card when the selected boot media is NOR+SDCARD. It can initialize the NOR flash and with separately written uSD card the whole NOR+SDCARD boot process works. Later I will try to fix the BSP so that STM32CubeProgrammer can do the whole initialization in a single step.<br />
<br />
'''Changelog v4.1.0 to v5.0.0:'''<br />
* tf-a now supports pure eMMC boot on silicon revision 2.1, rev Z<br />
* init script moved to meta-av96-scripts repo, manifest file moved to manifest-av96 repo. meta-av96 layer is now totally independent of the manifest and init scripts.<br />
* meta-av96 now uses STM32MP15-Ecosystem-v1.2.0<br />
* meta-av96 and av96-5.0.img uSD card image now support the “apt-get” feature of STM32MP15-Ecosystem-v1.2.0<br />
<br />
'''Changelog v3.2.0 to v4.1.0:'''<br />
* STMIPID02 and D3 camera mezzanine patches added, OV5640 camera can be tested with the default Weston GUI.<br />
* Source folder structure reworked. meta-av96 now uses a ‘repo’ manifest-based setup. ‘thud’ branch created and folder structure resembles more the ST way.<br />
<br />
'''Changelog v2.1.0 to v3.2.0:'''<br />
* U-Boot sets ethernet MAC address from 24AA02 EEprom<br />
* mmc0 now supports switching to 1.8V, UHS-I cards speeded up<br />
* HW version 1 added to U-Boot device tree, U-Boot now checks HW version of the actual Avenger96 board<br />
* Flashlayout file generation fixed, no need to change Flashlayout files manually before programming nor+emmc<br />
<br />
'''Changelog v2.0.3 to v2.1.0:'''<br />
* HDMI max resolution fixed, it’s 1280x720@60Hz again<br />
* DRAM size in U-Boot fixed, Linux now sees the whole 1GB<br />
* UART0 and SPI now supported on low-speed extension connector<br />
* tpm2-tools and tpm2-tss-engine for openssl added, TPM2.0 chip on Tresor board supported by openssl<br />
<br />
'''Changelog v2.0.2 to v2.0.3:'''<br />
* DHCP server running at usb0 network interface<br />
<br />
'''Changelog v2.0.1 to v2.0.2:'''<br />
* Supported features in U-Boot: UART, DDR3, QSPI, uSD, eMMC, ethernet<br />
* PRODUCT_BELOW_2V5 fix in U-Boot<br />
* Supported features in Linux: UART, uSD, eMMC, USB host, USB OTG, HDMI, GPU, WiFi, Bluetooth, Gbit ethernet<br />
* STM32CubeProgrammer can initialize NOR, eMMC, uSD<br />
* Avenger96 can boot from uSD or NOR+eMMC<br />
* BSP contains a single meta-av96 layer and a readme.txt<br />
* BSP builds the whole uSD or NOR+eMMC image in a single step, no extra file operations are needed<br />
* Standard STM32MP157C-DK2 demo runs on Avenger96: WiFi hotspot, video playback with sound, 3D demo<br />
Improvements compared to av96 v2.0.1:<br />
* SDMMC1,2,3 order fixed, build process simplified<br />
* WiFi fixed<br />
* Sound over HDMI, GPU support (there was no GPU in v2.0.1 because of EULA issues during build)<br />
* Bluetooth support, dummy soundcard added for BT (not tested yet)<br />
* QSPI, eMMC in U-Boot, PRODUCT_BELOW_2V5 programming added -> Gbit ethernet<br />
* STM32CubeProgrammer can initialize NOR, eMMC, uSD (a single manual modification of flashlayout files is still needed for NOR+eMMC boot -> needs to be documented yet)<br />
<br />
'''Changelog v1.2 to v2.0.1:'''<br />
* Switch to ST v1.0.0 SDK with 4.19 kernel<br />
* Till now, not all features of v1.2 (based on beta1 release of ST with 4.14 kernel support) are supported with v2.0.1 release<br />
* NOT working: QSPI in U-Boot and Linux, eMMC in U-Boot, WiFi, … <br />
* Working interfaces: HDMI, Ethernet, USB, uSD card and Gigabit ethernet (on board with programmed PRODUCT_BELOW_2V5 fuse)<br />
'''Changelog v1.1 to v1.2:'''<br />
* /home/root folder contains simple OpenAMP demo<br />
* HSLVEN_QSPI fix (from ST) was added to make QSPI boot work again with PRODUCT_BELOW_2V5 programmed<br />
'''Changelog v1.0 to v1.1:'''<br />
* Updated U-Boot which programs the PRODUCT_BELOW_2V5 fuse if necessary and reboots the board<br />
* BUCK3 voltage changed to 2.5V which enables Gbit ethernet support<br />
* Icon added in Weston for starting glmark2-es2-wayland<br />
* /etc/issue contains version info<br />
* Reduced display resolution of HDMI<br />
<br />
'''Old Images and Yocto releases:'''<br />
* [https://www.dropbox.com/s/i29htstp35awt3m/Avenger96_v5.0.0_2020-07-08.zip?dl=0 OpenSTLinux-4.19-thud v5.0.0 Starter Image]<br />
* [https://www.dropbox.com/s/ygjzu52syc63fi4/Avenger96_v4.1.0_2020-02-12.zip?dl=0 OpenSTLinux-4.19-thud v4.1.0 Starter Image]<br />
* [https://www.dropbox.com/s/3r52ld1f5zl09jb/Avenger96_v3.2.0_2019-08-09.zip?dl=0 OpenSTLinux-4.19-thud v3.2.0 Starter Image]<br />
* [https://www.dropbox.com/s/4x0olkqv3g983d7/Avenger96_v2.1.0_2019-05-22.zip?dl=0 Avenger96 v2.1.0 Starter Image]<br />
* [https://www.dropbox.com/s/ypv15rpe5a6wze4/Avenger96_v2.0.3_2019-05-03.zip?dl=0 Avenger96 v2.0.3 Starter Image]<br />
* [https://www.dropbox.com/s/wm1faek37u8c9v9/Avenger96_v2.0.2_2019-04-25.zip?dl=0 Avenger96 v2.0.2 Starter Image]<br />
* [https://www.dropbox.com/s/bevx8wv1fpf2ir8/Avenger96_v2.0.1_2019-04-12.zip?dl=0 Avenger96 v2.0.1 Starter Image]<br />
* [https://www.dropbox.com/s/6x484idku2youbw/meta-av96.thud.e11d35a1_2019-04-12.zip?dl=0 Avenger96 Yocto meta layer (based on v2.0.1 image from 2019-04-12)]<br />
* [https://www.dropbox.com/s/6oe6r1w3ig1vhep/Avenger96_v1.2_2019-03-29.zip?dl=0 Avenger96 v1.2 Starter Image]<br />
* [https://www.dropbox.com/s/c30rbj1z4wijpx4/Avenger96_v1.1_2019-03-15.zip?dl=0 Avenger96 v1.1 Starter Image]<br />
* [https://www.dropbox.com/s/cu3ivdukcp1x40g/Avenger96_EW_v1.0_2019-02-15.zip?dl=0 Avenger96 Embedded World v1.0 Starter Image]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3220Avenger962020-12-18T14:54:32Z<p>Mholzner: /* OpenSTLinux */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform '''NEW''' Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/nffk6xgm91ysqf3/dh-image-demo-dh-stm32mp1-dhcor-common-avenger96_2020-09-04.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image]<br />
* [[DHCOR_STM32MP1_Linux|'''NEW''' Linux and bootloader documentation]]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.1<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/viyqhcyiumt9kzg/Avenger96_v6.0_2020-11-09.zip?dl=0 OpenSTLinux-2.0 based on Yocto Dunfell LTS and Linux 5.4 - v6.0 Starter Image] (Supported by Arrow Electronics) [[Starter Image Changelog]]<br />
: This Image includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change them.]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3219Avenger962020-12-18T14:53:47Z<p>Mholzner: /* OpenSTLinux */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform '''NEW''' Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/nffk6xgm91ysqf3/dh-image-demo-dh-stm32mp1-dhcor-common-avenger96_2020-09-04.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image]<br />
* [[DHCOR_STM32MP1_Linux|'''NEW''' Linux and bootloader documentation]]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.1<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST v1.2.0 SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/viyqhcyiumt9kzg/Avenger96_v6.0_2020-11-09.zip?dl=0 OpenSTLinux-2.0 based on Yocto Dunfell LTS and Linux 5.4 - v6.0 Starter Image] (Supported by Arrow Electronics) [[Starter Image Changelog]]<br />
: This Image includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change them.]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3204Avenger962020-11-12T16:11:27Z<p>Mholzner: /* OpenSTLinux */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform '''NEW''' Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/nffk6xgm91ysqf3/dh-image-demo-dh-stm32mp1-dhcor-common-avenger96_2020-09-04.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image]<br />
* [[DHCOR_STM32MP1_Linux|'''NEW''' Linux and bootloader documentation]]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.0<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST v1.2.0 SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/viyqhcyiumt9kzg/Avenger96_v6.0_2020-11-09.zip?dl=0 OpenSTLinux-2.0 based on Yocto Dunfell LTS and Linux 5.4 - v6.0 Starter Image] (Supported by Arrow Electronics) [[Starter Image Changelog]]<br />
: This Image includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change them.]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3203Avenger962020-11-12T16:11:04Z<p>Mholzner: /* OpenSTLinux */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform '''NEW''' Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/nffk6xgm91ysqf3/dh-image-demo-dh-stm32mp1-dhcor-common-avenger96_2020-09-04.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image]<br />
* [[DHCOR_STM32MP1_Linux|'''NEW''' Linux and bootloader documentation]]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.0<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST v1.2.0 SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/viyqhcyiumt9kzg/Avenger96_v6.0_2020-11-09.zip?dl=0 OpenSTLinux-2.0 based on Yocto Dunfell LTS and Linux 5.4 - v6.0 Starter Image] (Supported by Arrow Electronics) [[Starter Image Changelog]]<br />
: This Image includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change between them.]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Starter_Image_Bootmode&diff=3202Starter Image Bootmode2020-11-12T16:10:33Z<p>Mholzner: </p>
<hr />
<div>With the Version v6.0 of the Starter Image you can easily switch between four bootmodes:<br />
:* plain Avenger96 without any mezzanine boards<br />
:* support for Tresor TPM2 board with tpm2-tools: https://www.96boards.org/product/tresor/<br />
:* support for Shiratech 96B-MEZ-CAM1 board<br />
:* support and demo for Shiratech LTE and Sensors mezzanine: https://www.96boards.org/product/shiratech-lte/<br />
<br />
<br><br />
<br />
:The bootmode can be selected in U-Boot menu during startup.<br />
:To do so, wait during the first seconds of startup untill you are asked to selecte a boot mode:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>Select the boot mode <br>1: Avenger96 without mezzanines<br>2: Tresor TPM + UART board<br>3: Shiratech 96B-MEZ-CAM1 camera<br>4: M4-core demo on LTE-sensors board<br>Enter choice: </tt><br />
|}<br />
<br />
:After seeing these lines, simple add you number of choice and hit enter to continue the boot process. <br />
<br />
<br><br />
<br />
:If you want to change the settings permanently, please modify this file:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>/boot/mmc0_extlinux/stm32mp157a-av96_extlinux.conf</tt><br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Starter_Image_Bootmode&diff=3201Starter Image Bootmode2020-11-12T16:09:35Z<p>Mholzner: </p>
<hr />
<div>With the Version v6.0 of the Starter Image you can easily switch between four bootmodes:<br />
:* plain Avenger96 without any mezzanine boards<br />
:* support for Tresor TPM2 board with tpm2-tools: https://www.96boards.org/product/tresor/<br />
:* support for Shiratech 96B-MEZ-CAM1 board<br />
:* support and demo for Shiratech LTE and Sensors mezzanine: https://www.96boards.org/product/shiratech-lte/<br />
<br />
<br><br />
<br />
:The bootmode can be selected in U-Boot menu during startup.<br />
:To do so, wait during the first seconds of startup untill you are asked to selecte a boot mode:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>Select the boot mode <br>1: Avenger96 without mezzanines<br>2: Tresor TPM + UART board<br>3: Shiratech 96B-MEZ-CAM1 camera<br>4: M4-core demo on LTE-sensors board<br>Enter choice: </tt><br />
|}<br />
<br />
:After seeing these lines, simple add you number of choice and hit enter to continue the boot process. <br />
<br />
<br><br />
<br />
:If you want to change the settings permanently, simply modify this file:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>/boot/mmc0_extlinux/stm32mp157a-av96_extlinux.conf</tt><br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3200Avenger962020-11-12T16:08:36Z<p>Mholzner: /* OpenSTLinux */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform '''NEW''' Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/nffk6xgm91ysqf3/dh-image-demo-dh-stm32mp1-dhcor-common-avenger96_2020-09-04.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image]<br />
* [[DHCOR_STM32MP1_Linux|'''NEW''' Linux and bootloader documentation]]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.0<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST v1.2.0 SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/viyqhcyiumt9kzg/Avenger96_v6.0_2020-11-09.zip?dl=0 OpenSTLinux-2.0 based on Yocto Dunfell LTS and Linux 5.4 - v6.0 Starter Image] (Supported by Arrow Electronics) [[Starter Image Changelog]]<br />
: This Image includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change between them.]<br />
<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Starter_Image_Bootmode&diff=3199Starter Image Bootmode2020-11-12T16:07:13Z<p>Mholzner: </p>
<hr />
<div>With the Version v6.0 of the Starter Image you can easily switch between four bootmodes:<br />
:* plain Avenger96 without any mezzanine boards<br />
:* support for Tresor TPM2 board with tpm2-tools: https://www.96boards.org/product/tresor/<br />
:* support for Shiratech 96B-MEZ-CAM1 board<br />
:* support and demo for Shiratech LTE and Sensors mezzanine: https://www.96boards.org/product/shiratech-lte/<br />
<br />
<br><br />
<br />
:The boot mode can be selected in U-Boot menu during startup.<br />
:To do so, wait during the first seconds of startup untill you are asked to selecte a boot mode:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>Select the boot mode <br>1: Avenger96 without mezzanines<br>2: Tresor TPM + UART board<br>3: Shiratech 96B-MEZ-CAM1 camera<br>4: M4-core demo on LTE-sensors board<br>Enter choice: </tt><br />
|}<br />
<br />
:After seeing these lines, simple add you number of choice and hit enter to continue the boot process. <br />
<br />
<br><br />
<br />
:If you want to change the settings permanently, simply modify this file:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>/boot/mmc0_extlinux/stm32mp157a-av96_extlinux.conf</tt><br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Starter_Image_Bootmode&diff=3198Starter Image Bootmode2020-11-12T16:06:20Z<p>Mholzner: </p>
<hr />
<div>With the Version v6.0 of the Starter Image you can easily switch between four bootmodes:<br />
:* plain Avenger96 without any mezzanine boards<br />
:* support for Tresor TPM2 board with tpm2-tools: https://www.96boards.org/product/tresor/<br />
:* support for Shiratech 96B-MEZ-CAM1 board<br />
:* support and demo for Shiratech LTE and Sensors mezzanine: https://www.96boards.org/product/shiratech-lte/<br />
<br />
<br><br />
<br />
:The boot mode can be selected in U-Boot menu during startup.<br />
:To do so, wait during the first seconds of startup untill you are asked to selecte a boot mode:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>Select the boot mode <br>1: Avenger96 without mezzanines<br>2: Tresor TPM + UART board<br>3: Shiratech 96B-MEZ-CAM1 camera<br>4: M4-core demo on LTE-sensors board<br>Enter choice: </tt><br />
|}<br />
<br />
:After seeing these lines, simple add you number of choice and hit enter to continue the boot process. <br />
<br />
<br><br />
<br />
:If you want to change the settings permanently, you have to modify this file:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>/boot/mmc0_extlinux/stm32mp157a-av96_extlinux.conf</tt><br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Starter_Image_Bootmode&diff=3197Starter Image Bootmode2020-11-12T16:05:55Z<p>Mholzner: </p>
<hr />
<div>With the Version v6.0 of the Starter Image you can easily switch between four bootmodes:<br />
:* plain Avenger96 without any mezzanine cards<br />
:* support for Tresor TPM2 board with tpm2-tools: https://www.96boards.org/product/tresor/<br />
:* support for Shiratech 96B-MEZ-CAM1 board<br />
:* support and demo for Shiratech LTE and Sensors mezzanine: https://www.96boards.org/product/shiratech-lte/<br />
<br />
<br><br />
<br />
:The boot mode can be selected in U-Boot menu during startup.<br />
:To do so, wait during the first seconds of startup untill you are asked to selecte a boot mode:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>Select the boot mode <br>1: Avenger96 without mezzanines<br>2: Tresor TPM + UART board<br>3: Shiratech 96B-MEZ-CAM1 camera<br>4: M4-core demo on LTE-sensors board<br>Enter choice: </tt><br />
|}<br />
<br />
:After seeing these lines, simple add you number of choice and hit enter to continue the boot process. <br />
<br />
<br><br />
<br />
:If you want to change the settings permanently, you have to modify this file:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>/boot/mmc0_extlinux/stm32mp157a-av96_extlinux.conf</tt><br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Starter_Image_Bootmode&diff=3196Starter Image Bootmode2020-11-12T16:05:00Z<p>Mholzner: </p>
<hr />
<div>With the Version v6.0 of the Starter Image you can easily switch between four bootmodes:<br />
:* plain Avenger96 without any mezzanine cards<br />
:* support for Tresor TPM2 board with tpm2-tools: https://www.96boards.org/product/tresor/<br />
:* support for Shiratech 96B-MEZ-CAM1 board<br />
:* support and demo for Shiratech LTE and Sensors mezzanine: https://www.96boards.org/product/shiratech-lte/<br />
<br />
<br><br />
<br />
:The boot mode can be selected in U-Boot menu during startup.<br />
:To do so, wait during the first seconds of startup untill you are asked to selecte a boot mode:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>Select the boot mode <br>1: Avenger96 without mezzanines<br>2: Tresor TPM + UART board<br>3: Shiratech 96B-MEZ-CAM1 camera<br>4: M4-core demo on LTE-sensors board<br>Enter choice: </tt><br />
|}<br />
<br />
:After seeing this line, simple add you number of choice and hit enter to continue the boot process. <br />
<br />
<br><br />
<br />
:If you want to change the settings permanently, you have to modify this file:<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>/boot/mmc0_extlinux/stm32mp157a-av96_extlinux.conf</tt><br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3195Avenger962020-11-12T15:54:00Z<p>Mholzner: /* OpenSTLinux */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform '''NEW''' Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/nffk6xgm91ysqf3/dh-image-demo-dh-stm32mp1-dhcor-common-avenger96_2020-09-04.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image]<br />
* [[DHCOR_STM32MP1_Linux|'''NEW''' Linux and bootloader documentation]]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.0<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST v1.2.0 SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/viyqhcyiumt9kzg/Avenger96_v6.0_2020-11-09.zip?dl=0 OpenSTLinux-2.0 based on Yocto Dunfell LTS and Linux 5.4 - v6.0 Starter Image] (Supported by Arrow Electronics)<br />
: This Image also includes four different bootmodes to support some additional mezzanine boars. [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode Click here to learn, how to change between them.]<br />
:[[Starter Image Changelog]]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3194Avenger962020-11-12T15:52:36Z<p>Mholzner: /* OpenSTLinux */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform '''NEW''' Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/nffk6xgm91ysqf3/dh-image-demo-dh-stm32mp1-dhcor-common-avenger96_2020-09-04.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image]<br />
* [[DHCOR_STM32MP1_Linux|'''NEW''' Linux and bootloader documentation]]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.0<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST v1.2.0 SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/viyqhcyiumt9kzg/Avenger96_v6.0_2020-11-09.zip?dl=0 OpenSTLinux-2.0 based on Yocto Dunfell LTS and Linux 5.4 - v6.0 Starter Image] (Supported by Arrow Electronics)<br />
: This Image also includes four different bootmodes to support some mezzanine boars. See [https://wiki.dh-electronics.com/index.php/Starter_Image_Bootmode here], how to change between them. <br />
:[[Starter Image Changelog]]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Starter_Image_Bootmode&diff=3193Starter Image Bootmode2020-11-12T15:48:34Z<p>Mholzner: Created page with "With the Version v6.0 of the Starter Image you can easily switch between four bootmodes: * plain Avenger96 without any mezzanine cards * support for Tresor TPM2 board with tpm..."</p>
<hr />
<div>With the Version v6.0 of the Starter Image you can easily switch between four bootmodes:<br />
* plain Avenger96 without any mezzanine cards<br />
* support for Tresor TPM2 board with tpm2-tools: https://www.96boards.org/product/tresor/<br />
* support for Shiratech 96B-MEZ-CAM1 board<br />
* support and demo for Shiratech LTE and Sensors mezzanine: https://www.96boards.org/product/shiratech-lte/<br />
The boot mode can be selected in U-Boot menu during startup.<br />
<br />
To swtich between them, wait during the first seconds of startup untill you are asked to selecte a boot mode:<br />
<br />
Select the boot mode<br />
1: Avenger96 without mezzanines<br />
2: Tresor TPM + UART board<br />
3: Shiratech 96B-MEZ-CAM1 camera<br />
4: M4-core demo on LTE-sensors board<br />
Enter choice:<br />
<br />
After seeing this line, simple add you number of choice and hit enter to continue the boot process. <br />
<br />
<br />
If you want to change the settings permanently, you have to modify this file:<br />
<br />
/boot/mmc0_extlinux/stm32mp157a-av96_extlinux.conf</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=Avenger96&diff=3192Avenger962020-11-11T17:35:26Z<p>Mholzner: /* OpenSTLinux */</p>
<hr />
<div>'''The Avenger96 board is the official DHCOR STM32MP1 reference design!'''<br />
<br />
{|<br />
|<br />
|<br />
|-<br />
|__TOC__<br />
|[[Image:Avenger96Board.png|600px|COM Avenger96Board]]<br />
|}<br />
<br />
== Introduction ==<br />
The AVENGER Board is a 96Boards compliant consumer edition board based on the STM32MP15 series of SoCs. The STM32MP15 series <br />
is a highly integrated multi-market applications processor designed to enable secure and portable applications within the Internet of Things. <br />
AVENGER board features Dual-core Arm® Cortex®-A7 processors operating at up to 650 MHz, Single core Arm® Cortex® M4 operating up to <br />
209 MHz. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays, <br />
MMC/SD cards and media processor engine. It also fully supports wireless communication, including WLAN and BLE.<br />
<br />
== Technical Details ==<br />
{| class="wikitable" align="center" | style="width: 100%; color: #000000; background: #f3f3f3;" valign="top" |<br />
|-<br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
| style="width: 50%; background: #076b8d; border: 0pt;" | <br />
|-<br />
|valign="top" style="border: 0pt;" | <br />
* '''STM32MP157AAC<br />
**2x ARM® Cortex-A7 up to 650 MHz<br />
**1x ARM® Cortex-M4 up to 209 MHz <br />
'''<br />
*'''GPU''' 1x 3D GPU Vivante® @ 533 MHz - OpenGL® ES 2.0<br />
*'''PMIC''' STPMIC1A<br />
*'''DDR3 DRAM''' 1024 Mbyte @ 533 MHz<br />
*'''eMMC Flash''' 8 Gbyte, v4.51 interface<br />
*'''NOR Flash''' 2 Mbyte, Quad SPI interface<br />
*'''EEPROM''' 128 byte<br />
*'''microSD Socket''' UHS-I speed grade, v3.01<br />
*'''USB Host''' 2x type A, 2.0 high-speed<br />
*'''USB OTG''' 1x type micro-AB, 2.0 high-speed<br />
*'''HDMI''' WXGA (1366x768) @ 60 fps, HDMI 1.4<br />
*'''WiFi / Bluetooth''' <br />
**WiFi 5 GHz & 2.4GHz IEEE 802.11a / b / g / n / ac<br />
**Bluetooth® v4.2 (BR/EDR/BLE)<br />
**PCB antenna<br />
*'''Ethernet''' 10 / 100 / 1000 Mbit/s, IEEE 802.3-compliant<br />
|valign="top" style="border: 0pt;" |<br />
*'''Push-Buttons''' Power and reset<br />
*'''Battery Socket''' CR1216, CR1220 and CR1225<br />
*'''LEDs'''<br />
**4x green user controlled LEDs <br />
**1x blue Bluetooth enabled <br />
**1x yellow WiFi enabled<br />
**1x red power supply okay<br />
*'''Boot Mode''' 3 bit boot mode switch<br />
*'''Debug Interface''' JTAG interface via tag-connect<br />
*'''Supply (SYS_DCIN)''' 8 - 18 VDC<br />
*'''Temperature Range''' 0 - 40 °C<br />
*'''Dimensions ''' 100 x 85 mm<br />
*'''Serial Peripherals''' <br />
**2 x UART<br />
**2 x I2C<br />
**1 x I2S<br />
**1 x SPI<br />
**1 x GPIOs<br />
|}<br />
<br />
== Documentation ==<br />
* [https://www.dropbox.com/s/f9jvcdq8rgb3e3f/DOC_Getting-Started-588-200_R03_2020-05-29.pdf?dl=1 Avenger96 588-200 Getting-Started R03]<br />
* [https://www.dropbox.com/s/40k1tygmsiogy6r/USM_DHCOR-STM32MP1_R05_2019-12-12.pdf?dl=0 '''NEW''' DHCOR STM32MP1 User Manual R05 <span style="color:#FF0000">'''IMPORTANT: Please have a look at NEW chapter 24. Hardware design checklist'''</span> ]<br />
:'''NOTE:''' Please also have a look at the STM32 MPU wiki: [[Avenger96#Links | Links]]<br />
<br />
== Design Files ==<br />
* [https://www.dropbox.com/s/u8nihe1xd6ysk3v/SCH_588-200-HS00008-public_R07_2019-08-01.pdf?dl=0 Avenger96 Schematic]<br />
* [https://www.dropbox.com/s/1gyb53slm50uu80/BOM_588-200-HS00008-public_R07_2019-08-01.xlsx?dl=0 Avenger96 Bill of Material]<br />
* [https://www.dropbox.com/s/78otmzqqbw0fkio/588-200_TOP_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Top]<br />
* [https://www.dropbox.com/s/su226xkonru494t/588-200_BOTTOM_ASSEMBLY__R04_2019-04-12.pdf?dl=0 Avenger96 Assembly Bottom]<br />
* [https://www.dropbox.com/s/orku1po5d7gywwd/BRD_588-200-with-DHCOR_2020-06-22.STEP?dl=1 Avenger96 3D STEP file]<br />
* [https://www.dropbox.com/s/yjx9l0qj9ja0de8/DHCOR-STM32MP1-Design-Symbols_2019-10-16.zip?dl=0 DHCOR STM32MP1 Allegro/Orcad schematic and layout symbols (release date: 16.10.2019) '''Now with Allegro *.brd file and 3D information''']<br />
* [https://www.dropbox.com/s/s4n5j9wzhhrv6so/DHCOR_STM32MP1_3D_STEP_586-100_R02.zip?dl=0 DHCOR STM32MP1 3D STEP file]<br />
* [https://www.dropbox.com/s/4i0la7q1wkv4anh/DHCOR-PinMux-TFBGA361-Avenger96-HW200_2019-05-03.zip?dl=0 Avenger96 CubeMX configuration (release date: 03.05.2019)]<br />
<br />
== Software ==<br />
=== DH Mainline based Linux ===<br />
:'''Notes:''' <br />
:- The Mainline based Linux offers Etnaviv GPU driver support!!!<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/dhcom_stm32mp1-bsp-platform '''NEW''' Yocto meta layer --> Github]<br />
* [https://www.dropbox.com/s/nffk6xgm91ysqf3/dh-image-demo-dh-stm32mp1-dhcor-common-avenger96_2020-09-04.wic.xz?dl=0 '''NEW''' DH Mainline based Starter Image]<br />
* [[DHCOR_STM32MP1_Linux|'''NEW''' Linux and bootloader documentation]]<br />
<br />
=== OpenSTLinux ===<br />
:'''Notes:''' <br />
:- Based on OpenSTLinux v2.0<br />
:- GPU support based on original vivante GPU driver.<br />
:- Based on kernel 5.4.x and Yocto version dunfell<br />
* [https://github.com/dh-electronics/manifest-av96 Yocto meta layer --> Github]<br />
:DH electronics Github contains the meta-av96 layer for ST v1.2.0 SDK. Please see readme.txt which describes the build process.<br />
<br />
* [https://www.dropbox.com/s/viyqhcyiumt9kzg/Avenger96_v6.0_2020-11-09.zip?dl=0 OpenSTLinux-2.0 based on Yocto Dunfell LTS and Linux 5.4 - v6.0 Starter Image]<br />
:[[Starter Image Changelog]]<br />
<br />
:'''X-LINUX-AI OpenSTLinux Expansion Package:''' Description: Expansion Package that targets artificial intelligence for STM32MP1 Series devices.<br />
* [https://wiki.st.com/stm32mpu/wiki/X-LINUX-AI_OpenSTLinux_Expansion_Package '''NEW''' X-LINUX-AI OpenSTLinux Expansion Package]<br />
* [https://wiki.st.com/stm32mpu/wiki/How_to_install_X-LINUX-AI_v2.0.0_on_Avenger96_board '''NEW''' How to install X-LINUX-AI v2.0.0 on Avenger96 board]<br />
<br />
=== Debian ===<br />
* [http://releases.linaro.org/96boards/avenger96/ Debian Buster Starter Image]<br />
<br />
== Useful instructions ==<br />
<br />
==== SPI Flash and eMMC Image Programming ====<br />
*[[Avenger96 Image Programming | Avenger96 Image Programming]]<br />
<br />
== Links ==<br />
* [https://wiki.st.com/stm32mpu/wiki/Main_Page STM32 MPU wiki]<br />
* [https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration STM32 MPU wiki - Device tree configuration]<br />
* [https://wiki.st.com/stm32mpu/index.php/STM32MP15_resources STM32MP15 resources]<br />
* [https://www.96boards.org/ 96Boards]</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3116DHCOR STM32MP1 Linux2020-09-02T14:19:45Z<p>Mholzner: /* I²C Interfaces */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART0 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
=== Read out the ADC Pins ===<br />
:The GPIOs G and H are mapped as ADC pins. These pins can meassure a value from 0 V to 2,9 V. This reference voltage of 2,9 V is driven by the LDO1 of the PMIC. <br />
:The value measured is calculated as followed:<br />
::''<tt>Umeassured = ( RAW + OFFSET ) * SCALE</tt>''<br />
<br />
:You can read out the values as followed:<br />
<br />
:'''GPIO G:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device0</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage6_raw</tt><br />
|}<br />
<br />
<br />
:'''GPIO H:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device1</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage2_raw</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1 (Standard UART)<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (mapped as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (mapped as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3115DHCOR STM32MP1 Linux2020-09-02T14:19:37Z<p>Mholzner: /* Kernel Userspace Interfaces to Access Hardware */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART0 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
=== Read out the ADC Pins ===<br />
:The GPIOs G and H are mapped as ADC pins. These pins can meassure a value from 0 V to 2,9 V. This reference voltage of 2,9 V is driven by the LDO1 of the PMIC. <br />
:The value measured is calculated as followed:<br />
::''<tt>Umeassured = ( RAW + OFFSET ) * SCALE</tt>''<br />
<br />
:You can read out the values as followed:<br />
<br />
:'''GPIO G:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device0</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage6_raw</tt><br />
|}<br />
<br />
<br />
:'''GPIO H:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device1</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage2_raw</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1 (Standard UART)<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 2000px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (mapped as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (mapped as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3114DHCOR STM32MP1 Linux2020-09-02T14:18:55Z<p>Mholzner: /* Serial (UART) Interfaces */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART0 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
=== Read out the ADC Pins ===<br />
:The GPIOs G and H are mapped as ADC pins. These pins can meassure a value from 0 V to 2,9 V. This reference voltage of 2,9 V is driven by the LDO1 of the PMIC. <br />
:The value measured is calculated as followed:<br />
::''<tt>Umeassured = ( RAW + OFFSET ) * SCALE</tt>''<br />
<br />
:You can read out the values as followed:<br />
<br />
:'''GPIO G:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device0</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage6_raw</tt><br />
|}<br />
<br />
<br />
:'''GPIO H:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device1</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage2_raw</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 200px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 200px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1 (Standard UART)<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (mapped as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (mapped as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3113DHCOR STM32MP1 Linux2020-09-02T14:18:40Z<p>Mholzner: /* Serial (UART) Interfaces */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART0 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
=== Read out the ADC Pins ===<br />
:The GPIOs G and H are mapped as ADC pins. These pins can meassure a value from 0 V to 2,9 V. This reference voltage of 2,9 V is driven by the LDO1 of the PMIC. <br />
:The value measured is calculated as followed:<br />
::''<tt>Umeassured = ( RAW + OFFSET ) * SCALE</tt>''<br />
<br />
:You can read out the values as followed:<br />
<br />
:'''GPIO G:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device0</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage6_raw</tt><br />
|}<br />
<br />
<br />
:'''GPIO H:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device1</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage2_raw</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1 (Standard UART)<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (mapped as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (mapped as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3112DHCOR STM32MP1 Linux2020-09-02T14:16:39Z<p>Mholzner: /* Activating the MIPI CSI Interface */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART0 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
=== Read out the ADC Pins ===<br />
:The GPIOs G and H are mapped as ADC pins. These pins can meassure a value from 0 V to 2,9 V. This reference voltage of 2,9 V is driven by the LDO1 of the PMIC. <br />
:The value measured is calculated as followed:<br />
::''<tt>Umeassured = ( RAW + OFFSET ) * SCALE</tt>''<br />
<br />
:You can read out the values as followed:<br />
<br />
:'''GPIO G:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device0</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage6_raw</tt><br />
|}<br />
<br />
<br />
:'''GPIO H:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device1</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage2_raw</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1 (Standard Console)<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (mapped as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (mapped as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3111DHCOR STM32MP1 Linux2020-09-02T14:16:15Z<p>Mholzner: /* Serial (UART) Interfaces */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
=== Read out the ADC Pins ===<br />
:The GPIOs G and H are mapped as ADC pins. These pins can meassure a value from 0 V to 2,9 V. This reference voltage of 2,9 V is driven by the LDO1 of the PMIC. <br />
:The value measured is calculated as followed:<br />
::''<tt>Umeassured = ( RAW + OFFSET ) * SCALE</tt>''<br />
<br />
:You can read out the values as followed:<br />
<br />
:'''GPIO G:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device0</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage6_raw</tt><br />
|}<br />
<br />
<br />
:'''GPIO H:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device1</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage2_raw</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1 (Standard Console)<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (mapped as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (mapped as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3110DHCOR STM32MP1 Linux2020-09-02T13:59:16Z<p>Mholzner: /* GPIOs */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
=== Read out the ADC Pins ===<br />
:The GPIOs G and H are mapped as ADC pins. These pins can meassure a value from 0 V to 2,9 V. This reference voltage of 2,9 V is driven by the LDO1 of the PMIC. <br />
:The value measured is calculated as followed:<br />
::''<tt>Umeassured = ( RAW + OFFSET ) * SCALE</tt>''<br />
<br />
:You can read out the values as followed:<br />
<br />
:'''GPIO G:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device0</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage6_raw</tt><br />
|}<br />
<br />
<br />
:'''GPIO H:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device1</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage2_raw</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (mapped as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (mapped as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3109DHCOR STM32MP1 Linux2020-09-02T13:47:38Z<p>Mholzner: /* Read out the ADC Pins */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
=== Read out the ADC Pins ===<br />
:The GPIOs G and H are mapped as ADC pins. These pins can meassure a value from 0 V to 2,9 V. This reference voltage of 2,9 V is driven by the LDO1 of the PMIC. <br />
:The value measured is calculated as followed:<br />
::''<tt>Umeassured = ( RAW + OFFSET ) * SCALE</tt>''<br />
<br />
:You can read out the values as followed:<br />
<br />
:'''GPIO G:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device0</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage6_raw</tt><br />
|}<br />
<br />
<br />
:'''GPIO H:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device1</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage2_raw</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (Used as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (Used as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3108DHCOR STM32MP1 Linux2020-09-02T13:47:03Z<p>Mholzner: /* Read out the ADC Pins */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
=== Read out the ADC Pins ===<br />
:The GPIOs G and H are mapped as ADC pins. These pins can meassure a value from 0 V to 2,9 V. The 2,9 V rail is driven by the LDO1 of the PMIC. <br />
:The value measured is calculated as followed:<br />
::''<tt>Umeassured = ( RAW + OFFSET ) * SCALE</tt>''<br />
<br />
:You can read out the values as followed:<br />
<br />
:'''GPIO G:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device0</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage6_raw</tt><br />
|}<br />
<br />
<br />
:'''GPIO H:'''<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device1</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage2_raw</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (Used as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (Used as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3107DHCOR STM32MP1 Linux2020-09-02T13:46:26Z<p>Mholzner: /* Read out the ADC Pins */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
=== Read out the ADC Pins ===<br />
:The GPIOs G and H are mapped as ADC pins. These pins can meassure a value from 0 V to 2,9 V. The 2,9 V rail is driven by the LDO1 of the PMIC. <br />
:The value measured is calculated as followed:<br />
::''<tt>Umeassured = ( RAW + OFFSET ) * SCALE</tt>''<br />
<br />
:You can read out the values as followed:<br />
<br />
:GPIO G:<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device0</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage6_raw</tt><br />
|}<br />
<br />
<br />
:GPIO H:<br />
:Navigate to its directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /sys/bus/iio/devices/iio:device1</tt><br />
|}<br />
<br />
:Read out ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_scale</tt><br />
|}<br />
<br />
:Read out ''<tt>OFFSET</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage_offset</tt><br />
|}<br />
<br />
:Once you know these two values, you can read the actual ADC value<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cat in_voltage2_raw</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (Used as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (Used as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3106DHCOR STM32MP1 Linux2020-09-02T13:33:04Z<p>Mholzner: /* Formatting and mounting the eMMC */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
=== Read out the ADC Pins ===<br />
:The GPIOs G and H are mapped as ADC pins. These pins can meassure a value from 0 V to 2,9 V. The 2,9 V rail is driven by the LDO1 of the PMIC. <br />
:The value measured is calculated as followed:<br />
::''<tt>Umeassured = ( RAW + OFFSET ) * SCALE</tt>''<br />
Before reading out the value you have to read out the ''<tt>OFFSET</tt>'' and ''<tt>SCALE</tt>''<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
''<tt> </tt>''<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (Used as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (Used as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3105DHCOR STM32MP1 Linux2020-09-02T13:27:04Z<p>Mholzner: /* GPIOs */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
<br />
''<tt> </tt>''<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (Used as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (Used as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3104DHCOR STM32MP1 Linux2020-09-02T13:26:55Z<p>Mholzner: /* GPIOs */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
<br />
''<tt> </tt>''<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G (Used as ADC)<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H (USed as ADC)<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3103DHCOR STM32MP1 Linux2020-09-02T13:25:38Z<p>Mholzner: /* Formatting and mounting the eMMC */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
<br />
''<tt> </tt>''<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3102DHCOR STM32MP1 Linux2020-09-02T13:25:29Z<p>Mholzner: /* Formatting and mounting the eMMC */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
<br />
:Now select the partitiontable ''<tt>gpt</tt>''. Then in the menu you can add a new partiton by entering ''<tt>new</tt>'' and then the size of your partition e.g. ''<tt>7G</tt>''. <br />
:After that enter ''<tt>write</tt>'' and confirm it with ''<tt>yes</tt>''. Then you can ''<tt>quit</tt>'' this tool. <br />
<br />
:Now you can format you new partition<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mkfs.ext4 /dev/mmcblk2p1</tt><br />
|}<br />
<br />
:To access this partition you have to mount it just like an USB-Stick<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/mmcblk2p1 /mnt</tt><br />
|}<br />
<br />
<br />
''<tt> </tt>''<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3101DHCOR STM32MP1 Linux2020-09-02T13:08:54Z<p>Mholzner: /* Formatting and mounting the eMMC */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:At first you can check all blockdevices by this command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# lsblk</tt><br />
|}<br />
<br />
:First partitionate the eMMC device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cfdisk /dev/mmcblk2</tt><br />
|}<br />
<br />
<br />
:Now select<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3100DHCOR STM32MP1 Linux2020-09-02T12:17:03Z<p>Mholzner: /* microSD and eMMC */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:Dieser Teil muss noch ergänzt werden!: <br />
<br />
: --> TBD <--<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <--</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| microSD<br />
| <tt>mmcblk1</tt><br />
| SDMMC1<br />
|-<br />
| eMMC<br />
| <tt>mmcblk2</tt><br />
| SDMMC2<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3099DHCOR STM32MP1 Linux2020-09-02T12:01:26Z<p>Mholzner: /* Using the second UART port */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in a terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:Dieser Teil muss noch ergänzt werden!: <br />
<br />
: --> TBD <--<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <--</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| ??????????<br />
| <tt>??????????</tt><br />
| ??????????<br />
|-<br />
| ??????????<br />
| <tt>??????????</tt><br />
| ??????????<br />
|-<br />
| ??????????<br />
| <tt>??????????</tt><br />
| ??????????<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3098DHCOR STM32MP1 Linux2020-09-02T12:00:47Z<p>Mholzner: /* Using the second UART port */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:If you want to use the second UART Port available on the Low Speed Expansion Connector of the Avenger96, you can access it easily with the tool called minicom<br />
:To open up its configuration enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# minicom -s</tt><br />
|}<br />
<br />
:Once you've opend minicom, navigate to ''<tt>Serial port setup</tt>'' and change the Serial Device to ''<tt>/dev/ttySTM1</tt>''. <br />
:Now you can hit ''<tt>exit</tt>'' and you are in an terminal which is connected to the secon UART port. <br />
<br />
:To reopen the settings of minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>O</tt>'' on your keyboard. <br />
:To close minicom press ''<tt>CTRL + A</tt>'' and then ''<tt>X</tt>'' on your keyboard.<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:Dieser Teil muss noch ergänzt werden!: <br />
<br />
: --> TBD <--<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <--</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| ??????????<br />
| <tt>??????????</tt><br />
| ??????????<br />
|-<br />
| ??????????<br />
| <tt>??????????</tt><br />
| ??????????<br />
|-<br />
| ??????????<br />
| <tt>??????????</tt><br />
| ??????????<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3097DHCOR STM32MP1 Linux2020-09-02T11:49:05Z<p>Mholzner: /* Connecting to a Bluetooth Device */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:Dieser Teil muss noch ergänzt werden!: <br />
<br />
: --> TBD <--<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <--</tt><br />
|}<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open ''<tt>bluetoothctl</tt>'' again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:Dieser Teil muss noch ergänzt werden!: <br />
<br />
: --> TBD <--<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <--</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| ??????????<br />
| <tt>??????????</tt><br />
| ??????????<br />
|-<br />
| ??????????<br />
| <tt>??????????</tt><br />
| ??????????<br />
|-<br />
| ??????????<br />
| <tt>??????????</tt><br />
| ??????????<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholznerhttps://wiki.dh-electronics.com/index.php?title=DHCOR_STM32MP1_Linux&diff=3096DHCOR STM32MP1 Linux2020-09-02T11:48:44Z<p>Mholzner: /* Connecting to a Bluetooth Device */</p>
<hr />
<div><br />
<br />
'''CAUTION! THIS PAGE IS UNDER CONSTRUCTION!'''<br />
<br />
<br />
== U-Boot Bootloader Commands ==<br />
<br />
=== Activating Device Tree Overlays ===<br />
:Some of the hardware features can be activated with the help of a device tree overlay. To activate a device tree overlay, you have to go into the U-Boot console first. This can be done during the first seconds after startup, by simply hitting any button on a keyboard once the system tells you to do so. <br />
<br />
:When you are in the bootloder, you can view a list of all available device tree overlays with the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> ls mmc 0:4 /boot </tt><br />
|}<br />
<br />
:After that, you can select a device tree overlay with the following commands:<br />
<br />
:To activate CAN on the GPIOs :<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-fdcan1-x6.dtbo#conf@stm32mp157a-avenger96-overlay-fdcan2-x6.dtbo' </tt><br />
|}<br />
<br />
:To activate the 96Boards D3Camera Mezzanine Board enter:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-ov5640-x7.dtbo' </tt><br />
|}<br />
<br />
:If you want to make use of the MIPI DSI interface, you can start with an MIPI DSI interface board developed by DH electronics. If you want to use it, simply contact us to find out more about it. <br />
:To activate the MIPI DSI Interface enter the following device tree overlay. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb#conf@stm32mp157a-avenger96-overlay-644-100-x6-otm8009a.dtbo' </tt><br />
|}<br />
<br />
:If you want to save your settings, so that you don't have to enter the device tree overlay after every reboot, enter this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> saveenv </tt><br />
|}<br />
<br />
:To reset your device tree overlay, simply override the last settings:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> setenv loaddtos '#conf@stm32mp157a-avenger96.dtb' </tt><br />
|}<br />
<br />
:Once the device tree overlay is set, you can boot up your board by entering boot:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''> boot </tt><br />
|}<br />
<br />
== Linux Userspace Commands ==<br />
<br />
=== Logging in after Startup ===<br />
:After booting, you con login as the user "root" without any password. Note, that the standard console is connected to the UART 1 Port (96Boards Name). <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>dh-stm32mp1-dhcor-avenger96 login: '''root'''</tt><br />
|}<br />
<br />
=== Interacting with GPIOs ===<br />
:An GPIO can be activated with the gpioset command. To find out which GPIO is connected to what gpiochip-device, take a look at the Hardware Section below. <br />
:The GPIO "A" can be turned on by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=1</tt><br />
|}<br />
<br />
:and off by <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# gpioset gpiochip0 14=0</tt><br />
|}<br />
<br />
=== Interacting with the User LEDs ===<br />
:In between the two USB-Host connectors of the Avenger96, you can find four so called User LEDs. These LEDs can be used for simple programming examples and be accessed and manipulated by the user form the userspace. <br />
:The LEDs are located under /sys/class/leds. <br />
:To disable the blinking of the LED0 hit following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo none > /sys/class/leds/green:user0/trigger</tt><br />
|}<br />
<br />
:The LEDs can also be turned on or off permanently by writing either "1" or "0" to the following file:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 1 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# echo 0 > /sys/class/leds/green:user0/brightness</tt><br />
|}<br />
<br />
=== Accessing Devices over I2C ===<br />
:Once you have connected some I2C devices to the Avenger96, you can scan the I2C bus and see if your device is available.<br />
:To scan for devices on the I2C-Bus 1 enter the following command:<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdetect -y 1 </tt><br />
|}<br />
<br />
:To write on the device on the address 0x50 to its register number 0x10 the value 0x20 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cset -y 1 0x50 0x10 0x20 </tt><br />
|}<br />
<br />
:To read the data of the device on the address 0x50 at its register 0x10 enter this: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cget -y 1 0x50 0x10 </tt><br />
|}<br />
<br />
:For a dump of the entire registers of the device at address 0x50 enter the following command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# i2cdump -f 1 0x50 </tt><br />
|}<br />
<br />
=== Unsing the internal RTC ===<br />
:Read out the current date and time of the system (not the RTC itself)<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date</tt><br />
|}<br />
<br />
:Set a specific system time <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# date -s "2020-01-30 10:00:00"</tt><br />
|}<br />
<br />
:Save the current system time to the RTC of the STM32MP1<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -w</tt><br />
|}<br />
<br />
:When you allready have stored a date on the RTC and you want to read it out, use the next command. This command only gives back the time, but does not synchronize it with the system time. This is done in the next step. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -r</tt><br />
|}<br />
<br />
:The system time can be synchronised to the RTC by this command: <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hwclock -s</tt><br />
|}<br />
<br />
=== Using the second UART port ===<br />
:Dieser Teil muss noch ergänzt werden!: <br />
<br />
: --> TBD <--<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <--</tt><br />
|}<br />
<br />
=== Connecting to a WiFi network ===<br />
:After bootup, you have to enter the following commands: <br />
<br />
:activating the wlan0 interface<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig wlan0 up</tt><br />
|}<br />
<br />
:Enter the SSID and the WPA Key<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_passphrase "YOUR SSID" your-wpa-key > wpa_supplicant.conf </tt><br />
|}<br />
<br />
:Defining the settings<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# wpa_supplicant -B -Dnl8011 -iwlan0 -cwpa_supplicant.conf </tt><br />
|}<br />
<br />
After that you should get the message "successfully initialized wpa_supplicant"<br />
<br />
:Requesting an IP-Address from the DHCP-Server<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# udhcpc -i wlan0 </tt><br />
|}<br />
<br />
:Checking your IP Address <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ifconfig </tt><br />
|}<br />
<br />
=== Connecting to a Bluetooth Device ===<br />
:In this example you can see how to connect a bluetooth headset to the Avenger96 and play a song over it. <br />
:For this you have to first store a *.wav audiofile in the homedirectory (/home/root). <br />
<br />
:First start pulsaudio<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# pulseaudio --start</tt><br />
|}<br />
<br />
:Bring up the Bluetooth Device<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# hciconfig hci0 up</tt><br />
|}<br />
<br />
:Start the Bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# bluetoothctl</tt><br />
|}<br />
<br />
:Now you are controlling the configuration tool. Here you can start the scanning for bluetooth devices<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan on</tt><br />
|}<br />
<br />
:Once you see the device you like to connect to stop the scanning. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# scan off</tt><br />
|}<br />
<br />
:Now Copy the MAC-address of your bluetooth device and pair to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# pair xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Next add it to the list of trusted divces<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# trust xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Finnaly connect to it<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# connect xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
:Your Headphone should now be connected to the Avenger96, so you can leave the bluetooth configuration tool<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# exit</tt><br />
|}<br />
<br />
:Now you can start playing your audiofile <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# aplay audiofile.wav</tt><br />
|}<br />
<br />
:When you want to remove your device from the Avenger96, open <tt>bluetoothctl</tt> again and remove its MAC-address<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''[bluetooth]# remove xx:xx:xx:xx:xx:xx</tt><br />
|}<br />
<br />
=== Activating the CAN interface ===<br />
:The Avenger96 has two CAN FD ports which can be accessed from the GPIOs on the Low Speed Expansion Connector: <br />
::FDCAN 1:<br />
:::PA12 - TX<br />
:::PA11 - RX<br />
<br />
::FDCAN 2:<br />
:::PB13 - TX<br />
:::PB5 - RX<br />
<br />
:To activate them, you have to add a Device Tree Overlay in the bootloader, like mentioned in the beginning of this page. <br />
:Once this is done, you have to connect a CAN-Transceiver to the GPIOs and from here you can access the CAN-Bus. <br />
<br />
:Setup CAN interface with baudrate 500kbit/sec.<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 up type can bitrate 500000</tt><br />
|}<br />
<br />
:Start to listen on CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# candump can0</tt><br />
|}<br />
<br />
:Send test message <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cansend can0 100#11.2233.44556677.88</tt><br />
|}<br />
<br />
:Deinitialize CAN port <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# ip link set can0 down</tt><br />
|}<br />
<br />
=== Activating the MIPI CSI Interface ===<br />
:The Avenger96 is compatible with the [https://www.96boards.org/product/d3camera/ D3Camera Mezzanine Board] available on the 96Boards website. <br />
<br />
:To activate this Mezzanine Board you have to connect it to the Avenger96 before you power it up. Note, that you also have to access the UART1 which is then available on the Solderpins of the D3Camera Mezzanine board. <br />
:Like for CAN you also have to activate the proper device tree overlay as describte in the beginning of this page. <br />
<br />
:Once the system is booted, you have to connect a display to the Avenger96 via HDMI and then enter the following command. <br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# XDG_RUNTIME_DIR=/var/run/user/0/ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,pixelformat=RGB565 ! waylandsink</tt><br />
|}<br />
<br />
=== Mounting a USB Drive ===<br />
:To mount a USB drive connect it to the Avenger96 and mount it with the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# mount /dev/sda1 /mnt</tt><br />
|}<br />
<br />
:Now your USB drive is available under the following directory<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# cd /mnt</tt><br />
|}<br />
<br />
:To unmount the drive enter the following command<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# umount /dev/sda1 </tt><br />
|}<br />
<br />
=== Formatting and mounting the eMMC ===<br />
:Dieser Teil muss noch ergänzt werden!: <br />
<br />
: --> TBD <--<br />
:{| class="wikitable" align="center" | style="color: #000000; background: #FFFFFF;" valign="top" |<br />
|<tt>''# --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <-- --> TBD <--</tt><br />
|}<br />
<br />
== Kernel Userspace Interfaces to Access Hardware ==<br />
The pinmuxing of the DHCOR STM32MP1 can be configured just as needed by you as a customer and therefore the interfaces used in each configuration might be different. However, to give you an easy way to start developing with the DHCOR STM32MP1 you can use the Avenger96 Board, which is the reference design for our DHCOR module. Thus, the interfaces described here, are the configuration for the Avenger96.<br />
<br />
=== Serial (UART) Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| UART 0<br />
| <tt>/dev/ttySTM1</tt><br />
| UART 7<br />
|-<br />
| UART 1<br />
| <tt>/dev/ttySTM0</tt><br />
| UART 4<br />
|}<br />
<br />
=== I²C Interfaces ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| I2C0<br />
| <tt>/dev/i2c-1</tt><br />
| I2C2<br />
|-<br />
| I2C1<br />
| <tt>/dev/i2c-0</tt><br />
| I2C1<br />
|-<br />
| OnBoard<br />
| <tt>/dev/i2c-2</tt><br />
| I2C4<br />
|}<br />
<br />
=== microSD and eMMC ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| ??????????<br />
| <tt>??????????</tt><br />
| ??????????<br />
|-<br />
| ??????????<br />
| <tt>??????????</tt><br />
| ??????????<br />
|-<br />
| ??????????<br />
| <tt>??????????</tt><br />
| ??????????<br />
|}<br />
<br />
=== GPIOs ===<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| A<br />
| <tt>gpiochip0 14</tt><br />
| PA14<br />
|-<br />
| B<br />
| <tt>gpiochip1 11</tt><br />
| PB11<br />
|-<br />
| C<br />
| <tt>gpiochip2 3</tt><br />
| PC3<br />
|-<br />
| D<br />
| <tt>gpiochip3 8</tt><br />
| PD8<br />
|-<br />
| E<br />
| <tt>gpiochip3 14</tt><br />
| PD14<br />
|-<br />
| F<br />
| <tt>gpiochip3 15</tt><br />
| PD15<br />
|-<br />
| G<br />
| <tt>gpiochip5 12</tt><br />
| PF12<br />
|-<br />
| H<br />
| <tt>gpiochip5 13</tt><br />
| PF13<br />
|-<br />
| I<br />
| <tt>gpiochip0 12</tt><br />
| PA12<br />
|-<br />
| J<br />
| <tt>gpiochip1 5</tt><br />
| PB5<br />
|-<br />
| K<br />
| <tt>gpiochip0 11</tt><br />
| PA11<br />
|-<br />
| L<br />
| <tt>gpiochip1 13</tt><br />
| PB13<br />
|}<br />
<br />
<br />
:Beside the GPIOs, the Avenger96 has also four user LEDs, which are controlled the same way as the GPIOs.<br />
:{| class="wikitable" <br />
! style="background-color:#efefef; width: 150px; text-align:left" | 96Boards Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Linux Name<br />
! style="background-color:#efefef; width: 150px; text-align:left" | Hardware Name<br />
|-<br />
| LED 0<br />
| <tt>/sys/class/leds/green:user0</tt><br />
| PZ7<br />
|-<br />
| LED 1<br />
| <tt>/sys/class/leds/green:user1</tt><br />
| PF3<br />
|-<br />
| LED 2<br />
| <tt>/sys/class/leds/green:user2</tt><br />
| PG0<br />
|-<br />
| LED 3<br />
| <tt>/sys/class/leds/green:user3</tt><br />
| PG1<br />
|}</div>Mholzner