Zephyr RTOS

Relates to #

Windows Install #

The details are in the link above, the summary of the step for installing on windows are

  • Installing choco
  • Installing west dependencies with choco
  • installing west with pip
  • the retrieving the repo and building are performed through west
  • The compiler toolchain as multiple options
    • Zephyr own SDK, not available on windows
    • GNU ARM Embedded : to be installed on a path without spaces

e.g. for a path "D:\tools\gnu_arm_embedded\9_2020-q2-update\bin\arm-none-eabi-gcc.exe" GNUARMEMB_TOOLCHAIN_PATH shall be set to D:\tools\gnu_arm_embedded\9_2020-q2-update

Linux Install #

tar -xf nRFCommandLineTools10121Linuxamd64.tar.gz
sudo dpkg -i nRF-Command-Line-Tools_10_12_1_Linux-amd64.deb

Build and Flash #

Testing blinky sample

add CONFIG_BOARD_HAS_NRF5_BOOTLOADER=n to prj.conf

tested version 2.5.99

cd ~/zephyrproject/zephyr/samples/basic/blinky
west build -p auto -b nrf52840dongle_nrf52840 -- -DCONF_FILE=prj.conf
west flash
nrfjprog -f nrf52 --reset

RTT config #

required configuration to have logs running over the segger j-link RTT (log through the same SWD interface used for programming)

prj.conf
CONFIG_GPIO=y
CONFIG_SERIAL=n
CONFIG_BOARD_HAS_NRF5_BOOTLOADER=n

# Logging
CONFIG_LOG=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n
CONFIG_BOOT_BANNER=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=n
CONFIG_RTT_CONSOLE=y

main.c
#include <zephyr.h>
#include <logging/log.h>
LOG_MODULE_REGISTER(main, LOG_LEVEL_INF);
void main(void)
{
	LOG_INF("Starting");
	int count = 0;
	while (1) {
		LOG_INF("loop: %d",count++);
	}
}