I got a strange issue with debugging a RISC-V program on a raspberry pi pico 2W. I can upload the program to the flash, but when i try to connect openocd it seems that the RISC-V cores are not active. I need to explicitly reboot into riscv mode to be able to use openocd and gdb.
Then when i connect to the program, the current instruction is way outside the program flash memory and when i examine the flash location, it just returns all zeroes, as if the program was never written. However, when i dump the program with picotool, then i _can_ see the program at the correct location. It just seems the riscv cores cannot access the flash memory.
I'm gonna try with a non-W pico 2 but if anyone can give some insights or hints i'd greatly appreciate it!


