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.
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.
On Windows
west build -p auto -b da1469x_dk_pro .\samples\basic\blinky\
On Linux
west build -p auto -b da1469x_dk_pro ./samples/basic/blinky/
After a successful 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
Right now the LED on the devkit should be blinking, If it didn't start blinking you may have to hit the reset button.
With the toolchain working we can move onto BLE. Building images with BLE needs the CMAC library, this is distributed as a binary blob in the Zephyhr HAL repos. By default these are not downloaded, you can download the library by running
west blobs fetch hal_renesas
Skipping this step will result in an error like
ninja: error: '*/zephyrproject/modules/hal/renesas/zephyr/blobs/smartbond/cmac/libcmac/libcmac.a', needed by 'zephyr/zephyr_pre0.elf', missing and no known rule to make it
Now we are ready to compile the first BLE example, which is very simple, just substitute the path to blinky with the path to a bluetooth example:
west build -p auto -b da1469x_dk_pro ./samples/bluetooth/peripheral/
This can be flashed using west flash
too. If everything went well, you should have BLE peripheral running. This can be validated with any BLE scanning app.
By default, Zephyr doesn't use one of the best features of the DA1469x devices: sleep. Thankfully the Kconfig system allows us to enable sleep easily. Simply add these lines:
CONFIG_PM=y
CONFIG_DEBUG_OPTIMIZATIONS=y
CONFIG_PM_DEVICE=y
CONFIG_REGULATOR=y
To the prj.conf file of the example you're building.
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.