Problem with vFlashErase on RP2040 Feather

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
k5551
 
Posts: 9
Joined: Sat Jan 20, 2018 2:54 am

Problem with vFlashErase on RP2040 Feather

Post by k5551 »

Hi,

I'm trying to learn how to use Ada and I'm using the Adafruit RP2040 feather (https://www.adafruit.com/product/4884). I soldered a SWD debug header onto the feather, and tried to load an led blinking program, using the black magic probe (https://www.adafruit.com/product/3839) to connect to the feather but I get an error about vFlashErase. My GDB session log is below. Do you have any suggestions?
(gdb) target extended-remote /dev/ttyACM1
Remote debugging using /dev/ttyACM1
(gdb) monitor version
Black Magic Probe v1.8.2, Hardware Version 6
Copyright (C) 2022 Black Magic Debug Project
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

(gdb) file bin/ada_hello_pi_pico
Reading symbols from bin/ada_hello_pi_pico...
(gdb) monitor swdp_scan
Target voltage: 3.3V
Available Targets:
No. Att Driver
1 Raspberry RP2040 M0+
2 Raspberry RP2040 M0+
3 Raspberry RP2040 Rescue(Attach to reset!)
(gdb) attach 1
Attaching to program: /home/kcurtis/project-base/software/apps/ada_hello_pi_pico/bin/ada_hello_pi_pico, Remote target
0x000020e0 in ?? ()
(gdb) load
Error erasing flash with vFlashErase packet
From looking online, it sounds like if there was a write-protected section on the flash, it could cause that error. If that's the case, how would I clear the write protection? I don't see anything obvious in the gdb menus under "monitor".

FWIW, I have been able to successful load Ada code onto the STM32F405 feather.

Thanks,
Keith

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Problem with vFlashErase on RP2040 Feather

Post by mikeysklar »

Looks like a related documented case with some suggestions.

1) manual reset board
2) 'r' to reload
3) apply patch

https://github.com/blackmagic-debug/bla ... issues/875

User avatar
k5551
 
Posts: 9
Joined: Sat Jan 20, 2018 2:54 am

Re: Problem with vFlashErase on RP2040 Feather

Post by k5551 »

Thanks! I ended up using dfu-util to upload the 1.9.0 blackmagic firmware to the blackmagic probe. Unplugged the USB power to the feather, and replugged it in, and I could reflash within gdb.
(gdb) monitor swdp_scan
Target voltage: 3.3V
Available Targets:
No. Att Driver
1 Raspberry RP2040 M0+
2 Raspberry RP2040 M0+
3 Raspberry RP2040 Rescue (Attach to reset!)
(gdb) attach 1
A program is being debugged already. Kill it? (y or n) y
Attaching to program: ada_hello_pi_pico, Remote target
0x000020e0 in ?? ()
(gdb) load
Loading section .boot2, size 0x100 lma 0x10000000
Loading section .text, size 0x12000 lma 0x10000100
Loading section .rodata, size 0x29a4 lma 0x10012100
Loading section .ARM.exidx, size 0x8 lma 0x10014aa4
Loading section .data, size 0x2084 lma 0x10014aac
Start address 0x100001e0, load size 92976
Transfer rate: 39 KB/sec, 948 bytes/write.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Problem with vFlashErase on RP2040 Feather

Post by mikeysklar »

Cool, glad to hear that a BlackMagic FW update resolved this. Thank you for the followup.

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”