Upload to 1Bitsy fails, but Start Debugging works

The output from pio run -t upload is the following:

Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [=         ]   8.2% (used 10724 bytes from 131072 bytes)
PROGRAM: [          ]   0.5% (used 5600 bytes from 1048576 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, jlink, stlink
CURRENT: upload_protocol = blackmagic
Looking for BlackMagic port...
Auto-detected: /dev/cu.usbmodem7BB0799D3
Uploading .pio/build/1bitsy_stm32f415rgt/firmware.elf
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Remote replied unexpectedly to 'vMustReplyEmpty': timeout
"monitor" command not supported by this target.
Don't know how to attach.  Try "help target".
You can't do that when your target is `exec'
Section .isr_vector, range 0x8000000 -- 0x8000188: matched.
Section .text, range 0x8000190 -- 0x8001754: matched.
warning: One or more sections of the target image does not match
the loaded file

The program is not being run.
Section .rodata, range 0x8001754 -- 0x8001768: matched.
Section .data, range 0x8001768 -- 0x8001770: MIS-MATCHED!

However, when I choose Start Debugging from the VSCode menu, the new code is uploaded and I can step through it. Any clues about what I need to change to make the upload work cleanly, too?

Thanks!

After reading this Autodetect: Blackmagic probe & MCB1700 (LPC1768)[macOS/OSX] - #12 by jxsl13 , I realized I hadn’t specified the upload_port. I had specified the debug_port, which is why that was working.

upload_tool = blackmagic
upload_port = /dev/cu.usbmodem7BB0799D1
debug_tool = blackmagic
debug_port = /dev/cu.usbmodem7BB0799D1

It’s a little redundant, but it works.

1 Like