Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
slav-at-attachix committed Dec 27, 2024
2 parents 3482a02 + e31ee0b commit 438f9d8
Show file tree
Hide file tree
Showing 127 changed files with 2,285 additions and 2,261 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/ci-esp32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
variant: [esp32, esp32s2, esp32c3, esp32s3, esp32c2]
idf_version: ["4.4", "5.0", "5.2"]
include:
- os: ubuntu-latest
variant: esp32
idf_version: "4.3"
exclude:
- variant: esp32c2
idf_version: "4.4"
- os: macos-latest
idf_version: "4.4"
- os: macos-latest
idf_version: "5.0"
- os: windows-latest
idf_version: "5.0"
idf_version: ["5.2"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ toJson(matrix) }}
Expand Down Expand Up @@ -58,7 +45,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.idf_version == '4.3' && '3.8' || '3.12' }}
python-version: '3.12'

- name: Fix permissions
if: matrix.os != 'windows-latest'
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
variant: [esp8266, host, rp2040]
variant: [esp8266, host, rp2040, rp2350]
toolchain: [gcc]
include:
- variant: esp8266
Expand All @@ -31,6 +31,8 @@ jobs:
toolchain: gcc64
- variant: rp2040
arch: Rp2040
- variant: rp2350
arch: Rp2040

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ toJson(matrix) }}
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
variant: [esp8266, host, esp32, esp32s2, esp32c3, esp32s3, esp32c2, rp2040]
idf_version: ["4.4", ""] # "" denotes default, currently 5.2
idf_version: [""] # "" denotes default, currently 5.2
toolchain: [gcc]
include:
- variant: esp8266
Expand All @@ -50,17 +50,6 @@ jobs:
arch: Esp32
- variant: rp2040
arch: Rp2040
exclude:
- variant: esp32c2
idf_version: "4.4"
- variant: esp8266
idf_version: "4.4"
- variant: host
idf_version: "4.4"
- variant: rp2040
idf_version: "4.4"
- os: macos-latest
idf_version: "4.4"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ toJson(matrix) }}
Expand Down
10 changes: 9 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@

[submodule "Rp2040.picotool"]
path = Sming/Arch/Rp2040/Components/picotool/picotool
url = https://github.com/mikee47/picotool
url = https://github.com/raspberrypi/picotool
ignore = dirty

[submodule "Rp2040.Sdk"]
Expand Down Expand Up @@ -213,6 +213,10 @@
path = Sming/Libraries/Arduino_TensorFlowLite
url = https://github.com/slaff/Arduino_TensorFlowLite.git
ignore = dirty
[submodule "Libraries.ConfigDB"]
path = Sming/Libraries/ConfigDB
url = https://github.com/mikee47/ConfigDB
ignore = dirty
[submodule "Libraries.CS5460"]
path = Sming/Libraries/CS5460/CS5460
url = https://github.com/xxzl0130/CS5460.git
Expand Down Expand Up @@ -281,6 +285,10 @@
path = Sming/Libraries/ITEADLIB_Arduino_Nextion
url = https://github.com/itead/ITEADLIB_Arduino_Nextion.git
ignore = dirty
[submodule "Libraries.JsonStreamingParser"]
path = Sming/Libraries/JsonStreamingParser
url = https://github.com/mikee47/JsonStreamingParser
ignore = dirty
[submodule "Libraries.libsodium"]
path = Sming/Libraries/libsodium/libsodium
url = https://github.com/jedisct1/libsodium.git
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Sming

