-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
Type: QuestionOnly questionOnly question
Description
Board
lilygo-t-display-s3
Device Description
lilygo-t-display-s3
Original sample
Hardware Configuration
NULL
Version
latest master (checkout manually)
IDE Name
arduino
Operating System
windows10
Flash frequency
240MHz
PSRAM enabled
yes
Upload speed
115200
Description
我想根据LittleFS中的BIN文件进行更新,但是我一直报错
我已经排查了下列信息
- FS文件和编译文件对比,无差异
- Being及Wirte无异常
- 仅仅在esp_ota_set_boot_partition(_partition)报错
I tried to update from the BIN file in LittleFS, but I kept getting errors
I've checked the following information
- There is no difference between the FS file and the compiled file
- Being and Wirte are normal
- Only esp_ota_set_boot_partition(_partition) reports an error
Sketch
#include <Arduino.h>
#include "FS.h"
#include <LittleFS.h>
#include "Update.h"
#include <functional>
#include "esp_ota_ops.h"
// put function declarations here:
uint32_t timesdfsf = 0;
extern uint32_t lenccsa;
bool sfsfdsdfdsf = false;
byte buffs[1500];
int readwwflen;
File filess;
void setup() {
delay(2000);
Serial0.begin(115200);
LittleFS.begin();
// LittleFS.format();
Serial0.println("littlefs is init");
// LittleFS.begin();
// led.LedOpen();
// uart485.UartOpen();
// mcuConfig.McuConfigInit();
auto appVal = esp_ota_get_running_partition();
// mcuConfig.RtuConfigReadFs();
// mcuConfig.RtuCtpReadFs();
// mcuConfig.RtuCtpAllReadFs();
// ht16k33.Ht16k33Open(&Wire, 0x70);
// adc.AdcOpen();
// keyObject.KeyInit();
// moto.MotoOpen(100);
// rtuModeVal.ModeInit();
// Serial1.begin(115200, SERIAL_8N1, USART_RX, USART_TX);
Serial0.println("app:" + String(appVal->label));
delay(10000);
}
esp_ota_handle_t update_handle = 0; // update的hdl,用于识别当前是哪个OTA,这里应该允许多个OTA同时进行?
const esp_partition_t *update_partition = NULL; // 拿分区的指针
int binary_file_length = 0; // 文件长度
bool image_header_was_checked = false; // 是否检测到头了
void loop() {
byte sdfsd[4096];
byte sdfdfsdfwwww;
int sdfsdfsdfsdf;
int filesfs = 0;
sfsfdsdfdsf = true;
// ymodem_receive();
sfsfdsdfdsf = false;
filess = LittleFS.open("/ssx.bin", FILE_READ);
update_partition = esp_ota_get_next_update_partition(NULL);
Serial0.println("appnext:" + String(update_partition->label));
Update.begin(filess.size());
Update.printError(Serial0);
Serial0.println("begin");
while (1) {
sdfsdfsdfsdf = filess.read(sdfsd, 4096);
Update.write(sdfsd, sdfsdfsdfsdf);
filesfs += sdfsdfsdfsdf;
if (sdfsdfsdfsdf < 4096) {
break;
}
}
Update.printError(Serial0);
Serial0.println("writeStream:" + String(filesfs));
filess.close();
Update.printError(Serial0);
Serial0.println("close");
Update.end();
Update.printError(Serial0);
Serial0.println("end");
ESP.restart();
}Debug Message
1⸮app:app1
No Error
begin
No Error
writeStream:337648
No Error
close
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x4037daa9 PS : 0x00060c33 A0 : 0x8037fab4 A1 : 0x3fcea940
A2 : 0xffcf1314 A3 : 0xffffffff A4 : 0x0000abab A5 : 0x00060c23
A6 : 0x000001ce A7 : 0x00000000 A8 : 0x82019fa8 A9 : 0x3fceaa70
A10 : 0x00000000 A11 : 0x00000000 A12 : 0x00000005 A13 : 0x3fc96190
A14 : 0xb33fffff A15 : 0x00000001 SAR : 0x00000009 EXCCAUSE: 0x0000001c
EXCVADDR: 0xffcf1314 LBEG : 0x400570e8 LEND : 0x400570f3 LCOUNT : 0xffffffff
Backtrace: 0x4037daa6:0x3fcea940 0x4037fab1:0x3fcea970 0x4037fc0d:0x3fcea990 0x4037737e:0x3fcea9b0 0x403775af:0x3fcea9e0 0x42019159:0x3fceaa00 0x42019fbb:0x3fceaa50 0x4201a011:0x3fceaa70 0x42019fa5:0x3fceaae0 0x42019eff:0x3fceab00 0x42019b5c:0x3fceab40 0x42009748:0x3fceab70 0x4200954a:0x3fceab90 0x42009613:0x3fceabf0 0x420096fd:0x3fceac50 0x42009f96:0x3fceac70 0x4200a12c:0x3fceada0 0x420032a8:0x3fceae
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.
Metadata
Metadata
Assignees
Labels
Type: QuestionOnly questionOnly question