No digitalWrite on pins 8 and 9

I'm having issues with the Nano ESP32 purchase from the PiHut (so I guess its genuine). Fighting a bit with the docs and which packages etc to use but eventually got it to compile and upload.

My LED flashing test didn't work. Here is my test code to see which pins work.

void setup() {
  Serial.begin(9600);
  // initialize digital pin LED_BUILTIN as an output.
  //pinMode(LED_BUILTIN, OUTPUT);
  pinMode(2, OUTPUT); digitalWrite(2, HIGH);
  pinMode(3, OUTPUT); digitalWrite(3, HIGH);
  pinMode(4, OUTPUT); digitalWrite(4, HIGH);
  pinMode(5, OUTPUT); digitalWrite(5, HIGH);
  pinMode(6, OUTPUT); digitalWrite(6, HIGH);
  pinMode(7, OUTPUT); digitalWrite(7, HIGH);
  pinMode(8, OUTPUT); digitalWrite(8, HIGH);
  pinMode(9, OUTPUT); digitalWrite(9, HIGH);

}

pins 2-7 output 3.2 v (as expected) but pins 8 and 9 are around 0v.

Using Esspressif ESP32S3 Dev Module as the board.

Thank you.

Are the pin mappings messed up?

digitalWrite to pin 9 outputs to pin 6 and 8 to pin 5...

Hi @acboother

You must select the "Arduino Nano ESP32" board from the Tools > Board menu in Arduino IDE in order to have the correct pin mapping.

If you don't see that option, you might not have the necessary version of the board platform installed.

If so, the most convenient way to get it is to use the Arduino IDE Boards Manager to install the "Arduino ESP32 Boards" platform, following the instructions here:

If for some reason you prefer to only use the full ESP32 boards platform from Espressif installed, you can use that on too since Arduino has added the "Arduino Nano ESP32" board definition to it. But you must make sure to install the latest version of the ESP32 boards platform (currently 2.0.11) because the board was added only recently. If you don't see that board in the list then you are probably using an older version of the ESP32 boards platform.

1 Like

If I select that board I get the following on upload.

No DFU capable USB device available

I do not have anything except a COM port to select from. Do I need another device driver or something? If so where do I get it.

Thank you

Hello @acboother, by flashing with other board configurations, you may have changed the Nano ESP32's default programming. Please follow this guide to restore that and let us know!

I followed the instructions and the board now doesn't have a mauve light showing.

The board is correctly self identifying as Arduino Nano ESP32.

The upload still states

No DFU capable USB device available

Thank you

Do you see the board is detected and assigned a port number? Do you have any serial monitor open on upload?

I had to look up "mauve".

It thinks a COM port is assigned.

The only monitor open would be the one within the IDE which is doing the upload.

If I set the board to be ESP32S3 Dev Module it will upload through that COM port and run (sort of). I can get serial output but as you can read from my earlier postings the pin mappings appear to be off which is why one of the team suggested setting it to Arduino Nano ESP32... which is when the DFU issue appears.

This DFU thing turns up on the internet elsewhere but I cannot find anyway to either download/install a driver or make the NanoES32 use one if it is already installed on my Windows 11 machine.

The Espressif documentation isn't clear enough for me to work out what they say about DFU :frowning:

for instance
USB CDC and DFU Flashing refers to an option on the IDE tools menu USB Mode -> USB-OTG (TinyUSB) which I can't see.

and
USB DFU On Boot

refers to updating the firmware which I suspect is more complicated than what the Arduino team expect to have to happen (well, its more than I do).

and finally

enableDFU¶

doesn't help (me) either.

Still looking for an answer.

Thank you.

Which core are you using for the board at the moment? And the version number of the core?

Core (of what)? I can give you this info

IDE v 2.1.1 2023-06-30T16:04:40.277Z

esp32 by Espressif 2.0.11

Arduino ESP32 Boards no longer installed.

Thank you

Hello @acboother !
Allow me to ask, you mentioned no purple light turned on. Was this during the process of shorting B1 with GND and resetting the board or double pressing the reset button? Although no purple light turned on was the RGB LED an amber color? If not, did it have any behavior worth mentioning?
Would you be able to share the complete error log prompted by the IDE?

Cannot open DFU device 2341:0070 found on devnum 41 (LIBUSB_ERROR_NOT_FOUND)
No DFU capable USB device available
Failed uploading: uploading error: exit status 74

There has been so much going on I cannot remember now when the light was on or off, when it was green or puprple. Sorry

Here is the board identification information

Arduino Nano ESP32
VID:0x2341
PID:ox0070
SN:3485187B798C

along this journey the board has identified as, at least, two other types including one with Wifi in its name (don't recall its full description).

I was actually able to recreate the same error output. Here is what worked in my case:
I verified that on the drop-down menu for board selection, there was only one item detected (this had a different name from the board I have)
Short B1 and GND, the LED should turn a solid color (note which one it is), and then while shorting press reset and remove the short.
Make note of the color on the RGB LED at this moment.
Go into tools and make sure that esptool is selected (should have a tick to confirm it is selected, this is important even though it is the only option it should still be selected) on the "Programmer", the port is correctly selected (this might tell you it is another random board, it is not a problem just select it) and that the board Arduino Nano ESP32 is selected in "boards".
Next, go to Sketch>Upload Using Programmer
Let us know how it goes.

Before starting your process I had

After shorting B1 with GND the light went green. After pressing the reset and releasing the light went temporarily mauve, then green then off.

Uploading with programmer succeeded but the sketch doesn't run. It should make pin 9 go high then low. In my earlier tests it actually made pin 6 go high/low!!!

Attempting to upload the sketch normally and I get the following error message

No DFU capable USB device available
Failed uploading: uploading error: exit status 74

The board is identifying as an Adafruit one now on the COM port.

I powered the board down, unplugged from USB and it ran when plugged back in.

So the routine is to use the Programmer to upload and then reset?

Can anyone tell me where I can find the file that controls the mapping between digital pins and the output pin.

Elsewhere I have posted about my problems with the Arduino Nano ESP32 not mapping software pin names correctly to the physical pin. Regretfully those topics have not proved to have provided answers as the correct library/package to use or how to use DFU.

Consequently I think I will have to study the code that does this magic and see if I can untangle it (the hard way, probably).

Cheers
Alan

Hi @acboother. I think this is what you are looking for: