Skip to content

Commit 3038b6e

Browse files
Jason2866me-no-devUnexpectedMakerSuGliderPilnyTomas
authored
Tasmota changes (#22)
* Tasmota changes (espressif#123) * Initial S3 Support Just so we can compile and test! Some things might/will not work. SPI and UART baud detect need to be looked at. * Add S3 Toolchain * Update Esptool and add some missing adjustments * Add Dual-Core Support * Fix bootloop issue and enable DSP optimization * Run Arduino on Core1 * Rework USB selection * Update HWCDC.cpp * Update USB.cpp * Update esp32-hal-tinyusb.c * fix S3 flash image base (espressif#6208) * Added my new Unexpected Maker ESP32-S3 boards (espressif#6211) * Fixes UART_1 TX Pin setup When passing the PR to this branch, it seems that the change to this line was forgotten. * Initial SPI support and S3-Box variant * Bootloader is at 0x0000 for S3 (espressif#6215) * small adjustments for NVS and PSRAM init * WIP: Initial support for PSRAM (QSPI and OPI) * [FEATURE] Basic implementation of Arduino's I2S library (espressif#5304) Basic version of Arduino's I2S library. We currently support only 16bps + 16000 Hz sampling frequency. Other bitrates and sample rates will print warning and continue to operate, however the resulting audio quality may be poor. There will be further effort to fix these issues. * [I2S] Fix lib-builder error * Update idf_component.yml (espressif#6232) took me a while * Fixes RMT examples and adds ESP32-S3 config (espressif#6235) * WIP: Initial OPI support * Update Libs with the new lib-builder scripts * Update board menu for ESP32-S3 * fix ethernet clock runtime setting (espressif#6340) this was not possible anymore since the GPIO refactoring. This superseeds espressif/esp32-arduino-lib-builder#60 (which works only for clock on GPIO17). A PR will provided to revert this. @me-no-dev fyi The fix is done from @arendst Credits go to him! * Update IDF libs and fix missing BLE 4.2 features * Update CI scripts * script fixes * Add guard to USB examples * Disable some examples for ESP32-S3 * skip one more sketch and try again PIO * Fox SPI example and add proper esptool for PIO CI * Update ResetReason.ino * Update IDF, Add ESP-SR and RainMaker * Enable RainMaker on all chips * Enable hardware test on ESP32-S3 * Adjust build dir for tests and sketches * Update tests_build.sh * Send event also if tests fail * Add helper script for updating the core version * [Docs] Added/Updated Lib builder docs (espressif#6401) * [Docs] Added/Updated Lib builder docs * [Docs] Fixes according to the PR review * [Docs] Fixes according to the PR review * SD_MMC: add ESP32-S3 support * CmakeList + Rainmaker src files edit * remove Rainmaker * Tasmota change * Fix Unicore WDT on HTTP OTA update * Revert "ESP32-S3 SDMMC support" (#20) * Fix reboot into download from TinyUSB on ESP32-S3 Requires manual reboot back into the new firmware after flashing has finished * Fix psram crash pico d4 (espressif#110) * Fix reboot into download from TinyUSB on ESP32-S3 (espressif#111) Requires manual reboot back into the new firmware after flashing has finished Co-authored-by: me-no-dev <[email protected]> * Revert "Fix psram crash pico d4 (espressif#110)" (espressif#113) This reverts commit 56cf555. * Fix boot freeze when trying to init PSRAM on Pico D4 * revert tinyusb * hal/usb_serial_jtag_ll.h only C3, H2, S3 * Fix sd mmc * add wpa_supplicant as requirement * Update platform.txt * remove Rainmaker * Update boards.txt * Update HardwareSerial.h * Update USBCDC.cpp * Update esptool.py * Update platformio-build-esp32.py * Update platformio-build-esp32c3.py * Update platformio-build-esp32s2.py * Update platformio-build-esp32s3.py * fix merge errors * Reordering - HardwareSerial Constructor * Update platformio-build-esp32.py * Update platformio-build-esp32c3.py * Update platformio-build-esp32s2.py * Update platformio-build-esp32s3.py * Update pins_arduino.h * Update platformio-build-esp32.py * Update platformio-build-esp32c3.py * Update platformio-build-esp32s2.py * Update platformio-build-esp32s3.py Co-authored-by: me-no-dev <[email protected]> Co-authored-by: Unexpected Maker <[email protected]> Co-authored-by: Rodrigo Garcia <[email protected]> Co-authored-by: Tomáš Pilný <[email protected]> Co-authored-by: Me No Dev <[email protected]> Co-authored-by: Pedro Minatel <[email protected]> Co-authored-by: Ivan Grokhotkov <[email protected]> Co-authored-by: Jan Procházka <[email protected]> * Bugfix fs read+speed improvements (espressif#127) * Revert "Edited VFSFileImpl::read to use both read/fread (espressif#6456)" This reverts commit 7b89b39. * Added default file buffer size + function to change it by user Co-authored-by: Jan Procházka <[email protected]> Co-authored-by: me-no-dev <[email protected]> Co-authored-by: Unexpected Maker <[email protected]> Co-authored-by: Rodrigo Garcia <[email protected]> Co-authored-by: Tomáš Pilný <[email protected]> Co-authored-by: Me No Dev <[email protected]> Co-authored-by: Pedro Minatel <[email protected]> Co-authored-by: Ivan Grokhotkov <[email protected]> Co-authored-by: Jan Procházka <[email protected]>
1 parent b7b56ef commit 3038b6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+50
-3785
lines changed

Diff for: .github/scripts/install-arduino-core-esp32.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if [ ! -d "$ARDUINO_ESP32_PATH" ]; then
2020
ln -s $GITHUB_WORKSPACE esp32
2121
else
2222
echo "Cloning Core Repository..."
23-
git clone https://github.com/espressif/arduino-esp32.git esp32 > /dev/null 2>&1
23+
git clone https://github.com/tasmota/arduino-esp32.git esp32 > /dev/null 2>&1
2424
fi
2525

2626
#echo "Updating Submodules ..."

Diff for: CMakeLists.txt

-10
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ set(LIBRARY_SRCS
9090
libraries/I2S/src/I2S.cpp
9191
libraries/NetBIOS/src/NetBIOS.cpp
9292
libraries/Preferences/src/Preferences.cpp
93-
libraries/RainMaker/src/RMaker.cpp
94-
libraries/RainMaker/src/RMakerNode.cpp
95-
libraries/RainMaker/src/RMakerParam.cpp
96-
libraries/RainMaker/src/RMakerDevice.cpp
97-
libraries/RainMaker/src/RMakerType.cpp
9893
libraries/SD_MMC/src/SD_MMC.cpp
9994
libraries/SD/src/SD.cpp
10095
libraries/SD/src/sd_diskio.cpp
@@ -184,7 +179,6 @@ set(includedirs
184179
libraries/I2S/src
185180
libraries/NetBIOS/src
186181
libraries/Preferences/src
187-
libraries/RainMaker/src
188182
libraries/SD_MMC/src
189183
libraries/SD/src
190184
libraries/SimpleBLE/src
@@ -239,10 +233,6 @@ endfunction()
239233

240234
maybe_add_component(esp-dsp)
241235

242-
if(CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK)
243-
maybe_add_component(esp_rainmaker)
244-
maybe_add_component(qrcode)
245-
endif()
246236
if(IDF_TARGET MATCHES "esp32s2|esp32s3" AND CONFIG_TINYUSB_ENABLED)
247237
maybe_add_component(arduino_tinyusb)
248238
endif()

Diff for: cores/esp32/Esp.cpp

+9-5
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ extern "C" {
4747
#elif CONFIG_IDF_TARGET_ESP32C3
4848
#include "esp32c3/rom/spi_flash.h"
4949
#define ESP_FLASH_IMAGE_BASE 0x0000 // Esp32c3 is located at 0x0000
50-
#else
50+
#else
5151
#error Target CONFIG_IDF_TARGET is not supported
5252
#endif
5353
#else // ESP32 Before IDF 4.0
@@ -192,7 +192,7 @@ static uint32_t sketchSize(sketchSize_t response) {
192192
return data.image_len;
193193
}
194194
}
195-
195+
196196
uint32_t EspClass::getSketchSize () {
197197
return sketchSize(SKETCH_SIZE_TOTAL);
198198
}
@@ -231,6 +231,10 @@ String EspClass::getSketchMD5()
231231
md5.add(buf.get(), readBytes);
232232
lengthLeft -= readBytes;
233233
offset += readBytes;
234+
235+
#if CONFIG_FREERTOS_UNICORE
236+
delay(1); // Fix solo WDT
237+
#endif
234238
}
235239
md5.calculate();
236240
result = md5.toString();
@@ -391,17 +395,17 @@ bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size)
391395
return spi_flash_read(offset, (uint32_t*) data, size) == ESP_OK;
392396
}
393397

394-
bool EspClass::partitionEraseRange(const esp_partition_t *partition, uint32_t offset, size_t size)
398+
bool EspClass::partitionEraseRange(const esp_partition_t *partition, uint32_t offset, size_t size)
395399
{
396400
return esp_partition_erase_range(partition, offset, size) == ESP_OK;
397401
}
398402

399-
bool EspClass::partitionWrite(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size)
403+
bool EspClass::partitionWrite(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size)
400404
{
401405
return esp_partition_write(partition, offset, data, size) == ESP_OK;
402406
}
403407

404-
bool EspClass::partitionRead(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size)
408+
bool EspClass::partitionRead(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size)
405409
{
406410
return esp_partition_read(partition, offset, data, size) == ESP_OK;
407411
}

Diff for: libraries/ESP32/examples/RMT/RMTCallback/RMTCallback.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ void loop()
6464
{
6565
Serial.printf("GPIO 4: %08x 5: %08x 10: %08x\n", mp1.val(), mp2.val(), mp3.val());
6666
delay(500);
67-
}
67+
}

Diff for: libraries/FS/src/FS.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,15 @@ size_t File::size() const
130130
return _p->size();
131131
}
132132

133+
bool File::setBufferSize(size_t size)
134+
{
135+
if (!*this) {
136+
return 0;
137+
}
138+
139+
return _p->setBufferSize(size);
140+
}
141+
133142
void File::close()
134143
{
135144
if (_p) {

Diff for: libraries/FS/src/FS.h

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class File : public Stream
7070
}
7171
size_t position() const;
7272
size_t size() const;
73+
bool setBufferSize(size_t size);
7374
void close();
7475
operator bool() const;
7576
time_t getLastWrite();

Diff for: libraries/FS/src/FSImpl.h

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class FileImpl
3636
virtual bool seek(uint32_t pos, SeekMode mode) = 0;
3737
virtual size_t position() const = 0;
3838
virtual size_t size() const = 0;
39+
virtual bool setBufferSize(size_t size) = 0;
3940
virtual void close() = 0;
4041
virtual time_t getLastWrite() = 0;
4142
virtual const char* path() const = 0;

Diff for: libraries/FS/src/vfs_api.cpp

+23-24
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
// limitations under the License.
1414

1515
#include "vfs_api.h"
16-
#include <stdio_ext.h>
1716

1817
using namespace fs;
1918

20-
#define READ_SIZE_SWITCH 128 //swithc to read func when read size > 128bytes
19+
#define DEFAULT_FILE_BUFFER_SIZE 4096
2120

2221
FileImplPtr VFSImpl::open(const char* fpath, const char* mode, const bool create)
2322
{
@@ -283,6 +282,10 @@ VFSFileImpl::VFSFileImpl(VFSImpl* fs, const char* fpath, const char* mode)
283282
if(!_f) {
284283
log_e("fopen(%s) failed", temp);
285284
}
285+
if(_f && (_stat.st_blksize == 0))
286+
{
287+
setvbuf(_f,NULL,_IOFBF,DEFAULT_FILE_BUFFER_SIZE);
288+
}
286289
} else if(S_ISDIR(_stat.st_mode)) {
287290
_isDirectory = true;
288291
_d = opendir(temp);
@@ -310,6 +313,10 @@ VFSFileImpl::VFSFileImpl(VFSImpl* fs, const char* fpath, const char* mode)
310313
if(!_f) {
311314
log_e("fopen(%s) failed", temp);
312315
}
316+
if(_f && (_stat.st_blksize == 0))
317+
{
318+
setvbuf(_f,NULL,_IOFBF,DEFAULT_FILE_BUFFER_SIZE);
319+
}
313320
}
314321
}
315322
free(temp);
@@ -377,28 +384,7 @@ size_t VFSFileImpl::read(uint8_t* buf, size_t size)
377384
return 0;
378385
}
379386

