Unable to print using Serial.print ("xxxxx") instruction

Hi,
I am using the Arduino IDE 1.8.19 to interface with a ESP32 Dev kit v1.
I can program the device and the program works as expected.
The serial com is set to 115200 in both the serial begin() and the Serial monitor window.
However, none of the Serial.print() instructions that are placed in the code to help me debugging it DO NOT WORK!!!
There are more than a dozen of them inside the loop.
I have reinstalled the CP210x driver and the ESP32 appears at com4 in the device monitor.
The device properies says it that the driver was installed with return code 0 (is it ok?).
Any suggestions?
Thank you

If you can Upload a sketch then there's not a reason that Serial.print should not work.

Doesn't help anyone else either when you don't post your code.
Also use code brackets to do so.............

*Serial.begin(xxxx);*

In the setup of the esp32 you must enable "USB CDC On Boot"

https://docs.espressif.com/projects/arduino-esp32/en/latest/tutorials/cdc_dfu_flash.html

1 Like

Thank for the replies.
I did not posted the code because it is too big (more than 1100 lines).

Regarding the xfpd reply, I tried to follow the procedure but the device is listed as soon as I connect the USB cable.

Since I am able to program the device, I guess I am in the USB-DFU mode.

How to I change it?
I could not find the settings mentioned in the arlicle in the tool section of my Arduino IDE.
Thanks

Then an MRE -- Minimum Reproducible Example

so this code does not print anything ?

void setup() {
  Serial.begin(115200);
  while(!Serial) delay(1);
  Serial.println("Ready");
}

void loop() {
  Serial.println(millis() / 1000ul);
  delay(1000); 
}

I was seaching the internet about this isuue and it occurs to me that I might be using the ports used by the Serial communication for other purposes.
It would explain why I can program and I can get data when I press the Reset button.
Here is the schematic my application.

On the ESP32 when using the Arduino framework, the Serial object is typically associated with UART0. The pins associated with UART0 are GPIO1 for TX (transmit) and GPIO3 for RX (receive).

➜ you used those

Bingo!
Thank you very much.
I will change the wiring and the code.

Just for information.
The nRF24L01 does not work if I use CE=22 and CSN= 21.
I had to use CE=17 and CSN=16.

I am curious about this.
Can anyone explain this behavior?
Thanks

When using the ESP32 with Arduino IDE, the default I2C pins are GPIO 22 (SCL) and GPIO 21 (SDA) (and you can configure your code to use any other pins). Not sure why that would interfere if you don’t activate I2C

Thank you.
Maybe one of the libraries I am using open I2C .
I am using:
#include "SPI.h"
#include "nRF24L01.h"
#include "RF24.h"
#include <TFT_eSPI.h>

Any hint from this?

No I think they are SPI libraries

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.