iisfaq
1
I have a bare bones DFROBOT FIRE BEETLE ESP32-C6 that seems to go into a boot loop
Rebooting...
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0xc (SW_CPU),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4001975a
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c410,len:0xc24
load:0x4086e610,len:0x2708
Then it displays a stack memory dump
I have tried to erase the flash memory using python
esptool.py v4.8.1
Serial port COM4
Connecting...
Detecting chip type... ESP32-C6
Chip is ESP32-C6FH4 (QFN32) (revision v0.0)
Features: WiFi 6, BT 5, IEEE802.15.4
Crystal is 40MHz
MAC: 54:32:04:ff:fe:0b:59:ac
BASE MAC: 54:32:04:0b:59:ac
MAC_EXT: ff:fe
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 15.1s
Hard resetting via RTS pin...
There are no components plugged into the board expect USB cable.
The code I am running opens the serial port and uses ESPNOW, nothing else.
Bit lost on this - it is a firmware, hardware failure?
Issue is the same if USB Cable plugged into laptop or docking station.
The FastBlink sketch seems to work ok including the serial.
Could it be power related? If so how would I develop against this board. This board use to work without issue.
iisfaq
2
Very basic sketch
/*
USE ONEWIRENG by Piotr Stolarz 0.13.2 or later and not the default OneWire which will give compile errors.
*/
#include <OneWire.h>
#include <SunRecorder.h>
#include <esp_now.h>
#include <WiFi.h>
//MAC
uint8_t MAC_OF_THIS[] = { 0x54, 0x32, 0x04, 0x0b, 0x59, 0xAC };
uint8_t MAC_OF_SERVER[] = { 0x54, 0x32, 0x04, 0x0b, 0x2f, 0xf8 };
typedef struct struct_message {
bool error;
int light;
float temperature;
float current;
float battery;
long timestamp;
} struct_message;
struct_message sendData;
struct_message recvData;
esp_now_peer_info_t peerInfo;
//SCallback when data is sent
void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) {
if (status == ESP_NOW_SEND_SUCCESS) {
Serial.println("Send_Success");
} else {
Serial.println("Send_Fail");
}
}
//Callback when data is received
void OnDataRecv(const esp_now_recv_info *, const unsigned char *data, int data_len) {
memcpy(&recvData, data, sizeof(recvData));
Serial.print("Bytes received: Error=");
Serial.print(recvData.error);
Serial.print(", light=");
Serial.print(recvData.light);
Serial.print(", temp=");
Serial.print(recvData.temperature);
Serial.print(", current=");
Serial.print(recvData.current);
Serial.print(", battery=");
Serial.print(recvData.battery);
Serial.print("v, time=");
Serial.println(recvData.timestamp);
}
void setup() {
Serial.begin(115200);
while (!Serial) {
;
}
delay(1000);
if (1 == 0) {
WiFi.mode(WIFI_STA);
delay(1000);
Serial.println();
Serial.print("WIFI Mac Address: ");
Serial.println(WiFi.macAddress());
}
//Init ESP-NOW
if (esp_now_init() != ESP_OK) {
Serial.println("Error initializing");
return;
}
delay(1000);
time_t now;
char strftime_buf[64];
struct tm timeinfo;
time(&now);
localtime_r(&now, &timeinfo);
strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
Serial.println(strftime_buf);
//Register callback on data sent
esp_now_register_send_cb(OnDataSent);
peerInfo.channel = 0;
peerInfo.encrypt = false;
//Register MAC1 Device
memcpy(peerInfo.peer_addr, MAC_OF_SERVER, 6);
if (esp_now_add_peer(&peerInfo) != ESP_OK) {
Serial.println("Failed to add peer");
return;
}
//Register callback on data received
esp_now_register_recv_cb(OnDataRecv);
delay(1000);
/*
WiFi.begin(ssid, password);
Serial.print("Connecting to WiFi ..");
while (WiFi.status() != WL_CONNECTED) {
Serial.print('.');
delay(1000);
}
Serial.println(WiFi.localIP());
*/
}
void loop() {
// //Serial.println(millis());
if (Serial.available()) {
String Data = Serial.readString();
const char *charData = Data.c_str(); // Convert string to char*
esp_err_t result = esp_now_send(MAC_OF_SERVER, (uint8_t *)charData, strlen(charData));
}
delay(25);
}
@iisfaq, did not check all the code but noticed the following.
In setup(), is the following code supposed to be executed?
The if statement will never be entered since since ( 1 == 0 ) will always be false.
1 Like
iisfaq
5
Hi, yes it was intentionally written to comment out the code.
Understood, that makes sense.
Same boat here chip not booting. looking for a valid firmware to flash onto my chip. I personally hosed mine up. I'm struggling to get it back.
iisfaq
8
I moved over and tried ESP-IDF and my device worked properly, no problem with serial etc.
I also found that Claude ai could convert my code from ardu8no to esp-if. Well worth a try.
Maybe the arduino libraries are at fault?
Chris