380-
//ERASE BYTEBUFFER and use read when size > READ_SIZE_SWITCH always
381-
if(size > READ_SIZE_SWITCH)
382-
{
383-
//check some data in buffer exists –> clear buffer and move pointer to deleted data
384-
size_t bytesinbuf = __fpending(_f);
385-
if (bytesinbuf && (bytesinbuf != 128)) //buffer lenght is 128 bytes
386-
{
387-
fpurge(_f);
388-
lseek(fileno(_f),(-128+bytesinbuf),SEEK_CUR);
389-
}
390-
391-
int res = ::read(fileno(_f), buf, size);
392-
if (res < 0) {
393-
// an error occurred
394-
return 0;
395-
}
396-
return res;
397-
}
398-
else
399-
{
400-
return fread(buf, 1, size, _f);
401-
}
387+
return fread(buf, 1, size, _f);
402388
}
403389

404390
void VFSFileImpl::flush()
@@ -439,6 +425,19 @@ size_t VFSFileImpl::size() const
439425
return _stat.st_size;
440426
}
441427

428+
/*
429+
* Change size of files internal buffer used for read / write operations.
430+
* Need to be called right after opening file before any other operation!
431+
*/
432+
bool VFSFileImpl::setBufferSize(size_t size)
433+
{
434+
if(_isDirectory || !_f) {
435+
return 0;
436+
}
437+
int res = setvbuf(_f,NULL,_IOFBF,size);
438+
return res == 0;
439+
}
440+
442441
const char* VFSFileImpl::path() const
443442
{
444443
return (const char*) _path;

Diff for: libraries/FS/src/vfs_api.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ class VFSFileImpl : public FileImpl
6565
bool seek(uint32_t pos, SeekMode mode) override;
6666
size_t position() const override;
6767
size_t size() const override;
68+
bool setBufferSize(size_t size);
6869
void close() override;
6970
const char* path() const override;
7071
const char* name() const override;
71-
time_t getLastWrite() override;
72+
time_t getLastWrite() override;
7273
boolean isDirectory(void) override;
7374
FileImplPtr openNextFile(const char* mode) override;
7475
void rewindDirectory(void) override;

Diff for: libraries/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ arduino-esp32 includes libraries for Arduino compatibility along with some objec
6969
### Preferences
7070
Flash keystore using ESP32 NVS
7171

72-
### ESP RainMaker
73-
End-to-end platform by Espressif that enables Makers to realize their IoT ideas faster
74-
7572
### SD
7673
Secure Digital card filesystem using SPI access
7774

0 commit comments

Comments
 (0)