lupyuen / pinetime-rust-mynewt

PineTime Smart Watch firmware based on Rust and Apache Mynewt OS
https://lupyuen.github.io/articles/sneak-peek-of-pinetime-smart-watch-and-why-its-perfect-for-teaching-iot
Apache License 2.0
213 stars 54 forks source link

Missing file target/nrf52.cfg #17

Closed honyczek closed 4 years ago

honyczek commented 4 years ago

I'm trying to flash PineTime from Raspberry Pi according to README.md, now I'm at step 8) Flash the bootloader. I know there is flash protection, so I'm trying to run script/nrf52-pi/flash-unprotect.sh at first and later flash-boot.sh but there is an error:

pi@raspberrypi:~/pinetime-rust-mynewt $ ./scripts/nrf52-pi/flash-boot.sh
+ openocd/bin/openocd -f scripts/nrf52-pi/swd-pi.ocd -f scripts/nrf52/flash-boot.ocd
Open On-Chip Debugger 0.10.0+dev-01130-g9d1b46f5 (2020-07-19-22:23)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
scripts/nrf52-pi/swd-pi.ocd:13: Error: Can't find target/nrf52.cfg
in procedure 'script'
at file "embedded:startup.tcl", line 26
at file "scripts/nrf52-pi/swd-pi.ocd", line 13

The target folder is stored in parent folder and its subfolders - not ~/pinetime-rust-mynewt/target/ but ~/openocd-spi/tcl/target/ - so find command can't look it up.

lupyuen commented 4 years ago

Hmmm we seem to be missing some steps... Perhaps you can refer to the latest instructions here:

https://lupyuen.github.io/pinetime-rust-mynewt/articles/mcuboot#select-the-openocd-interface-st-link-or-raspberry-pi-spi

There is a file scripts/config.sh that says which OpenOCD script to use. Fo Pi, the file should contain...

#  Select Raspberry Pi as SWD Programmer
swd_device=scripts/nrf52-pi/swd-pi.ocd

Then the script to flash should be...

scripts/nrf52/flash-boot.sh

Instead of

scripts/nrf52-pi/flash-boot.sh

May I know where you got the instructions? I will have to update that doc. Thanks!

honyczek commented 4 years ago

I'm following description on the https://github.com/lupyuen/pinetime-rust-mynewt page. I suppose its text from README.md

lupyuen commented 4 years ago

I have updated the doc. Thanks!

lupyuen commented 4 years ago

Closing this issue because pinetime-rust-mynewt has been revamped for educational use.