Getting started with zephyr on DA1469x

From Renesas.info

Installing the toolchain

The process to install Zephyr is described in the zephyr docs.

Please note that micropython does NOT support building on windows. Windows users that want to build micropython should use WSL. A known issue with WSL is poor USB support, so that will complicate flashing hardware.

Testing on hardware

With the toolchain installed it's time to try flashing the board with a Zephyr program. The classic first project is blinky.

First, open a terminal in the zephyr folder under ~/zephyrproject(the folder you specified in west init) and build blinky.

west build -p auto -b da1469x_dk_pro .\samples\basic\blinky\ on Windows

or

west build -p auto -b da1469x_dk_pro ./samples/basic/blinky/ on Linux

After a successfull build, the board can be flashed by running west flash . This command runs EzFlashCLI to program the binary to flash. As EzFlashCLI isn't in requirements.txt yet, it may throw an error like EzFlashCLI not found. It can be installed using pip (when using WSL, make sure to install it on your Windows installation too): pip install ezflashcli

Note for WSL users: if west flash fails to find the JLink device it's possible to invoke powershell commands from WSL. The command to flash from WSL would be powershell.exe ezflashcli image_flash ./build/zephyr/zephyr.bin

Switching to the development branch

At this moment, the main branch of Zephyr has 69x drivers for GPIO, UART, SPI, I2C and USB. A notable thing that's missing from this list is BLE. This driver is done and fully operational, it just didn't make the cutoff to be merged into main before the 3.4 release deadline. This can be found on the Dialog Semiconductor github page. To switch to the updated branch you can run the following commands from the zephyr folder.

git remote add public https://github.com/dialog-semiconductor/zephyr.git

git fetch public

git checkout micropython-demo-2023

west update

west blobs fetch hal_renesas

This will pull in the latest code, and an updated HAL with the cmac binary included.

Compiling Micropython

Compiling Micropython for any board supported by Zephyr is remarkably easy(Do note windows isn't supported). Just clone the Micropython repo and build the embedded Zephyr project. The suggested place to clone Micropython is in the zephyrproject folder.

git clone -b micropython-demo-2023 https://github.com/dialog-semiconductor/micropython.git

This is the public facing repo which contains board support files that have not been merged into main yet.

With the Micropython repo cloned you are ready to build and flash:

west build -p auto -b da1469x_dk_pro ../micropython/ports/zephyr/

west flash

After flashing the board is reset and micropython is running. The Micropython REPL can be used over the serial port of the devkit.