ESP32-C3 Flash – Difference Between Embedded and External Flash

esp32flash

We are planning to add WiFi and BLE5 capabilities to our hardware and have narrowed down the module choices to ESP32_C3_MINI_1U and ESP32_C3_WROOM_02U. Unfortunately I lack any hands-on experience with ESP modules to make a final decision.

The only two differences between them seem to be packaging and flash, with MINI having it embedded into SoC and WROOM using in-module SPI chip. I'd prefer to use castellated WROOM package as easier for prototyping and PCB routing, however I am worried about performance difference when using external flash.

It is interesting that Technical reference does not mention embedded flash in its "internal memory" section at all. All the references to flash are made in a context of external SPI memory.
Furthermore, the pinout in C3 datasheet has this note:

Ports of embedded flash correspond to pins of ESP32-C3FN4 and ESP32-C3FH4 as follows … These pins are not recommended for other uses.

I think this means that the "embedded" flash is just a generic SPI flash die slapped onto SoC silicon and connected to SPI lines, which otherwise would be used by external chip. If this is the case then there should not be any real differences between the two.

Questions:

  1. Is there any performance difference between the chips with embedded and external flash?
  2. Is there any code difference, i.e. is code portable and do developers even care about this?

Best Answer

I think this means that the "embedded" flash is just a generic SPI flash die slapped onto SoC silicon and connected to SPI lines, which otherwise would be used by external chip. If this is the case then there should not be any real differences between the two.

This is the correct assumption. ESP32­-C3-­MINI-­1(U) module features ESP32-C3F[HN]4 SoC integrated on a module, which differs from casual ESP32-C3 SoC (found on ESP32-C3-WROOM-02 module) by more integrated peripherals.

If you take a look at part 2 of the datasheet for MINI modules it explains the difference and you can see that the on-die flash memory are still connected on the SPI bus:

ESP32-C3F(HN)4 diagram

As opposed to ESP32-C3-WROOM-02 datasheet:

ESP32-C3 diagram

You can see even this one uses Quad SPI (QSPI) lines for the SPI flash so there shouldn't be any difference on the flash memory speed. Only difference are in the module sizes and integration levels. This answers your first question.

As for the second - it's a no too. There is no difference between code. ESP32 provides SDK called IDF. Code generated for ESP32-C3 or ESP32-C3-F[HN]4 will be the same as it features the same RISC-V core and peripherals.