Libraries updated to support new RP2040-based boards (RASPBERRY_PI_PICO, etc.)

LittleFS_Mbed_RP2040 has just been published to support RP2040-based boards, such as Nano-RP2040-Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Arduino-mbed RP2040 v2.1.0+ core.

This library is just a simple LittleFS wrapper to facilitate your usage of LittleFS for the onboard flash on MBED RP2040-based boards such as Nano_RP2040_Connect, RASPBERRY_PI_PICO, using Arduino-mbed RP2040 core

Also check topic LittleFS_Mbed_RP2040 library in this Arduino forum.

RP2040_RTC has just been published to support internal RTC usage for RP2040-based boards, such as Nano-RP2040-Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Arduino-mbed RP2040 core or Earle Philhower's arduino-pico core.

This RP2040-based RTC, using ISR for callback function, has no battery backup. Time will be lost when powered down. Examples show how to use NTP-client to update RTC on every start-up.

1 Like
  1. TimerInterrupt_Generic v1.6.0+
  2. GSM_Generic v1.4.0+
  3. NB_Generic v1.2.0+

now support RP2040-based boards, such as Nano-RP2040-Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Earle Philhower's arduino-pico core v1.8.8+ or Arduino-mbed RP2040 v2.2.0+ core

Hi @khoih-prog
Thanks for creating and updating these libraries !

I've been trying to use ESP_AT_WM_LITE with a RPI Pico and an ESP-8266_01 for several days now, but unfortunately without success so far. I'm wondering where I should ask for help: on this thread or on Github maybe ? Or should I just create a new thread ?

In case it's OK to post here, here's a short description of the problem. Else, I'm happy to create a new issue on Github with the full details and output of the serial monitor.

Right now, I have no idea wether the problem is the hardware, the pins configuration in Mbed Core or the ESP or the library. Sorry, for asking here if the library is unlikely to be the problem...

To put it briefly:

  • I managed to flash an ESP-8266-01 with an AT firmware 1.7.4 (SDK 3.0.4)
  • The ESP is connected to the serial 2 (Tx on RX, and Rx on TX) of a Raspberry Pi Pico. I adjusted the pins in pins_arduino.h
  • The ESP responds to AT and AT+GMR in the Arduino IDE monitor when connected only with its USB adapter

But when I load the RP2040 example of the library to the Pico, the response in the monitor is always.

[ESP_AT] Cannot initialize ESP module
[ESP_AT] NoESP
[ESP_AT] Full output below

Full output

Start RPi_Pico_ESP8266Shield on MBED RASPBERRY_PI_PICO

ESP_AT_WM_Lite v1.4.0

Debug Level = 4

[ESP_AT] Cannot initialize ESP module

[ESP_AT] NoESP

LittleFS size (KB) = 64

LittleFS Mount OK

LittleFS Flag read = 0xd0d04321

Flag read = 0xd0d04321

No doubleResetDetected

Saving DOUBLERESETDETECTOR_FLAG to DRD file : 0xd0d01234

Saving DRD file OK

SetFlag write = 0xd0d01234

[ESP_AT] ======= Start Default Config Data =======

[ESP_AT] Hdr=SHD_ESP8266,SSID=SSID1,PW=password1

[ESP_AT] SSID1=SSID2,PW1=password2

[ESP_AT] BName=nRF52-ESP_AT

[ESP_AT] LoadCfgFile

[ESP_AT] failed

[ESP_AT] LoadBkUpCfgFile

[ESP_AT] failed

[ESP_AT] b:StayInCfgPortal:NoCfgDat

[ESP_AT] Scanning Network

[ESP_AT] scanWifiNetworks: Done, Scanned Networks n = -1

[ESP_AT] No network found

[ESP_AT] SSID=CfgPrtl-SSID,PW=CfgPrtl-PW

[ESP_AT] IP=192.168.4.1,CH=2

Stop doubleResetDetecting

Saving to DRD file : 0xd0d04321

Saving DRD file OK

LittleFS Flag read = 0xd0d04321

ClearFlag write = 0xd0d04321

FF

And since I finally successfully updated the firmware of the ESP to 1.7.4, I noticed that it does create an AP when it's connected to the Pico (ESP-987003 is listed in the Wifi networks), but it's not the "right" SSID, the one created by the library - CfgPrtl-SSID

I hope I can make it work at some point :slight_smile:

Thanks.

Hi @nordseele

Thanks for using the library.

You have to connect ESP8266-01 to Serial port as follows:

ESP8266-01 <-> MBED RP2040

ESP8266-01 TX <-> UART0_RX = GP1
ESP8266-01 RX <-> UART0_TX = GP0

If you still have some issue, please post on ESP_AT_WM_Lite issue

I just verify that the example is working OK