Sming is an asynchronous embedded C++ framework with superb performance and multiple network features.
Sming is [open source](LICENSE), modular and supports [multiple architectures](https://sming.readthedocs.io/en/latest/features.html) including ESP8266, ESP32 and RP2040.
Sming is [open source](LICENSE), modular and supports [multiple architectures](https://sming.readthedocs.io/en/latest/features.html) including ESP8266, ESP32 and Raspberry Pi Pico (both RP2040 and RP2350).

[![Examples](https://github.com/SmingHub/Sming/wiki/images/small/combine.png)](https://github.com/SmingHub/Sming/wiki/examples)

Expand Down Expand Up @@ -29,14 +29,14 @@ You can also try Sming without installing anything locally. We have an [interact

The purpose of Sming is to simplify the creation of embedded applications. The documentation will help you get started in no time.

- [**Documentation for version 5.2.0**](https://sming.readthedocs.io/en/stable) - current stable version.
- [**Documentation for version 6.0.0**](https://sming.readthedocs.io/en/stable) - current stable version.
- [Documentation for latest](https://sming.readthedocs.io/en/latest) - development version.

## Releases

### Stable

- [Sming V5.2.0](https://github.com/SmingHub/Sming/releases/tag/5.2.0) - great new features, performance and stability improvements.
- [Sming V6.0.0](https://github.com/SmingHub/Sming/releases/tag/6.0.0) - great new features, performance and stability improvements.

### Development

Expand Down
3 changes: 3 additions & 0 deletions Sming/Arch/Esp32/Components/driver/include/driver/hw_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
#include <stdint.h>
#include <esp_idf_version.h>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#if CONFIG_ESP_TIMER_IMPL_TG0_LAC
#include <soc/timer_group_reg.h>
#else
#include <hal/systimer_ll.h>
#endif
#pragma GCC diagnostic pop

#ifdef __cplusplus
extern "C" {
Expand Down
7 changes: 2 additions & 5 deletions Sming/Arch/Esp32/Components/driver/include/driver/pwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

#pragma once

#ifdef SOC_LEDC_CHANNEL_NUM
#include <soc/soc_caps.h>

#define PWM_CHANNEL_NUM_MAX SOC_LEDC_CHANNEL_NUM
#else
// this should not happen if the correct esp32 includes are used, just to be absolutely sure
#define PWM_CHANNEL_NUM_MAX 8
#endif
24 changes: 24 additions & 0 deletions Sming/Arch/Esp32/Components/driver/uart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,28 @@ smg_uart_t* get_standard_uart(smg_uart_t* uart)
return is_standard_uart(uart) ? uart : nullptr;
}

class Lock
{
public:
Lock()
{
if(!mutex) {
mutex = xSemaphoreCreateMutex();
}
xSemaphoreTake(mutex, portMAX_DELAY);
}

~Lock()
{
xSemaphoreGive(mutex);
}

private:
static SemaphoreHandle_t mutex;
};

SemaphoreHandle_t Lock::mutex;

#if UART_ID_SERIAL_USB_JTAG

/**
Expand Down Expand Up @@ -544,6 +566,8 @@ size_t smg_uart_write(smg_uart_t* uart, const void* buffer, size_t size)

auto buf = static_cast<const uint8_t*>(buffer);

Lock lock;

while(written < size) {
// If TX buffer not in use or it's empty then write directly to hardware FIFO
if(uart->tx_buffer == nullptr || uart->tx_buffer->isEmpty()) {
Expand Down
14 changes: 0 additions & 14 deletions Sming/Arch/Esp32/Components/esp32/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,6 @@ or if multiple versions are installed. By default, the most current version will
Location of ESP-IDF python.


.. envvar:: CREATE_EVENT_TASK

default: disabled

.. warning::

This setting is provided for debugging purposes ONLY.

Sming uses a custom event loop to ensure that timer and task callbacks are all executed in the same
thread context.

Sometimes this behaviour can cause issues with IDF code.
Setting this to 1 will create the event loop in a separate thread, which is standard IDF behaviour.


Background
----------
Expand Down
21 changes: 7 additions & 14 deletions Sming/Arch/Esp32/Components/esp32/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ COMPONENT_INCDIRS := src/include include
# Applications can provide file with custom SDK configuration settings
CACHE_VARS += SDK_CUSTOM_CONFIG

COMPONENT_RELINK_VARS += DISABLE_NETWORK DISABLE_WIFI CREATE_EVENT_TASK

ifeq ($(CREATE_EVENT_TASK),1)
COMPONENT_CPPFLAGS += -DCREATE_EVENT_TASK
endif
COMPONENT_RELINK_VARS += DISABLE_NETWORK DISABLE_WIFI

ifneq (,$(filter v4.%,$(IDF_VERSION)))
IDF_VERSION_4x := 1
Expand Down Expand Up @@ -121,7 +117,8 @@ SDK_INCDIRS := \
esp_netif/include \
esp_eth/include \
esp_wifi/include \
lwip/include/apps/sntp
lwip/include/apps/sntp \
usb/include

ifdef IDF_VERSION_4x
SDK_INCDIRS += \
Expand Down Expand Up @@ -266,6 +263,10 @@ SDK_COMPONENTS := \
soc \
spi_flash

ifneq (,$(filter esp32s2 esp32s3,$(SMING_SOC)))
SDK_COMPONENTS += usb
endif

ifdef IDF_VERSION_43
SDK_COMPONENTS += $(ESP_VARIANT)
else
Expand Down Expand Up @@ -392,14 +393,6 @@ EXTRA_LDFLAGS := \
$(call LinkerScript,rom.api) \
$(call LinkerScript,rom.libgcc) \
$(call LinkerScript,rom.newlib-nano) \
$(call Wrap,\
esp_event_loop_create_default \
esp_event_handler_register \
esp_event_handler_unregister \
esp_event_handler_instance_register \
esp_event_handler_instance_unregister \
esp_event_post \
esp_event_isr_post) \
$(LDFLAGS_$(ESP_VARIANT)) \
$(call Undef,$(SDK_UNDEF_SYMBOLS)) \
$(call Wrap,$(SDK_WRAP_SYMBOLS))
Expand Down
7 changes: 2 additions & 5 deletions Sming/Arch/Esp32/Components/esp32/sdk/config/common
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
CONFIG_COMPILER_OPTIMIZATION_SIZE=y

# Mandatory LWIP changes
CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=8192
CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=16384
CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=n

# Ethernet
Expand All @@ -39,7 +39,7 @@ CONFIG_BT_NIMBLE_MESH=n
CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=n

# Mandatory Sming framework changes
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=16384
CONFIG_ESP_MAIN_TASK_STACK_SIZE=16384
CONFIG_ESP_TASK_WDT_TIMEOUT_S=8

# Required by HardwareSPI library
Expand All @@ -58,8 +58,5 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n
# Don't change provided flash configuration information
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=n

# We'll handle WDT initialisation ourselves thankyouverymuch
CONFIG_ESP_TASK_WDT_INIT=n

# Issues with dual-core CPU, see #2653
CONFIG_FREERTOS_UNICORE=y
3 changes: 3 additions & 0 deletions Sming/Arch/Esp32/Components/esp32/sdk/config/debug
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y
CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID=y

# Watchdog
CONFIG_ESP_TASK_WDT_PANIC=y
6 changes: 3 additions & 3 deletions Sming/Arch/Esp32/Components/esp32/sdk/esp_system.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ ifndef CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE
SDK_UNDEF_SYMBOLS += start_app_other_cores
endif

# ld_include_panic_highint_hdl is added as an undefined symbol because otherwise the
# linker will ignore panic_highint_hdl.S as it has no other files depending on any
# ld_include_highint_hdl is added as an undefined symbol because otherwise the
# linker will ignore highint_hdl.S as it has no other files depending on any
# symbols in it.
SDK_UNDEF_SYMBOLS += ld_include_panic_highint_hdl
SDK_UNDEF_SYMBOLS += ld_include_highint_hdl

# IDF 5.2
SDK_WRAP_SYMBOLS += esp_newlib_init_global_stdio
Loading

0 comments on commit 438f9d8

Please sign in to comment.