기본 빌드 명령어
west build -b nrf52840/dk_nrf52840 samples/basic/blinky -- -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
.zshrc에 추가(nrf HW가 nrf52840-dk 밖에 없으니 아래처럼 함수를 정의해서 사용)
nrfbuild() {
west build -b nrf52840/dk_nrf52840 "$@" -- -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
}
flash 위한 tool(nrfjprog) 설치는아래 링크 참고했음
https://docs.zephyrproject.org/latest/develop/flash_debug/nordic_segger.html#flashing
nrfjprog --eraseall -f nrf52
nrfjprog --program build/zephyr/zephyr.hex -f nrf52
nrfjprog --reset -f nrf52
.zshrc에 추가(nrf HW가 nrf52840-dk 밖에 없으니 아래처럼 함수를 정의해서 사용)
nrfprog() {
nrfjprog --eraseall -f nrf52 && \
nrfjprog --program build/zephyr/zephyr.hex -f nrf52 && \
nrfjprog --reset -f nrf52
}
.zshrc-zephyr 작성 및 적용
.zshrc 깔끔하게 만들고싶어서 .zshrc-zephyr에 따로 작성했음..zshrc
[ -f ~/.zshrc-zephyr ] && source ~/.zshrc-zephyr
.zshrc-zephyr
alias zcd="cd /home/hyjn/zephyrproject/zephyr"
nrfbuild() {
west build -b nrf52840/dk_nrf52840 "$@" -- -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
}
nrfprog() {
nrfjprog --eraseall -f nrf52 && \
nrfjprog --program build/zephyr/zephyr.hex -f nrf52 && \
nrfjprog --reset -f nrf52
}