Programming the WeAct RP2350A_V10 not working

I apologize in advance if this turns out to be a dumb beginner mistake, but I’m trying out some WeAct RP2350A_V10 boards and are planning on swapping them in a prototype since they have the A4 version of the RP2350 chip which my official Raspberry Pi Pico 2 don’t.

I’ve managed to program the Pico 2 boards using this platformio.ini config without any issues, through SWD with the three pin Raspberry Pi Debug Probe:

[env]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
framework = arduino
board = rpipico2
board_build.core = earlephilhower
upload_protocol = cmsis-dap
debug_tool = cmsis-dap

I tried just swapping the Pico 2 boards with the WeAct board and tried uploading with the same config, but nothing happens. It seems to overwrite the already uploaded program that comes with the board (being some kind of blink test of the two onboard LEDs at GP24 and GP25), but it doesn’t run my code at all. I get a success message from the terminal saying that the upload was successful, but I only see the power LED being lit on the board with no code running.

Holding the BOOT button on the board and connecting it through USB works, where I can drag and drop a precompiled .uf2 file onto the storage unit that gets mounted for the unit. That runs the program immediately.

But trying upload through PlatformIO doesn’t work at all. I’ve tried also using the boards USB as the upload port instead of through the Raspberry Pi Debug Probe SWD, but both of them says that the upload is successful, but then nothing is running on the boards.

Am I missing something obvious here? Have anyone tried using these boards or similar generic boards with PlatformIO?

If relevant, here is the full log of the upload:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/raspberrypi/rpipico2.html
PLATFORM: Raspberry Pi RP2040 (1.14.0+sha.a606be6) > Pico 2
HARDWARE: RP2350 150MHz, 512KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (blackmagic, cmsis-dap, jlink, picoprobe, raspberrypi-swd)
PACKAGES: 
 - framework-arduinopico @ 1.40200.0+sha.5ef8a5a 
 - tool-mklittlefs-rp2040-earlephilhower @ 5.100300.230216 (10.3.0) 
 - tool-openocd-rp2040-earlephilhower @ 5.140200.240929 (14.2.0) 
 - tool-picotool-rp2040-earlephilhower @ 5.140200.240929 (14.2.0) 
 - toolchain-rp2040-earlephilhower @ 5.140200.240929 (14.2.0)
