drone-os / drone

CLI utility for Drone, an Embedded Operating System.
https://www.drone-os.com/
Apache License 2.0
165 stars 20 forks source link

just flash seems to be failing #7

Closed dhylands closed 4 years ago

dhylands commented 4 years ago

I'm following along the drone book using 2 blue pills and when I get to the just f;ash step I see the following error:

2080 >just flash
drone env thumbv7m-none-eabi -- cargo +nightly-2019-11-06 build --features "" --release
    Finished release [optimized] target(s) in 0.03s
drone probe flash target/thumbv7m-none-eabi/release/bluepill-hello-world
Black Magic Probe (Firmware v1.6.1-446-g8851504) (Hardware Version 1)
Copyright (C) 2015  Black Sphere Technologies Ltd.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

Assert SRST during connect: enabled
Target voltage: ABSENT!
Available Targets:
No. Att Driver
 1      STM32F1 medium density M3/M4
0x080002e0 in bluepill_hello_world::tasks::root::handler ()
/run/user/35029/.tmpf5GDh0:62: Error in sourced command file:
Error erasing flash with vFlashErase packet
[Inferior 1 (Remote target) detached]
Error: `"gdb-multiarch" "target/thumbv7m-none-eabi/release/bluepill-hello-world" "--quiet" "--nx" "--batch" "--command" "/run/user/35029/.tmpf5GDh0"` exited with status code: 1
error: Recipe `flash` failed on line 64 with exit code 1

I tried to cat the /run/user/35029/.tmpf5GDh0 file but it was deleted already. Are there any options that can be passed to drone to get the contents of that file to be printed?

For the above I was running on Ubuntu 19.10. I see the same error on my Mac.

dhylands commented 4 years ago

Just FYI: I get the same error using my real Black Magic Probe connected to the Blue Pill. My Black Magic Probe reports

(gdb) monitor version
Black Magic Probe (Firmware v1.6.1) (Hardware Version 3)
davehylands commented 4 years ago

It looks like my device got some option bytes set to turn on "Read Protection". I was able to do:

monitor option erase

after connecting manually under gdb and then just flash worked correctly.

valff commented 4 years ago

Thanks for the update! It's great that you found the reason.