Nguyen Ha
Published © GPL3+

How to program & debug ESP32S3 via USB Serial with Arduino

On chips with an integrated USB Serial/JTAG Controller, it is possible to use the part of this controller that implements a serial port (CDC

BeginnerFull instructions provided1 hour14,119
How to program & debug ESP32S3 via USB Serial with Arduino

Things used in this project

Hardware components

Kit Wifi ESP32-S3 SIM7600CE-M1S
KIT WIFI/BLE ESP32-S3 SIM 2G/3G/4G
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematic ESP32-S3 chip

Code

demo code ESP32 - SIM7600

C/C++
#include <HardwareSerial.h>
#if defined(CONFIG_IDF_TARGET_ESP32) 
    #define mySerial Serial2
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
    #define mySerial Serial1
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
   #define mySerial Serial2
#endif

void setup() 
{
  Serial.begin(115200);
  delay(500);
  #if defined(CONFIG_IDF_TARGET_ESP32) 
    mySerial.begin(115200);
 #elif defined(CONFIG_IDF_TARGET_ESP32S2)
    mySerial.begin(115200);
 #elif defined(CONFIG_IDF_TARGET_ESP32S3)
   mySerial.begin(115200, SERIAL_8N1, 18, 17);
 #endif
  delay(500);
  mySerial.println("ATI");
  delay(100);
  update_serial();
  mySerial.println("AT+CSQ");
  delay(100);
  update_serial();
  mySerial.println("AT+CIMI");
  delay(100);
  update_serial();
  pinMode(2,OUTPUT);digitalWrite(2,HIGH);
  sent_sms();
    
}
void loop() 
{     
  if (Serial.available()){
    char c = Serial.read();
    mySerial.write(c);
  }
 update_serial();
}

void update_serial()
{
    if (mySerial.available()) {
    Serial.write(mySerial.read());
  }
}

void sent_sms()
{
 mySerial.println("AT+CMGF=1");delay(500);
 mySerial.println("AT+CMGS=\"+84941732379\"");delay(500);
 mySerial.print("test sent sms SIM7600");delay(500);
 mySerial.write(26);delay(500);
}

Credits

Nguyen Ha

Nguyen Ha

3 projects • 6 followers
Founder of AHTLAB.COM

Comments