Raspberry pi pico Multicore

Hello, please help: how to use Multicore in my project? I found some info here get an error:

Arduino15\packages\arduino\hardware\mbed_rp2040\2.2.0\cores\arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/common/pico_stdlib/include/pico/stdlib.h:11:10: fatal error: pico/stdio.h: No such file or directory
 #include "pico/stdio.h"

Thanks

Syntax for include ? Missing library ?

try

#include <stdio.h>
#include "pico/stdlib.h"
#include "pico/multicore.h"

and

#include <stdio.h>
#include <pico/stdlib.h>
#include <pico/multicore.h>

and what library is need?

Unsure just looked to me as tho you were missing library from your computer , or the error said the syntax with “” was wrong .
That’s all I can offer

I think what's going on is that the directory

Arduino15\packages\arduino\hardware\mbed_rp2040\2.2.0\cores\arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/common/pico_stdlib/include/

Apparently isn't on the include path, so when pico/stdlib.h references pico/stdio.h it can't find it - I presume its meant to be in the same directory as stdlib.h

Suggests a mis-install of the pico stuff, maybe.

Why the mix of \ and / though?

I don't think the use of #include "foo.h" style of syntax instead of the #include <foo.h> style will cause a "No such file or directory" error. The double quotes syntax causes the local path to be searched before the standard include paths, so even when it's less appropriate that the angle brackets syntax (i.e., the header file is in the standard include paths so searching the local path first is pointless), it will still always find the file if it is present.

It is possible that a filename collision could cause the double quotes syntax to find a local file when a non-local file was the target the author of the code intended to be #included, but that would not be likely result in a "No such file or directory" error. My primary issue with the unnecessary usage of the double quotes syntax is that it does as clearly indicate the intent of that code.

The first part is generated by Windows, and so uses the native path separator. The second part is hardcoded into the Nano RP2040 Connect's core variant in the Arduino Mbed OS Nano Boards platform:
https://github.com/arduino/ArduinoCore-mbed/blob/2.1.0/variants/NANO_RP2040_CONNECT/includes.txt#L230

-iwithprefixbefore/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/common/pico_stdlib/include

In addition to Windows, this file is used on Linux and macOS systems, which only support the / path separator, which Windows supports in addition to its goofy native \ separator. So in order to be compatible with all operating systems this must use /. So when the two paths are combined in the command you get the mixed path separators on Windows, but this is fine and happens on all Windows systems, so not the cause of the problem.

pico/stdio.h i fix, now get an error:

'rp2040' was not declared in this scope

no any idea?...

I think there might be something else going on here (that I really don't understand). Is it possible the mbed object isn't linked against the pico stdlib?

the reason I ask is because I've had this problem even when I provide complete path to stdlib.h. I've used two different workarounds.

  1. put the functions in stdlib,h at the top of your .ino file. There are only four or five of them and they are all short.

2 use the community pico code. I have only had this issue with the mbed code

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.