diff --git a/CHANGELOG.md b/CHANGELOG.md index dd3a955..babbb44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,29 @@ # Changelog for rESCue firmware +## Release 1.3.4 (not released yet) + +### 20.07.2021 + +- fixed WiFi OTA update by changing partition schema to default +- fixed "Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed)" while OTA +- fixed app crash when App-Configuration is written and not dividable by 6 byte + +## Release 1.3.3 + +### 19.07.2021 + +- improved CANBUS communication +- Fixed bug that CANBUS freezes when sending multiple frames at the same time + ## Release 1.3.1 - bugfix lights, erpm was read wrong sometimes ## Release 1.3.0 -### 27.06.2021 +### 27.06.2021 - - prepared release 1.3.0 +- prepared release 1.3.0 ### 25.06.2021 diff --git a/default.csv b/default.csv new file mode 100644 index 0000000..5d1cef1 --- /dev/null +++ b/default.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x140000, +app1, app, ota_1, 0x150000,0x140000, +spiffs, data, spiffs, 0x290000,0x170000, \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 36202af..c167ee1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -44,7 +44,7 @@ board = wemos_d1_mini32 framework = arduino monitor_speed = 115200 upload_Speed = 921600 -board_build.partitions = min_spiffs.csv +board_build.partitions = default.csv lib_deps = ${common_env_data.lib_deps_external} build_flags = @@ -55,7 +55,7 @@ platform = espressif32 board = nodemcu-32s framework = arduino monitor_speed = 115200 -board_build.partitions = min_spiffs.csv +board_build.partitions = default.csv lib_deps = ${common_env_data.lib_deps_external} build_flags = diff --git a/src/CanBus.cpp b/src/CanBus.cpp index 5a70346..2e75bab 100644 --- a/src/CanBus.cpp +++ b/src/CanBus.cpp @@ -361,7 +361,9 @@ void CanBus::proxyIn(std::string in) { tx_frame.MsgID = (uint32_t(0x8000) << 16) + (uint16_t(CAN_PACKET_FILL_RX_BUFFER) << 8) + VESC_CAN_ID; tx_frame.FIR.B.DLC = 8; tx_frame.data.u8[0] = byteNum - offset; //startbyte counter of frame - for (int i = 1; i < 8; i++) { + + int sendLen = (longPackBuffer.length() >= byteNum + 7) ? 7 : longPackBuffer.length() - byteNum; + for (int i = 1; i> 8; tx_frame.data.u8[1] = (byteNum - 1) & 0xFF; - for (int i=2; i<8; i++) { + + int sendLen = (longPackBuffer.length() >= byteNum + 6) ? 6 : longPackBuffer.length() - byteNum; + for (int i=2; isize)); esp_ota_begin(partition, OTA_SIZE_UNKNOWN, &otaHandler); updateFlag = true; + Serial.println("Update started"); } void handleUpdate(std::string data) { @@ -65,7 +66,7 @@ void activateWiFiAp(const char *password) { AsyncWebParameter* p = request->getParam(i); if(p->isPost() && p->name().compareTo("data") != -1) { const char *value =p->value().c_str(); - Serial.printf("\nPOST[%s]: bytes %d\n", p->name().c_str(), p->value().length()); + //Serial.printf("\nPOST[%s]: bytes %d\n", p->name().c_str(), p->value().length()); if(!updateFlag) { startUpdate(); } @@ -107,7 +108,6 @@ void OTAUpdater::setup() { printf("Type: %02x SubType %02x Address 0x%06X Size 0x%06X Encryption %i Label %s\r\n", _mypart->type, _mypart->subtype, _mypart->address, _mypart->size, _mypart->encrypted, _mypart->label); _mypartiterator = esp_partition_next(_mypartiterator); } - _mypart = esp_ota_get_boot_partition(); printf("Current active partition is %s\r\n", _mypart->label); } diff --git a/src/main.cpp b/src/main.cpp index 4cb4158..475fb80 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -60,13 +60,15 @@ void setup() { } AppConfiguration::getInstance()->readPreferences(); - ledController = LedControllerFactory::getInstance()->createLedController(); if(AppConfiguration::getInstance()->config.otaUpdateActive) { updater->setup(); return; } + ledController = LedControllerFactory::getInstance()->createLedController(); + + pinMode(PIN_FORWARD, INPUT); pinMode(PIN_BACKWARD, INPUT); pinMode(PIN_BRAKE, INPUT);