빌드와 flash writing
· 96b_wistrio board
west build -b 96b_wistrio samples/hello_world
west build -b 96b_wistrio samples/hello_world --pristine
west flash
· ST Nucleo F030R8
west build -b nucleo_f030r8 samples/basic/blinky
west build -b nucleo_f030r8 samples/basic/blinky --pristine
west flash
menuconfig or guiconfig를 사용하는 방법
1. uild your application as usual using either west or cmake:
Using west:
west build -b
Using CMake and ninja:
mkdir build && cd build cmake -GNinja -DBOARD= .. ninja
2. Use either of these commands to run the terminal-based menuconfig interface:
west build -t menuconfig
ninja menuconfig
Use either of these command to run the graphical guiconfig interface:
west build -t guiconfig
ninja guiconfig
[참고 사이트]
Application Development — Zephyr Project Documentation
The Zephyr build system compiles and links all components of an application into a single application image that can be run on simulated hardware or real hardware. Like any other CMake-based system, the build process takes place in two stages. First, build
docs.zephyrproject.org
openocd 추가 방법
96b_wistro보드에서 openocd를 사용하기 위해서는 다음과 같은 파일과 내용을 수정해야 한다.
boards/arm/96b_wistrio/board.cmake
boards/arm/96b_wistrio/support/openocd.cfg
openocd.cfg 수정 사항
source [find board/stm32ldiscovery.cfg] $_TARGETNAME configure -event gdb-attach { echo "Debugger attaching: halting execution" reset halt gdb_breakpoint_override hard } $_TARGETNAME configure -event gdb-detach { echo "Debugger detaching: resuming execution" resume } |
위에 source를 불러 오는 부분은 zephyr-sdk가 설치 된 곳에서 참조를 하게 된다.
"/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/share/openocd/scripts/board/stm32ldiscovery.cfg"
참조하게 되는 cfg파일에 chip에 대한 정보가 들어가 있기 때문에 각 chip에 맞는 cfg를 써야한다.(없다면 만들어야 겠죠)
board.cmake 수정 사항
# SPDX-License-Identifier: Apache-2.0 board_runner_args(jlink "--device=STM32L151CBT6" "--speed=4000") include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) |
위와 같이 device 정보를 쓰고 stlink를 통해서 테스트 할 speed를 넣어야 한다.