ESP32-C3 Program Prevents Flashing.
Posted: Tue Feb 22, 2022 3:08 am
Hello,
I am fairly new to using the ESP-32 C3 and have run into an issue while taking the Esspressif course for the ESP32. Specifically, I have uploaded my copy of the iBeacon program through VSCode, which was successfully uploaded, but now prevents me from flashing to the board in any way.
Some background:
- I am using a custom board I created that integrates the ESP32-C3-WROOM-02-N4 and uses the onboard USB Serial/JTAG Controller for programming. I know this board was designed right to at least some extent as I was able to upload a variety of programs to it and control a lot of the onboard peripherals.
- I have tried flashing to the chip in both standard operation (after pressing reset or unplugging the board) and serial bootloader mode through VSCode. Device Manager in Windows identifies the board in both instances but as different COM ports.
- The board is still functional. I still get 3.3V onto the Vin pin of the ESP-32. I also get a readout on Tera Term when I use the reset button on the device. The Tera Term readout is as follows:
The main file, which is all I have edited beyond creating a template project, reads as follows:
The error I get when attempting to flash to the board is as follows:
"
Executing action: flash
Serial port COM5
COM5 failed to connect: Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31)
No serial ports found. Connect a device, or use '-p PORT' option to set a specific port.
"
I am fairly new to using the ESP-32 C3 and have run into an issue while taking the Esspressif course for the ESP32. Specifically, I have uploaded my copy of the iBeacon program through VSCode, which was successfully uploaded, but now prevents me from flashing to the board in any way.
Some background:
- I am using a custom board I created that integrates the ESP32-C3-WROOM-02-N4 and uses the onboard USB Serial/JTAG Controller for programming. I know this board was designed right to at least some extent as I was able to upload a variety of programs to it and control a lot of the onboard peripherals.
- I have tried flashing to the chip in both standard operation (after pressing reset or unplugging the board) and serial bootloader mode through VSCode. Device Manager in Windows identifies the board in both instances but as different COM ports.
- The board is still functional. I still get 3.3V onto the Vin pin of the ESP-32. I also get a readout on Tera Term when I use the reset button on the device. The Tera Term readout is as follows:
The main file, which is all I have edited beyond creating a template project, reads as follows:
Code: Select all
#include <stdio.h>
#include <String.h>
#include "driver/gpio.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "esp_nimble_hci.h"
#include "nimble/nimble_port.h"
#include "nimble/nimble_port_freertos.h"
#include "host/ble_hs.h"
#include "services/gap/ble_svc_gap.h"
void ble_app_on_sync(void)
{
ble_addr_t addr;
ble_hs_id_gen_rnd(1, &addr);
ble_hs_id_set_rnd(addr.val);
uint8_t uuid128[16];
memset(uuid128, 0x11, sizeof(uuid128));
ble_ibeacon_set_adv_data(uuid128, 2, 10, -10);
struct ble_gap_adv_params adv_params = (struct ble_gap_adv_params) {0};
ble_gap_adv_start(BLE_OWN_ADDR_RANDOM, NULL, BLE_HS_FOREVER, &adv_params, NULL, NULL);
}
void host_Task(void *param)
{
nimble_port_run();
}
void app_main(void)
{
nvs_flash_init();
esp_nimble_hci_and_controller_init();
nimble_port_init();
ble_hs_cfg.sync_cb = ble_app_on_sync;
nimble_port_freertos_init(host_Task);
}
"
Executing action: flash
Serial port COM5
COM5 failed to connect: Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31)
No serial ports found. Connect a device, or use '-p PORT' option to set a specific port.
"