najnesnaj / pinetime-zephyr

pinetime smartwatch nrf52 zephyr
Apache License 2.0
106 stars 20 forks source link

Chapter 14 - FIRMWARE OVER THE AIR (FOTA) Documentation/Build Issue #21

Closed tdaileygithub closed 4 years ago

tdaileygithub commented 4 years ago

Excellent Work!
I successfully flashed all your zephyr sample apps except mcuboot on my pinetime dev kit!

However, I am having build/env var issues with zephyr+mcuboot build/documentation.

TLDR

export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
export ZEPHYR_SDK_INSTALL_DIR=/home/tim/zephyr-sdk-0.11.2
export ZEPHYR_BASE=/home/tim/Documents/github.com/pinetime-zephyr/work
export PATH=/home/tim/gcc-arm-none-eabi-9-2019-q4-major/bin:$PATH

cd ~/Documents/github.com
git clone https://github.com/JuulLabs-OSS/mcuboot.git
cd mcuboot
cd boot/zephyr 
mkdir build && cd build 
cmake -GNinja -DBOARD=pinetime .. ninja

Results in:

-- Selected BOARD pinetime
No board named 'pinetime' found

Which makes sense as mcuboots directory does not have that board. Is there a way to merge board dirs/link.

If I copy the pinetime board configs into ZEPHYR_BASE... it gets further but this can't be right.

I am booting up on both zephyr and mcuboot so if there is a simple environment variable that is omitted from the docs that would be a great addition.

Cool Stuff. Be well.

najnesnaj commented 4 years ago

Thank you for your feedback. You're right that you should not copy the board definition, but I think I did it this way ( I just wanted to move on). I had to cut a few corners to get it compiled. But it eventually did.

Later on I ran into trouble uploading over the air, where he would not swap the images.... (it did upload though!)

At first I thought it was spi-flash-related, but this was not the case.

~# mcumgr --conntype ble --connstring ctlr_name=hci0,peer_name='Zephyr' image list Images: image=0 slot=0 version: 1.6.0 bootable: true flags: active confirmed hash: 661bbd5ff74e4efeaadde3b76940dc67bafdd36037973888dbcd0d476a4be113 image=0 slot=1 version: 1.8.0 bootable: true flags: pending permanent hash: 5fc02cc9042c750d9329a82948e9d92ae1f26a9e3ebd3be53c3aef78e699f979 Split status: N/A (0)