maxgerhardt / framework-wizio-pico

framework-wizio-pico
0 stars 2 forks source link

Update to 1.5.0? #1

Closed bmentink closed 5 months ago

bmentink commented 5 months ago

Hi,

Love the framework by the way, great way to work with the Pico.

Any chance of updating to 1.5.0? That version is needed to support the Bluetooth module on Pico W

Many Thanks

bmentink commented 5 months ago

?? @maxgerhardt

maxgerhardt commented 5 months ago

Updating? No, no, no. This is an archive of just wizio's previous work. This is not further developed.

You can very easily access the Pico-SDK 1.5.1 with PicoW bluetooth and WiFi support using https://github.com/earlephilhower/arduino-pico. This is supported in PlatformIO as well.

bmentink commented 5 months ago

I do not want to build under Arduino. I can't see how to build using the SDK with the link you sent.

bmentink commented 5 months ago

@maxgerhardt Ok, I finally found the documentation for the "official" platformio pico sdk support. It compiles ok, but upload I have to do the reset/prog button thing.. with the wizo-pico I did not have to use the buttons.

my platformio.ini is:

[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico
framework = arduino
board_build.core = earlephilhower

How do I get seem-less uploads to work, the documentation is not clear, as it keeps changing ..

maxgerhardt commented 5 months ago

PlatformIO documentation in Arduino-Pico has stayed the same since essentially May 2023. I cannot recommend PlatformIO if you want to use the raw Pico-SDK, as the support is lacking. Use the native CMake toolchain as intended instead, or the Pico-SDK through Arduino.

bmentink commented 5 months ago

Thanks, I am using the Pico-SDK through Arduino. I am trying to get upload/dbugging working with cmsis-dap, however I get the following error:

Open On-Chip Debugger 0.12.0-g4d87f6dca-dirty (2024-01-02-22:17)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

adapter speed: 1000 kHz

Error: Failed to connect multidrop rp2040.dap1
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

I have this in my platformio.ini

[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico
framework = arduino
board_build.core = earlephilhower

upload_protocol = cmsis-dap
debug_tool = cmsis-dap

I found pico-debug-gimmecache.uf2, and copied that to the device as requested. Any idea's how to fix?

I am on MacOS M1

maxgerhardt commented 4 months ago

I found pico-debug-gimmecache.uf2, and copied that to the device as requested.

No, Picoprobe and Pico-Debug are two entirely different debugging methods. Picoprobe is a firmware you load into a second Pico that connects to the SWD port of your target (to-be-debugged) Pico. "Pico-Debug" is a way that runs a debugging probe firmware directly on the to-be-debugged Pico itself, namely the second core and in RAM (or cache) and takes over the control of USB. "picoprobe.uf2" from here should work perfectly fine with cmsis-dap and the wiring as referenced here. "Pico-Debug" must be configured as shown in the referenced note.

grafik

bmentink commented 4 months ago

Why do you keep saying "No"? I know they are for different uses.

I am trying to use pico-debug. I had to google pico-debug-gimmecache.uf2 because I could not find a link in that documentation to where it can be downloaded. I found one eventually and followed those instructions you quote above, and I got that error I posted in my previous post. What am I missing?

What would be helpful is , if you could link the official location of that file. (pico-debug-gimmecache.uf2) So I can be sure I am using the correct file. EDIT: Never mind, I see the 'download' link, it was not obvious ..

(I am not interested in the picoprobe as I don't want to use an extra board.)

bmentink commented 4 months ago

If I add the section:

upload_protocol = pico-debug
debug_tool = pico-debug
build_flags = -DPIO_FRAMEWORK_ARDUINO_NO_USB

I get these errors:

Updating metadata for the vscode IDE...
UserSideException: Processing pico (platform: https://github.com/maxgerhardt/platform-raspberrypi.git; board: pico; framework: arduino)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
DebugInvalidOptionsError: Unknown debug tool `pico-debug`. Please use one of `blackmagic, cmsis-dap, jlink, picoprobe, raspberrypi-swd` or `custom`:
  File "/Users/bernardmentink/.platformio/penv/lib/python3.11/site-packages/platformio/builder/main.py", line 173:
    env.SConscript("$BUILD_SCRIPT")
  File "/Users/bernardmentink/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Script/SConscript.py", line 612:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/Users/bernardmentink/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Script/SConscript.py", line 279:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/Users/bernardmentink/.platformio/platforms/raspberrypi/builder/main.py", line 253:
    target_elf = env.BuildProgram()
  File "/Users/bernardmentink/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Util/envs.py", line 251:
    return self.method(*nargs, **kwargs)
  File "/Users/bernardmentink/.platformio/penv/lib/python3.11/site-packages/platformio/builder/tools/piobuild.py", line 61:
    env.ProcessProgramDeps()

That error occurred after saving platformio.ini. Seems it does not know anything about pico-debug. SO either the docmentation is out of date, or The platform from git is ...

It would be really helpful if you could provide a platformio.ini that works with pico-debug!

maxgerhardt commented 4 months ago

You're right, the board = pico is the only board definition that doesn't have pico-debug in the list of supported protocols. Please set board = rpipico, this is otherwise equivalent.

Fixed in https://github.com/maxgerhardt/platform-raspberrypi/commit/38b1c2ff1d69911a659fedec7f211e9be657b9a4.

bmentink commented 4 months ago

Thanks, I thought I was going crazy ... works on debugging now.