How many times we can upload a sketch to Arduino Nano ESP32?

I got my first IoT board, the Arduino Nano ESP32. I loved it.

I am new to IoT world as well as C++.

Since I don't know how to code, I make small changes and upload to board frequently. I read somewhere that flash memory wear out after certain writes. Since Nano ESP32 is very coslty, I wish it could last for long.

My question are:

  1. How many times we can upload sketches to an Arduino Nano ESP32 board?
  2. What issues shall I face after crossing this limit?
  3. How to minimize uploads like testing my code in another way?

Assuming I don't know anything about hardware and programming, can anyone clear my doubts in a simple way and give some suggestions?

The flash memory of an ESP32 typically has a write endurance in between 10,000 to 100,000 write cycles per sector, depending on the specific model and the quality of the flash chip.

Each time you upload code, the flash memory is erased and rewritten. The wearing out primarily affects the sectors being rewritten, not the entire flash memory but the ESP32 uses a defined memory layout, where the bootloader, partition table, and application are written to fixed addresses in the flash memory.

So the more you use it the more it wears out but it's likely going to be years before you start seeing issues.

Just use it and don't worry about it. (and there are some that are not so costly).

If this is just about learning, you can also use wokwi with a virtual ESP32 if you want to practice or test some code.

From https://docs.arduino.cc/tutorials/nano-esp32/cheat-sheet/, the board

From https://www.gigadevice.com.cn/Public/Uploads/uploadfile/files/20240902/DS-00594-GD25B128E-Rev1.1.pdf

I think that @J-M-L give a pessimistic value :wink:

Thanks :raised_hands: for the suggestion.
I shall try to code in a simulator and when it will look ok, I shall upload to the board.

Ok - I think I remember seeing some good for 10.000 min but may be I’m getting confused and it was not an ESP32

AVR is guaranteed for 10,000 cycles.

But the ESP32 typically uses external SPI flash, which is soldered onto the board rather than integrated into the microcontroller itself.

So I would not be surprised if some cheap manufacturers were cutting corners there

I agree but this is about a Nano ESP32; I would not call Arduino products cheap and they're supposed to have QA :slight_smile:

I used to work for an independent testhouse where components (from e.g. Motorola) were tested before the manufacturer of the final product (e.g. ABS boards in the car industry) placed them on their PCBs. It saved the manufacturer money because debugging a PCB with a faulty component did cost more.

I do not know if Arduino follows that path or that they just pray :slight_smile:

If you can only do this 10000 times you can upload a new sketch each day for the next 27 years. And if it is 100000 times you can continue doing it even longer :slight_smile:

With other words, you don't have to worry about it at all.

@bojan_jurca

I can easily do 50 uploads in a day during debugging.

There was a time we would make a bit more efforts to proof read the code and manually follow the computational path to ensure all was right before hitting compile as compiling was an expensive a long tasks (sometimes once a night in a batch process).

But yes nowadays I hit compile and upload again because I had a small spelling mistake in a debug print that would not even make it to the final code.

Times changed!

Relax. Just use the :heavy_check_mark: mark, top left, to compile without uploading.

As far as the number of upload times is concerned, you will be much older before that becomes a problem.

Grab a decent text on the subject. (I started with "Bruce Eckel - Using C++" ISBN : 0-07-881522-3) and start from "hello world".

Just be grateful that, with Arduino, you get no closer to the serial port than "Serial.do()". There was once a time when you had to design/create the whole "Serial" class from hardware up :wink:

Thanks for the advice. Now my first priorty is to write and upload programs rather than caring about number of uploads :grinning_face_with_smiling_eyes:.
(I purchased a general ESP32 development board and do frequent uploads in it while learning or debugging.)