# Octavo Systems OSD32MP1-RED on eMMC

**URL:** <https://hub.mender.io/t/octavo-systems-osd32mp1-red-on-emmc/5649>\
**Category:** Yocto Project\
**Tags:** stm32mp1, osd32mp1-red\
**Created:** [February 28, 2023, 11:53pm UTC](https://hub.mender.io/t/octavo-systems-osd32mp1-red-on-emmc/5649 "2023-02-28T23:53:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![amsobr](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/amsobr/32/1846_2.png) [@amsobr](https://hub.mender.io/u/amsobr)\
**Post date:** [February 28, 2023, 11:53pm UTC](https://hub.mender.io/t/octavo-systems-osd32mp1-red-on-emmc/5649/1 "2023-02-28T23:53:03Z")

</div>

# Board description

The OSD32MP1-RED board is a development board for the STM32MP1 based SiP, the OSD32MP1.

The OSD32MP1 SiP contains the SoC (STM32MP157C), DDR and PMIC. The electrical connection of these 3 components is rather similar to the STM32MP157C-DK2 and probably other ST development kits too, which make it easy to port this integration to other boards (being mostly a matter of providing a matching device tree).

The main features of this board are:

- 512M DDR3
- 1GB eMMC chip
- ethernet port
- USB-C connector (which can be used as boot source)
- DIP switches to select boot source (USB/UART, SD or eMMC)
- etc.

For more details on this board please visit the [OSD32MP1-RED product page](https://octavosystems.com/octavo_products/osd32mp1-red/)

 ![osd32mp1-red-board](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/2X/6/6a0dd8494f8dde4875dfd16dd9c3056b75f3f705.png)

This integration currently targets the eMMC as boot media an uses the `STM32_Cube_Programmer` to flash the eMMC while the the board is set to USB/UART boot mode.

# Test results

The Yocto Project releases in the table below have been tested by the Mender community. Please update it if you have tested this integration on other [Yocto Project releases](https://wiki.yoctoproject.org/wiki/Releases?target=_blank):

| Yocto Project | Build | Runtime |
| --- | --- | --- |
| kirkstone (4.0) | :test_works: | :test_works: |

**Build** Means that the Yocto Project build using this Mender integration completes without errors and outputs images.  
**Runtime** Means that Mender has been verified to work on the board. For U-Boot-based boards, the [integration checklist](https://docs.mender.io/system-updates-yocto-project/board-integration/bootloader-support/u-boot/integration-checklist?target=_blank) has been verified.

# Getting started

## Prerequisites

- A supported Linux distribution and dependencies installed on your workstation/laptop as described in the [Yocto Mega Manual](https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#detailed-supported-distros)
  - NOTE. Instructions depend on which Yocto version you intend to use.

- Google repo tool [installed](https://hub.mender.io/t/google-repo/58/2) and in your `PATH`.

## Configuring the build

### Setup Yocto environment

Set the Yocto Project branch you are building for:

```auto
# set to your branch, make sure it is supported (see table above)
export BRANCH="kirkstone"

```

Create a directory for your `mender-octavo-osd32mp` setup to live in and clone the  
meta information.

```auto
mkdir mender-octavo-osd32mp && cd mender-octavo-osd32mp

```

Initialize repo manifest:

```auto
repo init -u https://github.com/mendersoftware/meta-mender-community \
           -m meta-mender-octavo-osd32mp/scripts/manifest-octavo-osd32mp.xml \
           -b ${BRANCH}

```

Fetch layers in manifest:

```auto
repo sync

```

## Setup build environment

Initialize the build environment:

```auto
source setup-environment octavo-osd32mp

```

### Configure Mender server URL (optional)

This section is not required for a successful build but images that are generated by default are only suitable for usage with the Mender client in [Standalone deployments](https://docs.mender.io/artifact-creation/standalone-deployment?target=_blank), due to lack of server configuration.

You can edit the `conf/local.conf` file to provide your Mender server configuration, ensuring the generated images and Mender Artifacts are connecting to the Mender server that you are using. There should already be a commented section in the generated `conf/local.conf` file and you can simply uncomment the relevant configuration options and assign appropriate values to them.

Build for Hosted Mender:

```auto
# To get your tenant token:
# - log in to https://hosted.mender.io
# - click your email at the top right and then "My organization"
# - press the "COPY TO CLIPBOARD"
# - assign content of clipboard to MENDER_TENANT_TOKEN
#
MENDER_SERVER_URL = "https://hosted.mender.io"
MENDER_TENANT_TOKEN = "<copy token here>"

```

### Building the image

You can now proceed with building an image:

```auto
bitbake st-image-core

```

Replace `st-image-core` with your desired image target.

### Using the build output

After a successful build, the images and build artifacts are placed in `tmp-glibc/deploy/images/osd32mp1-emmc-mender/`.

The built artefacts are comprised of several files and are meant to be flashed using the `STM32_Cube_Programmer` tool. Please see the references below for more information on how to install and run the tool.

To flash the board’s eMMC using the built artefacts:

1. Set all the board DIP switches to the **OFF** position
2. Attach the board to the computer using a USB-C cable
3. (Optional) Attach a serial adapter (TTL levels) to the debug header on the board
4. Run the STM32\_Cube\_Programmer

```auto
cd tmp-glibc/deploy/images/osd32mp1-emmc-mender
STM32_Programmer_CLI -c port=usb1 -w flashlayout_st-image-core/trusted/FlashLayout_emmc_stm32mp157c-osd32mp1-red-trusted.tsv

```

Finally, to boot the newly flashed image, set the DIP switch #2 to ON and reset the board.

On the other hand, if you already have Mender running on your device and want to deploy a rootfs update using this build, you should use the [Mender Artefact](https://docs.mender.io/overview/artifact) files, which have `.mender` suffix. You can either deploy this Artifact in managed mode with the Mender server (upload it under Releases in the server UI) or by using the Mender client [standalone mode](https://docs.mender.io/artifact-creation/standalone-deployment).

# References

- [mender-octavo-osd32mp README](https://github.com/mendersoftware/meta-mender-community/blob/kirkstone/meta-mender-octavo-osd32mp/README.md)
- [OSD32MP1-RED Getting Started Guide](https://octavosystems.com/app_notes/osd32mp1-red-getting-started/)
- [OpenSTLinux Distribution Package](https://wiki.st.com/stm32mpu/wiki/STM32MP1_Distribution_Package)
- [STM32CubeProgrammer](https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer)
- The official [Mender documentation](https://docs.mender.io/) explains how Mender works. This is simply a board-specific complement to the official documentation.

# Known issues

- This build was tested on an OSD32MP1-RED v1.1. The v1.2 board uses a different ethernet PHY connection and will likely require a different device tree to bring up the interface.
- For some reason, `core-image-minimal` lacks the devicetree in the `/boot` directory. I might find the problem and provide a solution in the future.