Start RPi_Pico_ESP8266Shield on MBED RASPBERRY_PI_PICO
ESP_AT_WM_Lite v1.4.0
Debug Level = 4
[ESP_AT] Use ES8266-AT Command
LittleFS size (KB) = 64
LittleFS Mount OK
LittleFS Flag read = 0xd0d01234
Flag read = 0xd0d01234
doubleResetDetected
Saving to DRD file : 0xd0d04321
Saving DRD file OK
LittleFS Flag read = 0xd0d04321
ClearFlag write = 0xd0d04321
[ESP_AT] Double Reset Detected
[ESP_AT] ======= Start Default Config Data =======
[ESP_AT] Hdr=SHD_ESP8266,SSID=SSID1,PW=password1
[ESP_AT] SSID1=SSID2,PW1=password2
[ESP_AT] BName=nRF52-ESP_AT
[ESP_AT] LoadCfgFile 
[ESP_AT] failed
[ESP_AT] LoadBkUpCfgFile 
[ESP_AT] failed
[ESP_AT] b:StayInCfgPortal:DRD
[ESP_AT] Scanning Network
[ESP_AT] scanWifiNetworks: Done, Scanned Networks n = 9
[ESP_AT] Sorting
[ESP_AT] Removing Dup
[ESP_AT] DUP AP:
[ESP_AT] WiFi networks found:
[ESP_AT] 1: HueNetTek, -38dB
[ESP_AT] 2: HueNet1, -86dB
[ESP_AT] 3: house, -81dB
[ESP_AT] 4: dlink-4F96, -87dB
[ESP_AT] 5: , -83dB
[ESP_AT] 7: elef, -85dB
[ESP_AT] 8: Waterhome, -84dB
[ESP_AT] 9: TP-LINK_2.4GHz_9A67ED, -84dB
[ESP_AT] SSID=CfgPrtl-SSID,PW=CfgPrtl-PW
[ESP_AT] IP=192.168.4.1,CH=4
FFFFFFFFFF FFFFFFFFFF FFFFFFFFFF FFFFFF
1 Like

Thank you very much for your reply.
I'm using the second serial ports (gpio 8 and 9) of the Pico on a custom PCB. I've modified pins_arduino.h in consequence but that's very likely the problem. I will disconnect the ESP from its header and connect it to the GPIO 0 & 1 for a test as mentioned in your post, hopefully this will work.

Thanks again :-))

Edit: After checking the schematics again, the TX and RX have been inverted by mistake on the PCB, probably because of a wrong pinout image of the ESP found on the internet... Serial2 works thanks to the workaround found on the other thread, I've been able to test that with a passthrough script but with the TX of the Pico going to the TX of the ESP of course the ESP won't work... I'm not sure if there's a way to invert the serial pins. Too bad...

No issue at all with your library. Just tested with inverted Rx and TX using Dupont wires and the library is working really great. Just my own mistake.

Also check this topic Serial2 on Raspberry Pi Pico to know why it didn't work with your connection.

Currently, Arduino-mbed RP2040 core only provides 1 serial port. Check pins_arduino.h#L41-L61

1 Like

RP2040_SD has just been published to support SD-card usage for RP2040-based boards, such as Nano-RP2040-Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Arduino-mbed RP2040 core or Earle Philhower's arduino-pico core.

This library was created as an effort to use SD Card while the arduino-pico core still has issue SD card FILE_WRITE issue #214, which has been fixed from core v1.8.6.

It's better to use the built-in SD library for Earle Philhower's arduino-pico core v1.8.6+.

But if you need to write codes to be used in both Arduino-mbed RP2040 core and Earle Philhower's arduino-pico core without having to modify the code, you can have the option to use this library.

Hi @khoih-prog,
I can see that you have provided a couple of examples on GitHub for using the RP2040_RTC library, however these seem to rely on Ethernet and WiFi connectivity, which my Pico does not have. As a beginner, these examples are too complex for me. Could you please provide a very basic example of manually setting the time on the Pico internal RTC and then reading it. Then I should be able to build on that knowledge. Hope you can assist.

@kenb2054

Just released new RP2040_RTC releases v1.0.3 with these new simple examples per your request

  1. RP2040_RTC_Alarm
  2. RP2040_RTC_Time

Just remember that currently, RP2040-based boards RTC has no battery backup. So the time will be lost when power down. Therefore, NTP client is necessary to get precise NTP time to update RTC.

Thanks very much for the new RP2040_RTC Time and Alarm examples which make it easier to understand the code while I am learning.
However, when I run the example code for my Pico using EarlePhilhower RP2040 Core I get the following error message:

I found an article https://forum.arduino.cc/t/confusion-with-time-h-and-timelib-h/433864 which indicates that some Windows users have problems when compiling code which uses the Time.h library and so I modifed the statement in DateTime_Generic.h library from #include <Time.h> to #include <TimeLib.h> and it overcomes the errors.

1 Like

@kenb2054 ,

That's good you found out the solution as well as the reason.

It's really bad that Windows still behaves the same way as the bad old DOS (case insensitive). That's why I've been avoiding using Windows quite a long time and didn't see that issue.

Anyway, I'll fix the library in next release for completeness.

@kenb2054

The RP2040_RTC v1.0.4 has just been releases thanks to your bug report

Releases v1.0.4

  1. Using TimeLib instead of Time to avoid case-insensitive issue with Windows and MacOS.
1 Like

It turns out that macOS also uses a case insensitive file system. So Linux's behavior is actually in the (sensible) minority. I always used to think that Windows was the only one, like with the annoying path separator.

Due to how common this problem is with the Time library, its maintainer Paul Stoffregen has finally removed the Time.h file from the library altogether in the release of the library made this week:

This will break all code which is still using the Windows/macOS-incompatible Time.h, forcing the maintainers to switch to TimeLib.h.

1 Like

If you set MacOS up correctly its file system is case-sensitive. Its an option you setup from factory state.

now support RP2040 -based boards, such as Nano-RP2040-Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040 , using Earle Philhower's arduino-pico core v1.9.4+ or Arduino-mbed RP2040 v2.4.1+ core

New hardware-based RP2040_PWM Library

New ISR-based MBED_RP2040_Slow_PWM Library

New ISR-based RP2040_Slow_PWM

New release of WebSockets2_Generic to add support to Nano_RP2040_Connect using WiFiNINA

Major Release v1.8.0

  1. Add support to RP2040-based boards, such as Nano_RP2040_Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040, using WiFiNINA
  2. Add examples with new features
  3. Update many Packages' Patches