-
-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 4.6.0 #2516
Merged
Merged
Release 4.6.0 #2516
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR fix poor performance of hwtimer2 on ESP32 by using hardware directly. It also fixes code so it can be used from C. How many loop iterations can we achieve in 100 ms ? **ESP32** Using millis(), managed 105418 iterations, average loop time = 949ns (152 CPU cycles) Using micros(), managed 102942 iterations, average loop time = 971ns (155 CPU cycles) Using PolledTimer: BEFORE: managed 135827 iterations, average loop time = 736ns (118 CPU cycles) AFTER: managed 921085 iterations, average loop time = 109ns (17 CPU cycles) **ESP32C3** Using millis(), managed 98837 iterations, average loop time = 1012ns (162 CPU cycles) Using micros(), managed 123863 iterations, average loop time = 807ns (129 CPU cycles) Using PolledTimer: BEFORE: managed 136670 iterations, average loop time = 732ns (117 CPU cycles) AFTER: managed 551882 iterations, average loop time = 181ns (29 CPU cycles) **ESP32S2** Using millis(), managed 68260 iterations, average loop time = 1465ns (234 CPU cycles) Using micros(), managed 68921 iterations, average loop time = 1451ns (232 CPU cycles) Using PolledTimer: AFTER: managed 528409 iterations, average loop time = 189ns (30 CPU cycles)
Cannot run make until after install
SmingHub#2455 changed the timer2 timebase so it no longer corresponds with the microsecond system clock used for OsTimer. Added check in HostTests to catch this. Also improve Host CPU clock emulation to accurately reflect selected frequency. Also fix rp2040 esp_get_ccount return value, now passes tests.
Building HueEmulator library fails because of missing `lxml` python requirement. This is defined in UPnP-Schemas but `make fetch` doesn't recurse dependencies. However, running `make submodules` from the project directory does fix the problem. Should have gone with that to start with! **Revise samples + component-samples build targets** Add `make submodules` as things could break there too. Merge make targets using %.built
* Revise `FixPath` build function Translates "" into "/" which is not only wrong but can do weird things in Windows. Let's just check various path permutations to make sure they're handled correctly. Test script: ``` define Check $(info FixPath "$1": "$(call FixPath,$1)") endef $(call Check,) $(call Check,C:\test) $(call Check,test) $(call Check,./test) $(call Check,/c/test) $(call Check,c:/test) ``` Run from `Basic_Blink` sample directory, we previously get this: ``` FixPath "": "/" FixPath "C:\test": "/C/test" FixPath "test": "/test" FixPath "./test": "/./test" FixPath "/c/test": "/c/test" FixPath "c:/test": "/c/test" ``` With this commit: ``` FixPath "": "" FixPath "C:\test": "/C/test" FixPath "test": "/s/sandboxes/sming-tmp/samples/Basic_Blink/test" FixPath "./test": "/s/sandboxes/sming-tmp/samples/Basic_Blink/test" FixPath "/c/test": "/c/test" FixPath "c:/test": "/c/test" ``` * Fix CI HostTests failure not reported * Fix 'access denied' issue patching jerryscript in Windows ``` Fetching submodule 'jerryscript' ... rm: cannot lstat `jerryscript/jerry-core/api': Permission denied rm: cannot lstat `jerryscript/jerry-core/debugger': Permission denied rm: cannot lstat `jerryscript/jerry-core/ecma': Permission denied fatal: cannot create directory at 'jerry-core/api': Permission denied Unable to checkout 'd69ac0e070a97babb4b8e4c116db765f47c3eb02' in submodule path 'jerryscript' ``` This seems to be happening because jerryscript/jerryscript is already pulled in. Cannot explain why the above failure occurs, but avoiding recursive clone means the offending directories are not present and the fault disappears.
Building LittleFS fscopy tool fails as command line overrides setting. In addition, using `make SMING_SOC=` will build for default SOC (esp8266) which is consistent with how `make SMING_ARCH=` behaves.
…SmingHub#2462) This PR fixes the `SPISettings` parameters to be consistent with Arduino and related libraries, which all expect a `bitOrder` parameter. Byte order is always LSB first, corresponding with system endianness. ESP8266 and ESP32 code simplified and refactored. An SPI test module has also been added to HostTests to perform basic checks in loopback mode. Fixes arising: - Fix Esp32 + Esp8266 misaligned reads - Fix Esp32 + Esp8266 `set_mode` - Fix Esp8266 clock register setting - Fix `transfer32` method so it works correctly with all bit lengths in both LS/MS bit order - Revise SPISoft to support modes and bit order See SmingHub#1428 (comment)
* Avoid explicity CPU frequencies where slow/normal/fast is sufficient * Update pico SDK to latest develop (1.3.1) Considered 1.3.0 but there are bugfixes * Implement Rp2040 SPIClass Supports minimum 4 bit transfers so update tests accordingly. * Get samples building for RP2040 Use spiffs-2m or less if possible Fix library samples to build for rp2040, add to CI NB. Basic_WebSkeletonApp needs wifi_set_sleep_type. Basic_Tasks needs AnalogRead * Request 24MHz for ILI9341 Will get 20MHz on ESP and 24MHz on RP2040 * Update Rp2040 README * Implement Host SPI using RP2040 code
This PR allows projects to build for Rp2040 with network enabled, although networking is not functional. Instead, it provides a starting point to incorporate future support for external network adapters via SPI or USB. The Host LWIP Component has been moved into core Components, supporting Host and Rp2040 and builds using Ninja. Future PRs could look at adding ESP8266 support to this library as the current lwip2 implementation is quite old.
This PR adds support for Rp2040 to the HardwareSPI and Graphics libraries. Host support is also improved to allow integration testing. This includes revisions to thread/interrupt handling to more closely emulate real hardware behaviour. ## HardwareSPI - Refactor using architecture-specific `ControllerBase` class to simplify/clarify Controller.h. - Replace `maxTransactionSize` with `sizeAlign` Required only where requests have to be split up due to size. For example, transferring 4K of display pixel data for ESP8266 will require splitting into transactions of 64 bytes or less. The data must be transferred strictly in groups of 3 bytes (R, G, B) so `sizeAlign=3` ensures this happens. ESP32 has ~4K DMA capability, so still must be considered. RP2040 has no DMA size restriction so can be simplified. - Fix Host Controller sequencing A complex application (e.g. Basic_Graphics) should run without stalling, race conditions or exceptions. ### Improvements - Add version header - Add loopback method to Controller - Copy pin setup from SPI library Provides some consistency between the two libraries. - Supported device IO mode also depends on controller capability e.g. Device may support quad modes but controller may not, so `Device::isSupported` method returns intersection of device/controller capabilities. - Add Rp2040 implementation DMA transaction sizes are unrestricted which simplifies code, offset by lack of cmd/address/dummy phase support which complicates it. Hardware CS behaviour is weird. It gets asserted for every word in mode 0 or 2 (but not 1 or 3). This breaks operation with some devices, e.g. ILI9341. Also, there's no 'request complete' interrupt available. This is solved by using standard GPIO for CS control and completing request on RX DMA interrupt. - Add test application Provides a vehicle for testing basic operation and performing integration testing. Improved Host interrupt support in framework allows inclusion in CI testing, inserting calculated delay (based on number of bits being transferred) before firing interrupt. ## Graphics - Add Rp2040 support - Remove extraneous file added in error - duplicate of file in resource/fonts/Linux/ - Fix issue with `showFonts` in Basic_Graphics sample Gets stuck second time around the loop - Update Basic_Graphics sample, use for integration tests Simplify font functions. Add build variables to configure application to run more quickly so it can be used in CI testing. Host HardwareSPI may not do much but it allows the control flow to be verified and checked with valgrind, etc. - Fix access violation rendering fonts Detected in Windows CI run. - Don't assume location of Graphics library Running CI on standalone library means it won't be in the Sming repo. ## Framework - Fix flashmem read Must claim DMA channel so it doesn't get given to HardwareSPI. - Improve CThread interrupt handling Make `host_printf`, etc. threadsafe using `write` instead of buffered `printf` calls. Honour interrupt levels, masking out lower-level threads during interrupt Main thread synchronisation fixed. Mitigate signal deadlock using timer. Note: Running in valgrind may encounter 'undefined syscall' errors (407, 409) due to missing wrappers for 64-bit time functions. Valgrind version 3.17 has the wrappers (available in Ubuntu 21.04). - Add CI test notification support Graphics library test uses a sample application rather than SmingTest, so notifications are handled in a makefile. - Update Graphics & HardwareSPI libraries RP2040 support added. - Use 64-bit python Freetype python library doesn't work on Windows as DLL isn't installed for 32-bit python. This only happens with standard appveyor system as `C:\Python39` contains 32-bit python installation.
This PR pulls in current versions of the following Adafruit libraries: - Adafruit_ILI9341 - Adafruit_GFX - Adafruit_ST7735 - Adafruit_NeoPixel - Adafruit_PCD8544 Only the `ScreenTFT_ILI9341-9341` has been tested on hardware.
This PR improves Host performance by using efficient waiting for tasks & timers rather than just looping. Running the `HttpServer_ConfigNetwork` example sees a drop from 100% CPU usage to < 2% running in linux. Difference in Windows is less pronounced as the lwip layer incorporates a 1ms wait. LWIP is now serviced using an event timer. The interval is adjusted dynamically which allows good file transfer performance and reduced CPU usage when idle.
* Implement Smart Config for ESP32 * Rearrange WiFi event handling Move classes into SmingInternal::Network namespace Handle station events in station class implementation Add placeholder for accesspoint events Implement auto-connect setting * Move network initialisation out of startup * Add `gotIP` handler to smartconfig sample * Move network init into separate unit * Use same NVS namespace as other WiFi settings * Block auto-connect if WPS or Smart Config are active
…ong (SmingHub#2475) * Call clang-format in batches of 20 Co-authored-by: mikee47 <[email protected]>
…on) (SmingHub#2477) **Allow setting Host RTC clock** Calling `setRtcSeconds()` fails which can break applications. Instead, note difference between set time and system time. **UART improvements** Remove Host UART1 TX-only restriction. (Originally included to mirror ESP8266 behaviour.) Fix race condition in Host threads. Manifests with assertion failure running two telnet ports. Allow console to be directed to alternative UART. Also default UART0 to console, even if other ports are redirected **CLI_TARGET_OPTIONS** We need a way to more miscellaneous settings from the command line. e.g. `make run CLI_TARGET_OPTIONS=--cpulimit=1`. However, currently this means options from `HOST_NETWORK_OPTIONS` and `HOST_UART_OPTIONS` are ignored. This might be considered a bug, so behaviour has been fixed so this works as expected.
This PR extends CStringArray so it can be used as a FIFO or stack: ``` const char* front() const; bool pushFront(const char* str); String popFront(); const char* back() const; bool pushBack(const char* str); String popBack(); ``` Method names and behaviour consistent with STL.
Calling with no/empty parameters should produce no results, but instead get a list of root directories. It should also handle multiple parameters.
Co-authored-by: mikee47 <[email protected]>
Add `MacAddress(const String&)` constructor Works with both `aa:bb:cc:dd:ee:ff` and `aabbccddeeff` forms. Add tests, change const operator[] to return constant reference to octets
This PR fixes a few bugs and improves support for filesystem archiving and copying. A couple of issues have been fixed with the `ArchiveStream` class, used to generates archive files. These files can be mounted as FWFS partitions for access. The LittleFS `fscopy` tool is used to generate LittleFS images from a source FWFS image. The code has been extracted into a new general-use class `FileCopier`. This can be used to restore directory trees with attibutes. - Storage - Add debug functions (taken from IFS test application) - Add block erase support to PartitionStream - Add `createDirectory` and `createDirectories` functions Naming borrowed from std::filesystem. Prefer to avoid `mkdir` in global namespace to avoid possible conflicts with C library. Note that a regular `fileRemove` call can be used to delete a directory, which must be empty. - Change FileStream open error to debug-only Check for .gz files clutters up debug - IFS - Add fsbuild `--nominify` option, and FSBUILD_OPTIONS build variable - Fix assertion failure using named root directory for ArchiveStream - Fix problem archiving directory which is a mount point - Fix host `settime`, sets timespec incorrectly - Support host filesystem rooted to specified directory - Move debug helper code into separate unit - Add `mountArchive` helper function, and global function `fileMountArchive()` - Have test build for all architectures - Add FileCopier - Improve mountpoint handling in fsbuild tool - Check for duplicate directory names and throw error - Mountpoints can be in subdirectories, all intermediate directories are created - LittleFS - Allow inline config definitions - Move code from fscopy into new IFS FileCopier class - Fix `fstat` call failing to set directory attribute
- Add `smg_uart_intr_config` function for controlling rx/tx buffer threshold values. (I use this for RS485.) - Add `smg_uart_set_format` function to allow parity, etc. to be changed dynamically (e.g. multiple devices on same wire.) - Move common code into arch_driver Component - Fix race condition in host threads (and simplify)
This PR fixes a few problems related to handling of file/directory Access Control entries. **IFS** - Fix FileCopier class not copying directory attributes - In filesystem builder, allow minifcation to fail, but print warning (to support e.g. JSON template files) **LittleFS** - Fix `readdir()` not setting default ACL - Translate 'NOENT' lfs error code into 'NotFound' IFS error - Fix missing directory attribute (imperfect fix in SmingHub#2487) Also remove unused FileStream method. Opening on directory handle removed in SmingHub#2308.
This PR contains a few miscelleanous minor fixes: - Samples don't need to expclitly `#include <Platform/Timers.h>` as it's provided from `SmingCore.h` - Fix typos in comments/documentation
The IO Control library is an asynchronous Input/Output device stack for embedded devices such as the ESP8266. The main reason for building this was to provide a mechanism for serialising ModBus requests along with commands to other types of device such as DMX512 dimmers and 433MHz light switches.
Updated jinja2 to version 3. Co-authored-by: mikee47 <[email protected]>
Co-authored-by: mikee47 <[email protected]>
* Initial refactoring. * Add sample. * Add documentation.
…s. (SmingHub#2503) * Update SimpleRPC version. * Coding style fixes. * Add signature processing in the parser. * Add better support for overloaded functions and class method calls. * Enable class method calls. * Send as soon as possible. Some devices have limitations on the data that can be buffered before sending it. * Decrease network lag. * Use > as command name ending. * Add TwoWire commands.
* Start Using Github Actions for Continuous Integration, Coverity Scan and Release workflows. * Use appveyor for the failing CI Tests for Host @ Windows.
* Updated AnimatedGIF. * Fixed small typos.
Compatible only with Esp8266.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.