mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2025-12-01 12:06:48 +00:00
esp8266 optimize + idle hooks (#1869)
This commit is contained in:
committed by
GitHub
parent
e9e20ed445
commit
35fca72376
31
.github/workflows/workflow.yaml
vendored
31
.github/workflows/workflow.yaml
vendored
@ -422,36 +422,21 @@ jobs:
|
||||
- name: SDK checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: espressif/ESP8266_RTOS_SDK
|
||||
path: sdk/ESP8266_RTOS_SDK
|
||||
ref: release/v3.4
|
||||
submodules: false
|
||||
repository: NonPIayerCharacter/OpenESP8266
|
||||
path: sdk/OpenESP8266
|
||||
ref: obk
|
||||
fetch-tags: true
|
||||
fetch-depth: '200'
|
||||
fetch-depth: '10'
|
||||
submodules: recursive
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
git config --global user.name github-actions
|
||||
git config --global user.email github-actions@github.com
|
||||
apt-get update && apt-get -y install cmake
|
||||
apt update && apt install -y cmake
|
||||
pip2 install virtualenv
|
||||
cd sdk/ESP8266_RTOS_SDK
|
||||
git checkout c965e03d2b7418b085c394dc98c6a0d3371c2abd
|
||||
patch -p1 -d . < ../../platforms/ESP8266/sdk.patch
|
||||
git revert 0325f833aac7b34d7627619499949331a98fc3ab --no-edit
|
||||
git submodule update --init components/coap/libcoap
|
||||
cd components/coap/libcoap
|
||||
git fetch
|
||||
git checkout 017528d7d96dca2318ed587b5fd3c0d57a89e49a
|
||||
cd ../../..
|
||||
git add .
|
||||
git commit -m "upd"
|
||||
git submodule update --init --recursive
|
||||
cd ../..
|
||||
python2 -m pip install --user -r sdk/ESP8266_RTOS_SDK/requirements.txt
|
||||
python2 -m pip install --user -r sdk/OpenESP8266/requirements.txt
|
||||
python3 -m pip install esptool
|
||||
- name: Run make
|
||||
run: |
|
||||
cd sdk/ESP8266_RTOS_SDK
|
||||
cd sdk/OpenESP8266
|
||||
./install.sh > /dev/null
|
||||
. ./export.sh
|
||||
. ./add_path.sh
|
||||
|
||||
8
.gitmodules
vendored
8
.gitmodules
vendored
@ -65,10 +65,10 @@
|
||||
path = sdk/OpenXR806
|
||||
url = https://github.com/openshwprojects/OpenXR806
|
||||
branch = master
|
||||
[submodule "sdk/ESP8266_RTOS_SDK"]
|
||||
path = sdk/ESP8266_RTOS_SDK
|
||||
url = https://github.com/espressif/ESP8266_RTOS_SDK
|
||||
branch = release/v3.4
|
||||
[submodule "sdk/OpenESP8266"]
|
||||
path = sdk/OpenESP8266
|
||||
url = https://github.com/NonPIayerCharacter/OpenESP8266
|
||||
branch = obk
|
||||
[submodule "sdk/ameba-rtos"]
|
||||
path = sdk/ameba-rtos
|
||||
url = https://github.com/Ameba-AIoT/ameba-rtos
|
||||
|
||||
6
Makefile
6
Makefile
@ -227,7 +227,7 @@ endif
|
||||
fi
|
||||
|
||||
prebuild_ESP8266: berry
|
||||
#git submodule update --init --recursive --depth=1 sdk/ESP8266_RTOS_SDK
|
||||
#git submodule update --init --recursive --depth=1 sdk/OpenESP8266
|
||||
-rm platforms/ESP8266/sdkconfig
|
||||
-rm platforms/ESP8266/partitions.csv
|
||||
cp platforms/ESP8266/partitions-2mb.csv platforms/ESP8266/partitions.csv
|
||||
@ -702,8 +702,6 @@ OpenRDA5981: prebuild_OpenRDA5981
|
||||
# clean .o files and output directory
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-test -d ./sdk/OpenBK7231T && $(MAKE) -C sdk/OpenBK7231T/platforms/bk7231t/bk7231t_os APP_BIN_NAME=$(APP_NAME) USER_SW_VER=$(APP_VERSION) clean
|
||||
-test -d ./sdk/OpenBK7231N && $(MAKE) -C sdk/OpenBK7231N/platforms/bk7231n/bk7231n_os APP_BIN_NAME=$(APP_NAME) USER_SW_VER=$(APP_VERSION) clean
|
||||
-test -d ./sdk/OpenXR809 && $(MAKE) -C sdk/OpenXR809/src clean
|
||||
-test -d ./sdk/OpenXR809 && $(MAKE) -C sdk/OpenXR809/project/oxr_sharedApp/gcc clean
|
||||
-test -d ./sdk/OpenXR806 && $(MAKE) -C sdk/OpenXR806/src clean
|
||||
@ -734,6 +732,8 @@ clean:
|
||||
-test -d ./platforms/ESP-IDF/build-c61 && cmake --build ./platforms/ESP-IDF/build-c61 --target clean
|
||||
-test -d ./platforms/ESP8266/build && cmake --build ./platforms/ESP8266/build --target clean
|
||||
-test -d ./sdk/OpenECR6600 && cd sdk/OpenECR6600 && make BOARD_DIR=$(ECRDIR)/Boards/ecr6600/standalone APP_NAME=OpenBeken TOPDIR=$(ECRDIR) GCC_PATH=$(ECRDIR)/tool/nds32le-elf-mculib-v3s/bin/ clean
|
||||
-test -d ./sdk/OpenBK7231T && $(MAKE) -C sdk/OpenBK7231T/platforms/bk7231t/bk7231t_os APP_BIN_NAME=$(APP_NAME) USER_SW_VER=$(APP_VERSION) clean
|
||||
-test -d ./sdk/OpenBK7231N && $(MAKE) -C sdk/OpenBK7231N/platforms/bk7231n/bk7231n_os APP_BIN_NAME=$(APP_NAME) USER_SW_VER=$(APP_VERSION) clean
|
||||
-$(RM) -r $(BUILD_DIR)
|
||||
|
||||
# Example upload command - import the following snippet into Node-RED and update the IPs in the variables below
|
||||
|
||||
@ -21,3 +21,5 @@ CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=n
|
||||
CONFIG_LWIP_TCP_MSL=1000
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="16MB"
|
||||
|
||||
CONFIG_FREERTOS_USE_IDLE_HOOK=y
|
||||
|
||||
@ -1,170 +0,0 @@
|
||||
commit 185db7d2b13a2a8c18c8ed5abce9a80de259fa7b
|
||||
Author: NonPIayerCharacter <18557343+NonPIayerCharacter@users.noreply.github.com>
|
||||
Date: Tue Jul 1 22:45:37 2025 +0000
|
||||
|
||||
for OBK
|
||||
|
||||
diff --git a/components/pthread/CMakeLists.txt b/components/pthread/CMakeLists.txt
|
||||
index 653799ad5a61ea87fbba15a3fea325a0dca46fa2..df5a961a6514aaa894cfde381406e077baeff635 100644
|
||||
--- a/components/pthread/CMakeLists.txt
|
||||
+++ b/components/pthread/CMakeLists.txt
|
||||
@@ -4,7 +4,7 @@ idf_component_register(SRCS "pthread.c"
|
||||
INCLUDE_DIRS include)
|
||||
|
||||
set(extra_link_flags "-u pthread_include_pthread_impl")
|
||||
-list(APPEND extra_link_flags "-u pthread_include_pthread_cond_impl")
|
||||
+list(APPEND extra_link_flags "-u pthread_include_pthread_cond_var_impl")
|
||||
list(APPEND extra_link_flags "-u pthread_include_pthread_local_storage_impl")
|
||||
|
||||
if(CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP)
|
||||
diff --git a/components/pthread/component.mk b/components/pthread/component.mk
|
||||
index c5793fded60c4e43f583121fc2a0b414eb7ef8f7..0e1cd8a32c26a54c18b319d06827883b24f4586d 100644
|
||||
--- a/components/pthread/component.mk
|
||||
+++ b/components/pthread/component.mk
|
||||
@@ -16,6 +16,6 @@ ifeq ($(GCC_NOT_5_2_0), 1)
|
||||
# Forces the linker to include pthread implementation from this component,
|
||||
# instead of the weak implementations provided by libgcc.
|
||||
COMPONENT_ADD_LDFLAGS += -u pthread_include_pthread_impl
|
||||
-COMPONENT_ADD_LDFLAGS += -u pthread_include_pthread_cond_impl
|
||||
+COMPONENT_ADD_LDFLAGS += -u pthread_include_pthread_cond_var_impl
|
||||
COMPONENT_ADD_LDFLAGS += -u pthread_include_pthread_local_storage_impl
|
||||
endif # GCC_NOT_5_2_0
|
||||
diff --git a/export.sh b/export.sh
|
||||
index 38a0b828e5d40e943719dffbe49e6769aeafad35..32b3291d17460a6284a213890bc7aaa81347cd86 100755
|
||||
--- a/export.sh
|
||||
+++ b/export.sh
|
||||
@@ -45,11 +45,11 @@ function idf_export_main() {
|
||||
# Call idf_tools.py to export tool paths
|
||||
export IDF_TOOLS_EXPORT_CMD=${IDF_PATH}/export.sh
|
||||
export IDF_TOOLS_INSTALL_CMD=${IDF_PATH}/install.sh
|
||||
- idf_exports=$(${IDF_PATH}/tools/idf_tools.py export) || return 1
|
||||
+ idf_exports=$(python2 ${IDF_PATH}/tools/idf_tools.py export) || return 1
|
||||
eval "${idf_exports}"
|
||||
|
||||
echo "Checking if Python packages are up to date..."
|
||||
- python ${IDF_PATH}/tools/check_python_dependencies.py || return 1
|
||||
+ python2 ${IDF_PATH}/tools/check_python_dependencies.py || return 1
|
||||
|
||||
|
||||
# Allow calling some IDF python tools without specifying the full path
|
||||
diff --git a/install.sh b/install.sh
|
||||
index d026e3c931672e00ec45277ee896b85762879385..acbce000124b4c54ec0aaab9aad5c2b61b931051 100755
|
||||
--- a/install.sh
|
||||
+++ b/install.sh
|
||||
@@ -6,10 +6,10 @@ set -u
|
||||
export IDF_PATH=$(cd $(dirname $0); pwd)
|
||||
|
||||
echo "Installing ESP-IDF tools"
|
||||
-${IDF_PATH}/tools/idf_tools.py install
|
||||
+python2 ${IDF_PATH}/tools/idf_tools.py install
|
||||
|
||||
echo "Installing Python environment and packages"
|
||||
-${IDF_PATH}/tools/idf_tools.py install-python-env
|
||||
+python2 ${IDF_PATH}/tools/idf_tools.py install-python-env
|
||||
|
||||
basedir="$(dirname $0)"
|
||||
echo "All done! You can now run:"
|
||||
diff --git a/requirements.txt b/requirements.txt
|
||||
index 6a97933042f3c05b189c45769fe4ecd9ff3c2345..e04e05c1e0bbb0df917dbf08f50b31b6e77bb925 100644
|
||||
--- a/requirements.txt
|
||||
+++ b/requirements.txt
|
||||
@@ -10,4 +10,4 @@ pyserial>=3.0
|
||||
future>=0.15.2
|
||||
cryptography>=2.1.4,<35
|
||||
pyparsing>=2.0.3,<2.4.0
|
||||
-pyelftools>=0.22
|
||||
+pyelftools>=0.22,<0.28
|
||||
diff --git a/tools/cmake/build.cmake b/tools/cmake/build.cmake
|
||||
index 566ff8e984635b7b6d4accc254fa4e7045a758a5..2713df4f55eaaf2b3a57ddc72ab83aa1de1378df 100644
|
||||
--- a/tools/cmake/build.cmake
|
||||
+++ b/tools/cmake/build.cmake
|
||||
@@ -451,6 +451,10 @@ endmacro()
|
||||
# files used for linking, targets which should execute before creating the specified executable,
|
||||
# generating additional binary files, generating files related to flashing, etc.)
|
||||
function(idf_build_executable elf)
|
||||
+ # Set additional link flags for the executable
|
||||
+ idf_build_get_property(link_options LINK_OPTIONS)
|
||||
+ set_property(TARGET ${elf} APPEND PROPERTY LINK_OPTIONS "${link_options}")
|
||||
+
|
||||
# Propagate link dependencies from component library targets to the executable
|
||||
idf_build_get_property(link_depends __LINK_DEPENDS)
|
||||
set_property(TARGET ${elf} APPEND PROPERTY LINK_DEPENDS "${link_depends}")
|
||||
diff --git a/tools/cmake/component.cmake b/tools/cmake/component.cmake
|
||||
index cbd6406d73e74d71c10d604f3f939cf0d0f8091f..dd4466face0004637319e0d3235a929de7e75dc4 100644
|
||||
--- a/tools/cmake/component.cmake
|
||||
+++ b/tools/cmake/component.cmake
|
||||
@@ -93,6 +93,7 @@ macro(__component_set_properties)
|
||||
__component_set_property(${component_target} EMBED_FILES "${__EMBED_FILES}")
|
||||
__component_set_property(${component_target} EMBED_TXTFILES "${__EMBED_TXTFILES}")
|
||||
__component_set_property(${component_target} REQUIRED_IDF_TARGETS "${__REQUIRED_IDF_TARGETS}")
|
||||
+ __component_set_property(${component_target} WHOLE_ARCHIVE ${__WHOLE_ARCHIVE})
|
||||
endmacro()
|
||||
|
||||
#
|
||||
@@ -386,8 +387,9 @@ endfunction()
|
||||
# @param[in, optional] REQUIRED_IDF_TARGETS (multivalue) the list of IDF build targets that the component only supports
|
||||
# @param[in, optional] EMBED_FILES (multivalue) list of binary files to embed with the component
|
||||
# @param[in, optional] EMBED_TXTFILES (multivalue) list of text files to embed with the component
|
||||
+# @param[in, optional] WHOLE_ARCHIVE (option) link the component as --whole-archive
|
||||
function(idf_component_register)
|
||||
- set(options)
|
||||
+ set(options WHOLE_ARCHIVE)
|
||||
set(single_value)
|
||||
set(multi_value SRCS SRC_DIRS EXCLUDE_SRCS
|
||||
INCLUDE_DIRS PRIV_INCLUDE_DIRS LDFRAGMENTS REQUIRES
|
||||
diff --git a/tools/cmake/project.cmake b/tools/cmake/project.cmake
|
||||
index e64080e69ea7ed866886193a402ae5d0da0dd79b..f40ff335f29628016d41dc50e8a351f5bccbb5a5 100644
|
||||
--- a/tools/cmake/project.cmake
|
||||
+++ b/tools/cmake/project.cmake
|
||||
@@ -358,6 +358,7 @@ macro(project project_name)
|
||||
__component_get_target(main_target idf::main)
|
||||
__component_get_property(reqs ${main_target} REQUIRES)
|
||||
__component_get_property(priv_reqs ${main_target} PRIV_REQUIRES)
|
||||
+ __component_set_property(${main_target} WHOLE_ARCHIVE true)
|
||||
idf_build_get_property(common_reqs __COMPONENT_REQUIRES_COMMON)
|
||||
if(reqs STREQUAL common_reqs AND NOT priv_reqs) #if user has not set any requirements
|
||||
list(REMOVE_ITEM build_components idf::main)
|
||||
@@ -396,7 +397,19 @@ macro(project project_name)
|
||||
if(test_components)
|
||||
list(REMOVE_ITEM build_components ${test_components})
|
||||
endif()
|
||||
- target_link_libraries(${project_elf} ${build_components})
|
||||
+
|
||||
+ foreach(build_component ${build_components})
|
||||
+ __component_get_target(build_component_target ${build_component})
|
||||
+ __component_get_property(whole_archive ${build_component_target} WHOLE_ARCHIVE)
|
||||
+ if(whole_archive)
|
||||
+ message(STATUS "Component ${build_component} will be linked with -Wl,--whole-archive")
|
||||
+ target_link_libraries(${project_elf} "-Wl,--whole-archive" ${build_component} "-Wl,--no-whole-archive")
|
||||
+ else()
|
||||
+ target_link_libraries(${project_elf} ${build_component})
|
||||
+ message(STATUS "Component ${build_component} will not be linked with -Wl,--whole-archive")
|
||||
+ #target_link_libraries(${project_elf} "-Wl,--whole-archive" ${build_component} "-Wl,--no-whole-archive")
|
||||
+ endif()
|
||||
+ endforeach()
|
||||
|
||||
set(mapfile "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.map")
|
||||
target_link_libraries(${project_elf} "-Wl,--cref -Wl,--Map=${mapfile} -Wl,--start-group")
|
||||
diff --git a/tools/cmake/scripts/component_get_requirements.cmake b/tools/cmake/scripts/component_get_requirements.cmake
|
||||
index 24637008bde86ead61a709c0a40c0be0274a7c46..15df499212d785d5763833fa77a69ddd3766df56 100644
|
||||
--- a/tools/cmake/scripts/component_get_requirements.cmake
|
||||
+++ b/tools/cmake/scripts/component_get_requirements.cmake
|
||||
@@ -22,7 +22,7 @@ macro(require_idf_targets)
|
||||
endmacro()
|
||||
|
||||
macro(idf_component_register)
|
||||
- set(options)
|
||||
+ set(options WHOLE_ARCHIVE)
|
||||
set(single_value)
|
||||
set(multi_value SRCS SRC_DIRS EXCLUDE_SRCS
|
||||
INCLUDE_DIRS PRIV_INCLUDE_DIRS LDFRAGMENTS REQUIRES
|
||||
diff --git a/tools/idf.py b/tools/idf.py
|
||||
index 7d6a3f49f64fcf41268adea041d19f6a48857c12..269b828ed98581464b0e08beb4464ab9089bd956 100755
|
||||
--- a/tools/idf.py
|
||||
+++ b/tools/idf.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/env python
|
||||
+#!/usr/bin/env python2
|
||||
#
|
||||
# 'idf.py' is a top-level config/build command line tool for ESP-IDF
|
||||
#
|
||||
@ -33,7 +33,6 @@ CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=1024
|
||||
CONFIG_LWIP_IP4_FRAG=n
|
||||
CONFIG_LWIP_IP6_FRAG=n
|
||||
CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048
|
||||
CONFIG_WIFI_PPT_TASKSTACK_SIZE=4096
|
||||
|
||||
CONFIG_ESP8266_WIFI_RX_BUFFER_NUM=6
|
||||
CONFIG_ESP8266_WIFI_LEFT_CONTINUOUS_RX_BUFFER_NUM=6
|
||||
@ -41,3 +40,9 @@ CONFIG_SUPPORT_TERMIOS=n
|
||||
CONFIG_ESPTOOLPY_FLASHMODE_DOUT=y
|
||||
CONFIG_ESPTOOLPY_FLASHMODE="dout"
|
||||
CONFIG_NEWLIB_NANO_FORMAT=n
|
||||
|
||||
ESP_SYSTEM_EVENT_TASK_STACK_SIZE=1024
|
||||
ESP_SYSTEM_EVENT_QUEUE_SIZE=16
|
||||
ESP_ERR_TO_NAME_LOOKUP=n
|
||||
ESP8266_CORE_GLOBAL_DATA_LINK_IRAM=n
|
||||
ESP8266_WIFI_TX_PKT_NUM=4
|
||||
|
||||
Submodule sdk/ESP8266_RTOS_SDK deleted from c965e03d2b
1
sdk/OpenESP8266
Submodule
1
sdk/OpenESP8266
Submodule
Submodule sdk/OpenESP8266 added at 57d7262713
Submodule sdk/OpenRTL8710A_B updated: e8022abf49...41dcb216b3
Submodule sdk/OpenRTL8720D updated: a25781506c...d86510d780
Submodule sdk/OpenRTL87X0C updated: 029e4ed1c8...29aa41cd30
Submodule sdk/esp-idf updated: cbe9388f45...fcae32885b
@ -1421,6 +1421,8 @@ void Main_Init_Before_Delay()
|
||||
// it registers a cllback from RTOS IDLE function.
|
||||
// why is it called IRDA?? is this where they check for IR?
|
||||
bg_register_irda_check_func(isidle);
|
||||
#elif PLATFORM_TR6260
|
||||
system_register_idle_callback(isidle);
|
||||
#endif
|
||||
|
||||
g_bootFailures = HAL_FlashVars_GetBootFailures();
|
||||
@ -1585,4 +1587,17 @@ void Main_Init()
|
||||
|
||||
}
|
||||
|
||||
#if PLATFORM_ESPIDF || PLATFORM_ESP8266 || PLATFORM_BL602 || (PLATFORM_REALTEK && !PLATFORM_REALTEK_NEW) || PLATFORM_XRADIO
|
||||
|
||||
void vApplicationIdleHook(void)
|
||||
{
|
||||
isidle();
|
||||
#if PLATFORM_BL602
|
||||
// sleep
|
||||
__asm volatile(
|
||||
" wfi "
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user