Get free stack size on Raspberry Pi Pico2 (RP2350)

Hi,

who can have any ideas how to get free stack size on Raspberry Pi Pico2 (RP2350)?

On RP2040 we can call rp2040.getFreeStack() and get proper value. On RP2350 the method returns 270272 and it does not seem to be true.

Platform.ini is:

[env:5500_evb_pico2]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = wiznet_5500_evb_pico2
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
framework = arduino
test_framework = unity
test_build_src = yes
build_flags = 
	'-D SHIELD="W5500-EVB-Pico2"'
build_unflags = -fno-rtti

Then plesse open an issue in https://github.com/earlephilhower/arduino-pico/issues, not here.

The getFreeStack() function assumes 0x20040000 is the end of memory.

And assumes RAM is 256 kB plus 2*4 KB scratch memory in

@maxgerhardt ok, the issue was created there.

Fixed in Fix rp2040.getFreeStack() on RP2350 by earlephilhower · Pull Request #3255 · earlephilhower/arduino-pico · GitHub and synced with PlatformIO in Sync boards, include Arduino-Pico hotfix · maxgerhardt/platform-raspberrypi@49292d1 · GitHub.

A regular pio pkg update -g -p raspberrypi on the CLI should update the platform and include that fix.

Thanks for quick fix!

pio pkg update -g -p raspberrypi didn’t help, so I had to clean up and get again .platformio folder

Weird. Then

pio pkg update -g -p https://github.com/maxgerhardt/platform-raspberrypi.git 

might do it next time.

2 Likes

Worked for me for the Olimex Pico2XXL board. Thanks!