We all know that the Arduino Nano RP2040 has two MCU: RP2040 and the ESP32.
So, what I want to do is to turn on the LED directly from the ESP32, using just pure ESP32 code.
According to the schematic, the RGB LED is connected to the ESP32 in GPIOs 25, 26 and 27.
So, what I did was to:
Load the SerialNINAPassthrough sketch.
Then I compiled this very simple ESP32 "blink" code: esp-idf/blink.c at release/v4.2 · espressif/esp-idf · GitHub
* I defined #define BLINK_GPIO 26
* I compiled it using ESP-IDF
* I flashed it using --before no_reset (instead of --before default_reset) in esptool.py
I know that code works, because when I try it on other ESP32 modules it works Ok.
My guess is that my code should just blink the LED, but nothing happens.
What am I missing?
At this point I don't care about having an SPI / UART connection with the RP2040. I just want to flash code to the ESP32 and turn on the LED.
I modified the nina-fw sketch. In the loop() I added the blinky code.
compiled and flashed it to the ESP32... same results... I cannot see the blinky LED
Then I did:
compiled and flashed to the RP2040 the CheckFirmwareVersion sketch (I don't care if it cannot fetch the version).
...same results... I cannot see the blinky LED.
BUT BUT BUT, now with my blinky-led code in the ESP32, and the CheckFirmwareVersion in the RP2040, if I open the "Tools -> Serial Monitor", only now, the LED starts to blink.
It seems that opening the Serial Monitor send an "boot ESP32" chip... but doesn't make sense.
Any idea?
If I try the ESP-IDF "blink" example compiled with ESP-IDF >= v4.0, it doesn't work.
If I compile it with v3.3 it works Ok (I have to follow the same steps as before: flash blink to the esp32, then flash the CheckFirmwareVersion to RP2040, and then open the Serial Monitor...)
Anyone else had issues with ESP-IDF >= v4.0 ?
Also, how can I see the output of the ESP32 ? Is there any sketch that prints the output of the ESP32?
The ESP32 is not started by default (makes sense, saves energy).
When you call WiFi.xxx() it enables it (perhaps by setting HIGH the "ESP32 EN" line... I guess)
But the serial monitor was needed because the "CheckFirmwareVersion" sketch has a while(!Serial) at the very beginning... and only after that WiFi.status() is called.
So, to capture the output from the ESP32 I just modified the SerialNINAPassthrough sketch by calling WIFI.status() at the very beginning...
What I still don't get, is why ESP-IDF >= v4.0 doesn't work... I was able to capture the output and I see:
NINA-W101/NINA-W102: When running the command idf.py make menuconfig set the
configuration flag CONFIG_SPI_FLASH_USE_LEGACY_IMPL flag to Y. The application fails to start unless this flag is set.
I did that, and I have "blink" running Ok using ESP-IDF v4.2.