Getting started with Zephyr OS on STM32F429 Discovery board with Platformio.

Why Zephyr OS?

Zephyr OS project is open source real time operating system with advanced features such as smp support, amp support features in development which are not present in FreeRTOS. Other than that it comes with device driver model which (hopefully) helps with writing portable code. One of the reason for choosing zephyr os is it’s support for multi-core architecture, there are not a lot of vendors with multi-core microcontrollers and there are some hetergeneous multi-core SoC with application core + microcontroller class core, it will be easier to migrate from single core controller to multi-core microcontroller or to AMP SoC with linux running on appliation core when inter processor core communication feature is available.

Why Platformio?

Every microcontroller vendor has own integrated development environment, porting code across the vendor platform becomes painful. Developing and targeting devices with multiple vendors is easier with platformio.

Getting started

Step 1: Install VS Code link

Step 2: Install platformio plugin in VS Code.

Step 3: Go to PIO Home under platforms search for ST STM32 and install it, this depends on vendor and/or product line.

Step 4: Install vendor specific device drivers for debugger. In this case st-link device driver available at link.

Step 5: Create new project, select board and framework.

Step 6: Write simple Hello World program and build it.

#include <zephyr.h>
#include <autoconf.h>

void main(void)
{
  printk("Hello World from %s\n",CONFIG_BOARD);  
  k_sleep(K_MSEC(100));
}

Step 7: Connect development board to a computer.

Serial devices connected to a computer listed under devices tab.

Step 8: Upload code to microcontroller using upload option under platformio menu. Open your favorite serial terminal, default baud rate for this board configuration is 115200. Reset board and monitor serial terminal.

Keep Zephyring….. 🙂