Aller au contenu principal

Build Your First App

Build the Blinky Example

Build the official Mbed OS blinky example from command line.

remarque

The references below should be changed appropriately for the board in use:

  • 6TRON_BOARD: board name (eg. Zest_Core_STM32L4A6RG)
  • 6TRON_BOARD_REPO: repository name (eg. mbed_zest-core-stm32l4a6rg)
  • MBED_TARGET: custom target name (eg. ZEST_CORE_STM32L4A6RG), see 6TRON Flash Tool
  • JLINK_DEVICE: SEGGER J-Link device name (eg. STM32L4A6RG), see 6TRON Flash Tool

Import the blinky source code example:

mbed import mbed-os-example-blinky

Download the 6TRON board support files for your board:

cd mbed-os-example-blinky
git clone https://github.com/catie-aq/6TRON_BOARD_REPO

Enable the custom target by copying its definition to the root of the project:

cp 6TRON_BOARD_REPO/custom_targets.json .

Define a target and a toolchain for your project:

mbed target MBED_TARGET
mbed toolchain GCC_ARM

And compile:

mbed compile

Flash the Target

Connect to the board with a SEGGER JLink probe.

Then flash the built example using the 6TRON Flash Tool:

sixtron_flash JLINK_DEVICE BUILD/MBED_TARGET/GCC_ARM/mbed-os-example-blinky.elf
attention

Do not forget to substitute JLINK_DEVICE and MBED_TARGET with correct values.