Flash size: 4.00MB
Sketch size: 4.00MB
Filesystem size: 0.00MB
PSRAM size: 0.00MB
Maximium Sketch size: 4190208 EEPROM start: 0x103ff000 Filesystem start: 0x103ff000 Filesystem end: 0x103ff000
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 66 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Retrieving maximum program size .pio/build/client/firmware.elf
Flash size: 4.00MB
Sketch size: 4.00MB
Filesystem size: 0.00MB
PSRAM size: 0.00MB
Maximium Sketch size: 4190208 EEPROM start: 0x103ff000 Filesystem start: 0x103ff000 Filesystem end: 0x103ff000
Checking size .pio/build/client/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   1.9% (used 10140 bytes from 524288 bytes)
Flash: [          ]   1.5% (used 63672 bytes from 4190208 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, picoprobe, picotool, raspberrypi-swd
CURRENT: upload_protocol = cmsis-dap
Uploading .pio/build/client/firmware.elf
Open On-Chip Debugger 0.12.0+dev-gebec9504d-dirty (2024-08-27-20:00)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1
DEPRECATED! use 'adapter serial' not 'cmsis_dap_serial'
cortex_m reset_config sysresetreq
adapter speed: 5000 kHz
Warn : [rp2350.dap.core1] VECTRESET is not supported on this Cortex-M core, using SYSRESETREQ instead.
Warn : [rp2350.dap.core1] Set 'cortex_m reset_config sysresetreq'.
[rp2350.dap.core0] halted due to breakpoint, current mode: Thread 
xPSR: 0xf9000000 pc: 0x000000a0 msp: 0xf0000000
[rp2350.dap.core1] halted due to debug-request, current mode: Thread 
xPSR: 0xf9000000 pc: 0x000000a0 msp: 0xf0000000
** Programming Started **
Warn : Adding extra erase range, 0x10012900 .. 0x10012fff
** Programming Finished **
** Verify Started **
** Verified OK **
Warn : [rp2350.dap.core1] VECTRESET is not supported on this Cortex-M core, using SYSRESETREQ instead.
Warn : [rp2350.dap.core1] Set 'cortex_m reset_config sysresetreq'.
[rp2350.dap.core0] halted due to breakpoint, current mode: Thread 
xPSR: 0xf9000000 pc: 0x000000a0 msp: 0xf0000000
[rp2350.dap.core1] halted due to debug-request, current mode: Thread 
xPSR: 0xf9000000 pc: 0x000000a0 msp: 0xf0000000
shutdown command invoked
============================================================================================= [SUCCESS] Took 3.06 seconds =============================================================================================

Does it still not run your code if you power cycle it? Just power off, power on.

Nope, it’s just the power LED being lit.

I’ve never seen an example where a SWD upload via a CMSIS-DAP produces a different result than a UF2 / picotool upload. OpenOCD definitely reports a success and the flashed content is verified.

Is this reproducable with the simplest most blinky firmware?

This is the blinky test I’m trying to upload:

#include <Arduino.h>

const int LED_PIN_A = 24;
const int LED_PIN_B = 25;

void setup() {
  pinMode(LED_PIN_A, OUTPUT);
  pinMode(LED_PIN_B, OUTPUT);
}

void loop() {
  digitalWrite(LED_PIN_A, HIGH);
  digitalWrite(LED_PIN_B, HIGH);
  delay(150);
  digitalWrite(LED_PIN_A, LOW);
  digitalWrite(LED_PIN_B, LOW);
  delay(150);
}

The WeAct board has two onboard LEDs. One little deviation from the Pico SWD wise is that the WeAct board has an additional 3.3V pin, similar to what I’ve seen on STM32 boards for voltage reference(?). But I obviously leave it disconnected since the RPI Debug Probe only provides three pins.

Shouldn’t make a difference though since the USB uploading doesn’t work either.

Not sure if either the pinout or the schematic leaves any clues?

Is the board connected to anything else when you upload that? It’s just the board, right, nothing attached? When programming, you plug in both the regular USB port of the board and the SWD pins from the CMSIS-DAP programmer (SWDIO, SWCLK, GND)?

I provide external 3.3V with the EN pin of the board connected to GND, in order to shut down the internal regulator. The USB is not connected (other than when I tried temporarily programming it through USB or mounting it as a storage device). The CMSIS-DAP programmer have SWDIO, SWCLK and GND connected.

I also have TX, RX and GND going from the RPI Debug Probe to the UART0 (GP0, GP1 and GND). Other than that and the power connection mentioned above, there is a RS-485 breakout board connected to UART1 pins.

Okay I need you to try and program just the board, with power going over USB and SWDIO, SWCLK, GND being connected from the Picoprobe/CMSIS-DAP. Otherwise this has too many variables and point of failures.

If you provide external power for example, the GNDs must all be connected together to become the common reference voltage.

Okay, I’ll try that!

All GNDs are connected. And just to be clear, swapping out the WeAct board back to Pico 2 works like a charm with the exact same setup.

Also, in the meantime before I test this: when I was trying to upload using USB (not BOOTSEL mode but with USB selected as upload port on PlatformIO) I only had the USB cable connected and still was unable to get the code to run despite the upload being succesful.

Can you try:

  • changing board = rpipico2 to board = generic_rp2350
  • adding debug_speed = 100 in the the platformio.ini for 100kHz SWD speed, much much slower.

I’ve now tried connecting the board to USB 5V only for power and then programming it through the CMSIS-DAP, but still the same issue.

I also tried your suggestions with changing the board in the config and the debug speed, but unfortunately no difference. I’m starting to think that this is something with the board itself and not related to settings of OpenOCD or PlatformIO. The fact that it behaves differently from the original Pico 2 is telling me that there is something fundamentally different with how it’s set up.

I’ve now tried connecting the board to USB 5V only for power and then programming it through the CMSIS-DAP, but still the same issue.

I also tried your suggestions with changing the board in the config and the debug speed, but unfortunately no difference. I’m starting to think that this is something with the board itself and not related to settings of OpenOCD or PlatformIO. The fact that it behaves differently from the original Pico 2 is telling me that there is something fundamentally different with how it’s set up.

Either that or I’m missing something with how you’re supposed to set the board to a mode where it gets properly programmed by doing something with the RESET or BOOT buttons, but it’s hard to tell with barely any documentation from WeAct. I know that they are doing a lot with STM32 so maybe this is a convention from those type of boards and I’m not initialising the board for receiving the upload properly? The additional 3.3V pin on the SWD header is also a clue.

I mean, the schematic is available at https://github.com/WeActStudio/WeActStudio.RP2350ACoreBoard/blob/main/RP2350A_V10/HDK/V10_SCH.pdf.

Can PlatformIO properly if you set

upload_protocol = mbed

and you put the board in BOOTSEL mode? (i.e., just upload via USB).

Some WeAct RP2350 boards already have support in newer versions of the Earle Philhower core.

Using


board = rpipico2

may not be the appropriate target.

Check whether there’s a board definition such as WeAct RP2350, WeAct Studio RP2350, RP2350A_V10 etc.

An update on this is that I can succesfully upload via the Raspberry Pi Debug Probe using the recommended approach via Cmake and OpenOCD with the Pico C/C++ SDK. I can share the config if that is of interest.

Using rpipico2 or genericrp2350 or similar doesn’t make any difference in PlatformIO unfortunately.