Setting up Zephyr Environment
Detailed description about Zephyr environment can be found here. Since most of the prerequisites are common to other development, chances are you already have most of them installed on your computer. Ubuntu and its derivative users may need to uninstall outdated device-tree-compiler package and install new one by building from the sourceRunning a Sample Code
Grab one of the board listed as supported, clone the Zephyr source tree, go to one of the sample code directory and run: Default CMake generator is "Unix Makefile". However ninja is way more faster. You can override it by creating a file named PreLoad.cmake with following content: and put it in the same directory as CMakeLists.txt. Additionally you can set the board in the CMakeLists.txt so you don't have to specify in the command line. Note that this line comes before including the boilerplate setting.Blinky
We are going to use ST Disco L475 IoT01 board in this example. To control the GPIO, you need to have proper Kconfig settings. This is usually done by adding following line to the prj.conf file: However it is likely done already when you specify your board above. Check the defconfig file for your board under Zephyr SDK directory. In this case, it is:(SDK_ROOT)/boards/arm/disco_l475_iot1/disco_l475_iot1_defconfig
main.c would be Port name on line number 5 can be found:
(SDK_ROOT)/soc/arm/st_stm32/stm32l4/dts_fixup.h
Comments
Post a Comment