In file included from /home/kh/Arduino/libraries/SafeString/examples/SafeString_Tests/SafeStringCaseChanges/SafeStringCaseChanges.ino:13:
/home/kh/Arduino/libraries/SafeString/src/SafeString.h:120:10: fatal error: Printable.h: No such file or directory
120 | #include <Printable.h>
| ^~~~~~~~~~~~~
compilation terminated.
exit status 1
Error compiling for board Raspberry Pi Pico.
User requested SafeString library support be added for this project.
Current SafeString library works for Arduino Mbed OS RP2040 V2.0.0 board install
This pull request fixes missing Printable.h file
But in order to complete adding the support need a unique define (-D... = .. ) that can be detected by SafeString.h so that the
necessary
namespace arduino {
can be set
Can you add a -D to your compile line (and when Arduino detects libraries)
Also dtostrf( ) declaration not found by SafeString library (works with Arduino pico, fixed by an extern ... in SafeString.h )
@khoih-prog
Drop me a MP if you want a modified version of SafeString the only runs on that board
Now solved: Where is the macro "BOARD_NAME" defined? It is used in the TimerInterruptTest example and gives a compile error for me:
d:\Arduino\RaspberryPico\TimerInterruptTest\TimerInterruptTest.ino:126:72: error: 'BOARD_NAME' was not declared in this scope
To be able to automatically detect and display BOARD_NAME on RP2040-based boards (RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040, GENERIC_RP2040, etc) boards, you have to copy the file RP2040 platform.txt into rp2040 directory (~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0).
Supposing the rp2040 core version is 1.4.0. This file must be copied into the directory:
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz
This file must be copied into the directory:
8.2 To avoid compile error relating to microsecondsToClockCycles
Some libraries, such as Adafruit DHT-sensor-library, require the definition of microsecondsToClockCycles(). To be able to compile and run on RP2040-based boards, you have to copy the files in RP2040 Arduino.h into rp2040 directory (~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0).
Supposing the rp2040 core version is 1.4.0. This file must be copied to replace:
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz
This file must be copied to replace:
Excuse me, I cannot follow your instructions.
Thanks to your answer, I have now updated from V0.9.18 to V1.4.0, thanks for that.
Then I copied the "platform.txt" file to the location as instructed. After that, it was no longer possible to compile. I was also wondering: The "new" file contains: name = Raspberry Pi RP2040 Boards version = 0.9.9
That doesn't look very up to date!
Therefore I continue to work with the original file, it contains name = Raspberry Pi RP2040 Boards (1.4.0) version = 1.4.0
and works - except for the macro "BOARD_NAME".
Hello khoih-prog, we'll keep in touch.
I have the following question: Why is a callback function of type bool? An interrupt callback cannot (and must) not give anything back?
/home/kh/Arduino/libraries/SafeString/src/SafeString.cpp: In member function 'size_t arduino::SafeString::printInt(double, int, int, bool, bool)':
/home/kh/Arduino/libraries/SafeString/src/SafeString.cpp:938:5: error: 'dtostrf' was not declared in this scope
dtostrf(d, width, decs, result);
^~~~~~~
/home/kh/Arduino/libraries/SafeString/src/SafeString.cpp:938:5: note: suggested alternative: 'strstr'
dtostrf(d, width, decs, result);
^~~~~~~
strstr
exit status 1
Error compiling for board Raspberry Pi Pico.