Just logged in to tell you about a bug that Iâve found in [maxgerhardt/platform-raspberrypi: Raspberry Pi: development platform for PlatformIO (GitHub - maxgerhardt/platform-raspberrypi: Raspberry Pi: development platform for PlatformIO)
Btw, super job implementing picoprobe support, Max!
After a wild goose chase (a few hours lost), thinking there is some kind of hardware issue with my picos (a picoprobe and a target), libusb driver issues,etc , eliminated all that by using pyocd succesfully to both program and debug with my setup.
I then started reading through platformio framework, to see how a platform comes together how a build process is defined, etc.and found the culprit.
My problem was during upload. This was the output:
ploading .pio\build\pico_arduinocore_mbed\firmware.elf
Open On-Chip Debugger 0.10.0+dev-g14c0d0d-dirty (2021-01-27-15:43)
Licensed under GNU GPL v2
For bug reports, read
debug_level: 1
Warn : Transport "swd" was already selected
adapter speed: 5000 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00
** Programming Started **
Warn : no flash bank found for address 0x20000000
Warn : no flash bank found for address 0x200114b8
** Programming Finished **
** Verify Started **
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0000012a msp: 0x20041f00
Error: checksum mismatch - attempting binary compare
embedded:startup.tcl:530: Error: ** Verify Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 591
at file "embedded:startup.tcl", line 530
*** [upload] Error 1
After doing a verbose debug, I saw that there is an offset argument with the openocd call that shouldnât be there, not with elf anyway.
So I dig trough the source ./builder/build.py and at starting at line 384 : I modified
from
board.get("upload.offset_address", "0x10000000")
to
board.get("upload.offset_address", "")
Because of the logic selecting elf or firm (bin), we need to default to no offset because we already defaulted to elf a few lines below when no offset is needed (i.e board_upload.offset_address is not set in platformio.ini file)
Everything works as expected now.
@maxgerhardt, I already updated in my own repo fork (GitHub - dlbogdan/platform-raspberrypi: Raspberry Pi: development platform for PlatformIO), and made a pull request.
Regards,
Bogdan