diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e14861ddc1d7c617445bc727d522e2d3701b52b4..07c33f18d52bd534854dffb52be1ab0ac6fe0f4d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -8,6 +8,7 @@ stages:
- pre_stage # 准备阶段
- compile_stage # 编译阶段
- test_stage # 测试阶段
+ - loop_test_stage # 循环测试阶段
- report_stage # 测试报表生成阶段
- post_stage # 收尾阶段
@@ -161,6 +162,67 @@ system_test:
allow_failure: true
when: manual
+loop_test:
+ stage: loop_test_stage
+ script:
+ - sleep 1
+ - echo TEST_PROJECT_DIR = "$TEST_PROJECT_DIR"
+ - echo LOOP_COUNT = "$LOOP_COUNT"
+ - cd /home/gitlab-runner/test_tool
+ - python3 set_common_info.py /home/gitlab-runner/test_tool/phytium-test-tools/test_tool/config_info/common.json freertos
+ - cd /home/gitlab-runner/test_tool/phytium-test-tools/test_tool
+ - python3 gitlab_pipeline_board_test.py $CI_PROJECT_DIR $CI_PROJECT_DIR/example/$TEST_PROJECT_DIR $LOOP_COUNT
+ tags:
+ - test
+ allow_failure: true
+ when: manual
+
+loop_test1:
+ stage: loop_test_stage
+ script:
+ - sleep 1
+ - echo TEST_PROJECT_DIR1= "$TEST_PROJECT_DIR1"
+ - echo LOOP_COUNT1 = "$LOOP_COUNT1"
+ - cd /home/gitlab-runner/test_tool
+ - python3 set_common_info.py /home/gitlab-runner/test_tool/phytium-test-tools/test_tool/config_info/common.json freertos
+ - cd /home/gitlab-runner/test_tool/phytium-test-tools/test_tool
+ - python3 gitlab_pipeline_board_test.py $CI_PROJECT_DIR $CI_PROJECT_DIR/example/$TEST_PROJECT_DIR1 $LOOP_COUNT1
+ tags:
+ - test
+ allow_failure: true
+ when: manual
+
+loop_test2:
+ stage: loop_test_stage
+ script:
+ - sleep 1
+ - echo TEST_PROJECT_DIR2 = "$TEST_PROJECT_DIR2"
+ - echo LOOP_COUNT2 = "$LOOP_COUNT2"
+ - cd /home/gitlab-runner/test_tool
+ - python3 set_common_info.py /home/gitlab-runner/test_tool/phytium-test-tools/test_tool/config_info/common.json freertos
+ - cd /home/gitlab-runner/test_tool/phytium-test-tools/test_tool
+ - python3 gitlab_pipeline_board_test.py $CI_PROJECT_DIR $CI_PROJECT_DIR/example/$TEST_PROJECT_DIR2 $LOOP_COUNT2
+ tags:
+ - test
+ allow_failure: true
+ when: manual
+
+loop_test3:
+ stage: loop_test_stage
+ script:
+ - sleep 1
+ - echo TEST_PROJECT_DIR3 = "$TEST_PROJECT_DIR3"
+ - echo LOOP_COUNT3 = "$LOOP_COUNT3"
+ - cd /home/gitlab-runner/test_tool
+ - python3 set_common_info.py /home/gitlab-runner/test_tool/phytium-test-tools/test_tool/config_info/common.json freertos
+ - cd /home/gitlab-runner/test_tool/phytium-test-tools/test_tool
+ - python3 gitlab_pipeline_board_test.py $CI_PROJECT_DIR $CI_PROJECT_DIR/example/$TEST_PROJECT_DIR3 $LOOP_COUNT3
+ tags:
+ - test
+ allow_failure: true
+ when: manual
+
+
# 测试报表生成
update_report:
stage: report_stage
diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md
index 9ced1d071315d98c1066b8eb55674a15d3ff73a0..31ef4f4c6ca0dce202d74c020ccd30f5c48a496b 100644
--- a/docs/ChangeLog.md
+++ b/docs/ChangeLog.md
@@ -1,3 +1,50 @@
+# Phytium FreeRTOS SDK 2025-05-16 ChangeLog
+
+Change Log since 2025-05-12
+
+## example
+
+- Modify pwm, i2c, timer_tacho examples
+
+## third-party
+
+- Improve SVC exception handling
+
+# Phytium FreeRTOS SDK 2025-05-08 ChangeLog
+
+Change Log since 2025-05-06
+
+## example
+
+- Add PD2308 configs to most examples
+- solve ddma example RX timeout problem
+
+# Phytium FreeRTOS SDK 2025-04-28 ChangeLog
+
+Change Log since 2025-04-25
+
+## tools
+
+- Added new makefile cmd to support AMP auto test
+
+# Phytium FreeRTOS SDK 2025-04-25 ChangeLog
+
+Change Log since 2025-04-24
+
+## install.py
+
+- Added standalone version check during environment deployment and image compilation
+
+# Phytium FreeRTOS SDK 2025-04-17 ChangeLog
+
+Change Log since 2025-03-19
+
+## third-party
+
+- Upgraded the FreeRTOS kernel to V11.1.0
+- Added FreeRTOS version information to the shell startup message
+- Standardized the FreeRTOS naming convention
+
# Phytium FreeRTOS SDK 2025-03-14 ChangeLog
Change Log since 2025-02-19
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 27e5425c632912275a179f21112bda66a0188367..bc63a07b40a1db57e6c075acdf2d78e65ced4fa7 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -1,122 +1,122 @@
-menu "Freertos Uart Drivers"
+menu "FreeRTOS Uart Drivers"
config FREERTOS_USE_UART
bool
- prompt "Use Freertos uart driver"
+ prompt "Use FreeRTOS uart driver"
default n
endmenu
-menu "Freertos Pwm Drivers"
+menu "FreeRTOS Pwm Drivers"
config FREERTOS_USE_PWM
bool
- prompt "Use Freertos pwm driver"
+ prompt "Use FreeRTOS pwm driver"
default n
select USE_PWM
select USE_FPWM
endmenu
-menu "Freertos Qspi Drivers"
+menu "FreeRTOS Qspi Drivers"
config FREERTOS_USE_QSPI
bool
- prompt "Use Freertos qspi driver"
+ prompt "Use FreeRTOS qspi driver"
default n
select USE_QSPI
select USE_FQSPI
endmenu
-menu "Freertos Wdt Drivers"
+menu "FreeRTOS Wdt Drivers"
config FREERTOS_USE_WDT
bool
- prompt "Use Freertos wdt driver"
+ prompt "Use FreeRTOS wdt driver"
default n
select USE_WDT
select USE_FWDT
endmenu
-menu "Freertos Eth Drivers"
+menu "FreeRTOS Eth Drivers"
config FREERTOS_USE_XMAC
select ENABLE_FXMAC
bool
- prompt "Use Freertos xmac driver"
+ prompt "Use FreeRTOS xmac driver"
default n
config FREERTOS_USE_GMAC
select ENABLE_FGMAC
bool
- prompt "Use Freertos gmac driver"
+ prompt "Use FreeRTOS gmac driver"
default n
endmenu
-menu "Freertos Spim Drivers"
+menu "FreeRTOS Spim Drivers"
config FREERTOS_USE_FSPIM
bool
- prompt "Use Freertos spim driver"
+ prompt "Use FreeRTOS spim driver"
default n
select USE_SPI
select USE_FSPIM
endmenu
-menu "Freertos DMA Drivers"
+menu "FreeRTOS DMA Drivers"
config FREERTOS_USE_FDDMA
bool
- prompt "Use Freertos ddma driver"
+ prompt "Use FreeRTOS ddma driver"
default n
config FREERTOS_USE_FGDMA
bool
- prompt "Use Freertos gdma driver"
+ prompt "Use FreeRTOS gdma driver"
default n
endmenu
-menu "Freertos Adc Drivers"
+menu "FreeRTOS Adc Drivers"
config FREERTOS_USE_ADC
bool
- prompt "Use Freertos adc driver"
+ prompt "Use FreeRTOS adc driver"
default n
select USE_ADC
select USE_FADC
endmenu
-menu "Freertos Can Drivers"
+menu "FreeRTOS Can Drivers"
config FREERTOS_USE_CAN
bool
- prompt "Use Freertos can driver"
+ prompt "Use FreeRTOS can driver"
default n
select USE_CAN
select USE_FCAN
endmenu
-menu "Freertos I2c Drivers"
+menu "FreeRTOS I2c Drivers"
config FREERTOS_USE_I2C
bool
- prompt "Use Freertos i2c driver"
+ prompt "Use FreeRTOS i2c driver"
default n
endmenu
-menu "Freertos Mio Drivers"
+menu "FreeRTOS Mio Drivers"
config FREERTOS_USE_MIO
bool
- prompt "Use Freertos mio driver"
+ prompt "Use FreeRTOS mio driver"
default n
endmenu
-menu "Freertos Timer Drivers"
+menu "FreeRTOS Timer Drivers"
config FREERTOS_USE_TIMER
bool
- prompt "Use Freertos timer driver"
+ prompt "Use FreeRTOS timer driver"
default n
endmenu
-menu "Freertos Media Drivers"
+menu "FreeRTOS Media Drivers"
config FREERTOS_USE_MEDIA
bool
- prompt "Use Freertos media driver"
+ prompt "Use FreeRTOS media driver"
default n
endmenu
-menu "Freertos I2s Drivers"
+menu "FreeRTOS I2s Drivers"
config FREERTOS_USE_I2S
bool
- prompt "Use Freertos i2s driver"
+ prompt "Use FreeRTOS i2s driver"
default n
endmenu
diff --git a/drivers/i2c/fi2c_os.c b/drivers/i2c/fi2c_os.c
index 6da44ac5afb89926c43049fd010548ec97c6fca9..0d96fb6be0dc67e47a23776601fcf2edac506799 100644
--- a/drivers/i2c/fi2c_os.c
+++ b/drivers/i2c/fi2c_os.c
@@ -33,14 +33,16 @@
#include "fi2c.h"
#include "fi2c_hw.h"
#include "fdebug.h"
-#include "fio_mux.h"
-
-#include "fmio_hw.h"
-#include "fmio.h"
+#ifdef CONFIG_PD2308_DEMO_BOARD
+#include "fio_mux.h"
+static FFreeRTOSI2c os_i2c[FI2C_NUM] = {0};
+#else
+ #include "fio_mux.h"
+ #include "fmio_hw.h"
+ #include "fmio.h"
static FFreeRTOSI2c os_i2c[FMIO_NUM] = {0};
-
-/* virtual eeprom memory */
+#endif
/**
* @name: FI2cOsSetupInterrupt
@@ -88,15 +90,19 @@ FFreeRTOSI2c *FFreeRTOSI2cInit(u32 instance_id, u32 work_mode, u32 slave_address
FI2cConfig i2c_config;
- /* E2000 use MIO -> I2C */
- FASSERT(instance_id < FMIO_NUM);
-
if (FT_COMPONENT_IS_READY == os_i2c[instance_id].i2c_device.is_ready)
{
vPrintf("I2c device %d is already initialized.\r\n", instance_id);
return NULL;
}
+#ifdef CONFIG_PD2308_DEMO_BOARD
+ i2c_config = *FI2cLookupConfig(instance_id);
+ FIOPadSetI2CMux(instance_id);
+ i2c_config.work_mode = work_mode;
+#else
+ /* E2000 use MIO -> I2C */
+ FASSERT(instance_id < FMIO_NUM);
const FMioConfig *mio_config_p ;
FMioCtrl pctrl;
mio_config_p = FMioLookupConfig(instance_id);
@@ -123,6 +129,12 @@ FFreeRTOSI2c *FFreeRTOSI2cInit(u32 instance_id, u32 work_mode, u32 slave_address
i2c_config.base_addr = pctrl.config.func_base_addr;
i2c_config.irq_num = pctrl.config.irq_num;
i2c_config.ref_clk_hz = FMIO_CLK_FREQ_HZ;
+ i2c_config.work_mode = FI2C_MASTER;
+ i2c_config.use_7bit_addr = TRUE;
+ i2c_config.speed_rate = FI2C_SPEED_STANDARD_RATE;
+ i2c_config.auto_calc = TRUE;
+#endif
+
if (work_mode == FI2C_MASTER)/* 主机中断优先级高于从机接收 */
{
i2c_config.irq_prority = I2C_MASTER_IRQ_PRORITY;
diff --git a/drivers/i2s/fi2s_os.c b/drivers/i2s/fi2s_os.c
index ef963f029c80df3bee217065539f4ab6a1b03d36..ed82bb9c04ca15f80f7f7746206715d09e7c121d 100644
--- a/drivers/i2s/fi2s_os.c
+++ b/drivers/i2s/fi2s_os.c
@@ -111,7 +111,7 @@ FError FFreeRTOSSetupI2S(FFreeRTOSI2s *os_i2s_p)
FASSERT(os_i2s_p);
FI2s *ctrl = &os_i2s_p->i2s_ctrl;
FError err = FT_SUCCESS;
- err = FI2sClkOutDiv(ctrl); /* 默认16-bits采集 */
+ err = FI2sClkOutDiv(ctrl, FI2S_SAMPLE_RATE_CD); /* 默认16-bits采集 */
if (FT_SUCCESS != err)
{
FI2S_ERROR("Set i2s failed, err: 0x%x!!!", err);
diff --git a/drivers/spi/fspim/fspim_os.c b/drivers/spi/fspim/fspim_os.c
index 6349a33f05ca2540e72ad0b27a41360b28f090e2..f1d88321c30a66d2a6cb313d974270a82aa43d1a 100644
--- a/drivers/spi/fspim/fspim_os.c
+++ b/drivers/spi/fspim/fspim_os.c
@@ -182,7 +182,7 @@ FFreeRTOSSpim *FFreeRTOSSpimInit(u32 id, const FFreeRTOSSpimConifg *input_config
FASSERT_MSG((instance->evt = xEventGroupCreate()) != NULL, "Create event group failed!!!");
FSpimOSSetupInterrupt(ctrl);
- FSpimRegisterIntrruptHandler(ctrl, FSPIM_INTR_EVT_RX_DONE, FSpimOsAckTransDone, instance);
+ FSpimRegisterInterruptHandler(ctrl, FSPIM_INTR_EVT_RX_DONE, FSpimOsAckTransDone, instance);
FSPIM_INFO("Init spi-%d success!!!", id);
diff --git a/example/freertos_feature/eventgroup/configs/pd2308_aarch64_demo_eventgroup.config b/example/freertos_feature/eventgroup/configs/pd2308_aarch64_demo_eventgroup.config
new file mode 100644
index 0000000000000000000000000000000000000000..cf6ea8bbc843ac4960c86b8fea5a65989a2f63d4
--- /dev/null
+++ b/example/freertos_feature/eventgroup/configs/pd2308_aarch64_demo_eventgroup.config
@@ -0,0 +1,8 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="eventgroup"
+CONFIG_ENABLE_IOPAD=y
+CONFIG_OUTPUT_ASM_DIS=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LETTER_SHELL=y
diff --git a/example/freertos_feature/eventgroup/makefile b/example/freertos_feature/eventgroup/makefile
index 4cdad37abc9d3403d56f48019b5bc80be45a84d4..dead7b40c64776cc0660ac2270d8e7a1a92e5056 100644
--- a/example/freertos_feature/eventgroup/makefile
+++ b/example/freertos_feature/eventgroup/makefile
@@ -26,4 +26,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/freertos_feature/eventgroup/sdkconfig b/example/freertos_feature/eventgroup/sdkconfig
index 571f42eba2effd75cd0bbd8cf0645cf2d94b8296..ec983848e2a76b888572a8d36d684eadbc2f3c13 100644
--- a/example/freertos_feature/eventgroup/sdkconfig
+++ b/example/freertos_feature/eventgroup/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -197,90 +198,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/freertos_feature/eventgroup/sdkconfig.h b/example/freertos_feature/eventgroup/sdkconfig.h
index b7793b44c514db1dac81c65af4cf36cf8d041e1d..88239b87371fbc988ae4f4927acce21c7539d7d1 100644
--- a/example/freertos_feature/eventgroup/sdkconfig.h
+++ b/example/freertos_feature/eventgroup/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -178,77 +179,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/timer_tacho/configs/e2000q_aarch64_demo_timer.config b/example/freertos_feature/interrupt/configs/pd2308_aarch64_demo_interrupt.config
similarity index 55%
rename from example/peripheral/timer_tacho/configs/e2000q_aarch64_demo_timer.config
rename to example/freertos_feature/interrupt/configs/pd2308_aarch64_demo_interrupt.config
index 4bc0a41d92f2dccc93d6d0ad58935488db28c66d..51290c922e0cb5347d334c64091cb7574917bae4 100644
--- a/example/peripheral/timer_tacho/configs/e2000q_aarch64_demo_timer.config
+++ b/example/freertos_feature/interrupt/configs/pd2308_aarch64_demo_interrupt.config
@@ -1,10 +1,10 @@
# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
-CONFIG_TARGET_NAME="timer"
-CONFIG_USE_TIMER=y
-CONFIG_ENABLE_TIMER_TACHO=y
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="interrupt"
+CONFIG_LOG_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_OUTPUT_ASM_DIS=y
CONFIG_DEFAULT_LINKER_SCRIPT=y
CONFIG_IMAGE_MAX_LENGTH=0x2000000
-CONFIG_STACK_SIZE=0x100000
-CONFIG_FREERTOS_USE_TIMER=y
CONFIG_USE_LETTER_SHELL=y
# CONFIG_USE_TLSF is not set
diff --git a/example/freertos_feature/interrupt/makefile b/example/freertos_feature/interrupt/makefile
index 5d3b169a539131d4a9359b0ac2d6999831ab8d4b..addf49e3b0edc60c1d4cf1626ad81e9aa7cf7879 100644
--- a/example/freertos_feature/interrupt/makefile
+++ b/example/freertos_feature/interrupt/makefile
@@ -30,4 +30,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/freertos_feature/interrupt/sdkconfig b/example/freertos_feature/interrupt/sdkconfig
index 08b23d6807470e7c0c31483a5e864ef84a2f19fa..3fddd5c3ae5ad10f25d71ea4a2e6bf75983bcbd1 100644
--- a/example/freertos_feature/interrupt/sdkconfig
+++ b/example/freertos_feature/interrupt/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +213,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/freertos_feature/interrupt/sdkconfig.h b/example/freertos_feature/interrupt/sdkconfig.h
index 8f658d61e8e78e1e9d7838759b1865c29a10d1a2..907dcf41b37b7bdc5957a3777e34f9168e3793fe 100644
--- a/example/freertos_feature/interrupt/sdkconfig.h
+++ b/example/freertos_feature/interrupt/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +192,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/freertos_feature/queue/configs/pd2308_aarch64_demo_queue.config b/example/freertos_feature/queue/configs/pd2308_aarch64_demo_queue.config
new file mode 100644
index 0000000000000000000000000000000000000000..981f2ee451078e024ccb5acf164946e310e40125
--- /dev/null
+++ b/example/freertos_feature/queue/configs/pd2308_aarch64_demo_queue.config
@@ -0,0 +1,10 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="queue"
+CONFIG_LOG_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_OUTPUT_ASM_DIS=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LETTER_SHELL=y
+# CONFIG_USE_TLSF is not set
diff --git a/example/freertos_feature/queue/makefile b/example/freertos_feature/queue/makefile
index 5d3b169a539131d4a9359b0ac2d6999831ab8d4b..addf49e3b0edc60c1d4cf1626ad81e9aa7cf7879 100644
--- a/example/freertos_feature/queue/makefile
+++ b/example/freertos_feature/queue/makefile
@@ -30,4 +30,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/freertos_feature/queue/sdkconfig b/example/freertos_feature/queue/sdkconfig
index a9ec86f25ba826e7e4df61eb299cf20f3cdc39be..991ffdb3e49df91d6f757b1bab0325aa9be0b7b6 100644
--- a/example/freertos_feature/queue/sdkconfig
+++ b/example/freertos_feature/queue/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +213,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/freertos_feature/queue/sdkconfig.h b/example/freertos_feature/queue/sdkconfig.h
index 0f543a31294c9057bf18d8bba5faa7edf6cbb8f9..c343203f48eaf564f1cbe398151dbfe2746aa580 100644
--- a/example/freertos_feature/queue/sdkconfig.h
+++ b/example/freertos_feature/queue/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +192,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/freertos_feature/resource/configs/pd2308_aarch64_demo_resoure.config b/example/freertos_feature/resource/configs/pd2308_aarch64_demo_resoure.config
new file mode 100644
index 0000000000000000000000000000000000000000..307a0a9f07b709b94e272acda0fb646f7d59a651
--- /dev/null
+++ b/example/freertos_feature/resource/configs/pd2308_aarch64_demo_resoure.config
@@ -0,0 +1,10 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="resoure"
+CONFIG_LOG_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_OUTPUT_ASM_DIS=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LETTER_SHELL=y
+# CONFIG_USE_TLSF is not set
diff --git a/example/freertos_feature/resource/makefile b/example/freertos_feature/resource/makefile
index 5d3b169a539131d4a9359b0ac2d6999831ab8d4b..addf49e3b0edc60c1d4cf1626ad81e9aa7cf7879 100644
--- a/example/freertos_feature/resource/makefile
+++ b/example/freertos_feature/resource/makefile
@@ -30,4 +30,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/freertos_feature/resource/sdkconfig b/example/freertos_feature/resource/sdkconfig
index 04146166c4b5c3bc52bcd65e9bfcd9608be5e664..8a640eeab4f0ecd8e5440415af743da5d3d8bfad 100644
--- a/example/freertos_feature/resource/sdkconfig
+++ b/example/freertos_feature/resource/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +213,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/freertos_feature/resource/sdkconfig.h b/example/freertos_feature/resource/sdkconfig.h
index 4147572779904dfa36b9a2c4c337e8b92918dfcb..e2105d77d21703df14babe183d4307cc86686666 100644
--- a/example/freertos_feature/resource/sdkconfig.h
+++ b/example/freertos_feature/resource/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +192,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/freertos_feature/software_timer/configs/pd2308_aarch64_demo_software_timer.config b/example/freertos_feature/software_timer/configs/pd2308_aarch64_demo_software_timer.config
new file mode 100644
index 0000000000000000000000000000000000000000..ad3e00093376a4093acb46dfd06ccb06103dc1dc
--- /dev/null
+++ b/example/freertos_feature/software_timer/configs/pd2308_aarch64_demo_software_timer.config
@@ -0,0 +1,10 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="software_timer"
+CONFIG_LOG_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_OUTPUT_ASM_DIS=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LETTER_SHELL=y
+# CONFIG_USE_TLSF is not set
diff --git a/example/freertos_feature/software_timer/makefile b/example/freertos_feature/software_timer/makefile
index 5d3b169a539131d4a9359b0ac2d6999831ab8d4b..addf49e3b0edc60c1d4cf1626ad81e9aa7cf7879 100644
--- a/example/freertos_feature/software_timer/makefile
+++ b/example/freertos_feature/software_timer/makefile
@@ -30,4 +30,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/freertos_feature/software_timer/sdkconfig b/example/freertos_feature/software_timer/sdkconfig
index b2975166b2034f89ac275cee38970136040bd1bf..57e34a2c6cad929959c8df295cafce38dc99f53e 100644
--- a/example/freertos_feature/software_timer/sdkconfig
+++ b/example/freertos_feature/software_timer/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +213,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/freertos_feature/software_timer/sdkconfig.h b/example/freertos_feature/software_timer/sdkconfig.h
index 914b065e8d08a2342caf0787e28ae86c7af51549..10904cf82b7c7ea6994e4a11f72c7849c5417e45 100644
--- a/example/freertos_feature/software_timer/sdkconfig.h
+++ b/example/freertos_feature/software_timer/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +192,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/freertos_feature/task/configs/pd2308_aarch64_demo_task.config b/example/freertos_feature/task/configs/pd2308_aarch64_demo_task.config
new file mode 100644
index 0000000000000000000000000000000000000000..14fe010fbfd18b6d9d6e96786c95d7886463c913
--- /dev/null
+++ b/example/freertos_feature/task/configs/pd2308_aarch64_demo_task.config
@@ -0,0 +1,9 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="task"
+CONFIG_ENABLE_IOPAD=y
+CONFIG_OUTPUT_ASM_DIS=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LETTER_SHELL=y
+CONFIG_FREERTOS_TIMER_TASK_PRIORITY=5
diff --git a/example/freertos_feature/task/makefile b/example/freertos_feature/task/makefile
index 5d3b169a539131d4a9359b0ac2d6999831ab8d4b..addf49e3b0edc60c1d4cf1626ad81e9aa7cf7879 100644
--- a/example/freertos_feature/task/makefile
+++ b/example/freertos_feature/task/makefile
@@ -30,4 +30,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/freertos_feature/task/sdkconfig b/example/freertos_feature/task/sdkconfig
index 1134a60b1dff87351a13520d801de21f4fbf2894..6bbac8cbe1f8f7b8b1a6d4e58153c98cd8a2b40e 100644
--- a/example/freertos_feature/task/sdkconfig
+++ b/example/freertos_feature/task/sdkconfig
@@ -33,14 +33,9 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
# CONFIG_MMU_DEBUG_PRINTS is not set
# end of Arm architecture configuration
-#
-# multi-core system deployment framework
-#
-# CONFIG_USE_MSDF is not set
-# end of multi-core system deployment framework
-
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +207,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/freertos_feature/task/sdkconfig.h b/example/freertos_feature/task/sdkconfig.h
index cf482c123dd2a8481a4955b0a0461f55503b5a78..b663287195f67f6065620e65f75bd5b8d191af0d 100644
--- a/example/freertos_feature/task/sdkconfig.h
+++ b/example/freertos_feature/task/sdkconfig.h
@@ -31,13 +31,9 @@
/* CONFIG_BOOT_WITH_FLUSH_CACHE is not set */
/* CONFIG_MMU_DEBUG_PRINTS is not set */
/* end of Arm architecture configuration */
-
-/* multi-core system deployment framework */
-
-/* CONFIG_USE_MSDF is not set */
-/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +187,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/freertos_feature/task_notify/configs/pd2308_aarch64_demo_task_notify.config b/example/freertos_feature/task_notify/configs/pd2308_aarch64_demo_task_notify.config
new file mode 100644
index 0000000000000000000000000000000000000000..e3618c5454a7bbdb3cb4e116e3b2ba2baab0e4fd
--- /dev/null
+++ b/example/freertos_feature/task_notify/configs/pd2308_aarch64_demo_task_notify.config
@@ -0,0 +1,10 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="task_notify"
+CONFIG_LOG_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_OUTPUT_ASM_DIS=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LETTER_SHELL=y
+# CONFIG_USE_TLSF is not set
diff --git a/example/freertos_feature/task_notify/makefile b/example/freertos_feature/task_notify/makefile
index 5d3b169a539131d4a9359b0ac2d6999831ab8d4b..addf49e3b0edc60c1d4cf1626ad81e9aa7cf7879 100644
--- a/example/freertos_feature/task_notify/makefile
+++ b/example/freertos_feature/task_notify/makefile
@@ -30,4 +30,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/freertos_feature/task_notify/sdkconfig b/example/freertos_feature/task_notify/sdkconfig
index 36170dfe8b0dc9ee30438981f7692df343fa1e3b..b742186e682e06950b31beb590a057f12bb4a424 100644
--- a/example/freertos_feature/task_notify/sdkconfig
+++ b/example/freertos_feature/task_notify/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +213,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/freertos_feature/task_notify/sdkconfig.h b/example/freertos_feature/task_notify/sdkconfig.h
index 293f34cf0c52187745c1ef1cee11ef444244f3c5..3ae849ef013fddb34a933f933b7d76ea6b88b8a7 100644
--- a/example/freertos_feature/task_notify/sdkconfig.h
+++ b/example/freertos_feature/task_notify/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +192,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/network/lwip_https/configs/pd2308_aarch64_demo_lwip_https.config b/example/network/lwip_https/configs/pd2308_aarch64_demo_lwip_https.config
new file mode 100644
index 0000000000000000000000000000000000000000..43c23a351855cabc90c037a9cb7bb21b23d5a258
--- /dev/null
+++ b/example/network/lwip_https/configs/pd2308_aarch64_demo_lwip_https.config
@@ -0,0 +1,25 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="lwip_https"
+CONFIG_ENABLE_IOPAD=y
+CONFIG_USE_ETH=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LWIP=y
+CONFIG_LWIP_FXMAC=y
+# CONFIG_LWIP_NO_SYS is not set
+CONFIG_LWIP_USE_MEM_HEAP=y
+CONFIG_MEM_SIZE=2
+CONFIG_LWIP_IP4_REASSEMBLY=y
+CONFIG_IP_REASS_MAX_PBUFS=32
+CONFIG_LWIP_MULTICAST_PING=y
+CONFIG_LWIP_BROADCAST_PING=y
+CONFIG_LWIP_DHCP_ENABLE=y
+CONFIG_LWIP_TCPIP_CORE_LOCKING=y
+CONFIG_LWIP_DEBUG=y
+CONFIG_LWIP_NETIF_DEBUG=y
+CONFIG_LWIP_PORT_RECEIVE_THREAD_STACKSIZE=1024
+CONFIG_LWIP_PORT_LINK_DETECT_STACKSIZE=1024
+CONFIG_LWIP_PORT_DHCP_STACKSIZE=2048
+CONFIG_USE_MBEDTLS=y
+CONFIG_USE_LETTER_SHELL=y
diff --git a/example/network/lwip_https/makefile b/example/network/lwip_https/makefile
index 01747b8802fa80782d442198dfe88bbef9b0ec2b..0a7b49843100ac37b6578374827cd67e252babef 100644
--- a/example/network/lwip_https/makefile
+++ b/example/network/lwip_https/makefile
@@ -25,4 +25,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/network/lwip_https/sdkconfig b/example/network/lwip_https/sdkconfig
index 83c58b18dd55c9c4fbb2d61bf4cd2242762676ca..e393426bd26c1003a2aaaf4528a286d00f8b61a3 100644
--- a/example/network/lwip_https/sdkconfig
+++ b/example/network/lwip_https/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -222,90 +223,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
CONFIG_FREERTOS_USE_XMAC=y
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
@@ -314,7 +315,7 @@ CONFIG_FREERTOS_USE_XMAC=y
CONFIG_USE_LWIP=y
#
-# LWIP Freertos Port Configuration
+# LWIP FreeRTOS Port Configuration
#
#
@@ -550,12 +551,12 @@ CONFIG_LWIP_PORT_DHCP_THREAD=y
CONFIG_LWIP_PORT_DHCP_STACKSIZE=2048
CONFIG_LWIP_PORT_DHCP_PRIORITY=5
# end of lwip port thread Configuration
-# end of LWIP Freertos Port Configuration
+# end of LWIP FreeRTOS Port Configuration
CONFIG_USE_MBEDTLS=y
#
-# MBEDTLS Freertos Port Configuration
+# MBEDTLS FreeRTOS Port Configuration
#
CONFIG_USE_LETTER_SHELL=y
diff --git a/example/network/lwip_https/sdkconfig.h b/example/network/lwip_https/sdkconfig.h
index 3c7b759ef0fa7bfb577613a7e876ce35fbe7dbc2..234cc57841f7b56018b7a9340bf4677bafef2b60 100644
--- a/example/network/lwip_https/sdkconfig.h
+++ b/example/network/lwip_https/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -199,84 +200,84 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
#define CONFIG_FREERTOS_USE_XMAC
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
#define CONFIG_USE_LWIP
-/* LWIP Freertos Port Configuration */
+/* LWIP FreeRTOS Port Configuration */
/* LWIP Configuration */
@@ -482,10 +483,10 @@
#define CONFIG_LWIP_PORT_DHCP_STACKSIZE 2048
#define CONFIG_LWIP_PORT_DHCP_PRIORITY 5
/* end of lwip port thread Configuration */
-/* end of LWIP Freertos Port Configuration */
+/* end of LWIP FreeRTOS Port Configuration */
#define CONFIG_USE_MBEDTLS
-/* MBEDTLS Freertos Port Configuration */
+/* MBEDTLS FreeRTOS Port Configuration */
#define CONFIG_USE_LETTER_SHELL
diff --git a/example/network/lwip_iperf/configs/pd2308_aarch64_demo_lwip_iperf.config b/example/network/lwip_iperf/configs/pd2308_aarch64_demo_lwip_iperf.config
new file mode 100644
index 0000000000000000000000000000000000000000..34c9796dc92cc692af2bf96e0fe4813f376a4e87
--- /dev/null
+++ b/example/network/lwip_iperf/configs/pd2308_aarch64_demo_lwip_iperf.config
@@ -0,0 +1,26 @@
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="lwip_iperf"
+CONFIG_ENABLE_IOPAD=y
+CONFIG_USE_ETH=y
+CONFIG_DEBUG_CUSTOMOPT=y
+CONFIG_OUTPUT_ASM_DIS=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LWIP=y
+CONFIG_LWIP_FXMAC=y
+# CONFIG_LWIP_NO_SYS is not set
+CONFIG_USE_LWIP_APP_LWIPERF=y
+CONFIG_LWIP_USE_MEM_HEAP=y
+CONFIG_LWIP_IP4_REASSEMBLY=y
+CONFIG_IP_REASS_MAX_PBUFS=32
+CONFIG_LWIP_MULTICAST_PING=y
+CONFIG_LWIP_BROADCAST_PING=y
+CONFIG_LWIP_DHCP_ENABLE=y
+# CONFIG_LWIP_IGMP_EN is not set
+CONFIG_LWIP_TCP_WND_DEFAULT=60000
+CONFIG_LWIP_TCP_MSS=1460
+CONFIG_LWIP_TCP_SND_BUF_DEFAULT=60000
+CONFIG_LWIP_TCPIP_CORE_LOCKING=y
+CONFIG_LWIP_DEBUG=y
+CONFIG_LWIP_NETIF_DEBUG=y
+CONFIG_USE_LETTER_SHELL=y
diff --git a/example/network/lwip_iperf/makefile b/example/network/lwip_iperf/makefile
index 585ed3cb954f5977f0891369f47358fb069b6cf4..c6802f4640e709db8097ca710cfc237f1c5e36d4 100644
--- a/example/network/lwip_iperf/makefile
+++ b/example/network/lwip_iperf/makefile
@@ -26,3 +26,4 @@ ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).bin
endif
@ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
diff --git a/example/network/lwip_iperf/sdkconfig b/example/network/lwip_iperf/sdkconfig
index 694178707692a1a4992ae60b30a463f4d96117bc..8ef175bc1f31bbd04b37c9511229001abe2da1f5 100644
--- a/example/network/lwip_iperf/sdkconfig
+++ b/example/network/lwip_iperf/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_BOOT_WITH_FLUSH_CACHE=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -223,90 +224,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
CONFIG_FREERTOS_USE_XMAC=y
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
@@ -315,7 +316,7 @@ CONFIG_FREERTOS_USE_XMAC=y
CONFIG_USE_LWIP=y
#
-# LWIP Freertos Port Configuration
+# LWIP FreeRTOS Port Configuration
#
#
@@ -551,7 +552,7 @@ CONFIG_LWIP_PORT_DHCP_THREAD=y
CONFIG_LWIP_PORT_DHCP_STACKSIZE=4096
CONFIG_LWIP_PORT_DHCP_PRIORITY=5
# end of lwip port thread Configuration
-# end of LWIP Freertos Port Configuration
+# end of LWIP FreeRTOS Port Configuration
# CONFIG_USE_MBEDTLS is not set
CONFIG_USE_LETTER_SHELL=y
diff --git a/example/network/lwip_iperf/sdkconfig.h b/example/network/lwip_iperf/sdkconfig.h
index 90cf80900478927d99faa2b2cf4f453488f38d78..d1b6a38b55ae10591ce480774eb5a7bc4ea1f7b6 100644
--- a/example/network/lwip_iperf/sdkconfig.h
+++ b/example/network/lwip_iperf/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -200,84 +201,84 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
#define CONFIG_FREERTOS_USE_XMAC
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
#define CONFIG_USE_LWIP
-/* LWIP Freertos Port Configuration */
+/* LWIP FreeRTOS Port Configuration */
/* LWIP Configuration */
@@ -483,7 +484,7 @@
#define CONFIG_LWIP_PORT_DHCP_STACKSIZE 4096
#define CONFIG_LWIP_PORT_DHCP_PRIORITY 5
/* end of lwip port thread Configuration */
-/* end of LWIP Freertos Port Configuration */
+/* end of LWIP FreeRTOS Port Configuration */
/* CONFIG_USE_MBEDTLS is not set */
#define CONFIG_USE_LETTER_SHELL
diff --git a/example/network/lwip_startup/configs/pd2308_aarch64_demo_lwip_startup.config b/example/network/lwip_startup/configs/pd2308_aarch64_demo_lwip_startup.config
new file mode 100644
index 0000000000000000000000000000000000000000..9403a62b76cdd6137bde09e9b362927358218d18
--- /dev/null
+++ b/example/network/lwip_startup/configs/pd2308_aarch64_demo_lwip_startup.config
@@ -0,0 +1,24 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="lwip_startup"
+CONFIG_ENABLE_IOPAD=y
+CONFIG_USE_ETH=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LWIP=y
+CONFIG_LWIP_FXMAC=y
+# CONFIG_LWIP_NO_SYS is not set
+CONFIG_LWIP_USE_MEM_HEAP=y
+CONFIG_MEM_SIZE=2
+CONFIG_LWIP_IP4_REASSEMBLY=y
+CONFIG_IP_REASS_MAX_PBUFS=32
+CONFIG_LWIP_MULTICAST_PING=y
+CONFIG_LWIP_BROADCAST_PING=y
+CONFIG_LWIP_DHCP_ENABLE=y
+CONFIG_LWIP_TCPIP_CORE_LOCKING=y
+CONFIG_LWIP_DEBUG=y
+CONFIG_LWIP_NETIF_DEBUG=y
+CONFIG_LWIP_PORT_RECEIVE_THREAD_STACKSIZE=1024
+CONFIG_LWIP_PORT_LINK_DETECT_STACKSIZE=1024
+CONFIG_LWIP_PORT_DHCP_STACKSIZE=2048
+CONFIG_USE_LETTER_SHELL=y
diff --git a/example/network/lwip_startup/makefile b/example/network/lwip_startup/makefile
index 01747b8802fa80782d442198dfe88bbef9b0ec2b..0a7b49843100ac37b6578374827cd67e252babef 100644
--- a/example/network/lwip_startup/makefile
+++ b/example/network/lwip_startup/makefile
@@ -25,4 +25,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/network/lwip_startup/sdkconfig b/example/network/lwip_startup/sdkconfig
index c9fdf0d02f2e4a4899d46378298ec9512d9215ef..c56faed84c23316fd639b1ec28024efbfcb8b080 100644
--- a/example/network/lwip_startup/sdkconfig
+++ b/example/network/lwip_startup/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -222,90 +223,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
CONFIG_FREERTOS_USE_XMAC=y
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
@@ -314,7 +315,7 @@ CONFIG_FREERTOS_USE_XMAC=y
CONFIG_USE_LWIP=y
#
-# LWIP Freertos Port Configuration
+# LWIP FreeRTOS Port Configuration
#
#
@@ -550,7 +551,7 @@ CONFIG_LWIP_PORT_DHCP_THREAD=y
CONFIG_LWIP_PORT_DHCP_STACKSIZE=2048
CONFIG_LWIP_PORT_DHCP_PRIORITY=5
# end of lwip port thread Configuration
-# end of LWIP Freertos Port Configuration
+# end of LWIP FreeRTOS Port Configuration
# CONFIG_USE_MBEDTLS is not set
CONFIG_USE_LETTER_SHELL=y
diff --git a/example/network/lwip_startup/sdkconfig.h b/example/network/lwip_startup/sdkconfig.h
index 041a8b89c54a5962628d65fdf737004ab6e9a4e8..9c8c15cada1c311a7dbd5ea659a400d516485e3a 100644
--- a/example/network/lwip_startup/sdkconfig.h
+++ b/example/network/lwip_startup/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -199,84 +200,84 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
#define CONFIG_FREERTOS_USE_XMAC
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
#define CONFIG_USE_LWIP
-/* LWIP Freertos Port Configuration */
+/* LWIP FreeRTOS Port Configuration */
/* LWIP Configuration */
@@ -482,7 +483,7 @@
#define CONFIG_LWIP_PORT_DHCP_STACKSIZE 2048
#define CONFIG_LWIP_PORT_DHCP_PRIORITY 5
/* end of lwip port thread Configuration */
-/* end of LWIP Freertos Port Configuration */
+/* end of LWIP FreeRTOS Port Configuration */
/* CONFIG_USE_MBEDTLS is not set */
#define CONFIG_USE_LETTER_SHELL
diff --git a/example/network/sockets/udp_multicast/configs/pd2308_aarch64_demo_udp_multicast.config b/example/network/sockets/udp_multicast/configs/pd2308_aarch64_demo_udp_multicast.config
new file mode 100644
index 0000000000000000000000000000000000000000..c327b49e4abeecb8e57ebbffa82a59107fc923cc
--- /dev/null
+++ b/example/network/sockets/udp_multicast/configs/pd2308_aarch64_demo_udp_multicast.config
@@ -0,0 +1,24 @@
+CONFIG_EXAMPLE_MULTICAST_TTL=255
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="udp_multicast"
+CONFIG_LOG_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_USE_ETH=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LWIP=y
+CONFIG_LWIP_FXMAC=y
+# CONFIG_LWIP_NO_SYS is not set
+CONFIG_LWIP_USE_MEM_HEAP=y
+CONFIG_LWIP_IP4_REASSEMBLY=y
+CONFIG_IP_REASS_MAX_PBUFS=45
+CONFIG_LWIP_MULTICAST_PING=y
+CONFIG_LWIP_DHCP_ENABLE=y
+CONFIG_LWIP_TCPIP_CORE_LOCKING=y
+CONFIG_LWIP_IP6_REASSEMBLY=y
+CONFIG_LWIP_DEBUG=y
+CONFIG_LWIP_NETIF_DEBUG=y
+CONFIG_LWIP_TCPIP_TASK_PRIO=5
+CONFIG_USE_LETTER_SHELL=y
+CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=11
diff --git a/example/network/sockets/udp_multicast/makefile b/example/network/sockets/udp_multicast/makefile
index 8bdf90a4af60a1fb93b6d657782f8c6986daf3d6..62622c803e4925cc2a1864ce6ddadf22a1008b01 100644
--- a/example/network/sockets/udp_multicast/makefile
+++ b/example/network/sockets/udp_multicast/makefile
@@ -26,6 +26,7 @@ ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).bin
endif
@ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
test_code:
$(MAKE) -C $(PROJECT_DIR)/test/ all
\ No newline at end of file
diff --git a/example/network/sockets/udp_multicast/sdkconfig b/example/network/sockets/udp_multicast/sdkconfig
index 8dea3a50fd39770900a2ee8607a277cc95615ce2..4623f44f09f4d8741dfb69929f3ba09b8db66c02 100644
--- a/example/network/sockets/udp_multicast/sdkconfig
+++ b/example/network/sockets/udp_multicast/sdkconfig
@@ -58,6 +58,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -239,90 +240,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
CONFIG_FREERTOS_USE_XMAC=y
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
@@ -331,7 +332,7 @@ CONFIG_FREERTOS_USE_XMAC=y
CONFIG_USE_LWIP=y
#
-# LWIP Freertos Port Configuration
+# LWIP FreeRTOS Port Configuration
#
#
@@ -567,7 +568,7 @@ CONFIG_LWIP_PORT_DHCP_THREAD=y
CONFIG_LWIP_PORT_DHCP_STACKSIZE=4096
CONFIG_LWIP_PORT_DHCP_PRIORITY=5
# end of lwip port thread Configuration
-# end of LWIP Freertos Port Configuration
+# end of LWIP FreeRTOS Port Configuration
# CONFIG_USE_MBEDTLS is not set
CONFIG_USE_LETTER_SHELL=y
diff --git a/example/network/sockets/udp_multicast/sdkconfig.h b/example/network/sockets/udp_multicast/sdkconfig.h
index dc2a6e1a4221cf400074a85ded4d4266db0404f8..8dbf44dd56ce72266824ab611fb7d03a74db39ca 100644
--- a/example/network/sockets/udp_multicast/sdkconfig.h
+++ b/example/network/sockets/udp_multicast/sdkconfig.h
@@ -52,6 +52,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -213,84 +214,84 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
#define CONFIG_FREERTOS_USE_XMAC
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
#define CONFIG_USE_LWIP
-/* LWIP Freertos Port Configuration */
+/* LWIP FreeRTOS Port Configuration */
/* LWIP Configuration */
@@ -496,7 +497,7 @@
#define CONFIG_LWIP_PORT_DHCP_STACKSIZE 4096
#define CONFIG_LWIP_PORT_DHCP_PRIORITY 5
/* end of lwip port thread Configuration */
-/* end of LWIP Freertos Port Configuration */
+/* end of LWIP FreeRTOS Port Configuration */
/* CONFIG_USE_MBEDTLS is not set */
#define CONFIG_USE_LETTER_SHELL
diff --git a/example/network/wlan/makefile b/example/network/wlan/makefile
index b82ed7c77add30d52a51e364b4fa464659ee127c..8b58d973abed7b225ece054177a2fd75da4f9f0e 100644
--- a/example/network/wlan/makefile
+++ b/example/network/wlan/makefile
@@ -26,4 +26,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/network/wlan/sdkconfig b/example/network/wlan/sdkconfig
index cc076477850ae670f28892239551d1bb2f328252..c796bd931aa11239f0a41245278f4088d6b1d2d3 100644
--- a/example/network/wlan/sdkconfig
+++ b/example/network/wlan/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_BOOT_WITH_FLUSH_CACHE=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -216,90 +217,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
@@ -308,7 +309,7 @@ CONFIG_FREERTOS_USE_UART=y
CONFIG_USE_LWIP=y
#
-# LWIP Freertos Port Configuration
+# LWIP FreeRTOS Port Configuration
#
#
@@ -537,7 +538,7 @@ CONFIG_LWIP_PORT_DHCP_THREAD=y
CONFIG_LWIP_PORT_DHCP_STACKSIZE=2048
CONFIG_LWIP_PORT_DHCP_PRIORITY=5
# end of lwip port thread Configuration
-# end of LWIP Freertos Port Configuration
+# end of LWIP FreeRTOS Port Configuration
# CONFIG_USE_MBEDTLS is not set
CONFIG_USE_LETTER_SHELL=y
diff --git a/example/network/wlan/sdkconfig.h b/example/network/wlan/sdkconfig.h
index dae474014068fa32f928be41345d14e8a492a801..5aa959bd609720076fd0acf3553723ce85122645 100644
--- a/example/network/wlan/sdkconfig.h
+++ b/example/network/wlan/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -195,84 +196,84 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
#define CONFIG_USE_LWIP
-/* LWIP Freertos Port Configuration */
+/* LWIP FreeRTOS Port Configuration */
/* LWIP Configuration */
@@ -471,7 +472,7 @@
#define CONFIG_LWIP_PORT_DHCP_STACKSIZE 2048
#define CONFIG_LWIP_PORT_DHCP_PRIORITY 5
/* end of lwip port thread Configuration */
-/* end of LWIP Freertos Port Configuration */
+/* end of LWIP FreeRTOS Port Configuration */
/* CONFIG_USE_MBEDTLS is not set */
#define CONFIG_USE_LETTER_SHELL
diff --git a/example/peripheral/can/can/configs/pd2308_aarch64_demo_can.config b/example/peripheral/can/can/configs/pd2308_aarch64_demo_can.config
new file mode 100644
index 0000000000000000000000000000000000000000..665ed27a1b6f96c75eb159f1646fd36362546c69
--- /dev/null
+++ b/example/peripheral/can/can/configs/pd2308_aarch64_demo_can.config
@@ -0,0 +1,10 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="can"
+CONFIG_LOG_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_FREERTOS_USE_CAN=y
+CONFIG_USE_LETTER_SHELL=y
+# CONFIG_USE_TLSF is not set
diff --git a/example/peripheral/can/can/makefile b/example/peripheral/can/can/makefile
index c34d5c423429bb4e3011ff5a7d308335e24ccd07..8f04c02504b44f402385fc16133134f8d111f7e2 100644
--- a/example/peripheral/can/can/makefile
+++ b/example/peripheral/can/can/makefile
@@ -28,4 +28,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/can/can/sdkconfig b/example/peripheral/can/can/sdkconfig
index c22286b42bedeb0776314f3eea01f07839449e7a..13e722695b355b66ddc7756ff01a7b8465b3a0eb 100644
--- a/example/peripheral/can/can/sdkconfig
+++ b/example/peripheral/can/can/sdkconfig
@@ -29,7 +29,6 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
# CONFIG_GCC_CODE_MODEL_LARGE is not set
# end of Compiler configuration
-# CONFIG_USE_L3CACHE is not set
# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
# CONFIG_MMU_DEBUG_PRINTS is not set
# end of Arm architecture configuration
@@ -42,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -51,12 +51,12 @@ CONFIG_MAX_XLAT_TABLES=256
# CONFIG_TARGET_E2000Q is not set
# CONFIG_TARGET_E2000D is not set
# CONFIG_TARGET_E2000S is not set
-CONFIG_TARGET_FT2004=y
+# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
-# CONFIG_TARGET_PD2308 is not set
+CONFIG_TARGET_PD2308=y
# CONFIG_TARGET_QEMU_VIRT is not set
-CONFIG_SOC_NAME="ft2004"
-CONFIG_SOC_CORE_NUM=4
+CONFIG_SOC_NAME="pd2308"
+CONFIG_SOC_CORE_NUM=8
CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000
CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
@@ -69,12 +69,22 @@ CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
#
# Board Configuration
#
-CONFIG_BOARD_NAME="dsk"
-CONFIG_FT2004_DSK_BOARD=y
+CONFIG_BOARD_NAME="demo"
+# CONFIG_USE_SPI_IOPAD is not set
+# CONFIG_USE_GPIO_IOPAD is not set
+# CONFIG_USE_CAN_IOPAD is not set
+# CONFIG_USE_QSPI_IOPAD is not set
+# CONFIG_USE_PWM_IOPAD is not set
+# CONFIG_USE_TACHO_IOPAD is not set
+# CONFIG_USE_UART_IOPAD is not set
+# CONFIG_USE_THIRD_PARTY_IOPAD is not set
+CONFIG_PD2308_DEMO_BOARD=y
#
# IO mux configuration when board start up
#
+# end of IO mux configuration when board start up
+
# CONFIG_CUS_DEMO_BOARD is not set
#
@@ -107,8 +117,8 @@ CONFIG_INTERRUPT_ROLE_MASTER=y
# Drivers configuration
#
CONFIG_USE_IOMUX=y
-CONFIG_ENABLE_IOCTRL=y
-# CONFIG_ENABLE_IOPAD is not set
+# CONFIG_ENABLE_IOCTRL is not set
+CONFIG_ENABLE_IOPAD=y
# CONFIG_USE_SPI is not set
# CONFIG_USE_QSPI is not set
CONFIG_USE_SERIAL=y
@@ -202,90 +212,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
CONFIG_FREERTOS_USE_CAN=y
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/can/can/sdkconfig.h b/example/peripheral/can/can/sdkconfig.h
index 7a93aaca2e266eed835868bb53b427f8e44bd634..f901d584475a0633dc3311b137e170fbe9b6a13b 100644
--- a/example/peripheral/can/can/sdkconfig.h
+++ b/example/peripheral/can/can/sdkconfig.h
@@ -28,7 +28,6 @@
#define CONFIG_GCC_CODE_MODEL_SMALL
/* CONFIG_GCC_CODE_MODEL_LARGE is not set */
/* end of Compiler configuration */
-/* CONFIG_USE_L3CACHE is not set */
/* CONFIG_BOOT_WITH_FLUSH_CACHE is not set */
/* CONFIG_MMU_DEBUG_PRINTS is not set */
/* end of Arm architecture configuration */
@@ -39,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -47,12 +47,12 @@
/* CONFIG_TARGET_E2000Q is not set */
/* CONFIG_TARGET_E2000D is not set */
/* CONFIG_TARGET_E2000S is not set */
-#define CONFIG_TARGET_FT2004
+/* CONFIG_TARGET_FT2004 is not set */
/* CONFIG_TARGET_D2000 is not set */
-/* CONFIG_TARGET_PD2308 is not set */
+#define CONFIG_TARGET_PD2308
/* CONFIG_TARGET_QEMU_VIRT is not set */
-#define CONFIG_SOC_NAME "ft2004"
-#define CONFIG_SOC_CORE_NUM 4
+#define CONFIG_SOC_NAME "pd2308"
+#define CONFIG_SOC_CORE_NUM 8
#define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000
#define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000
#define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000
@@ -64,11 +64,20 @@
/* Board Configuration */
-#define CONFIG_BOARD_NAME "dsk"
-#define CONFIG_FT2004_DSK_BOARD
+#define CONFIG_BOARD_NAME "demo"
+/* CONFIG_USE_SPI_IOPAD is not set */
+/* CONFIG_USE_GPIO_IOPAD is not set */
+/* CONFIG_USE_CAN_IOPAD is not set */
+/* CONFIG_USE_QSPI_IOPAD is not set */
+/* CONFIG_USE_PWM_IOPAD is not set */
+/* CONFIG_USE_TACHO_IOPAD is not set */
+/* CONFIG_USE_UART_IOPAD is not set */
+/* CONFIG_USE_THIRD_PARTY_IOPAD is not set */
+#define CONFIG_PD2308_DEMO_BOARD
/* IO mux configuration when board start up */
+/* end of IO mux configuration when board start up */
/* CONFIG_CUS_DEMO_BOARD is not set */
/* Build project name */
@@ -98,8 +107,8 @@
/* Drivers configuration */
#define CONFIG_USE_IOMUX
-#define CONFIG_ENABLE_IOCTRL
-/* CONFIG_ENABLE_IOPAD is not set */
+/* CONFIG_ENABLE_IOCTRL is not set */
+#define CONFIG_ENABLE_IOPAD
/* CONFIG_USE_SPI is not set */
/* CONFIG_USE_QSPI is not set */
#define CONFIG_USE_SERIAL
@@ -182,77 +191,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
#define CONFIG_FREERTOS_USE_CAN
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/can/canfd/configs/pd2308_aarch64_demo_canfd.config b/example/peripheral/can/canfd/configs/pd2308_aarch64_demo_canfd.config
new file mode 100644
index 0000000000000000000000000000000000000000..2c2bd9ba1209c40f4d2988f119ae39e5a77f9309
--- /dev/null
+++ b/example/peripheral/can/canfd/configs/pd2308_aarch64_demo_canfd.config
@@ -0,0 +1,10 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="canfd"
+CONFIG_LOG_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_FREERTOS_USE_CAN=y
+CONFIG_USE_LETTER_SHELL=y
+# CONFIG_USE_TLSF is not set
diff --git a/example/peripheral/can/canfd/makefile b/example/peripheral/can/canfd/makefile
index c34d5c423429bb4e3011ff5a7d308335e24ccd07..8f04c02504b44f402385fc16133134f8d111f7e2 100644
--- a/example/peripheral/can/canfd/makefile
+++ b/example/peripheral/can/canfd/makefile
@@ -28,4 +28,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/can/canfd/sdkconfig b/example/peripheral/can/canfd/sdkconfig
index 321de4caec073a68e236272c38395bb077402373..837d7451b8b2fa1c0b043c045d3fba4aa12d0691 100644
--- a/example/peripheral/can/canfd/sdkconfig
+++ b/example/peripheral/can/canfd/sdkconfig
@@ -41,27 +41,26 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
# Soc configuration
#
# CONFIG_TARGET_PHYTIUMPI is not set
-CONFIG_TARGET_E2000Q=y
+# CONFIG_TARGET_E2000Q is not set
# CONFIG_TARGET_E2000D is not set
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
-# CONFIG_TARGET_PD2308 is not set
+CONFIG_TARGET_PD2308=y
# CONFIG_TARGET_QEMU_VIRT is not set
-CONFIG_SOC_NAME="e2000"
-CONFIG_TARGET_TYPE_NAME="q"
-CONFIG_SOC_CORE_NUM=4
+CONFIG_SOC_NAME="pd2308"
+CONFIG_SOC_CORE_NUM=8
CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000
CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
-CONFIG_TARGET_E2000=y
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set
@@ -76,11 +75,10 @@ CONFIG_BOARD_NAME="demo"
# CONFIG_USE_CAN_IOPAD is not set
# CONFIG_USE_QSPI_IOPAD is not set
# CONFIG_USE_PWM_IOPAD is not set
-# CONFIG_USE_MIO_IOPAD is not set
# CONFIG_USE_TACHO_IOPAD is not set
# CONFIG_USE_UART_IOPAD is not set
# CONFIG_USE_THIRD_PARTY_IOPAD is not set
-CONFIG_E2000Q_DEMO_BOARD=y
+CONFIG_PD2308_DEMO_BOARD=y
#
# IO mux configuration when board start up
@@ -205,7 +203,7 @@ CONFIG_DEFAULT_LINKER_SCRIPT=y
CONFIG_IMAGE_LOAD_ADDRESS=0x80100000
CONFIG_IMAGE_MAX_LENGTH=0x2000000
CONFIG_HEAP_SIZE=1
-CONFIG_STACK_SIZE=0x100000
+CONFIG_STACK_SIZE=0x400
# end of Linker Options
# end of Build setup
@@ -214,90 +212,90 @@ CONFIG_STACK_SIZE=0x100000
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
CONFIG_FREERTOS_USE_CAN=y
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/can/canfd/sdkconfig.h b/example/peripheral/can/canfd/sdkconfig.h
index 7a098ec974f7badf1c1250e07f05bb3927432482..c4349ba27e4e55dd9817299b7c1ed5c9a439a585 100644
--- a/example/peripheral/can/canfd/sdkconfig.h
+++ b/example/peripheral/can/canfd/sdkconfig.h
@@ -38,26 +38,25 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
/* CONFIG_TARGET_PHYTIUMPI is not set */
-#define CONFIG_TARGET_E2000Q
+/* CONFIG_TARGET_E2000Q is not set */
/* CONFIG_TARGET_E2000D is not set */
/* CONFIG_TARGET_E2000S is not set */
/* CONFIG_TARGET_FT2004 is not set */
/* CONFIG_TARGET_D2000 is not set */
-/* CONFIG_TARGET_PD2308 is not set */
+#define CONFIG_TARGET_PD2308
/* CONFIG_TARGET_QEMU_VIRT is not set */
-#define CONFIG_SOC_NAME "e2000"
-#define CONFIG_TARGET_TYPE_NAME "q"
-#define CONFIG_SOC_CORE_NUM 4
+#define CONFIG_SOC_NAME "pd2308"
+#define CONFIG_SOC_CORE_NUM 8
#define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000
#define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000
#define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000
#define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000
-#define CONFIG_TARGET_E2000
#define CONFIG_DEFAULT_DEBUG_PRINT_UART1
/* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */
/* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */
@@ -71,11 +70,10 @@
/* CONFIG_USE_CAN_IOPAD is not set */
/* CONFIG_USE_QSPI_IOPAD is not set */
/* CONFIG_USE_PWM_IOPAD is not set */
-/* CONFIG_USE_MIO_IOPAD is not set */
/* CONFIG_USE_TACHO_IOPAD is not set */
/* CONFIG_USE_UART_IOPAD is not set */
/* CONFIG_USE_THIRD_PARTY_IOPAD is not set */
-#define CONFIG_E2000Q_DEMO_BOARD
+#define CONFIG_PD2308_DEMO_BOARD
/* IO mux configuration when board start up */
@@ -187,83 +185,83 @@
#define CONFIG_IMAGE_LOAD_ADDRESS 0x80100000
#define CONFIG_IMAGE_MAX_LENGTH 0x2000000
#define CONFIG_HEAP_SIZE 1
-#define CONFIG_STACK_SIZE 0x100000
+#define CONFIG_STACK_SIZE 0x400
/* end of Linker Options */
/* end of Build setup */
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
#define CONFIG_FREERTOS_USE_CAN
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/dma/ddma/makefile b/example/peripheral/dma/ddma/makefile
index 11579fd3a6ad29e7dc16b82e2eac1444e0371843..681587e37cb8a2adc896e36036c56f9a99321b9f 100644
--- a/example/peripheral/dma/ddma/makefile
+++ b/example/peripheral/dma/ddma/makefile
@@ -29,4 +29,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/dma/ddma/sdkconfig b/example/peripheral/dma/ddma/sdkconfig
index 63b2a9342fcea0d9caf8c7d6891e0aec9eefff6c..8b96ebdcd53b5a024bb2b5d6e969f84235db8b2b 100644
--- a/example/peripheral/dma/ddma/sdkconfig
+++ b/example/peripheral/dma/ddma/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -215,90 +216,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
CONFIG_FREERTOS_USE_FSPIM=y
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
CONFIG_FREERTOS_USE_FDDMA=y
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/dma/ddma/sdkconfig.h b/example/peripheral/dma/ddma/sdkconfig.h
index f292b4bebadb3fbe0ff4435c7fefe821b11053e0..bb4e34b89a4298b0434730ecd33320c4d0f177b9 100644
--- a/example/peripheral/dma/ddma/sdkconfig.h
+++ b/example/peripheral/dma/ddma/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -194,77 +195,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
#define CONFIG_FREERTOS_USE_FSPIM
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
#define CONFIG_FREERTOS_USE_FDDMA
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/dma/ddma/src/ddma_spi_loopback.c b/example/peripheral/dma/ddma/src/ddma_spi_loopback.c
index 8b37b0b0dfece38b3392155e6524c5d32c4ff94d..fbee35e9e03ad594d90234e69d531b77cde426d3 100755
--- a/example/peripheral/dma/ddma/src/ddma_spi_loopback.c
+++ b/example/peripheral/dma/ddma/src/ddma_spi_loopback.c
@@ -174,7 +174,8 @@ static boolean DdmaSpiLoopbackWaitDmaEnd(void)
boolean ret = TRUE;
u32 ulNotifiedValue;
u32 wait_bits = BIT(rx_chan_id) | BIT(tx_chan_id);
- xTaskNotifyWait(pdFALSE, 0xffffffff, &ulNotifiedValue,WAIT_DMA_DONE_TICKS);
+
+ xTaskNotifyWait(pdFALSE, 0xffffffff, &ulNotifiedValue, WAIT_DMA_DONE_TICKS);
if ((ulNotifiedValue & wait_bits) == wait_bits)
{
FDDMA_INFO("DDMA transfer success.");
@@ -276,19 +277,24 @@ static int DdmaSpiLoopbackCheckRecvData(u32 trans_len)
}
static void DdmaTask(void *pvParameters)
-{
+{
+ ddma_trans_task = xTaskGetCurrentTaskHandle();
+
int i=0;
int ret = FFREERTOS_DDMA_OK;
uint32_t notify_result;
- ddma_trans_task = xTaskGetCurrentTaskHandle();
uint32_t* trans_len_addr = (uint32_t*)pvParameters;
+
u32 trans_len = *trans_len_addr;
FASSERT_MSG((trans_len <= TX_RX_BUF_LEN) && (trans_len % 4 == 0), "Trans_len is wrong.");
+
+ /*set test mode */
FFreeRTOSSpimConifg spim_config;
spim_config.spi_mode = FFREERTOS_SPIM_MODE_0;
spim_config.en_dma = TRUE;
- /*set test mode */
spim_config.inner_loopback = TRUE;
+
+ /* test loop */
for(i = 0; i < LOOPBACK_TIMES; i++)
{
SpimDdmaInit(spim_config, trans_len);
@@ -298,13 +304,13 @@ static void DdmaTask(void *pvParameters)
goto task_ret;
}
+ vTaskDelay(100); /* insure RX is done */
if(!DdmaSpiLoopbackWaitDmaEnd())
{
ret = FFREERTOS_DDMA_TRANSFER_FAIL;
goto task_ret;
}
-
/* check recv data is right*/
ret = DdmaSpiLoopbackCheckRecvData(trans_len);
SpimDdmaDeinit();
@@ -315,6 +321,7 @@ static void DdmaTask(void *pvParameters)
}
task_ret:
+ SpimDdmaDeinit();
xQueueSend(xQueue, &ret, 0);
vTaskDelete(NULL);
}
diff --git a/example/peripheral/dma/gdma/configs/pd2308_aarch64_demo_gdma.config b/example/peripheral/dma/gdma/configs/pd2308_aarch64_demo_gdma.config
new file mode 100644
index 0000000000000000000000000000000000000000..34aa8732354d9b7daad6a035133dd694f9dac5d6
--- /dev/null
+++ b/example/peripheral/dma/gdma/configs/pd2308_aarch64_demo_gdma.config
@@ -0,0 +1,11 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="gdma"
+CONFIG_LOG_EXTRA_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_USE_DMA=y
+CONFIG_ENABLE_FGDMA=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_FREERTOS_USE_FGDMA=y
+CONFIG_USE_LETTER_SHELL=y
diff --git a/example/peripheral/dma/gdma/makefile b/example/peripheral/dma/gdma/makefile
index 11579fd3a6ad29e7dc16b82e2eac1444e0371843..681587e37cb8a2adc896e36036c56f9a99321b9f 100644
--- a/example/peripheral/dma/gdma/makefile
+++ b/example/peripheral/dma/gdma/makefile
@@ -29,4 +29,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/dma/gdma/sdkconfig b/example/peripheral/dma/gdma/sdkconfig
index e498826d2f832f1445e14dfec24ed9175fef8e5d..9a011dab8e6e7498ee88422f975b89129ba604e0 100644
--- a/example/peripheral/dma/gdma/sdkconfig
+++ b/example/peripheral/dma/gdma/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -214,90 +215,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
CONFIG_FREERTOS_USE_FGDMA=y
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/dma/gdma/sdkconfig.h b/example/peripheral/dma/gdma/sdkconfig.h
index beeb57f2dce3aedae81dd56cbb7c46417265523e..f997dcc2783413e6abbc47a6ce2e6c5258375f30 100644
--- a/example/peripheral/dma/gdma/sdkconfig.h
+++ b/example/peripheral/dma/gdma/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -193,77 +194,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
#define CONFIG_FREERTOS_USE_FGDMA
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/gpio/configs/pd2308_aarch64_demo_gpio.config b/example/peripheral/gpio/configs/pd2308_aarch64_demo_gpio.config
new file mode 100644
index 0000000000000000000000000000000000000000..250802dabfe80c7be4b8316efbebccb4bc9f52b5
--- /dev/null
+++ b/example/peripheral/gpio/configs/pd2308_aarch64_demo_gpio.config
@@ -0,0 +1,10 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="gpio"
+CONFIG_LOG_EXTRA_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_USE_GPIO=y
+CONFIG_ENABLE_FGPIO=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LETTER_SHELL=y
diff --git a/example/peripheral/gpio/makefile b/example/peripheral/gpio/makefile
index 7d8648d56925028498d523ada5d575ee23f46f24..6278cdf4569531b8b24edd2b2ce1815436738b28 100644
--- a/example/peripheral/gpio/makefile
+++ b/example/peripheral/gpio/makefile
@@ -28,4 +28,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/gpio/sdkconfig b/example/peripheral/gpio/sdkconfig
index 57aa47d2caab96f02743f36e0297e5625a605941..b00f9d3ed27b8a17bc34128ff43b78240ea97d3b 100644
--- a/example/peripheral/gpio/sdkconfig
+++ b/example/peripheral/gpio/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -213,90 +214,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/gpio/sdkconfig.h b/example/peripheral/gpio/sdkconfig.h
index 6f4a862aa55de390ca360dfca4e8b78bfaba9f2f..41163925d564f3b817b2d9e63cdf84887054493f 100644
--- a/example/peripheral/gpio/sdkconfig.h
+++ b/example/peripheral/gpio/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -192,77 +193,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/gpio/src/gpio_intr_example.c b/example/peripheral/gpio/src/gpio_intr_example.c
index 9f20d0a8139ac8cf0d5e17a19ce7c8ae295f7f41..e10465ec9c6f38439cfc780603e390dbbb06f84c 100644
--- a/example/peripheral/gpio/src/gpio_intr_example.c
+++ b/example/peripheral/gpio/src/gpio_intr_example.c
@@ -52,6 +52,9 @@ static const u32 output_pin_index = FGPIO_ID(FGPIO_CTRL_4, FGPIO_PIN_13);
#elif defined(CONFIG_E2000D_DEMO_BOARD) || defined(CONFIG_E2000Q_DEMO_BOARD)
static const u32 input_pin_index = FGPIO_ID(FGPIO_CTRL_4, FGPIO_PIN_11);
static const u32 output_pin_index = FGPIO_ID(FGPIO_CTRL_4, FGPIO_PIN_12);
+#elif defined(CONFIG_PD2308_DEMO_BOARD)
+static const u32 input_pin_index = FGPIO_ID(FGPIO_CTRL_0, FGPIO_PIN_8);
+static const u32 output_pin_index = FGPIO_ID(FGPIO_CTRL_0, FGPIO_PIN_10);
#elif defined(CONFIG_D2000_TEST_BOARD)
static const u32 input_pin_index = FGPIO_ID(FGPIO_CTRL_1, FGPIO_PORT_A, FGPIO_PIN_6);
static const u32 output_pin_index = FGPIO_ID(FGPIO_CTRL_1, FGPIO_PORT_A, FGPIO_PIN_7);
diff --git a/example/peripheral/i2c/configs/pd2308_aarch64_demo_i2c.config b/example/peripheral/i2c/configs/pd2308_aarch64_demo_i2c.config
new file mode 100644
index 0000000000000000000000000000000000000000..9745ef92869b4ce847149a5e2e3e303364aace8a
--- /dev/null
+++ b/example/peripheral/i2c/configs/pd2308_aarch64_demo_i2c.config
@@ -0,0 +1,13 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="i2c"
+CONFIG_ENABLE_IOPAD=y
+CONFIG_USE_I2C=y
+CONFIG_USE_FI2C=y
+CONFIG_USE_MIO=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_FREERTOS_USE_I2C=y
+CONFIG_FREERTOS_USE_MIO=y
+CONFIG_USE_LETTER_SHELL=y
+# CONFIG_USE_TLSF is not set
diff --git a/example/peripheral/i2c/makefile b/example/peripheral/i2c/makefile
index 489905c0bbeddfe5eba54d17df92580afdee6b8b..2a6b70c3a0da8219d6bc17b4ac5f507d3f21ce4e 100644
--- a/example/peripheral/i2c/makefile
+++ b/example/peripheral/i2c/makefile
@@ -13,6 +13,10 @@ ifdef CONFIG_FIREFLY_DEMO_BOARD
USER_CSRC += src/i2c_ms_example.c
endif
+ifdef CONFIG_PD2308_DEMO_BOARD
+USER_CSRC += src/i2c_ms_example.c
+endif
+
ifdef CONFIG_E2000Q_DEMO_BOARD
USER_CSRC += src/i2c_rtc_example.c
endif
@@ -40,4 +44,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/i2c/sdkconfig b/example/peripheral/i2c/sdkconfig
index 295f78b26d3c822f9a8f20fda9995330021dd65a..00ff4d78707b310546410baf12cc4404a2853816 100644
--- a/example/peripheral/i2c/sdkconfig
+++ b/example/peripheral/i2c/sdkconfig
@@ -39,8 +39,12 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
# CONFIG_USE_MSDF is not set
# end of multi-core system deployment framework
+CONFIG_MMU_PAGE_SIZE_4K=y
+# CONFIG_MMU_PAGE_SIZE_16K is not set
+# CONFIG_MMU_PAGE_SIZE_64K is not set
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -53,6 +57,7 @@ CONFIG_TARGET_PHYTIUMPI=y
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
+# CONFIG_TARGET_PS2316 is not set
# CONFIG_TARGET_QEMU_VIRT is not set
CONFIG_SOC_NAME="phytiumpi"
CONFIG_SOC_CORE_NUM=4
@@ -108,6 +113,8 @@ CONFIG_LOG_ERROR=y
# CONFIG_LOG_EXTRA_INFO is not set
# CONFIG_LOG_DISPALY_CORE_NUM is not set
# CONFIG_BOOTUP_DEBUG_PRINTS is not set
+CONFIG_USE_NS_GTIMER=y
+# CONFIG_USE_VIRTUAL_GTIMER is not set
CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y
CONFIG_INTERRUPT_ROLE_MASTER=y
# CONFIG_INTERRUPT_ROLE_SLAVE is not set
@@ -220,90 +227,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
CONFIG_FREERTOS_USE_I2C=y
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
CONFIG_FREERTOS_USE_MIO=y
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/i2c/sdkconfig.h b/example/peripheral/i2c/sdkconfig.h
index f5a0093201441015d46bf07dd1a33935a7f4ceb0..5767c6f8643fad32e85166e6ba12f4deb5caf32c 100644
--- a/example/peripheral/i2c/sdkconfig.h
+++ b/example/peripheral/i2c/sdkconfig.h
@@ -36,8 +36,12 @@
/* CONFIG_USE_MSDF is not set */
/* end of multi-core system deployment framework */
+#define CONFIG_MMU_PAGE_SIZE_4K
+/* CONFIG_MMU_PAGE_SIZE_16K is not set */
+/* CONFIG_MMU_PAGE_SIZE_64K is not set */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -49,6 +53,7 @@
/* CONFIG_TARGET_FT2004 is not set */
/* CONFIG_TARGET_D2000 is not set */
/* CONFIG_TARGET_PD2308 is not set */
+/* CONFIG_TARGET_PS2316 is not set */
/* CONFIG_TARGET_QEMU_VIRT is not set */
#define CONFIG_SOC_NAME "phytiumpi"
#define CONFIG_SOC_CORE_NUM 4
@@ -99,6 +104,8 @@
/* CONFIG_LOG_EXTRA_INFO is not set */
/* CONFIG_LOG_DISPALY_CORE_NUM is not set */
/* CONFIG_BOOTUP_DEBUG_PRINTS is not set */
+#define CONFIG_USE_NS_GTIMER
+/* CONFIG_USE_VIRTUAL_GTIMER is not set */
#define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG
#define CONFIG_INTERRUPT_ROLE_MASTER
/* CONFIG_INTERRUPT_ROLE_SLAVE is not set */
@@ -197,77 +204,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
#define CONFIG_FREERTOS_USE_I2C
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
#define CONFIG_FREERTOS_USE_MIO
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/i2c/src/i2c_ms_example.c b/example/peripheral/i2c/src/i2c_ms_example.c
index 2b614e33a9f38e047b684755a82bd7e52af81a65..50a5fec8d17f155eac21d8169d27ab173ca76be6 100644
--- a/example/peripheral/i2c/src/i2c_ms_example.c
+++ b/example/peripheral/i2c/src/i2c_ms_example.c
@@ -41,8 +41,13 @@
#define FI2C_DEBUG(format, ...) FT_DEBUG_PRINT_D(FI2C_DEBUG_TAG, format, ##__VA_ARGS__)
#if defined(CONFIG_FIREFLY_DEMO_BOARD)
-#define I2C_MS_TEST_MASTER_DEVICE FMIO1_ID
-#define I2C_MS_TEST_SLAVE_DEVICE FMIO2_ID
+ #define I2C_USE_MIO
+ #define I2C_MS_TEST_MASTER_ID FMIO1_ID
+ #define I2C_MS_TEST_SLAVE_ID FMIO2_ID
+#elif defined(CONFIG_PD2308_DEMO_BOARD)
+ #define I2C_USE_CONTROLLER
+ #define I2C_MS_TEST_MASTER_ID FI2C0_ID
+ #define I2C_MS_TEST_SLAVE_ID FI2C1_ID
#endif
/* write and read task delay in milliseconds */
@@ -370,8 +375,9 @@ static FError I2cWrite(FFreeRTOSI2c *os_i2c_write_p)
static FError FFreeRTOSI2cInitSet(uint32_t id, uint32_t work_mode, uint32_t slave_address)
{
FError ret = FREERTOS_I2C_SUCCESS;
-
+#ifdef I2C_USE_MIO
FIOPadSetMioMux(id);
+#endif
/* init i2c controller */
if (work_mode == FI2C_MASTER) /* 主机初始化默认使用poll模式 */
{
@@ -423,7 +429,7 @@ static void FFreeRTOSI2cLoopbackTask(void *pvParameters)
BaseType_t xReturn = pdPASS;
int task_res = I2C_MS_TEST_SUCCESS;
FIOMuxInit();
- ret = FFreeRTOSI2cInitSet(I2C_MS_TEST_SLAVE_DEVICE, FI2C_SLAVE, MASTER_SLAVE_ADDR);
+ ret = FFreeRTOSI2cInitSet(I2C_MS_TEST_SLAVE_ID, FI2C_SLAVE, MASTER_SLAVE_ADDR);
if (ret != FREERTOS_I2C_SUCCESS)
{
FI2C_ERROR("I2c FFreeRTOSI2cInitSet failed.\r\n");
@@ -431,7 +437,7 @@ static void FFreeRTOSI2cLoopbackTask(void *pvParameters)
goto task_exit;
}
- ret = FFreeRTOSI2cInitSet(I2C_MS_TEST_MASTER_DEVICE, FI2C_MASTER, MASTER_SLAVE_ADDR);
+ ret = FFreeRTOSI2cInitSet(I2C_MS_TEST_MASTER_ID, FI2C_MASTER, MASTER_SLAVE_ADDR);
if (ret != FREERTOS_I2C_SUCCESS)
{
FI2C_ERROR("I2c FFreeRTOSI2cInitSet failed.\r\n");
diff --git a/example/peripheral/i2c/src/i2c_rtc_example.c b/example/peripheral/i2c/src/i2c_rtc_example.c
index 607496d2b875ec37f6f47c9fec9182dd511df0fc..fb73e16f382ca2699f33e8132d7483449fe89790 100644
--- a/example/peripheral/i2c/src/i2c_rtc_example.c
+++ b/example/peripheral/i2c/src/i2c_rtc_example.c
@@ -66,7 +66,7 @@
#define DAT_LENGTH 15
static char data_r0[DAT_LENGTH];
-#define TIMER_OUT (pdMS_TO_TICKS(5000UL))
+#define TIMER_OUT (pdMS_TO_TICKS(8000UL))
enum
{
I2C_RTC_TEST_SUCCESS = 0,
@@ -358,7 +358,7 @@ static void FFreeRTOSI2cRtcTask(void *pvParameters)
task_res = I2C_RTC_WRITE_FAILURE;
goto task_exit;
}
- for (int i = 0; i < 2; i++)
+ for (int i = 0; i < 5; i++)
{
ret = I2cRead(os_i2c_master);
if (ret != FREERTOS_I2C_SUCCESS)
diff --git a/example/peripheral/i2s/README.md b/example/peripheral/i2s/README.md
index 944eced906eb914aa3bf7411e76c764f5f70c5e1..725bbefbf9deade53f9fa55218ff43bd6e08a776 100644
--- a/example/peripheral/i2s/README.md
+++ b/example/peripheral/i2s/README.md
@@ -70,7 +70,7 @@ E2000Q对应的配置项是:
- 在host侧完成配置
>配置成E2000D,对于其它平台,使用对应的默认配置,如E2000d 32位:
```
-$ make load_kconfigl = e2000d_aarch32_demo_i2s
+$ make load_kconfig = e2000d_aarch32_demo_i2s
```
- 在host侧完成构建
@@ -104,7 +104,7 @@ bootelf -p 0x90100000
- 使用E2000 demo板测试时,使用命令:
```
-i2s init
+i2s example
```
@@ -121,4 +121,4 @@ i2s init
>记录例程的重大修改记录,标明修改发生的版本号
-v0.1.0 初次合入i2s example
\ No newline at end of file
+v0.1.0 初次合入i2s example
diff --git a/example/peripheral/i2s/makefile b/example/peripheral/i2s/makefile
index 7d8648d56925028498d523ada5d575ee23f46f24..6278cdf4569531b8b24edd2b2ce1815436738b28 100644
--- a/example/peripheral/i2s/makefile
+++ b/example/peripheral/i2s/makefile
@@ -28,4 +28,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/i2s/sdkconfig b/example/peripheral/i2s/sdkconfig
index 200861bbd2b63543fb6633a56a86da3ebaaff68c..3042ed1884fb6f83c60a982322dce4eb91b2f510 100644
--- a/example/peripheral/i2s/sdkconfig
+++ b/example/peripheral/i2s/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_BOOT_WITH_FLUSH_CACHE=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -231,90 +232,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
CONFIG_FREERTOS_USE_FDDMA=y
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
CONFIG_FREERTOS_USE_I2C=y
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
CONFIG_FREERTOS_USE_MIO=y
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
CONFIG_FREERTOS_USE_I2S=y
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/i2s/sdkconfig.h b/example/peripheral/i2s/sdkconfig.h
index f7dee54261cef1b4094ead613807aecf2b8022c5..07757e62af25b4719235783c5bc62dbc063210e9 100644
--- a/example/peripheral/i2s/sdkconfig.h
+++ b/example/peripheral/i2s/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -206,77 +207,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
#define CONFIG_FREERTOS_USE_FDDMA
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
#define CONFIG_FREERTOS_USE_I2C
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
#define CONFIG_FREERTOS_USE_MIO
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
#define CONFIG_FREERTOS_USE_I2S
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/media/lvgl_demo/makefile b/example/peripheral/media/lvgl_demo/makefile
index c34d5c423429bb4e3011ff5a7d308335e24ccd07..8f04c02504b44f402385fc16133134f8d111f7e2 100644
--- a/example/peripheral/media/lvgl_demo/makefile
+++ b/example/peripheral/media/lvgl_demo/makefile
@@ -28,4 +28,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/media/lvgl_demo/sdkconfig b/example/peripheral/media/lvgl_demo/sdkconfig
index 726e06a11d2c90aa05c12667a8144028c99f3853..816c4ecf6608e841093ee652f573d6245ac6997d 100644
--- a/example/peripheral/media/lvgl_demo/sdkconfig
+++ b/example/peripheral/media/lvgl_demo/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -213,90 +214,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
CONFIG_FREERTOS_USE_MEDIA=y
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/media/lvgl_demo/sdkconfig.h b/example/peripheral/media/lvgl_demo/sdkconfig.h
index b4cdb5e379e84768372eef766f515ce8f5b8d079..d43dff874d616b7a69b81d12a54149506f73a6ed 100644
--- a/example/peripheral/media/lvgl_demo/sdkconfig.h
+++ b/example/peripheral/media/lvgl_demo/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -192,77 +193,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
#define CONFIG_FREERTOS_USE_MEDIA
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/media/lvgl_indev/makefile b/example/peripheral/media/lvgl_indev/makefile
index 11579fd3a6ad29e7dc16b82e2eac1444e0371843..681587e37cb8a2adc896e36036c56f9a99321b9f 100644
--- a/example/peripheral/media/lvgl_indev/makefile
+++ b/example/peripheral/media/lvgl_indev/makefile
@@ -29,4 +29,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/media/lvgl_indev/sdkconfig b/example/peripheral/media/lvgl_indev/sdkconfig
index 41d72167632053a19b4b7e99ba48495c6c0649a3..2d20cd2da2a97cfad5471910efd407745370678d 100644
--- a/example/peripheral/media/lvgl_indev/sdkconfig
+++ b/example/peripheral/media/lvgl_indev/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -213,90 +214,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
CONFIG_FREERTOS_USE_MEDIA=y
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/media/lvgl_indev/sdkconfig.h b/example/peripheral/media/lvgl_indev/sdkconfig.h
index f869c42d60774a673c52be0d5b64483b5ead4f64..8bc4c7c7c8851ce921bb073f1593e60f061308ef 100644
--- a/example/peripheral/media/lvgl_indev/sdkconfig.h
+++ b/example/peripheral/media/lvgl_indev/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -192,77 +193,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
#define CONFIG_FREERTOS_USE_MEDIA
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/media/lvgl_ui/makefile b/example/peripheral/media/lvgl_ui/makefile
index ff678fc9627d60e8dd977fcc6ca1830e52ccbec1..19fd8ff42f59b2097918afcd78c62f26b6ec24c8 100644
--- a/example/peripheral/media/lvgl_ui/makefile
+++ b/example/peripheral/media/lvgl_ui/makefile
@@ -32,4 +32,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/media/lvgl_ui/sdkconfig b/example/peripheral/media/lvgl_ui/sdkconfig
index 41d72167632053a19b4b7e99ba48495c6c0649a3..2d20cd2da2a97cfad5471910efd407745370678d 100644
--- a/example/peripheral/media/lvgl_ui/sdkconfig
+++ b/example/peripheral/media/lvgl_ui/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -213,90 +214,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
CONFIG_FREERTOS_USE_MEDIA=y
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/media/lvgl_ui/sdkconfig.h b/example/peripheral/media/lvgl_ui/sdkconfig.h
index f869c42d60774a673c52be0d5b64483b5ead4f64..8bc4c7c7c8851ce921bb073f1593e60f061308ef 100644
--- a/example/peripheral/media/lvgl_ui/sdkconfig.h
+++ b/example/peripheral/media/lvgl_ui/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -192,77 +193,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
#define CONFIG_FREERTOS_USE_MEDIA
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/media/media_test/makefile b/example/peripheral/media/media_test/makefile
index 11579fd3a6ad29e7dc16b82e2eac1444e0371843..681587e37cb8a2adc896e36036c56f9a99321b9f 100644
--- a/example/peripheral/media/media_test/makefile
+++ b/example/peripheral/media/media_test/makefile
@@ -29,4 +29,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/media/media_test/sdkconfig b/example/peripheral/media/media_test/sdkconfig
index fe4ecbd2e67ac3e379c3f2fdfefca90169f7618c..97db47c55859fdfe952422adfdee75cbafb57225 100644
--- a/example/peripheral/media/media_test/sdkconfig
+++ b/example/peripheral/media/media_test/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -213,90 +214,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
CONFIG_FREERTOS_USE_MEDIA=y
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/media/media_test/sdkconfig.h b/example/peripheral/media/media_test/sdkconfig.h
index 96ec5d440efb56edabd238d924d85173ff1798f9..a208ee245262e4a8ad3b5d37f1e2192279455b15 100644
--- a/example/peripheral/media/media_test/sdkconfig.h
+++ b/example/peripheral/media/media_test/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -192,77 +193,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
#define CONFIG_FREERTOS_USE_MEDIA
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/pwm/README.md b/example/peripheral/pwm/README.md
index 4c6dac87439b05bb352968ddc3d15807eed4a4b9..85b10baaac5d9c5fa455cfdbaf9df13423dd0aea 100644
--- a/example/peripheral/pwm/README.md
+++ b/example/peripheral/pwm/README.md
@@ -2,7 +2,7 @@
## 1. 例程介绍
-注:E2000共有8个PWM控制器(PWM0~PWM7),每个PWM控制器对应两路CHANNEL
+注:飞腾派有2个PWM控制器,每个PWM控制器对应两路CHANNEL。
PWM单通道测试例程 (pwm_single_channel_example.c)
@@ -35,36 +35,22 @@ PWM双通道测试例程 (pwm_dual_channel_example.c)
本例程需要以下硬件,
-- E2000D/Q demo板,PhytiumPi
+- 飞腾派
- 串口线和串口上位机
- 逻辑分析仪/示波器
- 杜邦线
-### 2.1 硬件配置方法
-
-### 2.1.1 E2000
-- E2000 demo板需外接逻辑分析仪或示波器测试,方法如下
-- 选择控制器PWM2的pwm5_dat_out(CHANNEL1)作为输出,对应开发板上J30引脚3
-
-
+### 2.1 硬件配置方法
-- 上图所示为E2000 J30组引脚,将pwm_out与GND与逻辑分析仪或示波器相连即可
+PhytiumPI: 飞腾派有以下引脚可供PWM使用
-### 2.1.2 PhytiumPi
-- PhytiumPi需外接逻辑分析仪或示波器测试,方法如下
+| **引脚** | **控制器与通道** |
+| :------------: | :--------------------- |
+| J1 PIN_32 | PWM1 channel0 |
-PhytiumPI:飞腾派引出多个引脚可供PWM使用
+GND为J1 PIN_39
-| **引脚** | **控制器与通道** |
-| :----------: | :----------------- |
-| J1 PIN_32 | PWM1 CHANNEL0 |
-| J1 PIN_33 | PWM2 CHANNEL1 |
-| J1 PIN_7 | PWM3 CHANNEL0 |
-| J2 PIN_4 | PWM3 CHANNEL1 |
-| J1 PIN_3 | PWM4 CHANNEL0 |
-| J1 PIN_8 | PWM4 CHANNEL1 |
-| J1 PIN_16 | PWM5 CHANNEL0 |
-| J1 PIN_27 | PWM6 CHANNEL1 |
+使用逻辑分析仪/示波器连接channel引脚和GND,开始测试。
### 2.2 SDK配置方法
@@ -159,6 +145,6 @@ pwm双通道测试对应波形
- 如默认用例无法使用或无波形输出,请根据不同的开发板,修改`pwm_common.h`文件中`PWM_TEST_ID`和`PWM_TEST_CHANNEL`两个宏定义,确保`FIOPadSetPwmMux`引脚复用设置正确
- PWM双通道测试例程,默认使用两个通道观测。
- PWM死区测试例程中,`PWM_TEST_CHANNEL`决定死区输入源,另一个CHANNEL作为输出源。
+- 飞腾派只支持单通道测试。
-- E2000 DEMO V0.8板无法使用PWM4至PWM7,故无法进行本用例
## 4. 修改历史记录
\ No newline at end of file
diff --git a/example/peripheral/pwm/configs/e2000d_aarch32_demo_pwm.config b/example/peripheral/pwm/configs/e2000d_aarch32_demo_pwm.config
deleted file mode 100644
index 9472b007d960310cf6a0b1aa2e01cd19fd7a77bd..0000000000000000000000000000000000000000
--- a/example/peripheral/pwm/configs/e2000d_aarch32_demo_pwm.config
+++ /dev/null
@@ -1,8 +0,0 @@
-CONFIG_ARCH_ARMV8_AARCH32=y
-CONFIG_TARGET_E2000D=y
-CONFIG_TARGET_NAME="pwm"
-CONFIG_LOG_INFO=y
-CONFIG_DEFAULT_LINKER_SCRIPT=y
-CONFIG_IMAGE_MAX_LENGTH=0x2000000
-CONFIG_FREERTOS_USE_PWM=y
-CONFIG_USE_LETTER_SHELL=y
diff --git a/example/peripheral/pwm/configs/e2000q_aarch32_demo_pwm.config b/example/peripheral/pwm/configs/e2000q_aarch32_demo_pwm.config
deleted file mode 100644
index 78613cb8c29360701ca9fb3cdba843440e084780..0000000000000000000000000000000000000000
--- a/example/peripheral/pwm/configs/e2000q_aarch32_demo_pwm.config
+++ /dev/null
@@ -1,7 +0,0 @@
-CONFIG_ARCH_ARMV8_AARCH32=y
-CONFIG_TARGET_NAME="pwm"
-CONFIG_LOG_INFO=y
-CONFIG_DEFAULT_LINKER_SCRIPT=y
-CONFIG_IMAGE_MAX_LENGTH=0x2000000
-CONFIG_FREERTOS_USE_PWM=y
-CONFIG_USE_LETTER_SHELL=y
diff --git a/example/peripheral/pwm/configs/e2000d_aarch64_demo_pwm.config b/example/peripheral/pwm/configs/pd2308_aarch64_demo_pwm.config
similarity index 81%
rename from example/peripheral/pwm/configs/e2000d_aarch64_demo_pwm.config
rename to example/peripheral/pwm/configs/pd2308_aarch64_demo_pwm.config
index 6ba859efe8c390820f47ee211b4f6d0436d8e5b2..fa6c870da3f186bf95a26dde4a020e40df6c2f6e 100644
--- a/example/peripheral/pwm/configs/e2000d_aarch64_demo_pwm.config
+++ b/example/peripheral/pwm/configs/pd2308_aarch64_demo_pwm.config
@@ -1,7 +1,8 @@
# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
-CONFIG_TARGET_E2000D=y
+CONFIG_TARGET_PD2308=y
CONFIG_TARGET_NAME="pwm"
CONFIG_LOG_INFO=y
+CONFIG_ENABLE_IOPAD=y
CONFIG_DEFAULT_LINKER_SCRIPT=y
CONFIG_IMAGE_MAX_LENGTH=0x2000000
CONFIG_FREERTOS_USE_PWM=y
diff --git a/example/peripheral/pwm/inc/pwm_example.h b/example/peripheral/pwm/inc/pwm_example.h
index 2cddea936f3ff4a6fa0ad1208bccacd78d55f3b8..2b94710f5bb4e5e7cacf19ce4d7563363330cea4 100644
--- a/example/peripheral/pwm/inc/pwm_example.h
+++ b/example/peripheral/pwm/inc/pwm_example.h
@@ -35,14 +35,13 @@ extern "C"
/************************** Constant Definitions *****************************/
#if defined(CONFIG_FIREFLY_DEMO_BOARD)
-#define PWM_TEST_ID FPWM3_ID
+#define PWM_TEST_ID FPWM1_ID
#define PWM_TEST_CHANNEL FPWM_CHANNEL_0
#elif defined(CONFIG_PD2308_DEMO_BOARD)
#define PWM_TEST_ID FPWM0_ID
#define PWM_TEST_CHANNEL FPWM_CHANNEL_0
#else
-#define PWM_TEST_ID FPWM2_ID
-#define PWM_TEST_CHANNEL FPWM_CHANNEL_1
+#error "Please select a valid board"
#endif
/* pwm test */
diff --git a/example/peripheral/pwm/main.c b/example/peripheral/pwm/main.c
index a3311d3f44f504c06f23be6ea4050ab7c2076cab..0a645eb1e369fb6f5cb922786ca3884bc14bf457 100644
--- a/example/peripheral/pwm/main.c
+++ b/example/peripheral/pwm/main.c
@@ -35,11 +35,6 @@ void PwmExampleTaskEntry()
{
/* example functions */
FFreeRTOSPwmSingleChannelTaskCreate();
-#ifdef CONFIG_FIREFLY_DEMO_BOARD
- FFreeRTOSPwmDeadBandTaskCreate();
-
- FFreeRTOSPwmDualChannelTaskCreate();
-#endif
/* end flag */
printf("[test_end]\r\n");
vTaskDelete(NULL);
diff --git a/example/peripheral/pwm/makefile b/example/peripheral/pwm/makefile
index 7a07f00face28648bfc3b665864d5d878285e233..780afb005dae03d7110c7ae28d7cc4b0e5b4476f 100644
--- a/example/peripheral/pwm/makefile
+++ b/example/peripheral/pwm/makefile
@@ -10,11 +10,9 @@ USER_CSRC := main.c
USER_CSRC += src/cmd_pwm.c
USER_CSRC += src/pwm_single_channel_example.c
-
-ifdef CONFIG_FIREFLY_DEMO_BOARD
USER_CSRC += src/pwm_dead_band_example.c
USER_CSRC += src/pwm_dual_channel_example.c
-endif
+
USER_ASRC :=
USER_CXXSRC :=
@@ -35,4 +33,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/pwm/sdkconfig b/example/peripheral/pwm/sdkconfig
index e52ec1a7eb9f4f812a089a98b756491aafe316d1..d2134443544ce88af3600a8e9ec631ca5d533270 100644
--- a/example/peripheral/pwm/sdkconfig
+++ b/example/peripheral/pwm/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -219,90 +220,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
CONFIG_FREERTOS_USE_PWM=y
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/pwm/sdkconfig.h b/example/peripheral/pwm/sdkconfig.h
index b0ff9db0dac55b203a1c8cc855bc759c3acb092d..43de9e35f88c80ad1693ee8c0716eeefd6c8e516 100644
--- a/example/peripheral/pwm/sdkconfig.h
+++ b/example/peripheral/pwm/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -196,77 +197,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
#define CONFIG_FREERTOS_USE_PWM
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/pwm/src/cmd_pwm.c b/example/peripheral/pwm/src/cmd_pwm.c
index 1ebfb5971d74008caa691130260109c937503eb6..aaf29ec04545ddf6939a204e2ab6648ed856ecef 100644
--- a/example/peripheral/pwm/src/cmd_pwm.c
+++ b/example/peripheral/pwm/src/cmd_pwm.c
@@ -46,12 +46,10 @@ static void PwmCmdUsage(void)
printf("Usage:\r\n");
printf("pwm single_channel\r\n");
printf("-- run pwm single channel at controller \r\n");
-#ifdef CONFIG_FIREFLY_DEMO_BOARD
printf("pwm dead_band\r\n");
printf("-- run pwm dead band example at controller \r\n");
printf("pwm dual_channel\r\n");
printf("-- run pwm dual channel at controller \r\n");
-#endif
}
static int PwmCmdEntry(int argc, char *argv[])
@@ -68,7 +66,6 @@ static int PwmCmdEntry(int argc, char *argv[])
{
ret = FFreeRTOSPwmSingleChannelTaskCreate();
}
-#ifdef CONFIG_FIREFLY_DEMO_BOARD
if (!strcmp(argv[1], "dead_band"))
{
ret = FFreeRTOSPwmDeadBandTaskCreate();
@@ -78,7 +75,6 @@ static int PwmCmdEntry(int argc, char *argv[])
{
ret = FFreeRTOSPwmDualChannelTaskCreate();
}
-#endif
return ret;
}
diff --git a/example/peripheral/qspi/configs/pd2308_aarch64_demo_qspi.config b/example/peripheral/qspi/configs/pd2308_aarch64_demo_qspi.config
new file mode 100644
index 0000000000000000000000000000000000000000..9edb512ae9c600a4f7f436a69f1082c62b8ba3de
--- /dev/null
+++ b/example/peripheral/qspi/configs/pd2308_aarch64_demo_qspi.config
@@ -0,0 +1,12 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_USE_QSPI_IOPAD=y
+CONFIG_TARGET_NAME="qspi"
+CONFIG_LOG_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_OUTPUT_ASM_DIS=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_FREERTOS_USE_QSPI=y
+CONFIG_USE_LETTER_SHELL=y
+# CONFIG_USE_TLSF is not set
diff --git a/example/peripheral/qspi/makefile b/example/peripheral/qspi/makefile
index d87ae3e2d14a321bf217bcd34152bf218f74e790..cf0a3fdcba13d055f692bcdba22b545e323947be 100644
--- a/example/peripheral/qspi/makefile
+++ b/example/peripheral/qspi/makefile
@@ -28,4 +28,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/qspi/sdkconfig b/example/peripheral/qspi/sdkconfig
index 0e89bb7475c6f53a5fff2c98f1d7a5ce2462da04..1cc8ea518be22fb8cf6062d20382001449df19cf 100644
--- a/example/peripheral/qspi/sdkconfig
+++ b/example/peripheral/qspi/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -219,90 +220,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
CONFIG_FREERTOS_USE_QSPI=y
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/qspi/sdkconfig.h b/example/peripheral/qspi/sdkconfig.h
index 5100ca9259ba3fac46b22757e8fcbd4468998fc8..6573b2ca4cd07b8e8d14441cf79b7f533dfa9cca 100644
--- a/example/peripheral/qspi/sdkconfig.h
+++ b/example/peripheral/qspi/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -196,77 +197,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
#define CONFIG_FREERTOS_USE_QSPI
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/qspi/src/cmd_qspi.c b/example/peripheral/qspi/src/cmd_qspi.c
index f32ae5b0008b4480b3f8a4ce296b9671722809af..ffcbb21100c36f4a959db978a5dbc5b63b1d48fd 100644
--- a/example/peripheral/qspi/src/cmd_qspi.c
+++ b/example/peripheral/qspi/src/cmd_qspi.c
@@ -24,7 +24,6 @@
#include "qspi_example.h"
#include
#include
-#include "projdefs.h"
#include "FreeRTOS.h"
#include "sdkconfig.h"
diff --git a/example/peripheral/sdif/configs/pd2308_aarch64_demo_sdif.config b/example/peripheral/sdif/configs/pd2308_aarch64_demo_sdif.config
new file mode 100644
index 0000000000000000000000000000000000000000..880b13b46f1437a2a684bd333eecad748bb76d56
--- /dev/null
+++ b/example/peripheral/sdif/configs/pd2308_aarch64_demo_sdif.config
@@ -0,0 +1,11 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="sdif"
+CONFIG_LOG_EXTRA_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_USE_SDMMC=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LETTER_SHELL=y
+CONFIG_USE_FSL_SDMMC=y
+CONFIG_FSL_SDMMC_USE_FSDIF=y
diff --git a/example/peripheral/sdif/makefile b/example/peripheral/sdif/makefile
index 3d544850bb7ea391c48aa795e20d7a0e69dcad18..a5c03b828a8bc3671eeeabf523262fdc89e4d07a 100644
--- a/example/peripheral/sdif/makefile
+++ b/example/peripheral/sdif/makefile
@@ -28,4 +28,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/sdif/sdkconfig b/example/peripheral/sdif/sdkconfig
index 73a839cc75e3656ff30e54a8bafb9a4fc7c8d2d4..aeee8b69afc49390a8fa53985e61dc5552a37eeb 100644
--- a/example/peripheral/sdif/sdkconfig
+++ b/example/peripheral/sdif/sdkconfig
@@ -41,27 +41,26 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
# Soc configuration
#
# CONFIG_TARGET_PHYTIUMPI is not set
-CONFIG_TARGET_E2000Q=y
+# CONFIG_TARGET_E2000Q is not set
# CONFIG_TARGET_E2000D is not set
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
-# CONFIG_TARGET_PD2308 is not set
+CONFIG_TARGET_PD2308=y
# CONFIG_TARGET_QEMU_VIRT is not set
-CONFIG_SOC_NAME="e2000"
-CONFIG_TARGET_TYPE_NAME="q"
-CONFIG_SOC_CORE_NUM=4
+CONFIG_SOC_NAME="pd2308"
+CONFIG_SOC_CORE_NUM=8
CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000
CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
-CONFIG_TARGET_E2000=y
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set
@@ -76,11 +75,10 @@ CONFIG_BOARD_NAME="demo"
# CONFIG_USE_CAN_IOPAD is not set
# CONFIG_USE_QSPI_IOPAD is not set
# CONFIG_USE_PWM_IOPAD is not set
-# CONFIG_USE_MIO_IOPAD is not set
# CONFIG_USE_TACHO_IOPAD is not set
# CONFIG_USE_UART_IOPAD is not set
# CONFIG_USE_THIRD_PARTY_IOPAD is not set
-CONFIG_E2000Q_DEMO_BOARD=y
+CONFIG_PD2308_DEMO_BOARD=y
#
# IO mux configuration when board start up
@@ -215,90 +213,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/sdif/sdkconfig.h b/example/peripheral/sdif/sdkconfig.h
index f4057e0b7cda88e74b450486b039ee521e1bda18..5f120eca297fb61d3087f461179676d1ee3ff0c0 100644
--- a/example/peripheral/sdif/sdkconfig.h
+++ b/example/peripheral/sdif/sdkconfig.h
@@ -38,26 +38,25 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
/* CONFIG_TARGET_PHYTIUMPI is not set */
-#define CONFIG_TARGET_E2000Q
+/* CONFIG_TARGET_E2000Q is not set */
/* CONFIG_TARGET_E2000D is not set */
/* CONFIG_TARGET_E2000S is not set */
/* CONFIG_TARGET_FT2004 is not set */
/* CONFIG_TARGET_D2000 is not set */
-/* CONFIG_TARGET_PD2308 is not set */
+#define CONFIG_TARGET_PD2308
/* CONFIG_TARGET_QEMU_VIRT is not set */
-#define CONFIG_SOC_NAME "e2000"
-#define CONFIG_TARGET_TYPE_NAME "q"
-#define CONFIG_SOC_CORE_NUM 4
+#define CONFIG_SOC_NAME "pd2308"
+#define CONFIG_SOC_CORE_NUM 8
#define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000
#define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000
#define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000
#define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000
-#define CONFIG_TARGET_E2000
#define CONFIG_DEFAULT_DEBUG_PRINT_UART1
/* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */
/* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */
@@ -71,11 +70,10 @@
/* CONFIG_USE_CAN_IOPAD is not set */
/* CONFIG_USE_QSPI_IOPAD is not set */
/* CONFIG_USE_PWM_IOPAD is not set */
-/* CONFIG_USE_MIO_IOPAD is not set */
/* CONFIG_USE_TACHO_IOPAD is not set */
/* CONFIG_USE_UART_IOPAD is not set */
/* CONFIG_USE_THIRD_PARTY_IOPAD is not set */
-#define CONFIG_E2000Q_DEMO_BOARD
+#define CONFIG_PD2308_DEMO_BOARD
/* IO mux configuration when board start up */
@@ -194,77 +192,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/sdif/src/sdif_tf_read_write.c b/example/peripheral/sdif/src/sdif_tf_read_write.c
index e59d661ee18d8270f4ddede5a9df30a2381ba215..2d0b687cab62c38f23f50de919eed346072cc292 100644
--- a/example/peripheral/sdif/src/sdif_tf_read_write.c
+++ b/example/peripheral/sdif/src/sdif_tf_read_write.c
@@ -43,10 +43,10 @@
#define FSD_INFO(format, ...) FT_DEBUG_PRINT_I(FSD_EXAMPLE_TAG, format, ##__VA_ARGS__)
#define FSD_DEBUG(format, ...) FT_DEBUG_PRINT_D(FSD_EXAMPLE_TAG, format, ##__VA_ARGS__)
-#ifdef CONFIG_TARGET_PHYTIUMPI
-#define SD_CONTROLLER_ID FSDIO0_ID
+#if defined(CONFIG_FIREFLY_DEMO_BOARD) || defined(CONFIG_PD2308_DEMO_BOARD)
+#define SD_CONTROLLER_ID FSDIF0_ID
#else
-#define SD_CONTROLLER_ID FSDIO1_ID
+#define SD_CONTROLLER_ID FSDIF1_ID
#endif
/* user-define */
@@ -202,7 +202,7 @@ int FFreeRTOSTfWriteRead(void)
memset(&s_inst_config, 0, sizeof(s_inst_config));
memset(&s_inst, 0, sizeof(s_inst));
- s_inst_config.hostId = FSDIF1_ID;
+ s_inst_config.hostId = SD_CONTROLLER_ID;
s_inst_config.hostType = kSDMMCHOST_TYPE_FSDIF;
s_inst_config.cardType = kSDMMCHOST_CARD_TYPE_MICRO_SD;
s_inst_config.enableDMA = SD_WORK_DMA;
diff --git a/example/peripheral/spi/configs/e2000d_aarch32_demo_spi.config b/example/peripheral/spi/configs/e2000d_aarch32_demo_spi.config
index 63644a0a918e67d635116df93c21437bb39f9a4a..49b0e5aaf8a2a30640c6716332773f4ed0cd6a77 100644
--- a/example/peripheral/spi/configs/e2000d_aarch32_demo_spi.config
+++ b/example/peripheral/spi/configs/e2000d_aarch32_demo_spi.config
@@ -8,5 +8,5 @@ CONFIG_FREERTOS_USE_FSPIM=y
CONFIG_USE_LETTER_SHELL=y
CONFIG_USE_SFUD=y
CONFIG_SFUD_CTRL_FSPIM=y
-CONFIG_SFUD_TRANS_MODE_INTRRUPT=y
+CONFIG_SFUD_TRANS_MODE_INTERRUPT=y
CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=11
diff --git a/example/peripheral/spi/configs/e2000d_aarch64_demo_spi.config b/example/peripheral/spi/configs/e2000d_aarch64_demo_spi.config
index 61f546e95aaee17fcb95b73b6ed7a2c9c8285409..e51764a9435574545b15d02baf8286233b77a8e5 100644
--- a/example/peripheral/spi/configs/e2000d_aarch64_demo_spi.config
+++ b/example/peripheral/spi/configs/e2000d_aarch64_demo_spi.config
@@ -9,5 +9,5 @@ CONFIG_FREERTOS_USE_FSPIM=y
CONFIG_USE_LETTER_SHELL=y
CONFIG_USE_SFUD=y
CONFIG_SFUD_CTRL_FSPIM=y
-CONFIG_SFUD_TRANS_MODE_INTRRUPT=y
+CONFIG_SFUD_TRANS_MODE_INTERRUPT=y
CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=11
diff --git a/example/peripheral/spi/configs/e2000q_aarch32_demo_spi.config b/example/peripheral/spi/configs/e2000q_aarch32_demo_spi.config
index 60218a475e9f4edd873e0dd5cbfa751fb872dd5d..d5344fba4cbee140a07574aa558169d9b7df1eb1 100644
--- a/example/peripheral/spi/configs/e2000q_aarch32_demo_spi.config
+++ b/example/peripheral/spi/configs/e2000q_aarch32_demo_spi.config
@@ -7,5 +7,5 @@ CONFIG_FREERTOS_USE_FSPIM=y
CONFIG_USE_LETTER_SHELL=y
CONFIG_USE_SFUD=y
CONFIG_SFUD_CTRL_FSPIM=y
-CONFIG_SFUD_TRANS_MODE_INTRRUPT=y
+CONFIG_SFUD_TRANS_MODE_INTERRUPT=y
CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=11
diff --git a/example/peripheral/spi/configs/e2000q_aarch64_demo_spi.config b/example/peripheral/spi/configs/e2000q_aarch64_demo_spi.config
index fc7556650fbd75e56fb72290ee1b4728a0706336..212ace78334cca3488a0272e890d5dc49e7e36c0 100644
--- a/example/peripheral/spi/configs/e2000q_aarch64_demo_spi.config
+++ b/example/peripheral/spi/configs/e2000q_aarch64_demo_spi.config
@@ -7,5 +7,5 @@ CONFIG_FREERTOS_USE_FSPIM=y
CONFIG_USE_LETTER_SHELL=y
CONFIG_USE_SFUD=y
CONFIG_SFUD_CTRL_FSPIM=y
-CONFIG_SFUD_TRANS_MODE_INTRRUPT=y
+CONFIG_SFUD_TRANS_MODE_INTERRUPT=y
CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=11
diff --git a/example/peripheral/spi/configs/pd2308_aarch64_demo_spi.config b/example/peripheral/spi/configs/pd2308_aarch64_demo_spi.config
new file mode 100644
index 0000000000000000000000000000000000000000..95bb7d496eec7d3fd9bdfddedfdedaec2966cd2c
--- /dev/null
+++ b/example/peripheral/spi/configs/pd2308_aarch64_demo_spi.config
@@ -0,0 +1,14 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="spi"
+CONFIG_LOG_EXTRA_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_STACK_SIZE=0x100000
+CONFIG_FREERTOS_USE_FSPIM=y
+CONFIG_USE_LETTER_SHELL=y
+CONFIG_USE_SFUD=y
+CONFIG_SFUD_CTRL_FSPIM=y
+CONFIG_SFUD_TRANS_MODE_INTERRUPT=y
+CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=11
diff --git a/example/peripheral/spi/configs/phytiumpi_aarch32_firefly_spi.config b/example/peripheral/spi/configs/phytiumpi_aarch32_firefly_spi.config
index e79600d781d819bb37ca5383433f9858bff60898..e7e7d02b94b64af9482dc64ea1f67ccce515864f 100644
--- a/example/peripheral/spi/configs/phytiumpi_aarch32_firefly_spi.config
+++ b/example/peripheral/spi/configs/phytiumpi_aarch32_firefly_spi.config
@@ -8,5 +8,5 @@ CONFIG_FREERTOS_USE_FSPIM=y
CONFIG_USE_LETTER_SHELL=y
CONFIG_USE_SFUD=y
CONFIG_SFUD_CTRL_FSPIM=y
-CONFIG_SFUD_TRANS_MODE_INTRRUPT=y
+CONFIG_SFUD_TRANS_MODE_INTERRUPT=y
CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=11
diff --git a/example/peripheral/spi/configs/phytiumpi_aarch64_firefly_spi.config b/example/peripheral/spi/configs/phytiumpi_aarch64_firefly_spi.config
index 5f65de2cd7f783c8830cedd83aca8c5a6b3865d9..a6e2260af3a588d76b889082f422158b0877e94f 100644
--- a/example/peripheral/spi/configs/phytiumpi_aarch64_firefly_spi.config
+++ b/example/peripheral/spi/configs/phytiumpi_aarch64_firefly_spi.config
@@ -8,5 +8,5 @@ CONFIG_FREERTOS_USE_FSPIM=y
CONFIG_USE_LETTER_SHELL=y
CONFIG_USE_SFUD=y
CONFIG_SFUD_CTRL_FSPIM=y
-CONFIG_SFUD_TRANS_MODE_INTRRUPT=y
+CONFIG_SFUD_TRANS_MODE_INTERRUPT=y
CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=11
diff --git a/example/peripheral/spi/inc/sfud_read_write.h b/example/peripheral/spi/inc/sfud_read_write.h
index ecb0e06376d617734005dee4e44ef953abf1e270..aab0bb834c2b991cdfac31bb082c99474674512a 100644
--- a/example/peripheral/spi/inc/sfud_read_write.h
+++ b/example/peripheral/spi/inc/sfud_read_write.h
@@ -33,7 +33,7 @@ extern "C"
#endif
#if defined(CONFIG_E2000Q_DEMO_BOARD) || defined(CONFIG_E2000D_DEMO_BOARD)
#define SFUD_FLASH_INDEX SFUD_FSPIM2_INDEX
-#elif defined (CONFIG_FIREFLY_DEMO_BOARD)
+#else
#define SFUD_FLASH_INDEX SFUD_FSPIM0_INDEX
#endif
/***************************** Include Files *********************************/
diff --git a/example/peripheral/spi/makefile b/example/peripheral/spi/makefile
index 92052c5942e04b8e61860dc5c8bbbefca925ff93..a62d02e6afecfccd90a9af2bdd1715fcb5bcb370 100644
--- a/example/peripheral/spi/makefile
+++ b/example/peripheral/spi/makefile
@@ -29,4 +29,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/spi/sdkconfig b/example/peripheral/spi/sdkconfig
index cbee4cfc196c2c0dc9af6a0ff7629679e0c3b4e9..cea2a3020c401b67123aded283f043bc4e60ccfa 100644
--- a/example/peripheral/spi/sdkconfig
+++ b/example/peripheral/spi/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -213,90 +214,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
CONFIG_FREERTOS_USE_FSPIM=y
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
@@ -326,7 +327,7 @@ CONFIG_USE_SFUD=y
#
CONFIG_SFUD_CTRL_FSPIM=y
# CONFIG_SFUD_TRANS_MODE_POLL_FIFO is not set
-CONFIG_SFUD_TRANS_MODE_INTRRUPT=y
+CONFIG_SFUD_TRANS_MODE_INTERRUPT=y
# CONFIG_SFUD_TRANS_MODE_DDMA is not set
# CONFIG_SFUD_CTRL_FQSPI is not set
# end of Sfud configuration
diff --git a/example/peripheral/spi/sdkconfig.h b/example/peripheral/spi/sdkconfig.h
index 1d8680bb364c21d873e098d2f50968fb1369171b..8e9beeaf6c78bc2be0c9fa70282401ba57d7e2fb 100644
--- a/example/peripheral/spi/sdkconfig.h
+++ b/example/peripheral/spi/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -192,77 +193,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
#define CONFIG_FREERTOS_USE_FSPIM
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
@@ -288,7 +289,7 @@
#define CONFIG_SFUD_CTRL_FSPIM
/* CONFIG_SFUD_TRANS_MODE_POLL_FIFO is not set */
-#define CONFIG_SFUD_TRANS_MODE_INTRRUPT
+#define CONFIG_SFUD_TRANS_MODE_INTERRUPT
/* CONFIG_SFUD_TRANS_MODE_DDMA is not set */
/* CONFIG_SFUD_CTRL_FQSPI is not set */
/* end of Sfud configuration */
diff --git a/example/peripheral/timer_tacho/README.md b/example/peripheral/timer_tacho/README.md
index c5b46d3ea1d0077fa8a7d6dd022e941bfa13cc2c..aba33a1d531b99b4f583d6467ea0707bb03f7b99 100644
--- a/example/peripheral/timer_tacho/README.md
+++ b/example/peripheral/timer_tacho/README.md
@@ -4,36 +4,37 @@
本例程示范了freertos环境下的timer、tacho和capture的使用,包括timer控制器的初始化、定时、信号捕捉操作;
程序启动后,创建timer、tacho或capture(两者使用同一IO,默认tacho,若想使用capture功能,则参照tacho测试步骤初始化即可)任务,分别测试定时功能,采样转换功能,以及脉冲计数触发功能;
-例程仅仅支持E2000上使用;
-E2000DQ上使用的demo板上的 PWM-IN12(tacho—in12) 进行测试。
-
+本测试例程使用飞腾派的TACH1进行测试。
## 2. 如何使用例程
本例程需要用到
-- Phytium开发板(E2000DQ of demo板)
+- 飞腾派
- [Phytium FreeRTOS SDK](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk)
- [Phytium standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk)
### 2.1 硬件配置方法
本例程支持的硬件平台包括
-- E2000DQ demo开发板
- PhytiumPi 开发板
对应的配置项是
-- CONFIG_TARGET_E2000D、 CONFIG_TARGET_E2000Q
- CONFIG_TARGET_PHYTIUMPI
### 2.1.1 硬件连线
-- E2000 pwm_in12使用1KHz的方波,也即J30上,右内侧第三脚接入示波器或其他信号源方波信号,如下图所示
+- 本测试可使用示波器的方波作为pwm输入,来验证功能的正确性
+- 如下图所示,右下角为示波器方波输出端口
+ 
+- PhytiumPI: 飞腾派有以下引脚可供TACH使用
-
+| **引脚** | **通道** |
+| :------------: | :------------- |
+| J1 PIN_22 | TACH1 |
-- PHYTIUMPI 硬件连线
+GND为J1 PIN_39
-
+示波器的方波输出端口连接飞腾派的J1 PIN_22,示波器的GND连接飞腾派的J1 PIN_39,开始测试。
### 2.2 SDK配置方法
@@ -60,13 +61,13 @@ E2000DQ上使用的demo板上的 PWM-IN12(tacho—in12) 进行测试。
#### 2.3.1 构建过程
-本文档将以E2000Ddemo开发板为例,对于其它平台,使用对应的默认配置
+本文档将以飞腾派为例,对于其它平台,使用对应的默认配置
- 在host端完成配置
- 选择目标平台
```
-make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_timer
+make load_kconfig LOAD_CONFIG_NAME=pd2308_aarch64_demo_tacho
```
- 选择例程需要的配置
@@ -105,11 +106,9 @@ bootelf -p 0x90100000
- 系统进入后,创建timer初始化任务,创建tacho初始化任务,注册中断服务函数,创建两个功能的任务函数。
-- E2000
-
-
+- 飞腾派
-
+
- 图中我们使用timer id 0 作为定时器任务的控制器,time in 的数字表示进入循环定时中断服务的次数。
- RPM表示转速
@@ -118,7 +117,6 @@ bootelf -p 0x90100000
- 若出现风扇中断异常,需确认连接是否正确,确保风扇波形不低于报警中断的最低设置转速。
-- 由于timer控制器的数量远多余pwm_in IO口数值,所以尽量使用id 15后面的定时控制器来做普通定时器。
## 4. 修改历史记录
v0.1.0 init
diff --git a/example/peripheral/timer_tacho/configs/e2000d_aarch32_demo_timer.config b/example/peripheral/timer_tacho/configs/e2000d_aarch32_demo_timer.config
deleted file mode 100644
index d61cbfdabf8c2f464c01c535174d923631ccab92..0000000000000000000000000000000000000000
--- a/example/peripheral/timer_tacho/configs/e2000d_aarch32_demo_timer.config
+++ /dev/null
@@ -1,10 +0,0 @@
-CONFIG_ARCH_ARMV8_AARCH32=y
-CONFIG_TARGET_E2000D=y
-CONFIG_TARGET_NAME="timer"
-CONFIG_USE_TIMER=y
-CONFIG_ENABLE_TIMER_TACHO=y
-CONFIG_DEFAULT_LINKER_SCRIPT=y
-CONFIG_IMAGE_MAX_LENGTH=0x2000000
-CONFIG_FREERTOS_USE_TIMER=y
-CONFIG_USE_LETTER_SHELL=y
-# CONFIG_USE_TLSF is not set
diff --git a/example/peripheral/timer_tacho/configs/e2000q_aarch32_demo_timer.config b/example/peripheral/timer_tacho/configs/e2000q_aarch32_demo_timer.config
deleted file mode 100644
index f788b3e502fdaf2dacb3287285e96ac15e6716a6..0000000000000000000000000000000000000000
--- a/example/peripheral/timer_tacho/configs/e2000q_aarch32_demo_timer.config
+++ /dev/null
@@ -1,9 +0,0 @@
-CONFIG_ARCH_ARMV8_AARCH32=y
-CONFIG_TARGET_NAME="timer"
-CONFIG_USE_TIMER=y
-CONFIG_ENABLE_TIMER_TACHO=y
-CONFIG_DEFAULT_LINKER_SCRIPT=y
-CONFIG_IMAGE_MAX_LENGTH=0x2000000
-CONFIG_FREERTOS_USE_TIMER=y
-CONFIG_USE_LETTER_SHELL=y
-# CONFIG_USE_TLSF is not set
diff --git a/example/peripheral/timer_tacho/configs/e2000d_aarch64_demo_timer.config b/example/peripheral/timer_tacho/configs/pd2308_aarch64_demo_timer.config
similarity index 85%
rename from example/peripheral/timer_tacho/configs/e2000d_aarch64_demo_timer.config
rename to example/peripheral/timer_tacho/configs/pd2308_aarch64_demo_timer.config
index 9f4d63d742192fe92ad55494b24ce15f5034b28a..f5efde330721892870aadbadbc5b541c2688793b 100644
--- a/example/peripheral/timer_tacho/configs/e2000d_aarch64_demo_timer.config
+++ b/example/peripheral/timer_tacho/configs/pd2308_aarch64_demo_timer.config
@@ -1,6 +1,7 @@
# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
-CONFIG_TARGET_E2000D=y
+CONFIG_TARGET_PD2308=y
CONFIG_TARGET_NAME="timer"
+CONFIG_ENABLE_IOPAD=y
CONFIG_USE_TIMER=y
CONFIG_ENABLE_TIMER_TACHO=y
CONFIG_DEFAULT_LINKER_SCRIPT=y
diff --git a/example/peripheral/timer_tacho/figs/oscilloscope.jpg b/example/peripheral/timer_tacho/figs/oscilloscope.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b8289bcb2be9ef710ad5aefccb8c72e056a3973a
Binary files /dev/null and b/example/peripheral/timer_tacho/figs/oscilloscope.jpg differ
diff --git a/example/peripheral/timer_tacho/figs/phytiumpi_tacho.png b/example/peripheral/timer_tacho/figs/phytiumpi_tacho.png
deleted file mode 100644
index 228c8e2eb0b311196031587648c1b63bc0468622..0000000000000000000000000000000000000000
Binary files a/example/peripheral/timer_tacho/figs/phytiumpi_tacho.png and /dev/null differ
diff --git a/example/peripheral/timer_tacho/figs/tacho_hdw.png b/example/peripheral/timer_tacho/figs/tacho_hdw.png
deleted file mode 100644
index e523d350e997be2da72068cecce9130074c4d032..0000000000000000000000000000000000000000
Binary files a/example/peripheral/timer_tacho/figs/tacho_hdw.png and /dev/null differ
diff --git a/example/peripheral/timer_tacho/figs/timer_capture.png b/example/peripheral/timer_tacho/figs/timer_capture.png
deleted file mode 100644
index d46001e2b300e9349737ef3f758cae2d8abe2977..0000000000000000000000000000000000000000
Binary files a/example/peripheral/timer_tacho/figs/timer_capture.png and /dev/null differ
diff --git a/example/peripheral/timer_tacho/figs/timer_tacho.png b/example/peripheral/timer_tacho/figs/timer_tacho.png
index b051cd8463926c73080c003517736243b62ec246..eec54bae9287bcf6ccfb593d959f3d6febb6c01c 100644
Binary files a/example/peripheral/timer_tacho/figs/timer_tacho.png and b/example/peripheral/timer_tacho/figs/timer_tacho.png differ
diff --git a/example/peripheral/timer_tacho/makefile b/example/peripheral/timer_tacho/makefile
index a5c3ae3031f9db19865231d85b7ef6726edd4604..e2680cec37f8c0ef436b3444ddc54454b7c1af10 100644
--- a/example/peripheral/timer_tacho/makefile
+++ b/example/peripheral/timer_tacho/makefile
@@ -29,4 +29,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/timer_tacho/sdkconfig b/example/peripheral/timer_tacho/sdkconfig
index 51c065c58f5970a451c6a2e508c8bafa06e63c58..91e5dabe3133e3be45b5c0121cb5882c4e9982be 100644
--- a/example/peripheral/timer_tacho/sdkconfig
+++ b/example/peripheral/timer_tacho/sdkconfig
@@ -39,8 +39,12 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
# CONFIG_USE_MSDF is not set
# end of multi-core system deployment framework
+CONFIG_MMU_PAGE_SIZE_4K=y
+# CONFIG_MMU_PAGE_SIZE_16K is not set
+# CONFIG_MMU_PAGE_SIZE_64K is not set
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -53,6 +57,7 @@ CONFIG_TARGET_PHYTIUMPI=y
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
+# CONFIG_TARGET_PS2316 is not set
# CONFIG_TARGET_QEMU_VIRT is not set
CONFIG_SOC_NAME="phytiumpi"
CONFIG_SOC_CORE_NUM=4
@@ -108,6 +113,8 @@ CONFIG_LOG_ERROR=y
# CONFIG_LOG_EXTRA_INFO is not set
# CONFIG_LOG_DISPALY_CORE_NUM is not set
# CONFIG_BOOTUP_DEBUG_PRINTS is not set
+CONFIG_USE_NS_GTIMER=y
+# CONFIG_USE_VIRTUAL_GTIMER is not set
CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y
CONFIG_INTERRUPT_ROLE_MASTER=y
# CONFIG_INTERRUPT_ROLE_SLAVE is not set
@@ -219,90 +226,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
CONFIG_FREERTOS_USE_TIMER=y
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/timer_tacho/sdkconfig.h b/example/peripheral/timer_tacho/sdkconfig.h
index e2015a80e3df7a167519e477aadc6780ae2e7b1c..715eceffb8e5f340b2761835a9cee7a910572beb 100644
--- a/example/peripheral/timer_tacho/sdkconfig.h
+++ b/example/peripheral/timer_tacho/sdkconfig.h
@@ -36,8 +36,12 @@
/* CONFIG_USE_MSDF is not set */
/* end of multi-core system deployment framework */
+#define CONFIG_MMU_PAGE_SIZE_4K
+/* CONFIG_MMU_PAGE_SIZE_16K is not set */
+/* CONFIG_MMU_PAGE_SIZE_64K is not set */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -49,6 +53,7 @@
/* CONFIG_TARGET_FT2004 is not set */
/* CONFIG_TARGET_D2000 is not set */
/* CONFIG_TARGET_PD2308 is not set */
+/* CONFIG_TARGET_PS2316 is not set */
/* CONFIG_TARGET_QEMU_VIRT is not set */
#define CONFIG_SOC_NAME "phytiumpi"
#define CONFIG_SOC_CORE_NUM 4
@@ -99,6 +104,8 @@
/* CONFIG_LOG_EXTRA_INFO is not set */
/* CONFIG_LOG_DISPALY_CORE_NUM is not set */
/* CONFIG_BOOTUP_DEBUG_PRINTS is not set */
+#define CONFIG_USE_NS_GTIMER
+/* CONFIG_USE_VIRTUAL_GTIMER is not set */
#define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG
#define CONFIG_INTERRUPT_ROLE_MASTER
/* CONFIG_INTERRUPT_ROLE_SLAVE is not set */
@@ -196,77 +203,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
#define CONFIG_FREERTOS_USE_TIMER
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/timer_tacho/src/timer_tacho_example.c b/example/peripheral/timer_tacho/src/timer_tacho_example.c
index 6817873a96dfbd024c46a43289f8591747900eb4..c1e57ec06a6f9d7ba7ac0c765ea1d048db101876 100644
--- a/example/peripheral/timer_tacho/src/timer_tacho_example.c
+++ b/example/peripheral/timer_tacho/src/timer_tacho_example.c
@@ -38,11 +38,7 @@
/************************** Constant Definitions *****************************/
-#ifdef CONFIG_FIREFLY_DEMO_BOARD
- #define TACHO_INSTANCE_NUM 3U
-#else
- #define TACHO_INSTANCE_NUM 12U
-#endif
+#define TACHO_INSTANCE_NUM 1
#define TIMER_TACHO_TEST_TASK_PRIORITY 3
diff --git a/example/peripheral/usb/pusb2_device/makefile b/example/peripheral/usb/pusb2_device/makefile
index b4c61bdaf7bfaf1dfa6c14ee19b7de4ea3e1fb12..f15f25aae1ecb014ffe8ecb82622cb506a8c4d38 100644
--- a/example/peripheral/usb/pusb2_device/makefile
+++ b/example/peripheral/usb/pusb2_device/makefile
@@ -26,4 +26,5 @@ image: all
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/usb/pusb2_device/sdkconfig b/example/peripheral/usb/pusb2_device/sdkconfig
index cbc5aebcb9fcc9174d746ced985256f8a2302731..a1666f16d3211a9ccd3955fd42ff16b5728d37f9 100644
--- a/example/peripheral/usb/pusb2_device/sdkconfig
+++ b/example/peripheral/usb/pusb2_device/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_BOOT_WITH_FLUSH_CACHE=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -213,90 +214,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/usb/pusb2_device/sdkconfig.h b/example/peripheral/usb/pusb2_device/sdkconfig.h
index d7556c10fd164014f4778ae470c50f3f2775584d..aa396b923c633eb892c37ba5d9ddd80193d10cbd 100644
--- a/example/peripheral/usb/pusb2_device/sdkconfig.h
+++ b/example/peripheral/usb/pusb2_device/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -192,77 +193,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/usb/pusb2_host/makefile b/example/peripheral/usb/pusb2_host/makefile
index fa6e0111b8f45c7d0ea072b3744b93d611340f03..2312cbd6f2a3ecfb65017182f65111b1fcc919f9 100644
--- a/example/peripheral/usb/pusb2_host/makefile
+++ b/example/peripheral/usb/pusb2_host/makefile
@@ -26,4 +26,5 @@ image: all
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/usb/pusb2_host/sdkconfig b/example/peripheral/usb/pusb2_host/sdkconfig
index 92f843a92389bffaa4f3183ad7b310bf9462dba1..0f26cafecfb2535fce16d4091fff08611ca09e46 100644
--- a/example/peripheral/usb/pusb2_host/sdkconfig
+++ b/example/peripheral/usb/pusb2_host/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_BOOT_WITH_FLUSH_CACHE=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +213,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/usb/pusb2_host/sdkconfig.h b/example/peripheral/usb/pusb2_host/sdkconfig.h
index d4b203dc246faedc77a55e8732e972c9ed2469d1..08eceffa83ad807de46363a494f78330f33a5d37 100644
--- a/example/peripheral/usb/pusb2_host/sdkconfig.h
+++ b/example/peripheral/usb/pusb2_host/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +192,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/usb/xhci_pcie/configs/pd2308_aarch64_demo_cherry_usb.config b/example/peripheral/usb/xhci_pcie/configs/pd2308_aarch64_demo_cherry_usb.config
new file mode 100644
index 0000000000000000000000000000000000000000..2bb8a6df24e665be93e1ab181a6878eedd149bde
--- /dev/null
+++ b/example/peripheral/usb/xhci_pcie/configs/pd2308_aarch64_demo_cherry_usb.config
@@ -0,0 +1,16 @@
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="cherry_usb"
+CONFIG_LOG_EXTRA_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_USE_PCIE=y
+CONFIG_ENABLE_FPCIE_ECAM=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_FRAME_POINTER=y
+CONFIG_OUTPUT_ASM_DIS=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LETTER_SHELL=y
+CONFIG_USE_CHERRY_USB=y
+CONFIG_CHERRY_USB_PORT_XHCI_PCIE=y
+CONFIG_CHERRY_USB_HOST_MSC=y
+CONFIG_CHERRY_USB_HOST_HID=y
diff --git a/example/peripheral/usb/xhci_pcie/makefile b/example/peripheral/usb/xhci_pcie/makefile
index a12ccba8ec27bf8f6fbde4a1138f59f9df72b911..eb5408492fdd6c40e124f1fa8c9c082b6dcf71dd 100644
--- a/example/peripheral/usb/xhci_pcie/makefile
+++ b/example/peripheral/usb/xhci_pcie/makefile
@@ -29,4 +29,5 @@ image: all
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/usb/xhci_pcie/sdkconfig b/example/peripheral/usb/xhci_pcie/sdkconfig
index a2521f25a1974b48fb830ff9effbece240bfb62d..ee6e122cb9dde243011d52bc49edda046978a9cb 100644
--- a/example/peripheral/usb/xhci_pcie/sdkconfig
+++ b/example/peripheral/usb/xhci_pcie/sdkconfig
@@ -41,27 +41,26 @@ CONFIG_BOOT_WITH_FLUSH_CACHE=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
# Soc configuration
#
# CONFIG_TARGET_PHYTIUMPI is not set
-CONFIG_TARGET_E2000Q=y
+# CONFIG_TARGET_E2000Q is not set
# CONFIG_TARGET_E2000D is not set
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
-# CONFIG_TARGET_PD2308 is not set
+CONFIG_TARGET_PD2308=y
# CONFIG_TARGET_QEMU_VIRT is not set
-CONFIG_SOC_NAME="e2000"
-CONFIG_TARGET_TYPE_NAME="q"
-CONFIG_SOC_CORE_NUM=4
+CONFIG_SOC_NAME="pd2308"
+CONFIG_SOC_CORE_NUM=8
CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000
CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
-CONFIG_TARGET_E2000=y
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set
@@ -76,11 +75,10 @@ CONFIG_BOARD_NAME="demo"
# CONFIG_USE_CAN_IOPAD is not set
# CONFIG_USE_QSPI_IOPAD is not set
# CONFIG_USE_PWM_IOPAD is not set
-# CONFIG_USE_MIO_IOPAD is not set
# CONFIG_USE_TACHO_IOPAD is not set
# CONFIG_USE_UART_IOPAD is not set
# CONFIG_USE_THIRD_PARTY_IOPAD is not set
-CONFIG_E2000Q_DEMO_BOARD=y
+CONFIG_PD2308_DEMO_BOARD=y
#
# IO mux configuration when board start up
@@ -221,90 +219,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/usb/xhci_pcie/sdkconfig.h b/example/peripheral/usb/xhci_pcie/sdkconfig.h
index a4273d5fe21a1fabcb8f54c8a80748a417bde19a..be0170b9b4986abf3cb40ca06b3a4eca7ddad323 100644
--- a/example/peripheral/usb/xhci_pcie/sdkconfig.h
+++ b/example/peripheral/usb/xhci_pcie/sdkconfig.h
@@ -38,26 +38,25 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
/* CONFIG_TARGET_PHYTIUMPI is not set */
-#define CONFIG_TARGET_E2000Q
+/* CONFIG_TARGET_E2000Q is not set */
/* CONFIG_TARGET_E2000D is not set */
/* CONFIG_TARGET_E2000S is not set */
/* CONFIG_TARGET_FT2004 is not set */
/* CONFIG_TARGET_D2000 is not set */
-/* CONFIG_TARGET_PD2308 is not set */
+#define CONFIG_TARGET_PD2308
/* CONFIG_TARGET_QEMU_VIRT is not set */
-#define CONFIG_SOC_NAME "e2000"
-#define CONFIG_TARGET_TYPE_NAME "q"
-#define CONFIG_SOC_CORE_NUM 4
+#define CONFIG_SOC_NAME "pd2308"
+#define CONFIG_SOC_CORE_NUM 8
#define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000
#define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000
#define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000
#define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000
-#define CONFIG_TARGET_E2000
#define CONFIG_DEFAULT_DEBUG_PRINT_UART1
/* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */
/* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */
@@ -71,11 +70,10 @@
/* CONFIG_USE_CAN_IOPAD is not set */
/* CONFIG_USE_QSPI_IOPAD is not set */
/* CONFIG_USE_PWM_IOPAD is not set */
-/* CONFIG_USE_MIO_IOPAD is not set */
/* CONFIG_USE_TACHO_IOPAD is not set */
/* CONFIG_USE_UART_IOPAD is not set */
/* CONFIG_USE_THIRD_PARTY_IOPAD is not set */
-#define CONFIG_E2000Q_DEMO_BOARD
+#define CONFIG_PD2308_DEMO_BOARD
/* IO mux configuration when board start up */
@@ -198,77 +196,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/usb/xhci_platform/makefile b/example/peripheral/usb/xhci_platform/makefile
index a12ccba8ec27bf8f6fbde4a1138f59f9df72b911..eb5408492fdd6c40e124f1fa8c9c082b6dcf71dd 100644
--- a/example/peripheral/usb/xhci_platform/makefile
+++ b/example/peripheral/usb/xhci_platform/makefile
@@ -29,4 +29,5 @@ image: all
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/usb/xhci_platform/sdkconfig b/example/peripheral/usb/xhci_platform/sdkconfig
index a0fe33e5314bc18817abd7a5818049a3656103fa..72986d2d68ea3653fb404a6ede969e35e1e38f16 100644
--- a/example/peripheral/usb/xhci_platform/sdkconfig
+++ b/example/peripheral/usb/xhci_platform/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_BOOT_WITH_FLUSH_CACHE=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +213,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/usb/xhci_platform/sdkconfig.h b/example/peripheral/usb/xhci_platform/sdkconfig.h
index 2e8fdeaa8643a71074906ba875175536870e243f..0cca83a1af4a6dd31ba79841d1d359df4b5c6a79 100644
--- a/example/peripheral/usb/xhci_platform/sdkconfig.h
+++ b/example/peripheral/usb/xhci_platform/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +192,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/wdt/configs/pd2308_aarch64_demo_wdt.config b/example/peripheral/wdt/configs/pd2308_aarch64_demo_wdt.config
new file mode 100644
index 0000000000000000000000000000000000000000..43a38172b811ede885f9982af831932794882b00
--- /dev/null
+++ b/example/peripheral/wdt/configs/pd2308_aarch64_demo_wdt.config
@@ -0,0 +1,9 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="wdt"
+CONFIG_ENABLE_IOPAD=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_FREERTOS_USE_WDT=y
+CONFIG_USE_LETTER_SHELL=y
+# CONFIG_USE_TLSF is not set
diff --git a/example/peripheral/wdt/makefile b/example/peripheral/wdt/makefile
index 7d8648d56925028498d523ada5d575ee23f46f24..6278cdf4569531b8b24edd2b2ce1815436738b28 100644
--- a/example/peripheral/wdt/makefile
+++ b/example/peripheral/wdt/makefile
@@ -28,4 +28,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/peripheral/wdt/sdkconfig b/example/peripheral/wdt/sdkconfig
index cda037f7daec3968c2cb51f4773b9ed91201e8b8..1222efcc296a3c1eee8e178a9b0948ebd2c1e7ff 100644
--- a/example/peripheral/wdt/sdkconfig
+++ b/example/peripheral/wdt/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -219,90 +220,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
CONFIG_FREERTOS_USE_WDT=y
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/peripheral/wdt/sdkconfig.h b/example/peripheral/wdt/sdkconfig.h
index 40946c28f3d24319e876e459f41a5db8d1403c09..0bb39cd97f40bbc61a406fa5e64302813139ad87 100644
--- a/example/peripheral/wdt/sdkconfig.h
+++ b/example/peripheral/wdt/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -196,77 +197,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
#define CONFIG_FREERTOS_USE_WDT
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/storage/fatfs/configs/pd2308_aarch64_demo_fatfs.config b/example/storage/fatfs/configs/pd2308_aarch64_demo_fatfs.config
new file mode 100644
index 0000000000000000000000000000000000000000..e893ea6da6fa8ea55cdc3a975747a38338c6e1e0
--- /dev/null
+++ b/example/storage/fatfs/configs/pd2308_aarch64_demo_fatfs.config
@@ -0,0 +1,25 @@
+CONFIG_FATFS_SPEED_TEST=y
+CONFIG_FATFS_CYCLE_TEST=y
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="fatfs"
+CONFIG_LOG_EXTRA_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_USE_SDMMC=y
+CONFIG_USE_PCIE=y
+CONFIG_ENABLE_FPCIE_ECAM=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_HEAP_SIZE=2
+CONFIG_USE_LETTER_SHELL=y
+CONFIG_USE_FATFS_0_1_4=y
+CONFIG_FATFS_SDMMC_FSDIF_TF=y
+CONFIG_FATFS_SDMMC_FSDIF_EMMC=y
+CONFIG_FATFS_SATA_DISK=y
+CONFIG_FATFS_USB=y
+CONFIG_FATFS_VOLUME_COUNT=10
+CONFIG_USE_CHERRY_USB=y
+CONFIG_CHERRY_USB_PORT_XHCI_PCIE=y
+CONFIG_CHERRY_USB_HOST_MSC=y
+CONFIG_CHERRY_USB_HOST_HID=y
+CONFIG_USE_FSL_SDMMC=y
+CONFIG_FSL_SDMMC_USE_FSDIF=y
diff --git a/example/storage/fatfs/makefile b/example/storage/fatfs/makefile
index 2af332e7944f756aad3b2e29c1d0d75caa6801b5..0651ebc27ed381e41f3f60feecf2ffed771f4fd9 100644
--- a/example/storage/fatfs/makefile
+++ b/example/storage/fatfs/makefile
@@ -29,4 +29,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/storage/fatfs/sdkconfig b/example/storage/fatfs/sdkconfig
index f8e14e696da9dae7cdb1aa17e161dd646223d0e3..c37094f249309331f40b61a79774d5d778da115c 100644
--- a/example/storage/fatfs/sdkconfig
+++ b/example/storage/fatfs/sdkconfig
@@ -50,6 +50,7 @@ CONFIG_BOOT_WITH_FLUSH_CACHE=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -223,90 +224,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/storage/fatfs/sdkconfig.h b/example/storage/fatfs/sdkconfig.h
index c61f794fb92d11eacbd6952444018535ba8d6ca4..61b1d5455294cc040319f02a65917810068c0764 100644
--- a/example/storage/fatfs/sdkconfig.h
+++ b/example/storage/fatfs/sdkconfig.h
@@ -44,6 +44,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -199,77 +200,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/storage/qspi_spiffs/configs/pd2308_aarch64_demo_qspi_spiffs.config b/example/storage/qspi_spiffs/configs/pd2308_aarch64_demo_qspi_spiffs.config
new file mode 100644
index 0000000000000000000000000000000000000000..6baa457f9fc3bbbd89cdca37d6e75fa3a10231c2
--- /dev/null
+++ b/example/storage/qspi_spiffs/configs/pd2308_aarch64_demo_qspi_spiffs.config
@@ -0,0 +1,13 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="qspi_spiffs"
+CONFIG_LOG_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_FREERTOS_USE_QSPI=y
+CONFIG_USE_LETTER_SHELL=y
+CONFIG_USE_SFUD=y
+# CONFIG_USE_TLSF is not set
+CONFIG_USE_SPIFFS=y
+CONFIG_SPIFFS_ON_FQSPI_SFUD=y
diff --git a/example/storage/qspi_spiffs/makefile b/example/storage/qspi_spiffs/makefile
index 2cac8f28fb8f74ea56618683ac2ed23cb017c505..dcee6dc7e8cefaa7fcba7f0bbe7fdbdfd0144677 100644
--- a/example/storage/qspi_spiffs/makefile
+++ b/example/storage/qspi_spiffs/makefile
@@ -26,4 +26,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/storage/qspi_spiffs/sdkconfig b/example/storage/qspi_spiffs/sdkconfig
index 4896c3ca5e067abfdaf85052bda50c6c5cd4f277..73649eab7f3c94a32105aefc53fed0e58912395f 100644
--- a/example/storage/qspi_spiffs/sdkconfig
+++ b/example/storage/qspi_spiffs/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -219,90 +220,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
CONFIG_FREERTOS_USE_QSPI=y
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/storage/qspi_spiffs/sdkconfig.h b/example/storage/qspi_spiffs/sdkconfig.h
index 700cbd78082cea4b680d035ac9104bb9ad18e61c..84eb36966ede2f3e64225d903a707ee716330b8c 100644
--- a/example/storage/qspi_spiffs/sdkconfig.h
+++ b/example/storage/qspi_spiffs/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -196,77 +197,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
#define CONFIG_FREERTOS_USE_QSPI
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/storage/qspi_spiffs/src/qspi_spiffs_example.c b/example/storage/qspi_spiffs/src/qspi_spiffs_example.c
index 82de9dd9fce483eba1d45ab7553d4b2328ee13d0..c3765b214a6f5e988d3a2c92aa223e1e0cf1db18 100644
--- a/example/storage/qspi_spiffs/src/qspi_spiffs_example.c
+++ b/example/storage/qspi_spiffs/src/qspi_spiffs_example.c
@@ -71,7 +71,7 @@ enum
#define FSPIFFS_DEBUG(format, ...) FT_DEBUG_PRINT_D(FSPIFFS_DEBUG_TAG, format, ##__VA_ARGS__)
/* spiffs start address and size */
-#if defined(CONFIG_E2000D_DEMO_BOARD) || defined(CONFIG_E2000Q_DEMO_BOARD) || defined(CONFIG_FIREFLY_DEMO_BOARD)
+#if defined(CONFIG_E2000D_DEMO_BOARD) || defined(CONFIG_E2000Q_DEMO_BOARD) || defined(CONFIG_FIREFLY_DEMO_BOARD) || defined(CONFIG_PD2308_DEMO_BOARD)
#define FSPIFFS_START_ADDR (3 * SZ_1M)
#elif defined(CONFIG_FT2004_DSK_BOARD) || defined(CONFIG_D2000_TEST_BOARD)
#define FSPIFFS_START_ADDR (7 * SZ_1M)
diff --git a/example/storage/spim_spiffs/configs/pd2308_aarch64_demo_spi_spiffs.config b/example/storage/spim_spiffs/configs/pd2308_aarch64_demo_spi_spiffs.config
new file mode 100644
index 0000000000000000000000000000000000000000..4e634b030334d46c7e1222d7040957a7d54a1762
--- /dev/null
+++ b/example/storage/spim_spiffs/configs/pd2308_aarch64_demo_spi_spiffs.config
@@ -0,0 +1,12 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="spi_spiffs"
+CONFIG_ENABLE_IOPAD=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_FREERTOS_USE_FSPIM=y
+CONFIG_USE_LETTER_SHELL=y
+CONFIG_USE_SFUD=y
+# CONFIG_USE_TLSF is not set
+CONFIG_USE_SPIFFS=y
+CONFIG_SPIFFS_ON_FSPIM_SFUD=y
diff --git a/example/storage/spim_spiffs/makefile b/example/storage/spim_spiffs/makefile
index e47755211ee13097e592a59143454c67ef994f48..52c7a6d4b2038ac6f2558cd85ead485cf61449ea 100644
--- a/example/storage/spim_spiffs/makefile
+++ b/example/storage/spim_spiffs/makefile
@@ -28,4 +28,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/storage/spim_spiffs/sdkconfig b/example/storage/spim_spiffs/sdkconfig
index e1e4d942817b7ec9cf06f726606bd0803b1fa6bf..895ac07b42a8164b11af7089a64c7fad1177515b 100644
--- a/example/storage/spim_spiffs/sdkconfig
+++ b/example/storage/spim_spiffs/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -213,90 +214,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
CONFIG_FREERTOS_USE_FSPIM=y
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
@@ -326,7 +327,7 @@ CONFIG_USE_SFUD=y
#
CONFIG_SFUD_CTRL_FSPIM=y
CONFIG_SFUD_TRANS_MODE_POLL_FIFO=y
-# CONFIG_SFUD_TRANS_MODE_INTRRUPT is not set
+# CONFIG_SFUD_TRANS_MODE_INTERRUPT is not set
# CONFIG_SFUD_TRANS_MODE_DDMA is not set
# CONFIG_SFUD_CTRL_FQSPI is not set
# end of Sfud configuration
diff --git a/example/storage/spim_spiffs/sdkconfig.h b/example/storage/spim_spiffs/sdkconfig.h
index 3f6bafb39d8f0222bce9bd4ab8f2b87c93d30b59..1648c5b10697d02d7ae0a8e34b55e331eceb45ca 100644
--- a/example/storage/spim_spiffs/sdkconfig.h
+++ b/example/storage/spim_spiffs/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -192,77 +193,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
#define CONFIG_FREERTOS_USE_FSPIM
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
@@ -288,7 +289,7 @@
#define CONFIG_SFUD_CTRL_FSPIM
#define CONFIG_SFUD_TRANS_MODE_POLL_FIFO
-/* CONFIG_SFUD_TRANS_MODE_INTRRUPT is not set */
+/* CONFIG_SFUD_TRANS_MODE_INTERRUPT is not set */
/* CONFIG_SFUD_TRANS_MODE_DDMA is not set */
/* CONFIG_SFUD_CTRL_FQSPI is not set */
/* end of Sfud configuration */
diff --git a/example/system/amp/openamp/device_core/configs/pd2308_aarch64_demo_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/pd2308_aarch64_demo_openamp_device_core.config
new file mode 100644
index 0000000000000000000000000000000000000000..9d038b0c3893e213ea9add3433f6df755a46974c
--- /dev/null
+++ b/example/system/amp/openamp/device_core/configs/pd2308_aarch64_demo_openamp_device_core.config
@@ -0,0 +1,17 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="openamp_device_core"
+CONFIG_LOG_VERBOS=y
+CONFIG_LOG_DISPALY_CORE_NUM=y
+CONFIG_INTERRUPT_ROLE_SLAVE=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_USE_SERIAL=y
+# CONFIG_OUTPUT_BINARY is not set
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_LOAD_ADDRESS=0xe0100000
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_FREERTOS_USE_UART=y
+CONFIG_USE_AMP=y
+CONFIG_USE_OPENAMP=y
+CONFIG_USE_OPENAMP_IPI=y
+# CONFIG_USE_TLSF is not set
diff --git a/example/system/amp/openamp/device_core/sdkconfig b/example/system/amp/openamp/device_core/sdkconfig
index c335e76af2ffb71c83e4543bd8fbf9d08bbaccd1..380f0a75d91c98ebd80ba7964824e678d64b37f2 100644
--- a/example/system/amp/openamp/device_core/sdkconfig
+++ b/example/system/amp/openamp/device_core/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +213,90 @@ CONFIG_STACK_SIZE=0x4000
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/system/amp/openamp/device_core/sdkconfig.h b/example/system/amp/openamp/device_core/sdkconfig.h
index 0989223d299b3e3916c5002b3055c9c786797be2..f73103a9c18453b5780f6da5582530b403feaa8e 100644
--- a/example/system/amp/openamp/device_core/sdkconfig.h
+++ b/example/system/amp/openamp/device_core/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +192,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/system/amp/openamp/driver_core/README.md b/example/system/amp/openamp/driver_core/README.md
index d4a582f645a3f11e8050b38227a360945abf4e06..21a765e33b76a3d07a89edbe418a9cbf078a0206 100644
--- a/example/system/amp/openamp/driver_core/README.md
+++ b/example/system/amp/openamp/driver_core/README.md
@@ -122,7 +122,7 @@ rpmsg-design:
> ``描述输入输出情况,列出存在哪些输入,对应的输出是什么(建议附录相关现象图片)`
`
-#### aarch64 程序测试 (freeRTOS 间)
+#### aarch64 程序测试 (FreeRTOS 间)
以E2000Q为例
@@ -161,7 +161,7 @@ rpmsg-design:

-#### aarch32 程序测试 (freeRTOS 间)
+#### aarch32 程序测试 (FreeRTOS 间)
以E2000Q为例
diff --git a/example/system/amp/openamp/driver_core/configs/pd2308_aarch64_demo_openamp_driver_core.config b/example/system/amp/openamp/driver_core/configs/pd2308_aarch64_demo_openamp_driver_core.config
new file mode 100644
index 0000000000000000000000000000000000000000..f3789d9c4ba10ff6418d7f29d12d808d2c7de35c
--- /dev/null
+++ b/example/system/amp/openamp/driver_core/configs/pd2308_aarch64_demo_openamp_driver_core.config
@@ -0,0 +1,14 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_USE_MSDF=y
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="openamp_driver_core"
+CONFIG_LOG_INFO=y
+CONFIG_LOG_DISPALY_CORE_NUM=y
+CONFIG_ENABLE_IOPAD=y
+# CONFIG_OUTPUT_BINARY is not set
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LETTER_SHELL=y
+CONFIG_USE_AMP=y
+CONFIG_USE_OPENAMP=y
+CONFIG_USE_OPENAMP_IPI=y
diff --git a/example/system/amp/openamp/driver_core/sdkconfig b/example/system/amp/openamp/driver_core/sdkconfig
index 960e7d04b01b3fd95607e755c8624bdb1024c17a..f5886cb5288be41cbb19786d4c16d7eddb7e87e8 100644
--- a/example/system/amp/openamp/driver_core/sdkconfig
+++ b/example/system/amp/openamp/driver_core/sdkconfig
@@ -45,6 +45,7 @@ CONFIG_MSDF_CORE_ID=2
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -216,90 +217,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/system/amp/openamp/driver_core/sdkconfig.h b/example/system/amp/openamp/driver_core/sdkconfig.h
index 6b17242cb89eca78ebaa3bdf301170354257c875..6028c849e522950de589f25c84a7669c5a3cbdc2 100644
--- a/example/system/amp/openamp/driver_core/sdkconfig.h
+++ b/example/system/amp/openamp/driver_core/sdkconfig.h
@@ -42,6 +42,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -195,77 +196,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/system/amp/openamp_for_linux/Kconfig b/example/system/amp/openamp_for_linux/Kconfig
index c5e5cfaee4af83bd25bb6d018d4650e5f99f9327..2a72e1c9727aebdc55ef5ec9611a3a9296f20ca2 100644
--- a/example/system/amp/openamp_for_linux/Kconfig
+++ b/example/system/amp/openamp_for_linux/Kconfig
@@ -4,11 +4,11 @@
#
-mainmenu "Phytium Freertos Configuration"
+mainmenu "Phytium FreeRTOS Configuration"
menu "Project Configuration"
- menu " Freertos Configuration"
+ menu " FreeRTOS Configuration"
config TARGET_NAME
string "Build Target Name"
default "openamp_for_linux"
diff --git a/example/system/amp/openamp_for_linux/configs/pd2308_aarch64_demo_openamp_for_linux.config b/example/system/amp/openamp_for_linux/configs/pd2308_aarch64_demo_openamp_for_linux.config
new file mode 100644
index 0000000000000000000000000000000000000000..172d3af1e9865722056ffa9926ded7d321a61a89
--- /dev/null
+++ b/example/system/amp/openamp_for_linux/configs/pd2308_aarch64_demo_openamp_for_linux.config
@@ -0,0 +1,18 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_LOG_VERBOS=y
+CONFIG_LOG_DISPALY_CORE_NUM=y
+CONFIG_INTERRUPT_ROLE_SLAVE=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_USE_SERIAL=y
+# CONFIG_OUTPUT_BINARY is not set
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_LOAD_ADDRESS=0xb0100000
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_FREERTOS_USE_UART=y
+CONFIG_USE_AMP=y
+CONFIG_USE_OPENAMP=y
+CONFIG_USE_OPENAMP_IPI=y
+CONFIG_SKIP_SHBUF_IO_WRITE=y
+CONFIG_USE_MASTER_VRING_DEFINE=y
+CONFIG_USE_CACHE_COHERENCY=y
diff --git a/example/system/amp/openamp_for_linux/sdkconfig b/example/system/amp/openamp_for_linux/sdkconfig
index 48262c673d201b95cb5d89e5415fcee51923347c..738a0a83a081b8f3a218c3cbc63429d372378650 100644
--- a/example/system/amp/openamp_for_linux/sdkconfig
+++ b/example/system/amp/openamp_for_linux/sdkconfig
@@ -4,10 +4,10 @@
#
#
-# Freertos Configuration
+# FreeRTOS Configuration
#
CONFIG_TARGET_NAME="openamp_for_linux"
-# end of Freertos Configuration
+# end of FreeRTOS Configuration
# end of Project Configuration
CONFIG_USE_FREERTOS=y
@@ -21,8 +21,8 @@ CONFIG_ARCH_NAME="armv8"
#
# Arm architecture configuration
#
-# CONFIG_ARCH_ARMV8_AARCH64 is not set
-CONFIG_ARCH_ARMV8_AARCH32=y
+CONFIG_ARCH_ARMV8_AARCH64=y
+# CONFIG_ARCH_ARMV8_AARCH32 is not set
#
# Compiler configuration
@@ -30,25 +30,19 @@ CONFIG_ARCH_ARMV8_AARCH32=y
CONFIG_ARM_GCC_SELECT=y
# CONFIG_ARM_CLANG_SELECT is not set
CONFIG_TOOLCHAIN_NAME="gcc"
-CONFIG_TARGET_ARMV8_AARCH32=y
-CONFIG_ARCH_EXECUTION_STATE="aarch32"
-
-#
-# Fpu configuration
-#
-CONFIG_CRYPTO_NEON_FP_ARMV8=y
-# CONFIG_VFPV4 is not set
-# CONFIG_VFPV4_D16 is not set
-# CONFIG_VFPV3 is not set
-# CONFIG_VFPV3_D16 is not set
-CONFIG_ARM_MFPU="crypto-neon-fp-armv8"
-CONFIG_MFLOAT_ABI_HARD=y
-# CONFIG_MFLOAT_ABI_SOFTFP is not set
-CONFIG_ARM_MFLOAT_ABI="hard"
-# end of Fpu configuration
+CONFIG_TARGET_ARMV8_AARCH64=y
+CONFIG_ARCH_EXECUTION_STATE="aarch64"
+CONFIG_ARM_NEON=y
+CONFIG_ARM_CRC=y
+CONFIG_ARM_CRYPTO=y
+CONFIG_ARM_FLOAT_POINT=y
+# CONFIG_GCC_CODE_MODEL_TINY is not set
+CONFIG_GCC_CODE_MODEL_SMALL=y
+# CONFIG_GCC_CODE_MODEL_LARGE is not set
# end of Compiler configuration
-CONFIG_USE_AARCH64_L1_TO_AARCH32=y
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+# CONFIG_MMU_DEBUG_PRINTS is not set
# end of Arm architecture configuration
#
@@ -58,23 +52,22 @@ CONFIG_USE_AARCH64_L1_TO_AARCH32=y
# end of multi-core system deployment framework
CONFIG_MMU_PAGE_SIZE=0x1000
-CONFIG_FMMU_NUM_L2_TABLES=256
+CONFIG_MAX_XLAT_TABLES=256
# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
# Soc configuration
#
-# CONFIG_TARGET_PHYTIUMPI is not set
-CONFIG_TARGET_E2000Q=y
+CONFIG_TARGET_PHYTIUMPI=y
+# CONFIG_TARGET_E2000Q is not set
# CONFIG_TARGET_E2000D is not set
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
# CONFIG_TARGET_QEMU_VIRT is not set
-CONFIG_SOC_NAME="e2000"
-CONFIG_TARGET_TYPE_NAME="q"
+CONFIG_SOC_NAME="phytiumpi"
CONFIG_SOC_CORE_NUM=4
CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000
CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
@@ -89,7 +82,7 @@ CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
#
# Board Configuration
#
-CONFIG_BOARD_NAME="demo"
+CONFIG_BOARD_NAME="firefly"
# CONFIG_USE_SPI_IOPAD is not set
# CONFIG_USE_GPIO_IOPAD is not set
# CONFIG_USE_CAN_IOPAD is not set
@@ -99,7 +92,7 @@ CONFIG_BOARD_NAME="demo"
# CONFIG_USE_TACHO_IOPAD is not set
# CONFIG_USE_UART_IOPAD is not set
# CONFIG_USE_THIRD_PARTY_IOPAD is not set
-CONFIG_E2000Q_DEMO_BOARD=y
+CONFIG_FIREFLY_DEMO_BOARD=y
#
# IO mux configuration when board start up
@@ -222,12 +215,7 @@ CONFIG_DEFAULT_LINKER_SCRIPT=y
CONFIG_IMAGE_LOAD_ADDRESS=0xb0100000
CONFIG_IMAGE_MAX_LENGTH=0x2000000
CONFIG_HEAP_SIZE=1
-CONFIG_SVC_STACK_SIZE=0x1000
-CONFIG_SYS_STACK_SIZE=0x1000
-CONFIG_IRQ_STACK_SIZE=0x1000
-CONFIG_ABORT_STACK_SIZE=0x1000
-CONFIG_FIQ_STACK_SIZE=0x1000
-CONFIG_UNDEF_STACK_SIZE=0x1000
+CONFIG_STACK_SIZE=0x400
# end of Linker Options
# end of Build setup
@@ -236,90 +224,90 @@ CONFIG_UNDEF_STACK_SIZE=0x1000
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/system/amp/openamp_for_linux/sdkconfig.h b/example/system/amp/openamp_for_linux/sdkconfig.h
index ca8cfb8d975f218ed7da7f86ace22b48450913c5..798cfdcf69006ce79b81fa2779e62061e7396d1b 100644
--- a/example/system/amp/openamp_for_linux/sdkconfig.h
+++ b/example/system/amp/openamp_for_linux/sdkconfig.h
@@ -3,10 +3,10 @@
/* Project Configuration */
-/* Freertos Configuration */
+/* FreeRTOS Configuration */
#define CONFIG_TARGET_NAME "openamp_for_linux"
-/* end of Freertos Configuration */
+/* end of FreeRTOS Configuration */
/* end of Project Configuration */
#define CONFIG_USE_FREERTOS
@@ -17,31 +17,26 @@
/* Arm architecture configuration */
-/* CONFIG_ARCH_ARMV8_AARCH64 is not set */
-#define CONFIG_ARCH_ARMV8_AARCH32
+#define CONFIG_ARCH_ARMV8_AARCH64
+/* CONFIG_ARCH_ARMV8_AARCH32 is not set */
/* Compiler configuration */
#define CONFIG_ARM_GCC_SELECT
/* CONFIG_ARM_CLANG_SELECT is not set */
#define CONFIG_TOOLCHAIN_NAME "gcc"
-#define CONFIG_TARGET_ARMV8_AARCH32
-#define CONFIG_ARCH_EXECUTION_STATE "aarch32"
-
-/* Fpu configuration */
-
-#define CONFIG_CRYPTO_NEON_FP_ARMV8
-/* CONFIG_VFPV4 is not set */
-/* CONFIG_VFPV4_D16 is not set */
-/* CONFIG_VFPV3 is not set */
-/* CONFIG_VFPV3_D16 is not set */
-#define CONFIG_ARM_MFPU "crypto-neon-fp-armv8"
-#define CONFIG_MFLOAT_ABI_HARD
-/* CONFIG_MFLOAT_ABI_SOFTFP is not set */
-#define CONFIG_ARM_MFLOAT_ABI "hard"
-/* end of Fpu configuration */
+#define CONFIG_TARGET_ARMV8_AARCH64
+#define CONFIG_ARCH_EXECUTION_STATE "aarch64"
+#define CONFIG_ARM_NEON
+#define CONFIG_ARM_CRC
+#define CONFIG_ARM_CRYPTO
+#define CONFIG_ARM_FLOAT_POINT
+/* CONFIG_GCC_CODE_MODEL_TINY is not set */
+#define CONFIG_GCC_CODE_MODEL_SMALL
+/* CONFIG_GCC_CODE_MODEL_LARGE is not set */
/* end of Compiler configuration */
-#define CONFIG_USE_AARCH64_L1_TO_AARCH32
+/* CONFIG_BOOT_WITH_FLUSH_CACHE is not set */
+/* CONFIG_MMU_DEBUG_PRINTS is not set */
/* end of Arm architecture configuration */
/* multi-core system deployment framework */
@@ -49,22 +44,21 @@
/* CONFIG_USE_MSDF is not set */
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
-#define CONFIG_FMMU_NUM_L2_TABLES 256
+#define CONFIG_MAX_XLAT_TABLES 256
/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
-/* CONFIG_TARGET_PHYTIUMPI is not set */
-#define CONFIG_TARGET_E2000Q
+#define CONFIG_TARGET_PHYTIUMPI
+/* CONFIG_TARGET_E2000Q is not set */
/* CONFIG_TARGET_E2000D is not set */
/* CONFIG_TARGET_E2000S is not set */
/* CONFIG_TARGET_FT2004 is not set */
/* CONFIG_TARGET_D2000 is not set */
/* CONFIG_TARGET_PD2308 is not set */
/* CONFIG_TARGET_QEMU_VIRT is not set */
-#define CONFIG_SOC_NAME "e2000"
-#define CONFIG_TARGET_TYPE_NAME "q"
+#define CONFIG_SOC_NAME "phytiumpi"
#define CONFIG_SOC_CORE_NUM 4
#define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000
#define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000
@@ -78,7 +72,7 @@
/* Board Configuration */
-#define CONFIG_BOARD_NAME "demo"
+#define CONFIG_BOARD_NAME "firefly"
/* CONFIG_USE_SPI_IOPAD is not set */
/* CONFIG_USE_GPIO_IOPAD is not set */
/* CONFIG_USE_CAN_IOPAD is not set */
@@ -88,7 +82,7 @@
/* CONFIG_USE_TACHO_IOPAD is not set */
/* CONFIG_USE_UART_IOPAD is not set */
/* CONFIG_USE_THIRD_PARTY_IOPAD is not set */
-#define CONFIG_E2000Q_DEMO_BOARD
+#define CONFIG_FIREFLY_DEMO_BOARD
/* IO mux configuration when board start up */
@@ -198,88 +192,83 @@
#define CONFIG_IMAGE_LOAD_ADDRESS 0xb0100000
#define CONFIG_IMAGE_MAX_LENGTH 0x2000000
#define CONFIG_HEAP_SIZE 1
-#define CONFIG_SVC_STACK_SIZE 0x1000
-#define CONFIG_SYS_STACK_SIZE 0x1000
-#define CONFIG_IRQ_STACK_SIZE 0x1000
-#define CONFIG_ABORT_STACK_SIZE 0x1000
-#define CONFIG_FIQ_STACK_SIZE 0x1000
-#define CONFIG_UNDEF_STACK_SIZE 0x1000
+#define CONFIG_STACK_SIZE 0x400
/* end of Linker Options */
/* end of Build setup */
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/system/atomic/configs/pd2308_aarch64_demo_atomic.config b/example/system/atomic/configs/pd2308_aarch64_demo_atomic.config
new file mode 100644
index 0000000000000000000000000000000000000000..8b2fe54fde2dbaeaa18218e262496530dd3951dc
--- /dev/null
+++ b/example/system/atomic/configs/pd2308_aarch64_demo_atomic.config
@@ -0,0 +1,8 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="atomic"
+CONFIG_ENABLE_IOPAD=y
+CONFIG_OUTPUT_ASM_DIS=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LETTER_SHELL=y
diff --git a/example/system/atomic/makefile b/example/system/atomic/makefile
index 1465ed12931966647c7b409d0d79b081012366d6..1c700dbd65960fbb4892cac9e229d0e18cdea86d 100644
--- a/example/system/atomic/makefile
+++ b/example/system/atomic/makefile
@@ -31,4 +31,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/system/atomic/sdkconfig b/example/system/atomic/sdkconfig
index 3e945ebd860f7e8a2c425dae9210ea461f533683..186bd91385221be895331e18e8837b8426295ac7 100644
--- a/example/system/atomic/sdkconfig
+++ b/example/system/atomic/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +213,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/system/atomic/sdkconfig.h b/example/system/atomic/sdkconfig.h
index b5337cc93e59df5d732d3d0bb012edbb3bf490cc..95710d128c7fe49042605707a3e764d07c4d5228 100644
--- a/example/system/atomic/sdkconfig.h
+++ b/example/system/atomic/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +192,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/system/exception_debug/configs/pd2308_aarch64_demo_exception.config b/example/system/exception_debug/configs/pd2308_aarch64_demo_exception.config
new file mode 100644
index 0000000000000000000000000000000000000000..7184614e5459cbee42a21a9ecc2a04bd1a78a604
--- /dev/null
+++ b/example/system/exception_debug/configs/pd2308_aarch64_demo_exception.config
@@ -0,0 +1,8 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="exception"
+CONFIG_ENABLE_IOPAD=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_STACK_SIZE=0x100000
+CONFIG_USE_LETTER_SHELL=y
diff --git a/example/system/exception_debug/makefile b/example/system/exception_debug/makefile
index 08f49d636ad3930910fbeb6ee24e44deaa763603..6ba8a848eab772dbafaa4bc7af33c540e6d241e0 100644
--- a/example/system/exception_debug/makefile
+++ b/example/system/exception_debug/makefile
@@ -25,4 +25,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/system/exception_debug/sdkconfig b/example/system/exception_debug/sdkconfig
index ce6c730861a0b12543260016055336cb61c8fa45..e8873ad67de9eba7a125fb407ff8d2a51323f14f 100644
--- a/example/system/exception_debug/sdkconfig
+++ b/example/system/exception_debug/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +213,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/system/exception_debug/sdkconfig.h b/example/system/exception_debug/sdkconfig.h
index 081e6a2cdb4defa504713bdbe93c5793d618f061..cd7c13c1720aa2281d8ff0740619f28516678622 100644
--- a/example/system/exception_debug/sdkconfig.h
+++ b/example/system/exception_debug/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +192,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/system/nested_interrupt/configs/pd2308_aarch64_demo_nested_interrupt.config b/example/system/nested_interrupt/configs/pd2308_aarch64_demo_nested_interrupt.config
new file mode 100644
index 0000000000000000000000000000000000000000..45086071fc2fbf0674cfc0caf9872ad03415da23
--- /dev/null
+++ b/example/system/nested_interrupt/configs/pd2308_aarch64_demo_nested_interrupt.config
@@ -0,0 +1,10 @@
+# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="nested_interrupt"
+CONFIG_LOG_INFO=y
+CONFIG_ENABLE_IOPAD=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LETTER_SHELL=y
+# CONFIG_USE_TLSF is not set
+CONFIG_FREERTOS_MAX_API_CALL_INTERRUPT_PRIORITIES=12
diff --git a/example/system/nested_interrupt/makefile b/example/system/nested_interrupt/makefile
index c904fe89935df5a383d1db766f1620b09b067c4f..3a2fae538eb5fa20dfd65074401b2771110592e0 100644
--- a/example/system/nested_interrupt/makefile
+++ b/example/system/nested_interrupt/makefile
@@ -32,5 +32,6 @@ ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/freertos.bin
endif
@ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
diff --git a/example/system/nested_interrupt/sdkconfig b/example/system/nested_interrupt/sdkconfig
index d5d7f159d4164114074b07a941235dc7f0418f94..fbbad309f0958e52af6ccbc0c852c7443121efb4 100644
--- a/example/system/nested_interrupt/sdkconfig
+++ b/example/system/nested_interrupt/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +213,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/system/nested_interrupt/sdkconfig.h b/example/system/nested_interrupt/sdkconfig.h
index c1c126c27e5f33593dad00fa3a492673dfb94eaf..601af59f6ed2d94748a6c90286f1f9a88ec64d1b 100644
--- a/example/system/nested_interrupt/sdkconfig.h
+++ b/example/system/nested_interrupt/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +192,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/system/posix/configs/pd2308_aarch64_demo_posix.config b/example/system/posix/configs/pd2308_aarch64_demo_posix.config
new file mode 100644
index 0000000000000000000000000000000000000000..b43eab97139b46b44d5e1d07821b8874ffe93ecd
--- /dev/null
+++ b/example/system/posix/configs/pd2308_aarch64_demo_posix.config
@@ -0,0 +1,14 @@
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="posix"
+CONFIG_ENABLE_IOPAD=y
+# CONFIG_CHECK_DEPS is not set
+CONFIG_DEBUG_FULLOPT=y
+CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_OUTPUT_ASM_DIS=y
+CONFIG_USE_NEWLIB=y
+CONFIG_DEFAULT_LINKER_SCRIPT=y
+CONFIG_IMAGE_MAX_LENGTH=0x2000000
+CONFIG_USE_LETTER_SHELL=y
+CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=1
+CONFIG_FREERTOS_USE_POSIX=y
diff --git a/example/system/posix/makefile b/example/system/posix/makefile
index 12a8c2675eb2b5b160af101951814b650b211010..40570285a02c1ead38d6096cb72c3e15383b6ce5 100644
--- a/example/system/posix/makefile
+++ b/example/system/posix/makefile
@@ -26,4 +26,5 @@ image:
ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).bin
endif
- @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
\ No newline at end of file
+ @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
\ No newline at end of file
diff --git a/example/system/posix/sdkconfig b/example/system/posix/sdkconfig
index f134f759bc3c592d3be7e981382f9a54a273300e..7464927d36a1f0b61db8cc11c861fd3f83ccd901 100644
--- a/example/system/posix/sdkconfig
+++ b/example/system/posix/sdkconfig
@@ -41,6 +41,7 @@ CONFIG_BOOT_WITH_FLUSH_CACHE=y
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +213,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/system/posix/sdkconfig.h b/example/system/posix/sdkconfig.h
index 011180ec0cefcbe6aa07b83a484c1ba6a50b1be6..6739b7c5acb60419ea2cca8b57fc63259f60a126 100644
--- a/example/system/posix/sdkconfig.h
+++ b/example/system/posix/sdkconfig.h
@@ -38,6 +38,7 @@
/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +192,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/example/peripheral/pwm/configs/e2000q_aarch64_demo_pwm.config b/example/template/configs/pd2308_aarch64_demo_eg.config
similarity index 69%
rename from example/peripheral/pwm/configs/e2000q_aarch64_demo_pwm.config
rename to example/template/configs/pd2308_aarch64_demo_eg.config
index 9adf1df0218da0304d9af6199f0fe2f9b298faf9..9b32b84a0ffaa264cca97e6b77211458a7e09d0c 100644
--- a/example/peripheral/pwm/configs/e2000q_aarch64_demo_pwm.config
+++ b/example/template/configs/pd2308_aarch64_demo_eg.config
@@ -1,8 +1,8 @@
# CONFIG_BOOT_WITH_FLUSH_CACHE is not set
-CONFIG_TARGET_NAME="pwm"
-CONFIG_LOG_INFO=y
+CONFIG_TARGET_PD2308=y
+CONFIG_TARGET_NAME="eg"
+CONFIG_ENABLE_IOPAD=y
CONFIG_DEFAULT_LINKER_SCRIPT=y
CONFIG_IMAGE_MAX_LENGTH=0x2000000
CONFIG_STACK_SIZE=0x100000
-CONFIG_FREERTOS_USE_PWM=y
CONFIG_USE_LETTER_SHELL=y
diff --git a/example/template/makefile b/example/template/makefile
index 5d5c82f086e9052a66ee0ab9c2888b3f8b9d8954..40bccebf11c42af91c889465bb3d41dcbfed04db 100644
--- a/example/template/makefile
+++ b/example/template/makefile
@@ -26,6 +26,7 @@ ifdef CONFIG_OUTPUT_BINARY
@cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).bin
endif
@ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l
+ @$(MAKE) -s check_standalone_version
e2000_jailhouse:
scp ./$(IMAGE_OUT_NAME).bin root@192.168.4.20:/root
\ No newline at end of file
diff --git a/example/template/sdkconfig b/example/template/sdkconfig
index 407421729220b0f6b7cbaf1f62a3aa528e92d152..7b9dfb3a32c3112fdafd0dc04a175e131cc2db67 100644
--- a/example/template/sdkconfig
+++ b/example/template/sdkconfig
@@ -33,14 +33,9 @@ CONFIG_GCC_CODE_MODEL_SMALL=y
# CONFIG_MMU_DEBUG_PRINTS is not set
# end of Arm architecture configuration
-#
-# multi-core system deployment framework
-#
-# CONFIG_USE_MSDF is not set
-# end of multi-core system deployment framework
-
CONFIG_MMU_PAGE_SIZE=0x1000
CONFIG_MAX_XLAT_TABLES=256
+# CONFIG_ENABLE_GIC_ITS is not set
# end of Arch configuration
#
@@ -212,90 +207,90 @@ CONFIG_STACK_SIZE=0x400
#
#
-# Freertos Uart Drivers
+# FreeRTOS Uart Drivers
#
CONFIG_FREERTOS_USE_UART=y
-# end of Freertos Uart Drivers
+# end of FreeRTOS Uart Drivers
#
-# Freertos Pwm Drivers
+# FreeRTOS Pwm Drivers
#
# CONFIG_FREERTOS_USE_PWM is not set
-# end of Freertos Pwm Drivers
+# end of FreeRTOS Pwm Drivers
#
-# Freertos Qspi Drivers
+# FreeRTOS Qspi Drivers
#
# CONFIG_FREERTOS_USE_QSPI is not set
-# end of Freertos Qspi Drivers
+# end of FreeRTOS Qspi Drivers
#
-# Freertos Wdt Drivers
+# FreeRTOS Wdt Drivers
#
# CONFIG_FREERTOS_USE_WDT is not set
-# end of Freertos Wdt Drivers
+# end of FreeRTOS Wdt Drivers
#
-# Freertos Eth Drivers
+# FreeRTOS Eth Drivers
#
# CONFIG_FREERTOS_USE_XMAC is not set
# CONFIG_FREERTOS_USE_GMAC is not set
-# end of Freertos Eth Drivers
+# end of FreeRTOS Eth Drivers
#
-# Freertos Spim Drivers
+# FreeRTOS Spim Drivers
#
# CONFIG_FREERTOS_USE_FSPIM is not set
-# end of Freertos Spim Drivers
+# end of FreeRTOS Spim Drivers
#
-# Freertos DMA Drivers
+# FreeRTOS DMA Drivers
#
# CONFIG_FREERTOS_USE_FDDMA is not set
# CONFIG_FREERTOS_USE_FGDMA is not set
-# end of Freertos DMA Drivers
+# end of FreeRTOS DMA Drivers
#
-# Freertos Adc Drivers
+# FreeRTOS Adc Drivers
#
# CONFIG_FREERTOS_USE_ADC is not set
-# end of Freertos Adc Drivers
+# end of FreeRTOS Adc Drivers
#
-# Freertos Can Drivers
+# FreeRTOS Can Drivers
#
# CONFIG_FREERTOS_USE_CAN is not set
-# end of Freertos Can Drivers
+# end of FreeRTOS Can Drivers
#
-# Freertos I2c Drivers
+# FreeRTOS I2c Drivers
#
# CONFIG_FREERTOS_USE_I2C is not set
-# end of Freertos I2c Drivers
+# end of FreeRTOS I2c Drivers
#
-# Freertos Mio Drivers
+# FreeRTOS Mio Drivers
#
# CONFIG_FREERTOS_USE_MIO is not set
-# end of Freertos Mio Drivers
+# end of FreeRTOS Mio Drivers
#
-# Freertos Timer Drivers
+# FreeRTOS Timer Drivers
#
# CONFIG_FREERTOS_USE_TIMER is not set
-# end of Freertos Timer Drivers
+# end of FreeRTOS Timer Drivers
#
-# Freertos Media Drivers
+# FreeRTOS Media Drivers
#
# CONFIG_FREERTOS_USE_MEDIA is not set
-# end of Freertos Media Drivers
+# end of FreeRTOS Media Drivers
#
-# Freertos I2s Drivers
+# FreeRTOS I2s Drivers
#
# CONFIG_FREERTOS_USE_I2S is not set
-# end of Freertos I2s Drivers
+# end of FreeRTOS I2s Drivers
# end of Component Configuration
#
diff --git a/example/template/sdkconfig.h b/example/template/sdkconfig.h
index de2d33bd178c85353d4c858de2f9126e0f7475db..718f0a3b4e97fa9691cf855ac65139d69e294421 100644
--- a/example/template/sdkconfig.h
+++ b/example/template/sdkconfig.h
@@ -31,13 +31,9 @@
/* CONFIG_BOOT_WITH_FLUSH_CACHE is not set */
/* CONFIG_MMU_DEBUG_PRINTS is not set */
/* end of Arm architecture configuration */
-
-/* multi-core system deployment framework */
-
-/* CONFIG_USE_MSDF is not set */
-/* end of multi-core system deployment framework */
#define CONFIG_MMU_PAGE_SIZE 0x1000
#define CONFIG_MAX_XLAT_TABLES 256
+/* CONFIG_ENABLE_GIC_ITS is not set */
/* end of Arch configuration */
/* Soc configuration */
@@ -191,77 +187,77 @@
/* Component Configuration */
-/* Freertos Uart Drivers */
+/* FreeRTOS Uart Drivers */
#define CONFIG_FREERTOS_USE_UART
-/* end of Freertos Uart Drivers */
+/* end of FreeRTOS Uart Drivers */
-/* Freertos Pwm Drivers */
+/* FreeRTOS Pwm Drivers */
/* CONFIG_FREERTOS_USE_PWM is not set */
-/* end of Freertos Pwm Drivers */
+/* end of FreeRTOS Pwm Drivers */
-/* Freertos Qspi Drivers */
+/* FreeRTOS Qspi Drivers */
/* CONFIG_FREERTOS_USE_QSPI is not set */
-/* end of Freertos Qspi Drivers */
+/* end of FreeRTOS Qspi Drivers */
-/* Freertos Wdt Drivers */
+/* FreeRTOS Wdt Drivers */
/* CONFIG_FREERTOS_USE_WDT is not set */
-/* end of Freertos Wdt Drivers */
+/* end of FreeRTOS Wdt Drivers */
-/* Freertos Eth Drivers */
+/* FreeRTOS Eth Drivers */
/* CONFIG_FREERTOS_USE_XMAC is not set */
/* CONFIG_FREERTOS_USE_GMAC is not set */
-/* end of Freertos Eth Drivers */
+/* end of FreeRTOS Eth Drivers */
-/* Freertos Spim Drivers */
+/* FreeRTOS Spim Drivers */
/* CONFIG_FREERTOS_USE_FSPIM is not set */
-/* end of Freertos Spim Drivers */
+/* end of FreeRTOS Spim Drivers */
-/* Freertos DMA Drivers */
+/* FreeRTOS DMA Drivers */
/* CONFIG_FREERTOS_USE_FDDMA is not set */
/* CONFIG_FREERTOS_USE_FGDMA is not set */
-/* end of Freertos DMA Drivers */
+/* end of FreeRTOS DMA Drivers */
-/* Freertos Adc Drivers */
+/* FreeRTOS Adc Drivers */
/* CONFIG_FREERTOS_USE_ADC is not set */
-/* end of Freertos Adc Drivers */
+/* end of FreeRTOS Adc Drivers */
-/* Freertos Can Drivers */
+/* FreeRTOS Can Drivers */
/* CONFIG_FREERTOS_USE_CAN is not set */
-/* end of Freertos Can Drivers */
+/* end of FreeRTOS Can Drivers */
-/* Freertos I2c Drivers */
+/* FreeRTOS I2c Drivers */
/* CONFIG_FREERTOS_USE_I2C is not set */
-/* end of Freertos I2c Drivers */
+/* end of FreeRTOS I2c Drivers */
-/* Freertos Mio Drivers */
+/* FreeRTOS Mio Drivers */
/* CONFIG_FREERTOS_USE_MIO is not set */
-/* end of Freertos Mio Drivers */
+/* end of FreeRTOS Mio Drivers */
-/* Freertos Timer Drivers */
+/* FreeRTOS Timer Drivers */
/* CONFIG_FREERTOS_USE_TIMER is not set */
-/* end of Freertos Timer Drivers */
+/* end of FreeRTOS Timer Drivers */
-/* Freertos Media Drivers */
+/* FreeRTOS Media Drivers */
/* CONFIG_FREERTOS_USE_MEDIA is not set */
-/* end of Freertos Media Drivers */
+/* end of FreeRTOS Media Drivers */
-/* Freertos I2s Drivers */
+/* FreeRTOS I2s Drivers */
/* CONFIG_FREERTOS_USE_I2S is not set */
-/* end of Freertos I2s Drivers */
+/* end of FreeRTOS I2s Drivers */
/* end of Component Configuration */
/* Third-party configuration */
diff --git a/install.py b/install.py
index 512129122de6bfec73db2d95585b8ea0fe8b948b..70e8db835306af8315fef816e907d2268bce9a93 100755
--- a/install.py
+++ b/install.py
@@ -24,19 +24,11 @@ else:
# get absoulte path current pwd to install sdk
install_path, install_script = os.path.split(os.path.abspath(__file__))
curr_path = os.getcwd()
-freertos_sdk_path = ''
-
-# in case user call this script not from current path
-if (curr_path != install_path):
- print("Please cd to install script path first !!!")
- exit()
-
# get absolute path of sdk install dir
freertos_sdk_path = install_path
-print("Standalone SDK at {}".format(freertos_sdk_path))
# Add standalone sdk
-standalone_sdk_v="80df5a255579b1ff08bdfeb2c8c524e8301da9b5"
+standalone_sdk_v="04a921499ab0a8b181f4f8101c0ec03be07f954f"
if (install_platform == windows_x64):
standalone_path=freertos_sdk_path + '\\standalone'
else:
@@ -68,9 +60,28 @@ if not os.path.exists(standalone_path):
/soc")
os.system("git checkout {}".format(standalone_sdk_v))
- print('Standalone sdk download is succeed')
+ print('Standalone SDK download is succeed')
else:
- print('Standalone sdk is exist')
+ # Check if the existing version matches the required version
+ current_path = os.getcwd()
+ os.chdir(standalone_path)
+ current_hash = os.popen('git rev-parse HEAD').read().strip()
+ os.chdir(current_path)
+
+ if current_hash != standalone_sdk_v:
+ print(f"\033[93mWarning: Existing standalone SDK version ({current_hash}) doesn't match required version ({standalone_sdk_v})\033[0m")
+ print(f"\033[93mRecommend: Delete the existing standalone SDK and run install.py to download the required version\033[0m")
+ # Optionally, you could add code here to update the repository to the correct version
+ # os.chdir(standalone_path)
+ # os.system(f"git checkout {standalone_sdk_v}")
+ # os.chdir(current_path)
+ # print("Standalone SDK has been updated to the required version")
+ exit()
+ else:
+ # in case user call this script not from current path
+ if (curr_path != install_path):
+ exit()
+ print("Existing standalone SDK version matches the required version")
pass
## STEP 2: display success message and enable environment
diff --git a/third-party/fatfs-0.1.4/port/fusb/diskio_usb.c b/third-party/fatfs-0.1.4/port/fusb/diskio_usb.c
index a1eeee303d9042058e14bed1d4ff364cff304991..58b5a2009baf9c9fb0527bdc1e2de03d3681622f 100644
--- a/third-party/fatfs-0.1.4/port/fusb/diskio_usb.c
+++ b/third-party/fatfs-0.1.4/port/fusb/diskio_usb.c
@@ -32,7 +32,11 @@
#define FF_DEBUG(format, ...) FT_DEBUG_PRINT_D(FF_DEBUG_TAG, format, ##__VA_ARGS__)
#define FF_WARN(format, ...) FT_DEBUG_PRINT_W(FF_DEBUG_TAG, format, ##__VA_ARGS__)
-#define FUSB_FATFS_ID FUSB3_ID_0
+#ifdef CONFIG_CHERRY_USB_PORT_XHCI_PCIE
+ #define FUSB_FATFS_ID 0U
+#else
+ #define FUSB_FATFS_ID FUSB3_ID_0
+#endif
typedef struct
{
@@ -90,7 +94,11 @@ static DSTATUS usb_disk_initialize(
if (FALSE == disk->init_ok)
{
+#ifdef CONFIG_CHERRY_USB_PORT_XHCI_PCIE
+ (void)usbh_initialize(disk->id, 0U); /* start a task to emurate usb hub and attached usb disk */
+#else
(void)usbh_initialize(disk->id, usb_hc_get_register_base(disk->id)); /* start a task to emurate usb hub and attached usb disk */
+#endif
while (TRUE)
{
if (NULL != usbh_find_class_instance(disk->disk_name))
diff --git a/third-party/freertos/History.txt b/third-party/freertos/History.txt
index 30d2610946e62a13e545962f45a5e2cc60772a2e..d5293b90bbd686b5ef8654e958cccae8448982ed 100644
--- a/third-party/freertos/History.txt
+++ b/third-party/freertos/History.txt
@@ -1,8 +1,313 @@
Documentation and download available at https://www.FreeRTOS.org/
+Changes between FreeRTOS V11.0.1 and FreeRTOS V11.1.0 released April 22, 2024
+
+ + Add ARMv7-R port with Memory Protection Unit (MPU) support.
+ + Add Memory Protection Unit (MPU) support to the Cortex-M0 port.
+ + Add stream batching buffer. A stream batching buffer differs from a stream
+ buffer when a task reads from a non-empty buffer:
+ - The task reading from a non-empty stream buffer returns immediately
+ regardless of the amount of data in the buffer.
+ - The task reading from a non-empty steam batching buffer blocks until the
+ amount of data in the buffer exceeds the trigger level or the block time
+ expires.
+ We thank @cperkulator for their contribution.
+ + Add the ability to change task notification index for stream buffers. We
+ thank @glemco for their contribution.
+ + Add xStreamBufferResetFromISR and xMessageBufferResetFromISR APIs to reset
+ stream buffer and message buffer from an Interrupt Service Routine (ISR).
+ We thank @HagaiMoshe for their contribution.
+ + Update all the FreeRTOS APIs to use configSTACK_DEPTH_TYPE for stack type.
+ We thank @feilipu for their contribution.
+ + Update vTaskEndScheduler to delete the timer and idle tasks,
+ once the scheduler is stopped.
+ + Make xTaskGetCurrentTaskHandleForCore() available to the single core
+ scheduler. We thank @Dazza0 for their contribution.
+ + Update uxTaskGetSystemState to not use the pxIndex member of the List_t
+ structure while iterating ready tasks list. The reason is that pxIndex
+ member must only used to select next ready task to run. We thank
+ @gemarcano for their inputs.
+ + Add a config option to the FreeRTOS SMP Kernel to set the default core
+ affinity mask for tasks created without an affinity mask. We thank @go2sh
+ for their contribution.
+ + Add configUSE_EVENT_GROUPS and configUSE_STREAM_BUFFERS configuration
+ constants to control the inclusion of event group and stream buffer
+ functionalities.
+ + Code changes to comply with MISRA C 2012.
+ + Add 64-bit support to the FreeRTOS Windows Simulator port. We thank @watsk
+ and @josesimoes for their contributions.
+ + Add support for 64-bit Microblaze processor to the MicroblazeV9 port. We
+ thank @mubinsyed for their contribution.
+ + Add support for MSP430 Embedded Application Binary Interface (EABI) to
+ the MSP430F449 port to make it work with both MSP430 GCC and MSPGCC
+ compilers. We thank @Forty-Bot for their contribution.
+ + Update xPortIsAuthorizedToAccessBuffer() on FreeRTOS ports with MPU
+ support to grant an unprivileged task access to all the memory before the
+ scheduler is started.
+ + Update the POSIX port to pass the FreeRTOS task name to pthread for
+ readable output in debuggers. We thank @Mixaill for their contribution.
+ + Update the POSIX port to ignore the user specified stack memory and only
+ pass the stack size to the pthread API to avoid errors caused when stack size
+ is smaller than the minimum. We thank @cmorgnaBE for their
+ contribution.
+ + Update the POSIX port to use a timer thread for tick interrupts instead of
+ POSIX timers to address issues with signal handling in non-FreeRTOS
+ pthreads. We thank @cmorgnaBE for their contribution.
+ + Update ARM_TFM port to support TF-Mv2.0.0 release of trusted-firmware-m.
+ We thanks @urutva for their contribution.
+ + Remove redundant constant pools in ARMv8 ports. We thank @urutva for their
+ contribution.
+ + Add APIs to reset the internal state of kernel modules. These APIs are
+ primarily intended to be used in the testing frameworks that restart the
+ scheduler.
+ + Use kernel provided implementations of vApplicationGetIdleTaskMemory() and
+ vApplicationGetTimerTaskMemory() in the RP2040 port. We thank @dpslwk for
+ their contribution.
+ + Fix atomic enter/exit critical section macro definitions in atomic.h for
+ ports that support nested interrupts. We thank @sebunger for their
+ contribution.
+ + Fix compiler warnings in the MSP430F449 port when compiled with the
+ MSP430 GCC compiler. We thank @Forty-Bot for their contribution.
+ + Update the scheduler suspension usage in ulTaskGenericNotifyTake and
+ xTaskGenericNotifyWait() to enhance code readability. We thank @Dazza0 for
+ their contribution.
+ + Add support for latest version of MPU wrappers( mpu_wrappers_v2) in CMake.
+ We thank @IsaacDynamo for their contribution.
+ + Update CMake support to create only one static library containing both the
+ kernel common code and the kernel port code. We thank @barnatahmed for
+ their contribution.
+
+Changes between FreeRTOS V11.0.0 and FreeRTOS V11.0.1 released December 21, 2023
+
+ + Updated the SBOM file.
+
+Changes between FreeRTOS V10.6.2 and FreeRTOS V11.0.0 released December 18, 2023
+
+ + SMP merged into the mainline: While FreeRTOS introduced Asymmetric
+ Multiprocessing (AMP) support in 2017, FreeRTOS Version 11.0.0 is the
+ first to merge Symmetric Multiprocessing (SMP) support into the mainline
+ release. SMP enables one instance of the FreeRTOS Kernel to schedule tasks
+ across multiple identical processor cores. We thank Mike Bruno and Jerry
+ McCarthy of XMOS and, Darian Liang, Sudeep Mohanty and Zim Kalinowski of
+ Espressif Systems for their contributions.
+ + Switch MISRA compliance checking from PC Lint to Coverity, and update from
+ MISRA C:2004 to MISRA C:2012.
+ + Add a template FreeRTOSConfig.h, inclusive of an abbreviated explanation of
+ each configuration item. Application writers can use this template as a
+ starting point to create the FreeRTOSConfig.h file for their application.
+ + Add a template FreeRTOS port which can be used as a starting point for
+ developing a new FreeRTOS port.
+ + Add bounds checking and obfuscation to internal heap block pointers in
+ heap_4.c and heap_5.c to help catch pointer corruptions. The application can
+ enable these checks by setting configENABLE_HEAP_PROTECTOR to 1 in their
+ FreeRTOSConfig.h. We thank @oliverlavery for their contribution.
+ + Update vTaskList and vTaskGetRunTimeStats APIs to replace the use of sprintf
+ with snprintf.
+ + Add trace macros to ports that enable tracing the interaction of ISRs with
+ scheduler events. We thank @conara for their contribution.
+ + Add trace macros that enable tracing of entering and exiting all APIs. We
+ thank @Techcore123 for their contribution.
+ + Add uxTaskBasePriorityGet and uxTaskBasePriorityGetFromISR APIs to get the
+ base priority of a task. The base priority of a task is the priority that
+ was last assigned to the task - which due to priority inheritance, may not
+ be the current priority of the task.
+ + Add pdTICKS_TO_MS macro to convert time in FreeRTOS ticks to time in
+ milliseconds. We thank @Dazza0 for their contribution.
+ + Add default implementations of vApplicationGetIdleTaskMemory and
+ vApplicationGetTimerTaskMemory. The application can enable these default
+ implementations by setting configKERNEL_PROVIDED_STATIC_MEMORY to 1 in their
+ FreeRTOSConfig.h. We thank @mdnr-g for their contribution.
+ + Update vTaskGetInfo to include start and end of the stack whenever both
+ values are available. We thank @vinceburns for their contribution.
+ + Prevent tasks waiting for a notification from being resumed by calls to
+ vTaskResume or vTaskResumeFromISR. We thank @Moral-Hao for their
+ contribution.
+ + Add asserts to validate that the application has correctly installed
+ FreeRTOS handlers for PendSV and SVCall interrupts on Cortex-M devices.
+ We thank @jefftenney for their contribution.
+ + Rename ARM_CA53_64_BIT and ARM_CA53_64_BIT_SRE ports to Arm_AARCH64 and
+ Arm_AARCH64_SRE respectively as these ports are applicable to all AArch64
+ architecture. We thank @urutva for their contribution.
+ + Add CMake support to allow the application writer to select the RISC-V
+ chip extension. We thank @JoeBenczarski for their contribution.
+ + Add CMake support to allow the application writer to build an application
+ with static allocation only. We thank @conara for their contribution.
+ + Make taskYIELD available to unprivileged tasks for ARMv8-M ports.
+ + Update Cortex-M23 ports to not use PSPLIM_NS. We thank @urutva for their
+ contribution.
+ + Update the SysTick setup code for ARMv8-M ports to first configure the clock
+ source and then enable SysTick. This is needed to address a bug in QEMU
+ versions older than 7.0.0, which causes an emulation error if SysTick is
+ enabled without first selecting a valid clock source. We thank @jefftenney
+ for their contribution.
+ + Add the port-optimized task selection algorithm optionally available for
+ ARMv7-M ports to the ARMv8-M ports. We thank @jefftenney for their
+ contribution.
+ + Improve the speed of pvPortMalloc in heap_4.c and heap_5.c by removing
+ unnecessary steps while splitting a large memory block into two. We thank
+ @Moral-Hao for their contribution.
+ + Shorten the critical section in pvPortMalloc in heap_2.c, heap_4.c and
+ heap_5.c by moving the size calculation out of the critical section. We thank
+ @Moral-Hao for their contribution.
+ + Update xTaskNotifyWait and ulTaskNotifyTake to remove the non-deterministic
+ operation of traversing a linked link from a critical section. We thank
+ @karver8 for their contribution.
+ + Fix stack end and stack size computation in POSIX port to meet the stack
+ alignment requirements on MacOS. We thank @tegimeki for their contribution.
+ + Update the vTaskPrioritySet implementation to use the new priority when the
+ task has inherited priority from a mutex it is holding, and the new priority
+ is bigger than the inherited priority. We thank @Moral-Hao for their
+ contribution.
+ + Add stack alignment adjustment if stack grows upwards. We thank @ivq for
+ their contribution.
+ + Fix pxTopOfStack calculation in configINIT_TLS_BLOCK when picolib C is
+ selected as the C library implementation to ensure that
+ pxPortInitialiseStack does not overwrite the data in the TLS block portion
+ of the stack. We thank @bebebib-rs for their contribution.
+ + Fix vPortEndScheduler() for the MSVC port so that the function
+ prvProcessSimulatedInterrupts is not stuck in an infinite loop when the
+ scheduler is stopped. We thank @Ju1He1 for their contribution.
+ + Add the Pull Request (PR) Process explaining the stages a PR goes through.
+
+Changes between FreeRTOS V10.6.1 and FreeRTOS V10.6.2 released November 29, 2023
+
+ + Add the following improvements to the new MPU wrapper (mpu_wrappers_v2.c)
+ introduced in version 10.6.0:
+ - Introduce Access Control List (ACL) feature to allow the application
+ writer to control an unprivileged task’s access to kernel objects.
+ - Update the system call entry mechanism to only require one Supervisor
+ Call (SVC) instruction.
+ - Wrap parameters for system calls with more than four parameters in a
+ struct to avoid special handling during system call entry.
+ - Fix 2 possible integer overflows.
+ - Convert some asserts to run time parameter checks.
+
+Changes between FreeRTOS V10.6.0 and FreeRTOS V10.6.1 released August 17, 2023
+
+ + Add runtime parameter checks to functions in mpu_wrappers_v2.c file.
+ The same checks are already performed in API implementations using
+ asserts.
+ We thank the following people for their inputs in these changes:
+ - Lan Luo, Zixia Liu of School of Computer Science and Technology,
+ Anhui University of Technology, China.
+ - Xinwen Fu of Department of Computer Science, University of
+ Massachusetts Lowell, USA.
+ - Xinhui Shao, Yumeng Wei, Huaiyu Yan, Zhen Ling of School of
+ Computer Science and Engineering, Southeast University, China.
+
+Changes between FreeRTOS V10.5.1 and FreeRTOS 10.6.0 released July 13, 2023
+
+ + Add a new MPU wrapper that places additional restrictions on unprivileged
+ tasks. The following is the list of changes introduced with the new MPU
+ wrapper:
+
+ 1. Opaque and indirectly verifiable integers for kernel object handles:
+ All the kernel object handles (for example, queue handles) are now
+ opaque integers. Previously object handles were raw pointers.
+ 2. Save the task context in Task Control Block (TCB): When a task is
+ swapped out by the scheduler, the task's context is now saved in its
+ TCB. Previously the task's context was saved on its stack.
+ 3. Execute system calls on a separate privileged only stack: FreeRTOS
+ system calls, which execute with elevated privilege, now use a
+ separate privileged only stack. Previously system calls used the
+ calling task's stack. The application writer can control the size of
+ the system call stack using new configSYSTEM_CALL_STACK_SIZE config
+ macro.
+ 4. Memory bounds checks: FreeRTOS system calls which accept a pointer
+ and de-reference it, now verify that the calling task has required
+ permissions to access the memory location referenced by the pointer.
+ 5. System calls restrictions: The following system calls are no longer
+ available to unprivileged tasks:
+ - vQueueDelete
+ - xQueueCreateMutex
+ - xQueueCreateMutexStatic
+ - xQueueCreateCountingSemaphore
+ - xQueueCreateCountingSemaphoreStatic
+ - xQueueGenericCreate
+ - xQueueGenericCreateStatic
+ - xQueueCreateSet
+ - xQueueRemoveFromSet
+ - xQueueGenericReset
+ - xTaskCreate
+ - xTaskCreateStatic
+ - vTaskDelete
+ - vTaskPrioritySet
+ - vTaskSuspendAll
+ - xTaskResumeAll
+ - xTaskGetHandle
+ - xTaskCallApplicationTaskHook
+ - vTaskList
+ - vTaskGetRunTimeStats
+ - xTaskCatchUpTicks
+ - xEventGroupCreate
+ - xEventGroupCreateStatic
+ - vEventGroupDelete
+ - xStreamBufferGenericCreate
+ - xStreamBufferGenericCreateStatic
+ - vStreamBufferDelete
+ - xStreamBufferReset
+ Also, an unprivileged task can no longer use vTaskSuspend to suspend
+ any task other than itself.
+
+ We thank the following people for their inputs in these enhancements:
+ - David Reiss of Meta Platforms, Inc.
+ - Lan Luo, Xinhui Shao, Yumeng Wei, Zixia Liu, Huaiyu Yan and Zhen Ling
+ of School of Computer Science and Engineering, Southeast University,
+ China.
+ - Xinwen Fu of Department of Computer Science, University of
+ Massachusetts Lowell, USA.
+ - Yueqi Chen, Zicheng Wang, Minghao Lin, Jiahe Wang of University of
+ Colorado Boulder, USA.
+ + Add Cortex-M35P port. Contributed by @urutva.
+ + Add embedded extension (RV32E) support to the IAR RISC-V port.
+ + Add ulTaskGetRunTimeCounter and ulTaskGetRunTimePercent APIs. Contributed by
+ @chrisnc.
+ + Add APIs to get the application supplied buffers from statically
+ created kernel objects. The following new APIs are added:
+ - xTaskGetStaticBuffers
+ - xQueueGetStaticBuffers
+ - xQueueGenericGetStaticBuffers
+ - xSemaphoreGetStaticBuffer
+ - xEventGroupGetStaticBuffer
+ - xStreamBufferGetStaticBuffers
+ - xMessageBufferGetStaticBuffers
+ These APIs enable the application writer to obtain static buffers from
+ the kernel object and free/reuse them at the time of deletion. Earlier
+ the application writer had to maintain the association of static buffers
+ and the kernel object in the application. Contributed by @Dazza0.
+ + Add Thread Local Storage (TLS) support using picolibc function. Contributed
+ by @keith-packard.
+ + Add configTICK_TYPE_WIDTH_IN_BITS to configure TickType_t data type. As a result,
+ the number of bits in an event group also increases with big data type. Contributed
+ by @Hadatko.
+ + Update eTaskGetState and uxTaskGetSystemState to return eReady for pending ready
+ tasks. Contributed by @Dazza0.
+ + Update heap_4 and heap_5 to add padding only if the resulting block is not
+ already aligned.
+ + Fix the scheduler logic in a couple of places to not preempt a task when an
+ equal priority task becomes ready.
+ + Add macros used in FreeRTOS-Plus libraries. Contributed by @Holden.
+ + Fix clang compiler warnings. Contributed by @phelter.
+ + Add assertions to ARMv8-M ports to detect when FreeRTOS APIs are called from
+ interrupts with priority higher than the configMAX_SYSCALL_INTERRUPT_PRIORITY.
+ Contributed by @urutva.
+ + Add xPortIsInsideInterrupt API to ARM_CM0 ports.
+ + Fix build warning in MSP430X port when large data model is used.
+ + Add the ability to use Cortex-R5 port on the parts without FPU.
+ + Fix build warning in heap implementations on PIC24/dsPIC.
+ + Update interrupt priority asserts for Cortex-M ports so that these do not fire
+ on QEMU which does not implement PRIO bits.
+ + Update ARMv7-M ports to ensure that kernel interrupts run at the lowest priority.
+ configKERNEL_INTERRUPT_PRIORITY is now obsolete for ARMv7-M ports and brings
+ these ports inline with the newer ARMv8-M ports. Contributed by @chrisnc.
+ + Fix build issue in POSIX GCC port on Windows Subsystem for Linux (WSL). Contributed
+ by @jacky309.
+ + Add portMEMORY_BARRIER to Microblaze port. Contributed by @bbain.
+ + Add portPOINTER_SIZE_TYPE definition for ATmega port. Contributed by @jputcu.
+ + Multiple improvements in the CMake support. Contributed by @phelte and @cookpate.
+
Changes between FreeRTOS V10.5.0 and FreeRTOS V10.5.1 released November 16 2022
-
- + Updating the version in the manifest.yml file to be accurate.
+ + Updated the kernel version in manifest and SBOM
Changes between FreeRTOS V10.4.6 and FreeRTOS V10.5.0 released September 16 2022
@@ -65,11 +370,11 @@ Changes between FreeRTOS V10.4.6 and FreeRTOS V10.5.0 released September 16 2022
The feature can be controlled by setting the configuration option
configUSE_SB_COMPLETED_CALLBACK in FreeRTOSConfig.h. When the option is set to 1,
APIs xStreamBufferCreateWithCallback() or xStreamBufferCreateStaticWithCallback()
- (and likewise APIs for message buffer) can be used to create a stream buffer
+ (and likewise APIs for message buffer) can be used to create a stream buffer
or message buffer instance with application provided callback overrides. When
the option is set to 0, then the default callbacks as defined by
- sbSEND_COMPLETED() and sbRECEIVE_COMPLETED() macros are invoked. To maintain
- backwards compatibility, configUSE_SB_COMPLETED_CALLBACK defaults to 0. The
+ sbSEND_COMPLETED() and sbRECEIVE_COMPLETED() macros are invoked. To maintain
+ backwards compatibility, configUSE_SB_COMPLETED_CALLBACK defaults to 0. The
functionality is currently not supported for MPU enabled ports.
+ Generalize the FreeRTOS's Thread Local Storage (TLS) support so that it
is not tied to newlib and can be used with other c-runtime libraries also.
@@ -3052,6 +3357,3 @@ Changes between V1.00 and V1.01
+ Prevent the call to kbhit() in main.c for debug builds as the debugger
seems to have problems stepping over the call. This if for the PC port
only.
-
-
-
diff --git a/third-party/freertos/LICENSE.md b/third-party/freertos/LICENSE.md
new file mode 100644
index 0000000000000000000000000000000000000000..9cf106272ac3b56b0c4c80218e8fc10a664ca5f4
--- /dev/null
+++ b/third-party/freertos/LICENSE.md
@@ -0,0 +1,19 @@
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/third-party/freertos/croutine.c b/third-party/freertos/croutine.c
index aa5ea6f06c5b6033b93ec75bbf7b50424df9dc11..e2c9cb012d0655233aa567058840a1f6a9a9ee14 100644
--- a/third-party/freertos/croutine.c
+++ b/third-party/freertos/croutine.c
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -30,7 +30,7 @@
#include "task.h"
#include "croutine.h"
-/* Remove the whole file is co-routines are not being used. */
+/* Remove the whole file if co-routines are not being used. */
#if ( configUSE_CO_ROUTINES != 0 )
/*
@@ -43,17 +43,19 @@
/* Lists for ready and blocked co-routines. --------------------*/
- static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */
- static List_t xDelayedCoRoutineList1; /*< Delayed co-routines. */
- static List_t xDelayedCoRoutineList2; /*< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */
- static List_t * pxDelayedCoRoutineList = NULL; /*< Points to the delayed co-routine list currently being used. */
- static List_t * pxOverflowDelayedCoRoutineList = NULL; /*< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */
- static List_t xPendingReadyCoRoutineList; /*< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */
+ static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /**< Prioritised ready co-routines. */
+ static List_t xDelayedCoRoutineList1; /**< Delayed co-routines. */
+ static List_t xDelayedCoRoutineList2; /**< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */
+ static List_t * pxDelayedCoRoutineList = NULL; /**< Points to the delayed co-routine list currently being used. */
+ static List_t * pxOverflowDelayedCoRoutineList = NULL; /**< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */
+ static List_t xPendingReadyCoRoutineList; /**< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */
/* Other file private variables. --------------------------------*/
CRCB_t * pxCurrentCoRoutine = NULL;
- static UBaseType_t uxTopCoRoutineReadyPriority = 0;
- static TickType_t xCoRoutineTickCount = 0, xLastTickCount = 0, xPassedTicks = 0;
+ static UBaseType_t uxTopCoRoutineReadyPriority = ( UBaseType_t ) 0U;
+ static TickType_t xCoRoutineTickCount = ( TickType_t ) 0U;
+ static TickType_t xLastTickCount = ( TickType_t ) 0U;
+ static TickType_t xPassedTicks = ( TickType_t ) 0U;
/* The initial state of the co-routine when it is created. */
#define corINITIAL_STATE ( 0 )
@@ -66,13 +68,13 @@
* used from within an ISR.
*/
#define prvAddCoRoutineToReadyQueue( pxCRCB ) \
- { \
+ do { \
if( ( pxCRCB )->uxPriority > uxTopCoRoutineReadyPriority ) \
{ \
uxTopCoRoutineReadyPriority = ( pxCRCB )->uxPriority; \
} \
vListInsertEnd( ( List_t * ) &( pxReadyCoRoutineLists[ ( pxCRCB )->uxPriority ] ), &( ( pxCRCB )->xGenericListItem ) ); \
- }
+ } while( 0 )
/*
* Utility to ready all the lists used by the scheduler. This is called
@@ -107,7 +109,12 @@
BaseType_t xReturn;
CRCB_t * pxCoRoutine;
+ traceENTER_xCoRoutineCreate( pxCoRoutineCode, uxPriority, uxIndex );
+
/* Allocate the memory that will store the co-routine control block. */
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
pxCoRoutine = ( CRCB_t * ) pvPortMalloc( sizeof( CRCB_t ) );
if( pxCoRoutine )
@@ -156,6 +163,8 @@
xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
}
+ traceRETURN_xCoRoutineCreate( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
@@ -165,6 +174,8 @@
{
TickType_t xTimeToWake;
+ traceENTER_vCoRoutineAddToDelayedList( xTicksToDelay, pxEventList );
+
/* Calculate the time to wake - this may overflow but this is
* not a problem. */
xTimeToWake = xCoRoutineTickCount + xTicksToDelay;
@@ -196,6 +207,8 @@
* function must be called with interrupts disabled. */
vListInsert( pxEventList, &( pxCurrentCoRoutine->xEventListItem ) );
}
+
+ traceRETURN_vCoRoutineAddToDelayedList();
}
/*-----------------------------------------------------------*/
@@ -283,6 +296,8 @@
void vCoRoutineSchedule( void )
{
+ traceENTER_vCoRoutineSchedule();
+
/* Only run a co-routine after prvInitialiseCoRoutineLists() has been
* called. prvInitialiseCoRoutineLists() is called automatically when a
* co-routine is created. */
@@ -313,6 +328,8 @@
/* Call the co-routine. */
( pxCurrentCoRoutine->pxCoRoutineFunction )( pxCurrentCoRoutine, pxCurrentCoRoutine->uxIndex );
}
+
+ traceRETURN_vCoRoutineSchedule();
}
/*-----------------------------------------------------------*/
@@ -341,6 +358,8 @@
CRCB_t * pxUnblockedCRCB;
BaseType_t xReturn;
+ traceENTER_xCoRoutineRemoveFromEventList( pxEventList );
+
/* This function is called from within an interrupt. It can only access
* event lists and the pending ready list. This function assumes that a
* check has already been made to ensure pxEventList is not empty. */
@@ -357,7 +376,30 @@
xReturn = pdFALSE;
}
+ traceRETURN_xCoRoutineRemoveFromEventList( xReturn );
+
return xReturn;
}
+/*-----------------------------------------------------------*/
+
+/*
+ * Reset state in this file. This state is normally initialized at start up.
+ * This function must be called by the application before restarting the
+ * scheduler.
+ */
+ void vCoRoutineResetState( void )
+ {
+ /* Lists for ready and blocked co-routines. */
+ pxDelayedCoRoutineList = NULL;
+ pxOverflowDelayedCoRoutineList = NULL;
+
+ /* Other file private variables. */
+ pxCurrentCoRoutine = NULL;
+ uxTopCoRoutineReadyPriority = ( UBaseType_t ) 0U;
+ xCoRoutineTickCount = ( TickType_t ) 0U;
+ xLastTickCount = ( TickType_t ) 0U;
+ xPassedTicks = ( TickType_t ) 0U;
+ }
+/*-----------------------------------------------------------*/
#endif /* configUSE_CO_ROUTINES == 0 */
diff --git a/third-party/freertos/event_groups.c b/third-party/freertos/event_groups.c
index f3e6aff777d09177186ad006b976be0d71740519..9e6fd8059e04c539f107fc561da95d8b533df11c 100644
--- a/third-party/freertos/event_groups.c
+++ b/third-party/freertos/event_groups.c
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -30,7 +30,7 @@
#include
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
- * all the API functions to use the MPU wrappers. That should only be done when
+ * all the API functions to use the MPU wrappers. That should only be done when
* task.h is included from an application file. */
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
@@ -40,40 +40,30 @@
#include "timers.h"
#include "event_groups.h"
-/* Lint e961, e750 and e9021 are suppressed as a MISRA exception justified
- * because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
+/* The MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
* for the header files above, but not in this file, in order to generate the
* correct privileged Vs unprivileged linkage and placement. */
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021 See comment above. */
-
-/* The following bit fields convey control information in a task's event list
- * item value. It is important they don't clash with the
- * taskEVENT_LIST_ITEM_VALUE_IN_USE definition. */
-#if configUSE_16_BIT_TICKS == 1
- #define eventCLEAR_EVENTS_ON_EXIT_BIT 0x0100U
- #define eventUNBLOCKED_DUE_TO_BIT_SET 0x0200U
- #define eventWAIT_FOR_ALL_BITS 0x0400U
- #define eventEVENT_BITS_CONTROL_BYTES 0xff00U
-#else
- #define eventCLEAR_EVENTS_ON_EXIT_BIT 0x01000000UL
- #define eventUNBLOCKED_DUE_TO_BIT_SET 0x02000000UL
- #define eventWAIT_FOR_ALL_BITS 0x04000000UL
- #define eventEVENT_BITS_CONTROL_BYTES 0xff000000UL
-#endif
-
-typedef struct EventGroupDef_t
-{
- EventBits_t uxEventBits;
- List_t xTasksWaitingForBits; /*< List of tasks waiting for a bit to be set. */
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
- #if ( configUSE_TRACE_FACILITY == 1 )
- UBaseType_t uxEventGroupNumber;
- #endif
+/* This entire source file will be skipped if the application is not configured
+ * to include event groups functionality. This #if is closed at the very bottom
+ * of this file. If you want to include event groups then ensure
+ * configUSE_EVENT_GROUPS is set to 1 in FreeRTOSConfig.h. */
+#if ( configUSE_EVENT_GROUPS == 1 )
+
+ typedef struct EventGroupDef_t
+ {
+ EventBits_t uxEventBits;
+ List_t xTasksWaitingForBits; /**< List of tasks waiting for a bit to be set. */
- #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
- uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the event group is statically allocated to ensure no attempt is made to free the memory. */
- #endif
-} EventGroup_t;
+ #if ( configUSE_TRACE_FACILITY == 1 )
+ UBaseType_t uxEventGroupNumber;
+ #endif
+
+ #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
+ uint8_t ucStaticallyAllocated; /**< Set to pdTRUE if the event group is statically allocated to ensure no attempt is made to free the memory. */
+ #endif
+ } EventGroup_t;
/*-----------------------------------------------------------*/
@@ -85,694 +75,810 @@ typedef struct EventGroupDef_t
* wait condition is met if any of the bits set in uxBitsToWait for are also set
* in uxCurrentEventBits.
*/
-static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
- const EventBits_t uxBitsToWaitFor,
- const BaseType_t xWaitForAllBits ) PRIVILEGED_FUNCTION;
+ static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
+ const EventBits_t uxBitsToWaitFor,
+ const BaseType_t xWaitForAllBits ) PRIVILEGED_FUNCTION;
/*-----------------------------------------------------------*/
-#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
- EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer )
- {
- EventGroup_t * pxEventBits;
+ EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer )
+ {
+ EventGroup_t * pxEventBits;
- /* A StaticEventGroup_t object must be provided. */
- configASSERT( pxEventGroupBuffer );
+ traceENTER_xEventGroupCreateStatic( pxEventGroupBuffer );
- #if ( configASSERT_DEFINED == 1 )
- {
- /* Sanity check that the size of the structure used to declare a
- * variable of type StaticEventGroup_t equals the size of the real
- * event group structure. */
- volatile size_t xSize = sizeof( StaticEventGroup_t );
- configASSERT( xSize == sizeof( EventGroup_t ) );
- } /*lint !e529 xSize is referenced if configASSERT() is defined. */
- #endif /* configASSERT_DEFINED */
-
- /* The user has provided a statically allocated event group - use it. */
- pxEventBits = ( EventGroup_t * ) pxEventGroupBuffer; /*lint !e740 !e9087 EventGroup_t and StaticEventGroup_t are deliberately aliased for data hiding purposes and guaranteed to have the same size and alignment requirement - checked by configASSERT(). */
-
- if( pxEventBits != NULL )
- {
- pxEventBits->uxEventBits = 0;
- vListInitialise( &( pxEventBits->xTasksWaitingForBits ) );
+ /* A StaticEventGroup_t object must be provided. */
+ configASSERT( pxEventGroupBuffer );
- #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ #if ( configASSERT_DEFINED == 1 )
{
- /* Both static and dynamic allocation can be used, so note that
- * this event group was created statically in case the event group
- * is later deleted. */
- pxEventBits->ucStaticallyAllocated = pdTRUE;
+ /* Sanity check that the size of the structure used to declare a
+ * variable of type StaticEventGroup_t equals the size of the real
+ * event group structure. */
+ volatile size_t xSize = sizeof( StaticEventGroup_t );
+ configASSERT( xSize == sizeof( EventGroup_t ) );
}
- #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
+ #endif /* configASSERT_DEFINED */
- traceEVENT_GROUP_CREATE( pxEventBits );
- }
- else
- {
- /* xEventGroupCreateStatic should only ever be called with
- * pxEventGroupBuffer pointing to a pre-allocated (compile time
- * allocated) StaticEventGroup_t variable. */
- traceEVENT_GROUP_CREATE_FAILED();
- }
-
- return pxEventBits;
- }
+ /* The user has provided a statically allocated event group - use it. */
+ /* MISRA Ref 11.3.1 [Misaligned access] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
+ /* coverity[misra_c_2012_rule_11_3_violation] */
+ pxEventBits = ( EventGroup_t * ) pxEventGroupBuffer;
-#endif /* configSUPPORT_STATIC_ALLOCATION */
-/*-----------------------------------------------------------*/
-
-#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ if( pxEventBits != NULL )
+ {
+ pxEventBits->uxEventBits = 0;
+ vListInitialise( &( pxEventBits->xTasksWaitingForBits ) );
- EventGroupHandle_t xEventGroupCreate( void )
- {
- EventGroup_t * pxEventBits;
-
- /* Allocate the event group. Justification for MISRA deviation as
- * follows: pvPortMalloc() always ensures returned memory blocks are
- * aligned per the requirements of the MCU stack. In this case
- * pvPortMalloc() must return a pointer that is guaranteed to meet the
- * alignment requirements of the EventGroup_t structure - which (if you
- * follow it through) is the alignment requirements of the TickType_t type
- * (EventBits_t being of TickType_t itself). Therefore, whenever the
- * stack alignment requirements are greater than or equal to the
- * TickType_t alignment requirements the cast is safe. In other cases,
- * where the natural word size of the architecture is less than
- * sizeof( TickType_t ), the TickType_t variables will be accessed in two
- * or more reads operations, and the alignment requirements is only that
- * of each individual read. */
- pxEventBits = ( EventGroup_t * ) pvPortMalloc( sizeof( EventGroup_t ) ); /*lint !e9087 !e9079 see comment above. */
-
- if( pxEventBits != NULL )
- {
- pxEventBits->uxEventBits = 0;
- vListInitialise( &( pxEventBits->xTasksWaitingForBits ) );
+ #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ {
+ /* Both static and dynamic allocation can be used, so note that
+ * this event group was created statically in case the event group
+ * is later deleted. */
+ pxEventBits->ucStaticallyAllocated = pdTRUE;
+ }
+ #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
- #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ traceEVENT_GROUP_CREATE( pxEventBits );
+ }
+ else
{
- /* Both static and dynamic allocation can be used, so note this
- * event group was allocated statically in case the event group is
- * later deleted. */
- pxEventBits->ucStaticallyAllocated = pdFALSE;
+ /* xEventGroupCreateStatic should only ever be called with
+ * pxEventGroupBuffer pointing to a pre-allocated (compile time
+ * allocated) StaticEventGroup_t variable. */
+ traceEVENT_GROUP_CREATE_FAILED();
}
- #endif /* configSUPPORT_STATIC_ALLOCATION */
- traceEVENT_GROUP_CREATE( pxEventBits );
- }
- else
- {
- traceEVENT_GROUP_CREATE_FAILED(); /*lint !e9063 Else branch only exists to allow tracing and does not generate code if trace macros are not defined. */
- }
+ traceRETURN_xEventGroupCreateStatic( pxEventBits );
- return pxEventBits;
- }
+ return pxEventBits;
+ }
-#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
+ #endif /* configSUPPORT_STATIC_ALLOCATION */
/*-----------------------------------------------------------*/
-EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
- const EventBits_t uxBitsToSet,
- const EventBits_t uxBitsToWaitFor,
- TickType_t xTicksToWait )
-{
- EventBits_t uxOriginalBitValue, uxReturn;
- EventGroup_t * pxEventBits = xEventGroup;
- BaseType_t xAlreadyYielded;
- BaseType_t xTimeoutOccurred = pdFALSE;
-
- configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
- configASSERT( uxBitsToWaitFor != 0 );
- #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
- {
- configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
- }
- #endif
-
- vTaskSuspendAll();
- {
- uxOriginalBitValue = pxEventBits->uxEventBits;
+ #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
- ( void ) xEventGroupSetBits( xEventGroup, uxBitsToSet );
-
- if( ( ( uxOriginalBitValue | uxBitsToSet ) & uxBitsToWaitFor ) == uxBitsToWaitFor )
+ EventGroupHandle_t xEventGroupCreate( void )
{
- /* All the rendezvous bits are now set - no need to block. */
- uxReturn = ( uxOriginalBitValue | uxBitsToSet );
+ EventGroup_t * pxEventBits;
- /* Rendezvous always clear the bits. They will have been cleared
- * already unless this is the only task in the rendezvous. */
- pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
+ traceENTER_xEventGroupCreate();
- xTicksToWait = 0;
- }
- else
- {
- if( xTicksToWait != ( TickType_t ) 0 )
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxEventBits = ( EventGroup_t * ) pvPortMalloc( sizeof( EventGroup_t ) );
+
+ if( pxEventBits != NULL )
{
- traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor );
+ pxEventBits->uxEventBits = 0;
+ vListInitialise( &( pxEventBits->xTasksWaitingForBits ) );
- /* Store the bits that the calling task is waiting for in the
- * task's event list item so the kernel knows when a match is
- * found. Then enter the blocked state. */
- vTaskPlaceOnUnorderedEventList( &( pxEventBits->xTasksWaitingForBits ), ( uxBitsToWaitFor | eventCLEAR_EVENTS_ON_EXIT_BIT | eventWAIT_FOR_ALL_BITS ), xTicksToWait );
+ #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ {
+ /* Both static and dynamic allocation can be used, so note this
+ * event group was allocated statically in case the event group is
+ * later deleted. */
+ pxEventBits->ucStaticallyAllocated = pdFALSE;
+ }
+ #endif /* configSUPPORT_STATIC_ALLOCATION */
- /* This assignment is obsolete as uxReturn will get set after
- * the task unblocks, but some compilers mistakenly generate a
- * warning about uxReturn being returned without being set if the
- * assignment is omitted. */
- uxReturn = 0;
+ traceEVENT_GROUP_CREATE( pxEventBits );
}
else
{
- /* The rendezvous bits were not set, but no block time was
- * specified - just return the current event bit value. */
- uxReturn = pxEventBits->uxEventBits;
- xTimeoutOccurred = pdTRUE;
+ traceEVENT_GROUP_CREATE_FAILED();
}
- }
- }
- xAlreadyYielded = xTaskResumeAll();
- if( xTicksToWait != ( TickType_t ) 0 )
- {
- if( xAlreadyYielded == pdFALSE )
- {
- portYIELD_WITHIN_API();
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
- }
-
- /* The task blocked to wait for its required bits to be set - at this
- * point either the required bits were set or the block time expired. If
- * the required bits were set they will have been stored in the task's
- * event list item, and they should now be retrieved then cleared. */
- uxReturn = uxTaskResetEventItemValue();
-
- if( ( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0 )
- {
- /* The task timed out, just return the current event bit value. */
- taskENTER_CRITICAL();
- {
- uxReturn = pxEventBits->uxEventBits;
-
- /* Although the task got here because it timed out before the
- * bits it was waiting for were set, it is possible that since it
- * unblocked another task has set the bits. If this is the case
- * then it needs to clear the bits before exiting. */
- if( ( uxReturn & uxBitsToWaitFor ) == uxBitsToWaitFor )
- {
- pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
- }
- }
- taskEXIT_CRITICAL();
+ traceRETURN_xEventGroupCreate( pxEventBits );
- xTimeoutOccurred = pdTRUE;
+ return pxEventBits;
}
- else
- {
- /* The task unblocked because the bits were set. */
- }
-
- /* Control bits might be set as the task had blocked should not be
- * returned. */
- uxReturn &= ~eventEVENT_BITS_CONTROL_BYTES;
- }
-
- traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred );
- /* Prevent compiler warnings when trace macros are not used. */
- ( void ) xTimeoutOccurred;
-
- return uxReturn;
-}
+ #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
/*-----------------------------------------------------------*/
-EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
+ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToSet,
const EventBits_t uxBitsToWaitFor,
- const BaseType_t xClearOnExit,
- const BaseType_t xWaitForAllBits,
TickType_t xTicksToWait )
-{
- EventGroup_t * pxEventBits = xEventGroup;
- EventBits_t uxReturn, uxControlBits = 0;
- BaseType_t xWaitConditionMet, xAlreadyYielded;
- BaseType_t xTimeoutOccurred = pdFALSE;
-
- /* Check the user is not attempting to wait on the bits used by the kernel
- * itself, and that at least one bit is being requested. */
- configASSERT( xEventGroup );
- configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
- configASSERT( uxBitsToWaitFor != 0 );
- #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
{
- configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
- }
- #endif
+ EventBits_t uxOriginalBitValue, uxReturn;
+ EventGroup_t * pxEventBits = xEventGroup;
+ BaseType_t xAlreadyYielded;
+ BaseType_t xTimeoutOccurred = pdFALSE;
- vTaskSuspendAll();
- {
- const EventBits_t uxCurrentEventBits = pxEventBits->uxEventBits;
+ traceENTER_xEventGroupSync( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTicksToWait );
- /* Check to see if the wait condition is already met or not. */
- xWaitConditionMet = prvTestWaitCondition( uxCurrentEventBits, uxBitsToWaitFor, xWaitForAllBits );
+ configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
+ configASSERT( uxBitsToWaitFor != 0 );
+ #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
+ {
+ configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
+ }
+ #endif
- if( xWaitConditionMet != pdFALSE )
+ vTaskSuspendAll();
{
- /* The wait condition has already been met so there is no need to
- * block. */
- uxReturn = uxCurrentEventBits;
- xTicksToWait = ( TickType_t ) 0;
+ uxOriginalBitValue = pxEventBits->uxEventBits;
+
+ ( void ) xEventGroupSetBits( xEventGroup, uxBitsToSet );
- /* Clear the wait bits if requested to do so. */
- if( xClearOnExit != pdFALSE )
+ if( ( ( uxOriginalBitValue | uxBitsToSet ) & uxBitsToWaitFor ) == uxBitsToWaitFor )
{
+ /* All the rendezvous bits are now set - no need to block. */
+ uxReturn = ( uxOriginalBitValue | uxBitsToSet );
+
+ /* Rendezvous always clear the bits. They will have been cleared
+ * already unless this is the only task in the rendezvous. */
pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
+
+ xTicksToWait = 0;
}
else
{
- mtCOVERAGE_TEST_MARKER();
+ if( xTicksToWait != ( TickType_t ) 0 )
+ {
+ traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor );
+
+ /* Store the bits that the calling task is waiting for in the
+ * task's event list item so the kernel knows when a match is
+ * found. Then enter the blocked state. */
+ vTaskPlaceOnUnorderedEventList( &( pxEventBits->xTasksWaitingForBits ), ( uxBitsToWaitFor | eventCLEAR_EVENTS_ON_EXIT_BIT | eventWAIT_FOR_ALL_BITS ), xTicksToWait );
+
+ /* This assignment is obsolete as uxReturn will get set after
+ * the task unblocks, but some compilers mistakenly generate a
+ * warning about uxReturn being returned without being set if the
+ * assignment is omitted. */
+ uxReturn = 0;
+ }
+ else
+ {
+ /* The rendezvous bits were not set, but no block time was
+ * specified - just return the current event bit value. */
+ uxReturn = pxEventBits->uxEventBits;
+ xTimeoutOccurred = pdTRUE;
+ }
}
}
- else if( xTicksToWait == ( TickType_t ) 0 )
- {
- /* The wait condition has not been met, but no block time was
- * specified, so just return the current value. */
- uxReturn = uxCurrentEventBits;
- xTimeoutOccurred = pdTRUE;
- }
- else
+ xAlreadyYielded = xTaskResumeAll();
+
+ if( xTicksToWait != ( TickType_t ) 0 )
{
- /* The task is going to block to wait for its required bits to be
- * set. uxControlBits are used to remember the specified behaviour of
- * this call to xEventGroupWaitBits() - for use when the event bits
- * unblock the task. */
- if( xClearOnExit != pdFALSE )
+ if( xAlreadyYielded == pdFALSE )
{
- uxControlBits |= eventCLEAR_EVENTS_ON_EXIT_BIT;
+ taskYIELD_WITHIN_API();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
- if( xWaitForAllBits != pdFALSE )
+ /* The task blocked to wait for its required bits to be set - at this
+ * point either the required bits were set or the block time expired. If
+ * the required bits were set they will have been stored in the task's
+ * event list item, and they should now be retrieved then cleared. */
+ uxReturn = uxTaskResetEventItemValue();
+
+ if( ( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0 )
{
- uxControlBits |= eventWAIT_FOR_ALL_BITS;
+ /* The task timed out, just return the current event bit value. */
+ taskENTER_CRITICAL();
+ {
+ uxReturn = pxEventBits->uxEventBits;
+
+ /* Although the task got here because it timed out before the
+ * bits it was waiting for were set, it is possible that since it
+ * unblocked another task has set the bits. If this is the case
+ * then it needs to clear the bits before exiting. */
+ if( ( uxReturn & uxBitsToWaitFor ) == uxBitsToWaitFor )
+ {
+ pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ taskEXIT_CRITICAL();
+
+ xTimeoutOccurred = pdTRUE;
}
else
{
- mtCOVERAGE_TEST_MARKER();
+ /* The task unblocked because the bits were set. */
}
- /* Store the bits that the calling task is waiting for in the
- * task's event list item so the kernel knows when a match is
- * found. Then enter the blocked state. */
- vTaskPlaceOnUnorderedEventList( &( pxEventBits->xTasksWaitingForBits ), ( uxBitsToWaitFor | uxControlBits ), xTicksToWait );
+ /* Control bits might be set as the task had blocked should not be
+ * returned. */
+ uxReturn &= ~eventEVENT_BITS_CONTROL_BYTES;
+ }
- /* This is obsolete as it will get set after the task unblocks, but
- * some compilers mistakenly generate a warning about the variable
- * being returned without being set if it is not done. */
- uxReturn = 0;
+ traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred );
- traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor );
- }
+ /* Prevent compiler warnings when trace macros are not used. */
+ ( void ) xTimeoutOccurred;
+
+ traceRETURN_xEventGroupSync( uxReturn );
+
+ return uxReturn;
}
- xAlreadyYielded = xTaskResumeAll();
+/*-----------------------------------------------------------*/
- if( xTicksToWait != ( TickType_t ) 0 )
+ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToWaitFor,
+ const BaseType_t xClearOnExit,
+ const BaseType_t xWaitForAllBits,
+ TickType_t xTicksToWait )
{
- if( xAlreadyYielded == pdFALSE )
+ EventGroup_t * pxEventBits = xEventGroup;
+ EventBits_t uxReturn, uxControlBits = 0;
+ BaseType_t xWaitConditionMet, xAlreadyYielded;
+ BaseType_t xTimeoutOccurred = pdFALSE;
+
+ traceENTER_xEventGroupWaitBits( xEventGroup, uxBitsToWaitFor, xClearOnExit, xWaitForAllBits, xTicksToWait );
+
+ /* Check the user is not attempting to wait on the bits used by the kernel
+ * itself, and that at least one bit is being requested. */
+ configASSERT( xEventGroup );
+ configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
+ configASSERT( uxBitsToWaitFor != 0 );
+ #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
{
- portYIELD_WITHIN_API();
+ configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
}
- else
+ #endif
+
+ vTaskSuspendAll();
{
- mtCOVERAGE_TEST_MARKER();
- }
+ const EventBits_t uxCurrentEventBits = pxEventBits->uxEventBits;
- /* The task blocked to wait for its required bits to be set - at this
- * point either the required bits were set or the block time expired. If
- * the required bits were set they will have been stored in the task's
- * event list item, and they should now be retrieved then cleared. */
- uxReturn = uxTaskResetEventItemValue();
+ /* Check to see if the wait condition is already met or not. */
+ xWaitConditionMet = prvTestWaitCondition( uxCurrentEventBits, uxBitsToWaitFor, xWaitForAllBits );
- if( ( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0 )
- {
- taskENTER_CRITICAL();
+ if( xWaitConditionMet != pdFALSE )
{
- /* The task timed out, just return the current event bit value. */
- uxReturn = pxEventBits->uxEventBits;
+ /* The wait condition has already been met so there is no need to
+ * block. */
+ uxReturn = uxCurrentEventBits;
+ xTicksToWait = ( TickType_t ) 0;
- /* It is possible that the event bits were updated between this
- * task leaving the Blocked state and running again. */
- if( prvTestWaitCondition( uxReturn, uxBitsToWaitFor, xWaitForAllBits ) != pdFALSE )
+ /* Clear the wait bits if requested to do so. */
+ if( xClearOnExit != pdFALSE )
{
- if( xClearOnExit != pdFALSE )
- {
- pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
- }
+ pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
-
+ }
+ else if( xTicksToWait == ( TickType_t ) 0 )
+ {
+ /* The wait condition has not been met, but no block time was
+ * specified, so just return the current value. */
+ uxReturn = uxCurrentEventBits;
xTimeoutOccurred = pdTRUE;
}
- taskEXIT_CRITICAL();
+ else
+ {
+ /* The task is going to block to wait for its required bits to be
+ * set. uxControlBits are used to remember the specified behaviour of
+ * this call to xEventGroupWaitBits() - for use when the event bits
+ * unblock the task. */
+ if( xClearOnExit != pdFALSE )
+ {
+ uxControlBits |= eventCLEAR_EVENTS_ON_EXIT_BIT;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ if( xWaitForAllBits != pdFALSE )
+ {
+ uxControlBits |= eventWAIT_FOR_ALL_BITS;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ /* Store the bits that the calling task is waiting for in the
+ * task's event list item so the kernel knows when a match is
+ * found. Then enter the blocked state. */
+ vTaskPlaceOnUnorderedEventList( &( pxEventBits->xTasksWaitingForBits ), ( uxBitsToWaitFor | uxControlBits ), xTicksToWait );
+
+ /* This is obsolete as it will get set after the task unblocks, but
+ * some compilers mistakenly generate a warning about the variable
+ * being returned without being set if it is not done. */
+ uxReturn = 0;
+
+ traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor );
+ }
}
- else
+ xAlreadyYielded = xTaskResumeAll();
+
+ if( xTicksToWait != ( TickType_t ) 0 )
{
- /* The task unblocked because the bits were set. */
- }
+ if( xAlreadyYielded == pdFALSE )
+ {
+ taskYIELD_WITHIN_API();
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
- /* The task blocked so control bits may have been set. */
- uxReturn &= ~eventEVENT_BITS_CONTROL_BYTES;
- }
+ /* The task blocked to wait for its required bits to be set - at this
+ * point either the required bits were set or the block time expired. If
+ * the required bits were set they will have been stored in the task's
+ * event list item, and they should now be retrieved then cleared. */
+ uxReturn = uxTaskResetEventItemValue();
+
+ if( ( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0 )
+ {
+ taskENTER_CRITICAL();
+ {
+ /* The task timed out, just return the current event bit value. */
+ uxReturn = pxEventBits->uxEventBits;
+
+ /* It is possible that the event bits were updated between this
+ * task leaving the Blocked state and running again. */
+ if( prvTestWaitCondition( uxReturn, uxBitsToWaitFor, xWaitForAllBits ) != pdFALSE )
+ {
+ if( xClearOnExit != pdFALSE )
+ {
+ pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
- traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred );
+ xTimeoutOccurred = pdTRUE;
+ }
+ taskEXIT_CRITICAL();
+ }
+ else
+ {
+ /* The task unblocked because the bits were set. */
+ }
- /* Prevent compiler warnings when trace macros are not used. */
- ( void ) xTimeoutOccurred;
+ /* The task blocked so control bits may have been set. */
+ uxReturn &= ~eventEVENT_BITS_CONTROL_BYTES;
+ }
- return uxReturn;
-}
-/*-----------------------------------------------------------*/
+ traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred );
-EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
- const EventBits_t uxBitsToClear )
-{
- EventGroup_t * pxEventBits = xEventGroup;
- EventBits_t uxReturn;
+ /* Prevent compiler warnings when trace macros are not used. */
+ ( void ) xTimeoutOccurred;
- /* Check the user is not attempting to clear the bits used by the kernel
- * itself. */
- configASSERT( xEventGroup );
- configASSERT( ( uxBitsToClear & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
+ traceRETURN_xEventGroupWaitBits( uxReturn );
- taskENTER_CRITICAL();
+ return uxReturn;
+ }
+/*-----------------------------------------------------------*/
+
+ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToClear )
{
- traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear );
+ EventGroup_t * pxEventBits = xEventGroup;
+ EventBits_t uxReturn;
- /* The value returned is the event group value prior to the bits being
- * cleared. */
- uxReturn = pxEventBits->uxEventBits;
+ traceENTER_xEventGroupClearBits( xEventGroup, uxBitsToClear );
- /* Clear the bits. */
- pxEventBits->uxEventBits &= ~uxBitsToClear;
- }
- taskEXIT_CRITICAL();
+ /* Check the user is not attempting to clear the bits used by the kernel
+ * itself. */
+ configASSERT( xEventGroup );
+ configASSERT( ( uxBitsToClear & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
- return uxReturn;
-}
-/*-----------------------------------------------------------*/
+ taskENTER_CRITICAL();
+ {
+ traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear );
-#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
+ /* The value returned is the event group value prior to the bits being
+ * cleared. */
+ uxReturn = pxEventBits->uxEventBits;
- BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup,
- const EventBits_t uxBitsToClear )
- {
- BaseType_t xReturn;
+ /* Clear the bits. */
+ pxEventBits->uxEventBits &= ~uxBitsToClear;
+ }
+ taskEXIT_CRITICAL();
- traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear );
- xReturn = xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL ); /*lint !e9087 Can't avoid cast to void* as a generic callback function not specific to this use case. Callback casts back to original type so safe. */
+ traceRETURN_xEventGroupClearBits( uxReturn );
- return xReturn;
+ return uxReturn;
}
-
-#endif /* if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) ) */
/*-----------------------------------------------------------*/
-EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup )
-{
- UBaseType_t uxSavedInterruptStatus;
- EventGroup_t const * const pxEventBits = xEventGroup;
- EventBits_t uxReturn;
+ #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
- uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
- {
- uxReturn = pxEventBits->uxEventBits;
- }
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+ BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToClear )
+ {
+ BaseType_t xReturn;
+
+ traceENTER_xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear );
+
+ traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear );
+ xReturn = xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL );
+
+ traceRETURN_xEventGroupClearBitsFromISR( xReturn );
- return uxReturn;
-} /*lint !e818 EventGroupHandle_t is a typedef used in other functions to so can't be pointer to const. */
+ return xReturn;
+ }
+
+ #endif /* if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) ) */
/*-----------------------------------------------------------*/
-EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
- const EventBits_t uxBitsToSet )
-{
- ListItem_t * pxListItem;
- ListItem_t * pxNext;
- ListItem_t const * pxListEnd;
- List_t const * pxList;
- EventBits_t uxBitsToClear = 0, uxBitsWaitedFor, uxControlBits;
- EventGroup_t * pxEventBits = xEventGroup;
- BaseType_t xMatchFound = pdFALSE;
-
- /* Check the user is not attempting to set the bits used by the kernel
- * itself. */
- configASSERT( xEventGroup );
- configASSERT( ( uxBitsToSet & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
-
- pxList = &( pxEventBits->xTasksWaitingForBits );
- pxListEnd = listGET_END_MARKER( pxList ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
- vTaskSuspendAll();
+ EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup )
{
- traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet );
+ UBaseType_t uxSavedInterruptStatus;
+ EventGroup_t const * const pxEventBits = xEventGroup;
+ EventBits_t uxReturn;
+
+ traceENTER_xEventGroupGetBitsFromISR( xEventGroup );
- pxListItem = listGET_HEAD_ENTRY( pxList );
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = taskENTER_CRITICAL_FROM_ISR();
+ {
+ uxReturn = pxEventBits->uxEventBits;
+ }
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
- /* Set the bits. */
- pxEventBits->uxEventBits |= uxBitsToSet;
+ traceRETURN_xEventGroupGetBitsFromISR( uxReturn );
- /* See if the new bit value should unblock any tasks. */
- while( pxListItem != pxListEnd )
+ return uxReturn;
+ }
+/*-----------------------------------------------------------*/
+
+ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToSet )
+ {
+ ListItem_t * pxListItem;
+ ListItem_t * pxNext;
+ ListItem_t const * pxListEnd;
+ List_t const * pxList;
+ EventBits_t uxBitsToClear = 0, uxBitsWaitedFor, uxControlBits;
+ EventGroup_t * pxEventBits = xEventGroup;
+ BaseType_t xMatchFound = pdFALSE;
+
+ traceENTER_xEventGroupSetBits( xEventGroup, uxBitsToSet );
+
+ /* Check the user is not attempting to set the bits used by the kernel
+ * itself. */
+ configASSERT( xEventGroup );
+ configASSERT( ( uxBitsToSet & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
+
+ pxList = &( pxEventBits->xTasksWaitingForBits );
+ pxListEnd = listGET_END_MARKER( pxList );
+ vTaskSuspendAll();
{
- pxNext = listGET_NEXT( pxListItem );
- uxBitsWaitedFor = listGET_LIST_ITEM_VALUE( pxListItem );
- xMatchFound = pdFALSE;
+ traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet );
+
+ pxListItem = listGET_HEAD_ENTRY( pxList );
- /* Split the bits waited for from the control bits. */
- uxControlBits = uxBitsWaitedFor & eventEVENT_BITS_CONTROL_BYTES;
- uxBitsWaitedFor &= ~eventEVENT_BITS_CONTROL_BYTES;
+ /* Set the bits. */
+ pxEventBits->uxEventBits |= uxBitsToSet;
- if( ( uxControlBits & eventWAIT_FOR_ALL_BITS ) == ( EventBits_t ) 0 )
+ /* See if the new bit value should unblock any tasks. */
+ while( pxListItem != pxListEnd )
{
- /* Just looking for single bit being set. */
- if( ( uxBitsWaitedFor & pxEventBits->uxEventBits ) != ( EventBits_t ) 0 )
+ pxNext = listGET_NEXT( pxListItem );
+ uxBitsWaitedFor = listGET_LIST_ITEM_VALUE( pxListItem );
+ xMatchFound = pdFALSE;
+
+ /* Split the bits waited for from the control bits. */
+ uxControlBits = uxBitsWaitedFor & eventEVENT_BITS_CONTROL_BYTES;
+ uxBitsWaitedFor &= ~eventEVENT_BITS_CONTROL_BYTES;
+
+ if( ( uxControlBits & eventWAIT_FOR_ALL_BITS ) == ( EventBits_t ) 0 )
+ {
+ /* Just looking for single bit being set. */
+ if( ( uxBitsWaitedFor & pxEventBits->uxEventBits ) != ( EventBits_t ) 0 )
+ {
+ xMatchFound = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else if( ( uxBitsWaitedFor & pxEventBits->uxEventBits ) == uxBitsWaitedFor )
{
+ /* All bits are set. */
xMatchFound = pdTRUE;
}
else
{
- mtCOVERAGE_TEST_MARKER();
+ /* Need all bits to be set, but not all the bits were set. */
}
- }
- else if( ( uxBitsWaitedFor & pxEventBits->uxEventBits ) == uxBitsWaitedFor )
- {
- /* All bits are set. */
- xMatchFound = pdTRUE;
- }
- else
- {
- /* Need all bits to be set, but not all the bits were set. */
- }
- if( xMatchFound != pdFALSE )
- {
- /* The bits match. Should the bits be cleared on exit? */
- if( ( uxControlBits & eventCLEAR_EVENTS_ON_EXIT_BIT ) != ( EventBits_t ) 0 )
- {
- uxBitsToClear |= uxBitsWaitedFor;
- }
- else
+ if( xMatchFound != pdFALSE )
{
- mtCOVERAGE_TEST_MARKER();
+ /* The bits match. Should the bits be cleared on exit? */
+ if( ( uxControlBits & eventCLEAR_EVENTS_ON_EXIT_BIT ) != ( EventBits_t ) 0 )
+ {
+ uxBitsToClear |= uxBitsWaitedFor;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ /* Store the actual event flag value in the task's event list
+ * item before removing the task from the event list. The
+ * eventUNBLOCKED_DUE_TO_BIT_SET bit is set so the task knows
+ * that is was unblocked due to its required bits matching, rather
+ * than because it timed out. */
+ vTaskRemoveFromUnorderedEventList( pxListItem, pxEventBits->uxEventBits | eventUNBLOCKED_DUE_TO_BIT_SET );
}
- /* Store the actual event flag value in the task's event list
- * item before removing the task from the event list. The
- * eventUNBLOCKED_DUE_TO_BIT_SET bit is set so the task knows
- * that is was unblocked due to its required bits matching, rather
- * than because it timed out. */
- vTaskRemoveFromUnorderedEventList( pxListItem, pxEventBits->uxEventBits | eventUNBLOCKED_DUE_TO_BIT_SET );
+ /* Move onto the next list item. Note pxListItem->pxNext is not
+ * used here as the list item may have been removed from the event list
+ * and inserted into the ready/pending reading list. */
+ pxListItem = pxNext;
}
- /* Move onto the next list item. Note pxListItem->pxNext is not
- * used here as the list item may have been removed from the event list
- * and inserted into the ready/pending reading list. */
- pxListItem = pxNext;
+ /* Clear any bits that matched when the eventCLEAR_EVENTS_ON_EXIT_BIT
+ * bit was set in the control word. */
+ pxEventBits->uxEventBits &= ~uxBitsToClear;
}
+ ( void ) xTaskResumeAll();
- /* Clear any bits that matched when the eventCLEAR_EVENTS_ON_EXIT_BIT
- * bit was set in the control word. */
- pxEventBits->uxEventBits &= ~uxBitsToClear;
- }
- ( void ) xTaskResumeAll();
+ traceRETURN_xEventGroupSetBits( pxEventBits->uxEventBits );
- return pxEventBits->uxEventBits;
-}
+ return pxEventBits->uxEventBits;
+ }
/*-----------------------------------------------------------*/
-void vEventGroupDelete( EventGroupHandle_t xEventGroup )
-{
- EventGroup_t * pxEventBits = xEventGroup;
- const List_t * pxTasksWaitingForBits;
+ void vEventGroupDelete( EventGroupHandle_t xEventGroup )
+ {
+ EventGroup_t * pxEventBits = xEventGroup;
+ const List_t * pxTasksWaitingForBits;
- configASSERT( pxEventBits );
+ traceENTER_vEventGroupDelete( xEventGroup );
- pxTasksWaitingForBits = &( pxEventBits->xTasksWaitingForBits );
+ configASSERT( pxEventBits );
- vTaskSuspendAll();
- {
- traceEVENT_GROUP_DELETE( xEventGroup );
+ pxTasksWaitingForBits = &( pxEventBits->xTasksWaitingForBits );
- while( listCURRENT_LIST_LENGTH( pxTasksWaitingForBits ) > ( UBaseType_t ) 0 )
+ vTaskSuspendAll();
{
- /* Unblock the task, returning 0 as the event list is being deleted
- * and cannot therefore have any bits set. */
- configASSERT( pxTasksWaitingForBits->xListEnd.pxNext != ( const ListItem_t * ) &( pxTasksWaitingForBits->xListEnd ) );
- vTaskRemoveFromUnorderedEventList( pxTasksWaitingForBits->xListEnd.pxNext, eventUNBLOCKED_DUE_TO_BIT_SET );
+ traceEVENT_GROUP_DELETE( xEventGroup );
+
+ while( listCURRENT_LIST_LENGTH( pxTasksWaitingForBits ) > ( UBaseType_t ) 0 )
+ {
+ /* Unblock the task, returning 0 as the event list is being deleted
+ * and cannot therefore have any bits set. */
+ configASSERT( pxTasksWaitingForBits->xListEnd.pxNext != ( const ListItem_t * ) &( pxTasksWaitingForBits->xListEnd ) );
+ vTaskRemoveFromUnorderedEventList( pxTasksWaitingForBits->xListEnd.pxNext, eventUNBLOCKED_DUE_TO_BIT_SET );
+ }
}
- }
- ( void ) xTaskResumeAll();
+ ( void ) xTaskResumeAll();
- #if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) )
- {
- /* The event group can only have been allocated dynamically - free
- * it again. */
- vPortFree( pxEventBits );
- }
- #elif ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
- {
- /* The event group could have been allocated statically or
- * dynamically, so check before attempting to free the memory. */
- if( pxEventBits->ucStaticallyAllocated == ( uint8_t ) pdFALSE )
+ #if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) )
{
+ /* The event group can only have been allocated dynamically - free
+ * it again. */
vPortFree( pxEventBits );
}
- else
+ #elif ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
{
- mtCOVERAGE_TEST_MARKER();
+ /* The event group could have been allocated statically or
+ * dynamically, so check before attempting to free the memory. */
+ if( pxEventBits->ucStaticallyAllocated == ( uint8_t ) pdFALSE )
+ {
+ vPortFree( pxEventBits );
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
+ #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
+
+ traceRETURN_vEventGroupDelete();
}
- #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
-}
+/*-----------------------------------------------------------*/
+
+ #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ BaseType_t xEventGroupGetStaticBuffer( EventGroupHandle_t xEventGroup,
+ StaticEventGroup_t ** ppxEventGroupBuffer )
+ {
+ BaseType_t xReturn;
+ EventGroup_t * pxEventBits = xEventGroup;
+
+ traceENTER_xEventGroupGetStaticBuffer( xEventGroup, ppxEventGroupBuffer );
+
+ configASSERT( pxEventBits );
+ configASSERT( ppxEventGroupBuffer );
+
+ #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ {
+ /* Check if the event group was statically allocated. */
+ if( pxEventBits->ucStaticallyAllocated == ( uint8_t ) pdTRUE )
+ {
+ /* MISRA Ref 11.3.1 [Misaligned access] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
+ /* coverity[misra_c_2012_rule_11_3_violation] */
+ *ppxEventGroupBuffer = ( StaticEventGroup_t * ) pxEventBits;
+ xReturn = pdTRUE;
+ }
+ else
+ {
+ xReturn = pdFALSE;
+ }
+ }
+ #else /* configSUPPORT_DYNAMIC_ALLOCATION */
+ {
+ /* Event group must have been statically allocated. */
+ /* MISRA Ref 11.3.1 [Misaligned access] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
+ /* coverity[misra_c_2012_rule_11_3_violation] */
+ *ppxEventGroupBuffer = ( StaticEventGroup_t * ) pxEventBits;
+ xReturn = pdTRUE;
+ }
+ #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
+
+ traceRETURN_xEventGroupGetStaticBuffer( xReturn );
+
+ return xReturn;
+ }
+ #endif /* configSUPPORT_STATIC_ALLOCATION */
/*-----------------------------------------------------------*/
/* For internal use only - execute a 'set bits' command that was pended from
* an interrupt. */
-void vEventGroupSetBitsCallback( void * pvEventGroup,
- const uint32_t ulBitsToSet )
-{
- ( void ) xEventGroupSetBits( pvEventGroup, ( EventBits_t ) ulBitsToSet ); /*lint !e9079 Can't avoid cast to void* as a generic timer callback prototype. Callback casts back to original type so safe. */
-}
+ void vEventGroupSetBitsCallback( void * pvEventGroup,
+ uint32_t ulBitsToSet )
+ {
+ traceENTER_vEventGroupSetBitsCallback( pvEventGroup, ulBitsToSet );
+
+ /* MISRA Ref 11.5.4 [Callback function parameter] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ ( void ) xEventGroupSetBits( pvEventGroup, ( EventBits_t ) ulBitsToSet );
+
+ traceRETURN_vEventGroupSetBitsCallback();
+ }
/*-----------------------------------------------------------*/
/* For internal use only - execute a 'clear bits' command that was pended from
* an interrupt. */
-void vEventGroupClearBitsCallback( void * pvEventGroup,
- const uint32_t ulBitsToClear )
-{
- ( void ) xEventGroupClearBits( pvEventGroup, ( EventBits_t ) ulBitsToClear ); /*lint !e9079 Can't avoid cast to void* as a generic timer callback prototype. Callback casts back to original type so safe. */
-}
-/*-----------------------------------------------------------*/
+ void vEventGroupClearBitsCallback( void * pvEventGroup,
+ uint32_t ulBitsToClear )
+ {
+ traceENTER_vEventGroupClearBitsCallback( pvEventGroup, ulBitsToClear );
-static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
- const EventBits_t uxBitsToWaitFor,
- const BaseType_t xWaitForAllBits )
-{
- BaseType_t xWaitConditionMet = pdFALSE;
+ /* MISRA Ref 11.5.4 [Callback function parameter] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ ( void ) xEventGroupClearBits( pvEventGroup, ( EventBits_t ) ulBitsToClear );
- if( xWaitForAllBits == pdFALSE )
- {
- /* Task only has to wait for one bit within uxBitsToWaitFor to be
- * set. Is one already set? */
- if( ( uxCurrentEventBits & uxBitsToWaitFor ) != ( EventBits_t ) 0 )
- {
- xWaitConditionMet = pdTRUE;
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
- }
+ traceRETURN_vEventGroupClearBitsCallback();
}
- else
+/*-----------------------------------------------------------*/
+
+ static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
+ const EventBits_t uxBitsToWaitFor,
+ const BaseType_t xWaitForAllBits )
{
- /* Task has to wait for all the bits in uxBitsToWaitFor to be set.
- * Are they set already? */
- if( ( uxCurrentEventBits & uxBitsToWaitFor ) == uxBitsToWaitFor )
+ BaseType_t xWaitConditionMet = pdFALSE;
+
+ if( xWaitForAllBits == pdFALSE )
{
- xWaitConditionMet = pdTRUE;
+ /* Task only has to wait for one bit within uxBitsToWaitFor to be
+ * set. Is one already set? */
+ if( ( uxCurrentEventBits & uxBitsToWaitFor ) != ( EventBits_t ) 0 )
+ {
+ xWaitConditionMet = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
else
{
- mtCOVERAGE_TEST_MARKER();
+ /* Task has to wait for all the bits in uxBitsToWaitFor to be set.
+ * Are they set already? */
+ if( ( uxCurrentEventBits & uxBitsToWaitFor ) == uxBitsToWaitFor )
+ {
+ xWaitConditionMet = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
- }
- return xWaitConditionMet;
-}
+ return xWaitConditionMet;
+ }
/*-----------------------------------------------------------*/
-#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
+ #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
- BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup,
- const EventBits_t uxBitsToSet,
- BaseType_t * pxHigherPriorityTaskWoken )
- {
- BaseType_t xReturn;
+ BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToSet,
+ BaseType_t * pxHigherPriorityTaskWoken )
+ {
+ BaseType_t xReturn;
- traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet );
- xReturn = xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken ); /*lint !e9087 Can't avoid cast to void* as a generic callback function not specific to this use case. Callback casts back to original type so safe. */
+ traceENTER_xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken );
- return xReturn;
- }
+ traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet );
+ xReturn = xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken );
-#endif /* if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) ) */
-/*-----------------------------------------------------------*/
+ traceRETURN_xEventGroupSetBitsFromISR( xReturn );
-#if ( configUSE_TRACE_FACILITY == 1 )
+ return xReturn;
+ }
- UBaseType_t uxEventGroupGetNumber( void * xEventGroup )
- {
- UBaseType_t xReturn;
- EventGroup_t const * pxEventBits = ( EventGroup_t * ) xEventGroup; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t, but EventGroupHandle_t is kept opaque outside of this file for data hiding purposes. */
+ #endif /* if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) ) */
+/*-----------------------------------------------------------*/
- if( xEventGroup == NULL )
- {
- xReturn = 0;
- }
- else
+ #if ( configUSE_TRACE_FACILITY == 1 )
+
+ UBaseType_t uxEventGroupGetNumber( void * xEventGroup )
{
- xReturn = pxEventBits->uxEventGroupNumber;
- }
+ UBaseType_t xReturn;
- return xReturn;
- }
+ /* MISRA Ref 11.5.2 [Opaque pointer] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ EventGroup_t const * pxEventBits = ( EventGroup_t * ) xEventGroup;
+
+ traceENTER_uxEventGroupGetNumber( xEventGroup );
+
+ if( xEventGroup == NULL )
+ {
+ xReturn = 0;
+ }
+ else
+ {
+ xReturn = pxEventBits->uxEventGroupNumber;
+ }
+
+ traceRETURN_uxEventGroupGetNumber( xReturn );
-#endif /* configUSE_TRACE_FACILITY */
+ return xReturn;
+ }
+
+ #endif /* configUSE_TRACE_FACILITY */
/*-----------------------------------------------------------*/
-#if ( configUSE_TRACE_FACILITY == 1 )
+ #if ( configUSE_TRACE_FACILITY == 1 )
- void vEventGroupSetNumber( void * xEventGroup,
- UBaseType_t uxEventGroupNumber )
- {
- ( ( EventGroup_t * ) xEventGroup )->uxEventGroupNumber = uxEventGroupNumber; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t, but EventGroupHandle_t is kept opaque outside of this file for data hiding purposes. */
- }
+ void vEventGroupSetNumber( void * xEventGroup,
+ UBaseType_t uxEventGroupNumber )
+ {
+ traceENTER_vEventGroupSetNumber( xEventGroup, uxEventGroupNumber );
+
+ /* MISRA Ref 11.5.2 [Opaque pointer] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ ( ( EventGroup_t * ) xEventGroup )->uxEventGroupNumber = uxEventGroupNumber;
-#endif /* configUSE_TRACE_FACILITY */
+ traceRETURN_vEventGroupSetNumber();
+ }
+
+ #endif /* configUSE_TRACE_FACILITY */
/*-----------------------------------------------------------*/
+
+/* This entire source file will be skipped if the application is not configured
+ * to include event groups functionality. If you want to include event groups
+ * then ensure configUSE_EVENT_GROUPS is set to 1 in FreeRTOSConfig.h. */
+#endif /* configUSE_EVENT_GROUPS == 1 */
diff --git a/third-party/freertos/freertos.kconfig b/third-party/freertos/freertos.kconfig
index f983bd84ec7d533a3aeb6918c3cecb3a1e9ec66f..672b1ca2c0b5df1667f712dc4440a5ab1c58dfa5 100644
--- a/third-party/freertos/freertos.kconfig
+++ b/third-party/freertos/freertos.kconfig
@@ -17,7 +17,7 @@ menu "FreeRTOS Kernel Configuration"
Select the tick rate at which FreeRTOS does pre-emptive context switching.
choice
- prompt "Freertos tick interrupt source"
+ prompt "FreeRTOS tick interrupt source"
default NON_SECURE_PHYSICAL_TIMER
config NON_SECURE_PHYSICAL_TIMER
diff --git a/third-party/freertos/include/FreeRTOS.h b/third-party/freertos/include/FreeRTOS.h
index d829d441a0c53faabe0081af19d50d8302e694df..146f286fee59a7ab6144190c73a8f3a7819b233a 100644
--- a/third-party/freertos/include/FreeRTOS.h
+++ b/third-party/freertos/include/FreeRTOS.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -55,9 +55,51 @@
#endif
/* *INDENT-ON* */
+/* Acceptable values for configTICK_TYPE_WIDTH_IN_BITS. */
+#define TICK_TYPE_WIDTH_16_BITS 0
+#define TICK_TYPE_WIDTH_32_BITS 1
+#define TICK_TYPE_WIDTH_64_BITS 2
+
/* Application specific configuration options. */
#include "FreeRTOSConfig.h"
+#if !defined( configUSE_16_BIT_TICKS ) && !defined( configTICK_TYPE_WIDTH_IN_BITS )
+ #error Missing definition: One of configUSE_16_BIT_TICKS and configTICK_TYPE_WIDTH_IN_BITS must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details.
+#endif
+
+#if defined( configUSE_16_BIT_TICKS ) && defined( configTICK_TYPE_WIDTH_IN_BITS )
+ #error Only one of configUSE_16_BIT_TICKS and configTICK_TYPE_WIDTH_IN_BITS must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details.
+#endif
+
+/* Define configTICK_TYPE_WIDTH_IN_BITS according to the
+ * value of configUSE_16_BIT_TICKS for backward compatibility. */
+#ifndef configTICK_TYPE_WIDTH_IN_BITS
+ #if ( configUSE_16_BIT_TICKS == 1 )
+ #define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_16_BITS
+ #else
+ #define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_32_BITS
+ #endif
+#endif
+
+/* Set configUSE_MPU_WRAPPERS_V1 to 1 to use MPU wrappers v1. */
+#ifndef configUSE_MPU_WRAPPERS_V1
+ #define configUSE_MPU_WRAPPERS_V1 0
+#endif
+
+/* Set configENABLE_ACCESS_CONTROL_LIST to 1 to enable access control list support. */
+#ifndef configENABLE_ACCESS_CONTROL_LIST
+ #define configENABLE_ACCESS_CONTROL_LIST 0
+#endif
+
+/* Set default value of configNUMBER_OF_CORES to 1 to use single core FreeRTOS. */
+#ifndef configNUMBER_OF_CORES
+ #define configNUMBER_OF_CORES 1
+#endif
+
+#ifndef configUSE_MALLOC_FAILED_HOOK
+ #define configUSE_MALLOC_FAILED_HOOK 0
+#endif
+
/* Basic FreeRTOS definitions. */
#include "projdefs.h"
@@ -72,41 +114,26 @@
/* Required if struct _reent is used. */
#if ( configUSE_NEWLIB_REENTRANT == 1 )
-/* Note Newlib support has been included by popular demand, but is not
- * used by the FreeRTOS maintainers themselves. FreeRTOS is not
- * responsible for resulting newlib operation. User must be familiar with
- * newlib and must provide system-wide implementations of the necessary
- * stubs. Be warned that (at the time of writing) the current newlib design
- * implements a system-wide malloc() that must be provided with locks.
- *
- * See the third party link http://www.nadler.com/embedded/newlibAndFreeRTOS.html
- * for additional information. */
- #include
+ #include "newlib-freertos.h"
- #define configUSE_C_RUNTIME_TLS_SUPPORT 1
+#endif /* if ( configUSE_NEWLIB_REENTRANT == 1 ) */
- #ifndef configTLS_BLOCK_TYPE
- #define configTLS_BLOCK_TYPE struct _reent
- #endif
+/* Must be defaulted before configUSE_PICOLIBC_TLS is used below. */
+#ifndef configUSE_PICOLIBC_TLS
+ #define configUSE_PICOLIBC_TLS 0
+#endif
- #ifndef configINIT_TLS_BLOCK
- #define configINIT_TLS_BLOCK( xTLSBlock ) _REENT_INIT_PTR( &( xTLSBlock ) )
- #endif
+#if ( configUSE_PICOLIBC_TLS == 1 )
- #ifndef configSET_TLS_BLOCK
- #define configSET_TLS_BLOCK( xTLSBlock ) _impure_ptr = &( xTLSBlock )
- #endif
+ #include "picolibc-freertos.h"
- #ifndef configDEINIT_TLS_BLOCK
- #define configDEINIT_TLS_BLOCK( xTLSBlock ) _reclaim_reent( &( xTLSBlock ) )
- #endif
-#endif /* if ( configUSE_NEWLIB_REENTRANT == 1 ) */
+#endif /* if ( configUSE_PICOLIBC_TLS == 1 ) */
#ifndef configUSE_C_RUNTIME_TLS_SUPPORT
#define configUSE_C_RUNTIME_TLS_SUPPORT 0
#endif
-#if ( ( configUSE_NEWLIB_REENTRANT == 0 ) && ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
+#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
#ifndef configTLS_BLOCK_TYPE
#error Missing definition: configTLS_BLOCK_TYPE must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
@@ -123,7 +150,7 @@
#ifndef configDEINIT_TLS_BLOCK
#error Missing definition: configDEINIT_TLS_BLOCK must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
#endif
-#endif /* if ( ( configUSE_NEWLIB_REENTRANT == 0 ) && ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) ) */
+#endif /* if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) */
/*
* Check all the required application specific macros have been defined.
@@ -151,12 +178,20 @@
#error Missing definition: configUSE_IDLE_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
#endif
+#if ( configNUMBER_OF_CORES > 1 )
+ #ifndef configUSE_PASSIVE_IDLE_HOOK
+ #error Missing definition: configUSE_PASSIVE_IDLE_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
+ #endif
+#endif
+
#ifndef configUSE_TICK_HOOK
#error Missing definition: configUSE_TICK_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
#endif
-#ifndef configUSE_16_BIT_TICKS
- #error Missing definition: configUSE_16_BIT_TICKS must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
+#if ( ( configTICK_TYPE_WIDTH_IN_BITS != TICK_TYPE_WIDTH_16_BITS ) && \
+ ( configTICK_TYPE_WIDTH_IN_BITS != TICK_TYPE_WIDTH_32_BITS ) && \
+ ( configTICK_TYPE_WIDTH_IN_BITS != TICK_TYPE_WIDTH_64_BITS ) )
+ #error Macro configTICK_TYPE_WIDTH_IN_BITS is defined to incorrect value. See the Configuration section of the FreeRTOS API documentation for details.
#endif
#ifndef configUSE_CO_ROUTINES
@@ -263,10 +298,6 @@
#endif
#endif
-#ifndef configUSE_DAEMON_TASK_STARTUP_HOOK
- #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
-#endif
-
#ifndef configUSE_APPLICATION_TASK_TAG
#define configUSE_APPLICATION_TASK_TAG 0
#endif
@@ -287,10 +318,32 @@
#define configUSE_TIMERS 0
#endif
+#ifndef configUSE_EVENT_GROUPS
+ #define configUSE_EVENT_GROUPS 1
+#endif
+
+#ifndef configUSE_STREAM_BUFFERS
+ #define configUSE_STREAM_BUFFERS 1
+#endif
+
+#ifndef configUSE_DAEMON_TASK_STARTUP_HOOK
+ #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
+#endif
+
+#if ( configUSE_DAEMON_TASK_STARTUP_HOOK != 0 )
+ #if ( configUSE_TIMERS == 0 )
+ #error configUSE_DAEMON_TASK_STARTUP_HOOK is set, but the daemon task is not created because configUSE_TIMERS is 0.
+ #endif
+#endif
+
#ifndef configUSE_COUNTING_SEMAPHORES
#define configUSE_COUNTING_SEMAPHORES 0
#endif
+#ifndef configUSE_TASK_PREEMPTION_DISABLE
+ #define configUSE_TASK_PREEMPTION_DISABLE 0
+#endif
+
#ifndef configUSE_ALTERNATIVE_API
#define configUSE_ALTERNATIVE_API 0
#endif
@@ -330,6 +383,17 @@
#define configPRECONDITION_DEFINED 1
#endif
+#ifndef configCHECK_HANDLER_INSTALLATION
+ #define configCHECK_HANDLER_INSTALLATION 1
+#else
+
+/* The application has explicitly defined configCHECK_HANDLER_INSTALLATION
+ * to 1. The checks requires configASSERT() to be defined. */
+ #if ( ( configCHECK_HANDLER_INSTALLATION == 1 ) && ( configASSERT_DEFINED == 0 ) )
+ #error You must define configASSERT() when configCHECK_HANDLER_INSTALLATION is 1.
+ #endif
+#endif
+
#ifndef portMEMORY_BARRIER
#define portMEMORY_BARRIER()
#endif
@@ -338,6 +402,116 @@
#define portSOFTWARE_BARRIER()
#endif
+#ifndef configRUN_MULTIPLE_PRIORITIES
+ #define configRUN_MULTIPLE_PRIORITIES 0
+#endif
+
+#ifndef portGET_CORE_ID
+
+ #if ( configNUMBER_OF_CORES == 1 )
+ #define portGET_CORE_ID() 0
+ #else
+ #error configNUMBER_OF_CORES is set to more than 1 then portGET_CORE_ID must also be defined.
+ #endif /* configNUMBER_OF_CORES */
+
+#endif /* portGET_CORE_ID */
+
+#ifndef portYIELD_CORE
+
+ #if ( configNUMBER_OF_CORES == 1 )
+ #define portYIELD_CORE( x ) portYIELD()
+ #else
+ #error configNUMBER_OF_CORES is set to more than 1 then portYIELD_CORE must also be defined.
+ #endif /* configNUMBER_OF_CORES */
+
+#endif /* portYIELD_CORE */
+
+#ifndef portSET_INTERRUPT_MASK
+
+ #if ( configNUMBER_OF_CORES > 1 )
+ #error portSET_INTERRUPT_MASK is required in SMP
+ #endif
+
+#endif /* portSET_INTERRUPT_MASK */
+
+#ifndef portCLEAR_INTERRUPT_MASK
+
+ #if ( configNUMBER_OF_CORES > 1 )
+ #error portCLEAR_INTERRUPT_MASK is required in SMP
+ #endif
+
+#endif /* portCLEAR_INTERRUPT_MASK */
+
+#ifndef portRELEASE_TASK_LOCK
+
+ #if ( configNUMBER_OF_CORES == 1 )
+ #define portRELEASE_TASK_LOCK()
+ #else
+ #error portRELEASE_TASK_LOCK is required in SMP
+ #endif
+
+#endif /* portRELEASE_TASK_LOCK */
+
+#ifndef portGET_TASK_LOCK
+
+ #if ( configNUMBER_OF_CORES == 1 )
+ #define portGET_TASK_LOCK()
+ #else
+ #error portGET_TASK_LOCK is required in SMP
+ #endif
+
+#endif /* portGET_TASK_LOCK */
+
+#ifndef portRELEASE_ISR_LOCK
+
+ #if ( configNUMBER_OF_CORES == 1 )
+ #define portRELEASE_ISR_LOCK()
+ #else
+ #error portRELEASE_ISR_LOCK is required in SMP
+ #endif
+
+#endif /* portRELEASE_ISR_LOCK */
+
+#ifndef portGET_ISR_LOCK
+
+ #if ( configNUMBER_OF_CORES == 1 )
+ #define portGET_ISR_LOCK()
+ #else
+ #error portGET_ISR_LOCK is required in SMP
+ #endif
+
+#endif /* portGET_ISR_LOCK */
+
+#ifndef portENTER_CRITICAL_FROM_ISR
+
+ #if ( configNUMBER_OF_CORES > 1 )
+ #error portENTER_CRITICAL_FROM_ISR is required in SMP
+ #endif
+
+#endif
+
+#ifndef portEXIT_CRITICAL_FROM_ISR
+
+ #if ( configNUMBER_OF_CORES > 1 )
+ #error portEXIT_CRITICAL_FROM_ISR is required in SMP
+ #endif
+
+#endif
+
+#ifndef configUSE_CORE_AFFINITY
+ #define configUSE_CORE_AFFINITY 0
+#endif /* configUSE_CORE_AFFINITY */
+
+#if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ #ifndef configTASK_DEFAULT_CORE_AFFINITY
+ #define configTASK_DEFAULT_CORE_AFFINITY tskNO_AFFINITY
+ #endif
+#endif
+
+#ifndef configUSE_PASSIVE_IDLE_HOOK
+ #define configUSE_PASSIVE_IDLE_HOOK 0
+#endif /* configUSE_PASSIVE_IDLE_HOOK */
+
/* The timers module relies on xTaskGetSchedulerState(). */
#if configUSE_TIMERS == 1
@@ -353,14 +527,42 @@
#error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined.
#endif /* configTIMER_TASK_STACK_DEPTH */
+ #ifndef portTIMER_CALLBACK_ATTRIBUTE
+ #define portTIMER_CALLBACK_ATTRIBUTE
+ #endif /* portTIMER_CALLBACK_ATTRIBUTE */
+
#endif /* configUSE_TIMERS */
+#ifndef portHAS_NESTED_INTERRUPTS
+ #if defined( portSET_INTERRUPT_MASK_FROM_ISR ) && defined( portCLEAR_INTERRUPT_MASK_FROM_ISR )
+ #define portHAS_NESTED_INTERRUPTS 1
+ #else
+ #define portHAS_NESTED_INTERRUPTS 0
+ #endif
+#endif
+
#ifndef portSET_INTERRUPT_MASK_FROM_ISR
- #define portSET_INTERRUPT_MASK_FROM_ISR() 0
+ #if ( portHAS_NESTED_INTERRUPTS == 1 )
+ #error portSET_INTERRUPT_MASK_FROM_ISR must be defined for ports that support nested interrupts (i.e. portHAS_NESTED_INTERRUPTS is set to 1)
+ #else
+ #define portSET_INTERRUPT_MASK_FROM_ISR() 0
+ #endif
+#else
+ #if ( portHAS_NESTED_INTERRUPTS == 0 )
+ #error portSET_INTERRUPT_MASK_FROM_ISR must not be defined for ports that do not support nested interrupts (i.e. portHAS_NESTED_INTERRUPTS is set to 0)
+ #endif
#endif
#ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR
- #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) ( uxSavedStatusValue )
+ #if ( portHAS_NESTED_INTERRUPTS == 1 )
+ #error portCLEAR_INTERRUPT_MASK_FROM_ISR must be defined for ports that support nested interrupts (i.e. portHAS_NESTED_INTERRUPTS is set to 1)
+ #else
+ #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) ( uxSavedStatusValue )
+ #endif
+#else
+ #if ( portHAS_NESTED_INTERRUPTS == 0 )
+ #error portCLEAR_INTERRUPT_MASK_FROM_ISR must not be defined for ports that do not support nested interrupts (i.e. portHAS_NESTED_INTERRUPTS is set to 0)
+ #endif
#endif
#ifndef portCLEAN_UP_TCB
@@ -375,6 +577,10 @@
#define portSETUP_TCB( pxTCB ) ( void ) ( pxTCB )
#endif
+#ifndef portTASK_SWITCH_HOOK
+ #define portTASK_SWITCH_HOOK( pxTCB ) ( void ) ( pxTCB )
+#endif
+
#ifndef configQUEUE_REGISTRY_SIZE
#define configQUEUE_REGISTRY_SIZE 0U
#endif
@@ -507,6 +713,14 @@
#define tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )
#endif
+#ifndef traceMOVED_TASK_TO_DELAYED_LIST
+ #define traceMOVED_TASK_TO_DELAYED_LIST()
+#endif
+
+#ifndef traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST
+ #define traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST()
+#endif
+
#ifndef traceQUEUE_CREATE
#define traceQUEUE_CREATE( pxNewQueue )
#endif
@@ -755,16 +969,28 @@
#define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify )
#endif
+#ifndef traceISR_EXIT_TO_SCHEDULER
+ #define traceISR_EXIT_TO_SCHEDULER()
+#endif
+
+#ifndef traceISR_EXIT
+ #define traceISR_EXIT()
+#endif
+
+#ifndef traceISR_ENTER
+ #define traceISR_ENTER()
+#endif
+
#ifndef traceSTREAM_BUFFER_CREATE_FAILED
- #define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer )
+ #define traceSTREAM_BUFFER_CREATE_FAILED( xStreamBufferType )
#endif
#ifndef traceSTREAM_BUFFER_CREATE_STATIC_FAILED
- #define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer )
+ #define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xStreamBufferType )
#endif
#ifndef traceSTREAM_BUFFER_CREATE
- #define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer )
+ #define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xStreamBufferType )
#endif
#ifndef traceSTREAM_BUFFER_DELETE
@@ -775,6 +1001,10 @@
#define traceSTREAM_BUFFER_RESET( xStreamBuffer )
#endif
+#ifndef traceSTREAM_BUFFER_RESET_FROM_ISR
+ #define traceSTREAM_BUFFER_RESET_FROM_ISR( xStreamBuffer )
+#endif
+
#ifndef traceBLOCKING_ON_STREAM_BUFFER_SEND
#define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer )
#endif
@@ -807,223 +1037,1871 @@
#define traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength )
#endif
-#ifndef configGENERATE_RUN_TIME_STATS
- #define configGENERATE_RUN_TIME_STATS 0
+#ifndef traceENTER_xEventGroupCreateStatic
+ #define traceENTER_xEventGroupCreateStatic( pxEventGroupBuffer )
#endif
-#if ( configGENERATE_RUN_TIME_STATS == 1 )
+#ifndef traceRETURN_xEventGroupCreateStatic
+ #define traceRETURN_xEventGroupCreateStatic( pxEventBits )
+#endif
- #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
- #error If configGENERATE_RUN_TIME_STATS is defined then portCONFIGURE_TIMER_FOR_RUN_TIME_STATS must also be defined. portCONFIGURE_TIMER_FOR_RUN_TIME_STATS should call a port layer function to setup a peripheral timer/counter that can then be used as the run time counter time base.
- #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */
+#ifndef traceENTER_xEventGroupCreate
+ #define traceENTER_xEventGroupCreate()
+#endif
- #ifndef portGET_RUN_TIME_COUNTER_VALUE
- #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE
- #error If configGENERATE_RUN_TIME_STATS is defined then either portGET_RUN_TIME_COUNTER_VALUE or portALT_GET_RUN_TIME_COUNTER_VALUE must also be defined. See the examples provided and the FreeRTOS web site for more information.
- #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */
- #endif /* portGET_RUN_TIME_COUNTER_VALUE */
+#ifndef traceRETURN_xEventGroupCreate
+ #define traceRETURN_xEventGroupCreate( pxEventBits )
+#endif
-#endif /* configGENERATE_RUN_TIME_STATS */
+#ifndef traceENTER_xEventGroupSync
+ #define traceENTER_xEventGroupSync( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTicksToWait )
+#endif
-#ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
- #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
+#ifndef traceRETURN_xEventGroupSync
+ #define traceRETURN_xEventGroupSync( uxReturn )
#endif
-#ifndef configUSE_MALLOC_FAILED_HOOK
- #define configUSE_MALLOC_FAILED_HOOK 0
+#ifndef traceENTER_xEventGroupWaitBits
+ #define traceENTER_xEventGroupWaitBits( xEventGroup, uxBitsToWaitFor, xClearOnExit, xWaitForAllBits, xTicksToWait )
#endif
-#ifndef portPRIVILEGE_BIT
- #define portPRIVILEGE_BIT ( ( UBaseType_t ) 0x00 )
+#ifndef traceRETURN_xEventGroupWaitBits
+ #define traceRETURN_xEventGroupWaitBits( uxReturn )
#endif
-#ifndef portYIELD_WITHIN_API
- #define portYIELD_WITHIN_API portYIELD
+#ifndef traceENTER_xEventGroupClearBits
+ #define traceENTER_xEventGroupClearBits( xEventGroup, uxBitsToClear )
#endif
-#ifndef portSUPPRESS_TICKS_AND_SLEEP
- #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )
+#ifndef traceRETURN_xEventGroupClearBits
+ #define traceRETURN_xEventGroupClearBits( uxReturn )
#endif
-#ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP
- #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
+#ifndef traceENTER_xEventGroupClearBitsFromISR
+ #define traceENTER_xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear )
#endif
-#if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2
- #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2
+#ifndef traceRETURN_xEventGroupClearBitsFromISR
+ #define traceRETURN_xEventGroupClearBitsFromISR( xReturn )
#endif
-#ifndef configUSE_TICKLESS_IDLE
- #define configUSE_TICKLESS_IDLE 0
+#ifndef traceENTER_xEventGroupGetBitsFromISR
+ #define traceENTER_xEventGroupGetBitsFromISR( xEventGroup )
#endif
-#ifndef configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING
- #define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x )
+#ifndef traceRETURN_xEventGroupGetBitsFromISR
+ #define traceRETURN_xEventGroupGetBitsFromISR( uxReturn )
#endif
-#ifndef configPRE_SLEEP_PROCESSING
- #define configPRE_SLEEP_PROCESSING( x )
+#ifndef traceENTER_xEventGroupSetBits
+ #define traceENTER_xEventGroupSetBits( xEventGroup, uxBitsToSet )
#endif
-#ifndef configPOST_SLEEP_PROCESSING
- #define configPOST_SLEEP_PROCESSING( x )
+#ifndef traceRETURN_xEventGroupSetBits
+ #define traceRETURN_xEventGroupSetBits( uxEventBits )
#endif
-#ifndef configUSE_QUEUE_SETS
- #define configUSE_QUEUE_SETS 0
+#ifndef traceENTER_vEventGroupDelete
+ #define traceENTER_vEventGroupDelete( xEventGroup )
#endif
-#ifndef portTASK_USES_FLOATING_POINT
- #define portTASK_USES_FLOATING_POINT()
+#ifndef traceRETURN_vEventGroupDelete
+ #define traceRETURN_vEventGroupDelete()
#endif
-#ifndef portALLOCATE_SECURE_CONTEXT
- #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize )
+#ifndef traceENTER_xEventGroupGetStaticBuffer
+ #define traceENTER_xEventGroupGetStaticBuffer( xEventGroup, ppxEventGroupBuffer )
#endif
-#ifndef portDONT_DISCARD
- #define portDONT_DISCARD
+#ifndef traceRETURN_xEventGroupGetStaticBuffer
+ #define traceRETURN_xEventGroupGetStaticBuffer( xReturn )
#endif
-#ifndef configUSE_TIME_SLICING
- #define configUSE_TIME_SLICING 1
+#ifndef traceENTER_vEventGroupSetBitsCallback
+ #define traceENTER_vEventGroupSetBitsCallback( pvEventGroup, ulBitsToSet )
#endif
-#ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS
- #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0
+#ifndef traceRETURN_vEventGroupSetBitsCallback
+ #define traceRETURN_vEventGroupSetBitsCallback()
#endif
-#ifndef configUSE_STATS_FORMATTING_FUNCTIONS
- #define configUSE_STATS_FORMATTING_FUNCTIONS 0
+#ifndef traceENTER_vEventGroupClearBitsCallback
+ #define traceENTER_vEventGroupClearBitsCallback( pvEventGroup, ulBitsToClear )
#endif
-#ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID
- #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID()
+#ifndef traceRETURN_vEventGroupClearBitsCallback
+ #define traceRETURN_vEventGroupClearBitsCallback()
#endif
-#ifndef configUSE_TRACE_FACILITY
- #define configUSE_TRACE_FACILITY 0
+#ifndef traceENTER_xEventGroupSetBitsFromISR
+ #define traceENTER_xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken )
#endif
-#ifndef mtCOVERAGE_TEST_MARKER
- #define mtCOVERAGE_TEST_MARKER()
+#ifndef traceRETURN_xEventGroupSetBitsFromISR
+ #define traceRETURN_xEventGroupSetBitsFromISR( xReturn )
#endif
-#ifndef mtCOVERAGE_TEST_DELAY
- #define mtCOVERAGE_TEST_DELAY()
+#ifndef traceENTER_uxEventGroupGetNumber
+ #define traceENTER_uxEventGroupGetNumber( xEventGroup )
#endif
-#ifndef portASSERT_IF_IN_ISR
- #define portASSERT_IF_IN_ISR()
+#ifndef traceRETURN_uxEventGroupGetNumber
+ #define traceRETURN_uxEventGroupGetNumber( xReturn )
#endif
-#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
- #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
+#ifndef traceENTER_vEventGroupSetNumber
+ #define traceENTER_vEventGroupSetNumber( xEventGroup, uxEventGroupNumber )
#endif
-#ifndef configAPPLICATION_ALLOCATED_HEAP
- #define configAPPLICATION_ALLOCATED_HEAP 0
+#ifndef traceRETURN_vEventGroupSetNumber
+ #define traceRETURN_vEventGroupSetNumber()
#endif
-#ifndef configUSE_TASK_NOTIFICATIONS
- #define configUSE_TASK_NOTIFICATIONS 1
+#ifndef traceENTER_xQueueGenericReset
+ #define traceENTER_xQueueGenericReset( xQueue, xNewQueue )
#endif
-#ifndef configTASK_NOTIFICATION_ARRAY_ENTRIES
- #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1
+#ifndef traceRETURN_xQueueGenericReset
+ #define traceRETURN_xQueueGenericReset( xReturn )
#endif
-#if configTASK_NOTIFICATION_ARRAY_ENTRIES < 1
- #error configTASK_NOTIFICATION_ARRAY_ENTRIES must be at least 1
+#ifndef traceENTER_xQueueGenericCreateStatic
+ #define traceENTER_xQueueGenericCreateStatic( uxQueueLength, uxItemSize, pucQueueStorage, pxStaticQueue, ucQueueType )
#endif
-#ifndef configUSE_POSIX_ERRNO
- #define configUSE_POSIX_ERRNO 0
+#ifndef traceRETURN_xQueueGenericCreateStatic
+ #define traceRETURN_xQueueGenericCreateStatic( pxNewQueue )
#endif
-#ifndef configUSE_SB_COMPLETED_CALLBACK
+#ifndef traceENTER_xQueueGenericGetStaticBuffers
+ #define traceENTER_xQueueGenericGetStaticBuffers( xQueue, ppucQueueStorage, ppxStaticQueue )
+#endif
-/* By default per-instance callbacks are not enabled for stream buffer or message buffer. */
- #define configUSE_SB_COMPLETED_CALLBACK 0
+#ifndef traceRETURN_xQueueGenericGetStaticBuffers
+ #define traceRETURN_xQueueGenericGetStaticBuffers( xReturn )
#endif
-#ifndef portTICK_TYPE_IS_ATOMIC
- #define portTICK_TYPE_IS_ATOMIC 0
+#ifndef traceENTER_xQueueGenericCreate
+ #define traceENTER_xQueueGenericCreate( uxQueueLength, uxItemSize, ucQueueType )
#endif
-#ifndef configSUPPORT_STATIC_ALLOCATION
- /* Defaults to 0 for backward compatibility. */
- #define configSUPPORT_STATIC_ALLOCATION 0
+#ifndef traceRETURN_xQueueGenericCreate
+ #define traceRETURN_xQueueGenericCreate( pxNewQueue )
#endif
-#ifndef configSUPPORT_DYNAMIC_ALLOCATION
- /* Defaults to 1 for backward compatibility. */
- #define configSUPPORT_DYNAMIC_ALLOCATION 1
+#ifndef traceENTER_xQueueCreateMutex
+ #define traceENTER_xQueueCreateMutex( ucQueueType )
#endif
-#if ( ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION != 1 ) )
- #error configUSE_STATS_FORMATTING_FUNCTIONS cannot be used without dynamic allocation, but configSUPPORT_DYNAMIC_ALLOCATION is not set to 1.
+#ifndef traceRETURN_xQueueCreateMutex
+ #define traceRETURN_xQueueCreateMutex( xNewQueue )
#endif
-#if ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 )
- #if ( ( configUSE_TRACE_FACILITY != 1 ) && ( configGENERATE_RUN_TIME_STATS != 1 ) )
- #error configUSE_STATS_FORMATTING_FUNCTIONS is 1 but the functions it enables are not used because neither configUSE_TRACE_FACILITY or configGENERATE_RUN_TIME_STATS are 1. Set configUSE_STATS_FORMATTING_FUNCTIONS to 0 in FreeRTOSConfig.h.
- #endif
+#ifndef traceENTER_xQueueCreateMutexStatic
+ #define traceENTER_xQueueCreateMutexStatic( ucQueueType, pxStaticQueue )
#endif
-#ifndef configSTACK_DEPTH_TYPE
+#ifndef traceRETURN_xQueueCreateMutexStatic
+ #define traceRETURN_xQueueCreateMutexStatic( xNewQueue )
+#endif
-/* Defaults to uint16_t for backward compatibility, but can be overridden
- * in FreeRTOSConfig.h if uint16_t is too restrictive. */
- #define configSTACK_DEPTH_TYPE uint16_t
+#ifndef traceENTER_xQueueGetMutexHolder
+ #define traceENTER_xQueueGetMutexHolder( xSemaphore )
#endif
-#ifndef configRUN_TIME_COUNTER_TYPE
+#ifndef traceRETURN_xQueueGetMutexHolder
+ #define traceRETURN_xQueueGetMutexHolder( pxReturn )
+#endif
-/* Defaults to uint32_t for backward compatibility, but can be overridden in
- * FreeRTOSConfig.h if uint32_t is too restrictive. */
+#ifndef traceENTER_xQueueGetMutexHolderFromISR
+ #define traceENTER_xQueueGetMutexHolderFromISR( xSemaphore )
+#endif
- #define configRUN_TIME_COUNTER_TYPE uint32_t
+#ifndef traceRETURN_xQueueGetMutexHolderFromISR
+ #define traceRETURN_xQueueGetMutexHolderFromISR( pxReturn )
#endif
-#ifndef configMESSAGE_BUFFER_LENGTH_TYPE
+#ifndef traceENTER_xQueueGiveMutexRecursive
+ #define traceENTER_xQueueGiveMutexRecursive( xMutex )
+#endif
-/* Defaults to size_t for backward compatibility, but can be overridden
- * in FreeRTOSConfig.h if lengths will always be less than the number of bytes
- * in a size_t. */
- #define configMESSAGE_BUFFER_LENGTH_TYPE size_t
+#ifndef traceRETURN_xQueueGiveMutexRecursive
+ #define traceRETURN_xQueueGiveMutexRecursive( xReturn )
#endif
-/* Sanity check the configuration. */
-#if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
- #error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.
+#ifndef traceENTER_xQueueTakeMutexRecursive
+ #define traceENTER_xQueueTakeMutexRecursive( xMutex, xTicksToWait )
#endif
-#if ( ( configUSE_RECURSIVE_MUTEXES == 1 ) && ( configUSE_MUTEXES != 1 ) )
- #error configUSE_MUTEXES must be set to 1 to use recursive mutexes
+#ifndef traceRETURN_xQueueTakeMutexRecursive
+ #define traceRETURN_xQueueTakeMutexRecursive( xReturn )
#endif
-#ifndef configINITIAL_TICK_COUNT
- #define configINITIAL_TICK_COUNT 0
+#ifndef traceENTER_xQueueCreateCountingSemaphoreStatic
+ #define traceENTER_xQueueCreateCountingSemaphoreStatic( uxMaxCount, uxInitialCount, pxStaticQueue )
#endif
-#if ( portTICK_TYPE_IS_ATOMIC == 0 )
+#ifndef traceRETURN_xQueueCreateCountingSemaphoreStatic
+ #define traceRETURN_xQueueCreateCountingSemaphoreStatic( xHandle )
+#endif
-/* Either variables of tick type cannot be read atomically, or
- * portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when
- * the tick count is returned to the standard critical section macros. */
- #define portTICK_TYPE_ENTER_CRITICAL() portENTER_CRITICAL()
- #define portTICK_TYPE_EXIT_CRITICAL() portEXIT_CRITICAL()
- #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
- #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )
-#else
+#ifndef traceENTER_xQueueCreateCountingSemaphore
+ #define traceENTER_xQueueCreateCountingSemaphore( uxMaxCount, uxInitialCount )
+#endif
-/* The tick type can be read atomically, so critical sections used when the
- * tick count is returned can be defined away. */
- #define portTICK_TYPE_ENTER_CRITICAL()
- #define portTICK_TYPE_EXIT_CRITICAL()
- #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0
- #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) ( void ) ( x )
+#ifndef traceRETURN_xQueueCreateCountingSemaphore
+ #define traceRETURN_xQueueCreateCountingSemaphore( xHandle )
+#endif
+
+#ifndef traceENTER_xQueueGenericSend
+ #define traceENTER_xQueueGenericSend( xQueue, pvItemToQueue, xTicksToWait, xCopyPosition )
+#endif
+
+#ifndef traceRETURN_xQueueGenericSend
+ #define traceRETURN_xQueueGenericSend( xReturn )
+#endif
+
+#ifndef traceENTER_xQueueGenericSendFromISR
+ #define traceENTER_xQueueGenericSendFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken, xCopyPosition )
+#endif
+
+#ifndef traceRETURN_xQueueGenericSendFromISR
+ #define traceRETURN_xQueueGenericSendFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_xQueueGiveFromISR
+ #define traceENTER_xQueueGiveFromISR( xQueue, pxHigherPriorityTaskWoken )
+#endif
+
+#ifndef traceRETURN_xQueueGiveFromISR
+ #define traceRETURN_xQueueGiveFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_xQueueReceive
+ #define traceENTER_xQueueReceive( xQueue, pvBuffer, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_xQueueReceive
+ #define traceRETURN_xQueueReceive( xReturn )
+#endif
+
+#ifndef traceENTER_xQueueSemaphoreTake
+ #define traceENTER_xQueueSemaphoreTake( xQueue, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_xQueueSemaphoreTake
+ #define traceRETURN_xQueueSemaphoreTake( xReturn )
+#endif
+
+#ifndef traceENTER_xQueuePeek
+ #define traceENTER_xQueuePeek( xQueue, pvBuffer, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_xQueuePeek
+ #define traceRETURN_xQueuePeek( xReturn )
+#endif
+
+#ifndef traceENTER_xQueueReceiveFromISR
+ #define traceENTER_xQueueReceiveFromISR( xQueue, pvBuffer, pxHigherPriorityTaskWoken )
+#endif
+
+#ifndef traceRETURN_xQueueReceiveFromISR
+ #define traceRETURN_xQueueReceiveFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_xQueuePeekFromISR
+ #define traceENTER_xQueuePeekFromISR( xQueue, pvBuffer )
+#endif
+
+#ifndef traceRETURN_xQueuePeekFromISR
+ #define traceRETURN_xQueuePeekFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_uxQueueMessagesWaiting
+ #define traceENTER_uxQueueMessagesWaiting( xQueue )
+#endif
+
+#ifndef traceRETURN_uxQueueMessagesWaiting
+ #define traceRETURN_uxQueueMessagesWaiting( uxReturn )
+#endif
+
+#ifndef traceENTER_uxQueueSpacesAvailable
+ #define traceENTER_uxQueueSpacesAvailable( xQueue )
+#endif
+
+#ifndef traceRETURN_uxQueueSpacesAvailable
+ #define traceRETURN_uxQueueSpacesAvailable( uxReturn )
+#endif
+
+#ifndef traceENTER_uxQueueMessagesWaitingFromISR
+ #define traceENTER_uxQueueMessagesWaitingFromISR( xQueue )
+#endif
+
+#ifndef traceRETURN_uxQueueMessagesWaitingFromISR
+ #define traceRETURN_uxQueueMessagesWaitingFromISR( uxReturn )
+#endif
+
+#ifndef traceENTER_vQueueDelete
+ #define traceENTER_vQueueDelete( xQueue )
+#endif
+
+#ifndef traceRETURN_vQueueDelete
+ #define traceRETURN_vQueueDelete()
+#endif
+
+#ifndef traceENTER_uxQueueGetQueueNumber
+ #define traceENTER_uxQueueGetQueueNumber( xQueue )
+#endif
+
+#ifndef traceRETURN_uxQueueGetQueueNumber
+ #define traceRETURN_uxQueueGetQueueNumber( uxQueueNumber )
+#endif
+
+#ifndef traceENTER_vQueueSetQueueNumber
+ #define traceENTER_vQueueSetQueueNumber( xQueue, uxQueueNumber )
+#endif
+
+#ifndef traceRETURN_vQueueSetQueueNumber
+ #define traceRETURN_vQueueSetQueueNumber()
+#endif
+
+#ifndef traceENTER_ucQueueGetQueueType
+ #define traceENTER_ucQueueGetQueueType( xQueue )
+#endif
+
+#ifndef traceRETURN_ucQueueGetQueueType
+ #define traceRETURN_ucQueueGetQueueType( ucQueueType )
+#endif
+
+#ifndef traceENTER_uxQueueGetQueueItemSize
+ #define traceENTER_uxQueueGetQueueItemSize( xQueue )
+#endif
+
+#ifndef traceRETURN_uxQueueGetQueueItemSize
+ #define traceRETURN_uxQueueGetQueueItemSize( uxItemSize )
+#endif
+
+#ifndef traceENTER_uxQueueGetQueueLength
+ #define traceENTER_uxQueueGetQueueLength( xQueue )
+#endif
+
+#ifndef traceRETURN_uxQueueGetQueueLength
+ #define traceRETURN_uxQueueGetQueueLength( uxLength )
+#endif
+
+#ifndef traceENTER_xQueueIsQueueEmptyFromISR
+ #define traceENTER_xQueueIsQueueEmptyFromISR( xQueue )
+#endif
+
+#ifndef traceRETURN_xQueueIsQueueEmptyFromISR
+ #define traceRETURN_xQueueIsQueueEmptyFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_xQueueIsQueueFullFromISR
+ #define traceENTER_xQueueIsQueueFullFromISR( xQueue )
+#endif
+
+#ifndef traceRETURN_xQueueIsQueueFullFromISR
+ #define traceRETURN_xQueueIsQueueFullFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_xQueueCRSend
+ #define traceENTER_xQueueCRSend( xQueue, pvItemToQueue, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_xQueueCRSend
+ #define traceRETURN_xQueueCRSend( xReturn )
+#endif
+
+#ifndef traceENTER_xQueueCRReceive
+ #define traceENTER_xQueueCRReceive( xQueue, pvBuffer, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_xQueueCRReceive
+ #define traceRETURN_xQueueCRReceive( xReturn )
+#endif
+
+#ifndef traceENTER_xQueueCRSendFromISR
+ #define traceENTER_xQueueCRSendFromISR( xQueue, pvItemToQueue, xCoRoutinePreviouslyWoken )
+#endif
+
+#ifndef traceRETURN_xQueueCRSendFromISR
+ #define traceRETURN_xQueueCRSendFromISR( xCoRoutinePreviouslyWoken )
+#endif
+
+#ifndef traceENTER_xQueueCRReceiveFromISR
+ #define traceENTER_xQueueCRReceiveFromISR( xQueue, pvBuffer, pxCoRoutineWoken )
+#endif
+
+#ifndef traceRETURN_xQueueCRReceiveFromISR
+ #define traceRETURN_xQueueCRReceiveFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_vQueueAddToRegistry
+ #define traceENTER_vQueueAddToRegistry( xQueue, pcQueueName )
+#endif
+
+#ifndef traceRETURN_vQueueAddToRegistry
+ #define traceRETURN_vQueueAddToRegistry()
+#endif
+
+#ifndef traceENTER_pcQueueGetName
+ #define traceENTER_pcQueueGetName( xQueue )
+#endif
+
+#ifndef traceRETURN_pcQueueGetName
+ #define traceRETURN_pcQueueGetName( pcReturn )
+#endif
+
+#ifndef traceENTER_vQueueUnregisterQueue
+ #define traceENTER_vQueueUnregisterQueue( xQueue )
+#endif
+
+#ifndef traceRETURN_vQueueUnregisterQueue
+ #define traceRETURN_vQueueUnregisterQueue()
+#endif
+
+#ifndef traceENTER_vQueueWaitForMessageRestricted
+ #define traceENTER_vQueueWaitForMessageRestricted( xQueue, xTicksToWait, xWaitIndefinitely )
+#endif
+
+#ifndef traceRETURN_vQueueWaitForMessageRestricted
+ #define traceRETURN_vQueueWaitForMessageRestricted()
+#endif
+
+#ifndef traceENTER_xQueueCreateSet
+ #define traceENTER_xQueueCreateSet( uxEventQueueLength )
+#endif
+
+#ifndef traceRETURN_xQueueCreateSet
+ #define traceRETURN_xQueueCreateSet( pxQueue )
+#endif
+
+#ifndef traceENTER_xQueueAddToSet
+ #define traceENTER_xQueueAddToSet( xQueueOrSemaphore, xQueueSet )
+#endif
+
+#ifndef traceRETURN_xQueueAddToSet
+ #define traceRETURN_xQueueAddToSet( xReturn )
+#endif
+
+#ifndef traceENTER_xQueueRemoveFromSet
+ #define traceENTER_xQueueRemoveFromSet( xQueueOrSemaphore, xQueueSet )
+#endif
+
+#ifndef traceRETURN_xQueueRemoveFromSet
+ #define traceRETURN_xQueueRemoveFromSet( xReturn )
+#endif
+
+#ifndef traceENTER_xQueueSelectFromSet
+ #define traceENTER_xQueueSelectFromSet( xQueueSet, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_xQueueSelectFromSet
+ #define traceRETURN_xQueueSelectFromSet( xReturn )
+#endif
+
+#ifndef traceENTER_xQueueSelectFromSetFromISR
+ #define traceENTER_xQueueSelectFromSetFromISR( xQueueSet )
+#endif
+
+#ifndef traceRETURN_xQueueSelectFromSetFromISR
+ #define traceRETURN_xQueueSelectFromSetFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_xTimerCreateTimerTask
+ #define traceENTER_xTimerCreateTimerTask()
+#endif
+
+#ifndef traceRETURN_xTimerCreateTimerTask
+ #define traceRETURN_xTimerCreateTimerTask( xReturn )
+#endif
+
+#ifndef traceENTER_xTimerCreate
+ #define traceENTER_xTimerCreate( pcTimerName, xTimerPeriodInTicks, xAutoReload, pvTimerID, pxCallbackFunction )
+#endif
+
+#ifndef traceRETURN_xTimerCreate
+ #define traceRETURN_xTimerCreate( pxNewTimer )
+#endif
+
+#ifndef traceENTER_xTimerCreateStatic
+ #define traceENTER_xTimerCreateStatic( pcTimerName, xTimerPeriodInTicks, xAutoReload, pvTimerID, pxCallbackFunction, pxTimerBuffer )
+#endif
+
+#ifndef traceRETURN_xTimerCreateStatic
+ #define traceRETURN_xTimerCreateStatic( pxNewTimer )
+#endif
+
+#ifndef traceENTER_xTimerGenericCommandFromTask
+ #define traceENTER_xTimerGenericCommandFromTask( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_xTimerGenericCommandFromTask
+ #define traceRETURN_xTimerGenericCommandFromTask( xReturn )
+#endif
+
+#ifndef traceENTER_xTimerGenericCommandFromISR
+ #define traceENTER_xTimerGenericCommandFromISR( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_xTimerGenericCommandFromISR
+ #define traceRETURN_xTimerGenericCommandFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_xTimerGetTimerDaemonTaskHandle
+ #define traceENTER_xTimerGetTimerDaemonTaskHandle()
+#endif
+
+#ifndef traceRETURN_xTimerGetTimerDaemonTaskHandle
+ #define traceRETURN_xTimerGetTimerDaemonTaskHandle( xTimerTaskHandle )
+#endif
+
+#ifndef traceENTER_xTimerGetPeriod
+ #define traceENTER_xTimerGetPeriod( xTimer )
+#endif
+
+#ifndef traceRETURN_xTimerGetPeriod
+ #define traceRETURN_xTimerGetPeriod( xTimerPeriodInTicks )
+#endif
+
+#ifndef traceENTER_vTimerSetReloadMode
+ #define traceENTER_vTimerSetReloadMode( xTimer, xAutoReload )
+#endif
+
+#ifndef traceRETURN_vTimerSetReloadMode
+ #define traceRETURN_vTimerSetReloadMode()
+#endif
+
+#ifndef traceENTER_xTimerGetReloadMode
+ #define traceENTER_xTimerGetReloadMode( xTimer )
+#endif
+
+#ifndef traceRETURN_xTimerGetReloadMode
+ #define traceRETURN_xTimerGetReloadMode( xReturn )
+#endif
+
+#ifndef traceENTER_uxTimerGetReloadMode
+ #define traceENTER_uxTimerGetReloadMode( xTimer )
+#endif
+
+#ifndef traceRETURN_uxTimerGetReloadMode
+ #define traceRETURN_uxTimerGetReloadMode( uxReturn )
+#endif
+
+#ifndef traceENTER_xTimerGetExpiryTime
+ #define traceENTER_xTimerGetExpiryTime( xTimer )
+#endif
+
+#ifndef traceRETURN_xTimerGetExpiryTime
+ #define traceRETURN_xTimerGetExpiryTime( xReturn )
+#endif
+
+#ifndef traceENTER_xTimerGetStaticBuffer
+ #define traceENTER_xTimerGetStaticBuffer( xTimer, ppxTimerBuffer )
+#endif
+
+#ifndef traceRETURN_xTimerGetStaticBuffer
+ #define traceRETURN_xTimerGetStaticBuffer( xReturn )
+#endif
+
+#ifndef traceENTER_pcTimerGetName
+ #define traceENTER_pcTimerGetName( xTimer )
+#endif
+
+#ifndef traceRETURN_pcTimerGetName
+ #define traceRETURN_pcTimerGetName( pcTimerName )
+#endif
+
+#ifndef traceENTER_xTimerIsTimerActive
+ #define traceENTER_xTimerIsTimerActive( xTimer )
+#endif
+
+#ifndef traceRETURN_xTimerIsTimerActive
+ #define traceRETURN_xTimerIsTimerActive( xReturn )
+#endif
+
+#ifndef traceENTER_pvTimerGetTimerID
+ #define traceENTER_pvTimerGetTimerID( xTimer )
+#endif
+
+#ifndef traceRETURN_pvTimerGetTimerID
+ #define traceRETURN_pvTimerGetTimerID( pvReturn )
+#endif
+
+#ifndef traceENTER_vTimerSetTimerID
+ #define traceENTER_vTimerSetTimerID( xTimer, pvNewID )
+#endif
+
+#ifndef traceRETURN_vTimerSetTimerID
+ #define traceRETURN_vTimerSetTimerID()
+#endif
+
+#ifndef traceENTER_xTimerPendFunctionCallFromISR
+ #define traceENTER_xTimerPendFunctionCallFromISR( xFunctionToPend, pvParameter1, ulParameter2, pxHigherPriorityTaskWoken )
+#endif
+
+#ifndef traceRETURN_xTimerPendFunctionCallFromISR
+ #define traceRETURN_xTimerPendFunctionCallFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_xTimerPendFunctionCall
+ #define traceENTER_xTimerPendFunctionCall( xFunctionToPend, pvParameter1, ulParameter2, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_xTimerPendFunctionCall
+ #define traceRETURN_xTimerPendFunctionCall( xReturn )
+#endif
+
+#ifndef traceENTER_uxTimerGetTimerNumber
+ #define traceENTER_uxTimerGetTimerNumber( xTimer )
+#endif
+
+#ifndef traceRETURN_uxTimerGetTimerNumber
+ #define traceRETURN_uxTimerGetTimerNumber( uxTimerNumber )
+#endif
+
+#ifndef traceENTER_vTimerSetTimerNumber
+ #define traceENTER_vTimerSetTimerNumber( xTimer, uxTimerNumber )
+#endif
+
+#ifndef traceRETURN_vTimerSetTimerNumber
+ #define traceRETURN_vTimerSetTimerNumber()
+#endif
+
+#ifndef traceENTER_xTaskCreateStatic
+ #define traceENTER_xTaskCreateStatic( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, puxStackBuffer, pxTaskBuffer )
+#endif
+
+#ifndef traceRETURN_xTaskCreateStatic
+ #define traceRETURN_xTaskCreateStatic( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskCreateStaticAffinitySet
+ #define traceENTER_xTaskCreateStaticAffinitySet( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, puxStackBuffer, pxTaskBuffer, uxCoreAffinityMask )
+#endif
+
+#ifndef traceRETURN_xTaskCreateStaticAffinitySet
+ #define traceRETURN_xTaskCreateStaticAffinitySet( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskCreateRestrictedStatic
+ #define traceENTER_xTaskCreateRestrictedStatic( pxTaskDefinition, pxCreatedTask )
+#endif
+
+#ifndef traceRETURN_xTaskCreateRestrictedStatic
+ #define traceRETURN_xTaskCreateRestrictedStatic( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskCreateRestrictedStaticAffinitySet
+ #define traceENTER_xTaskCreateRestrictedStaticAffinitySet( pxTaskDefinition, uxCoreAffinityMask, pxCreatedTask )
+#endif
+
+#ifndef traceRETURN_xTaskCreateRestrictedStaticAffinitySet
+ #define traceRETURN_xTaskCreateRestrictedStaticAffinitySet( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskCreateRestricted
+ #define traceENTER_xTaskCreateRestricted( pxTaskDefinition, pxCreatedTask )
+#endif
+
+#ifndef traceRETURN_xTaskCreateRestricted
+ #define traceRETURN_xTaskCreateRestricted( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskCreateRestrictedAffinitySet
+ #define traceENTER_xTaskCreateRestrictedAffinitySet( pxTaskDefinition, uxCoreAffinityMask, pxCreatedTask )
+#endif
+
+#ifndef traceRETURN_xTaskCreateRestrictedAffinitySet
+ #define traceRETURN_xTaskCreateRestrictedAffinitySet( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskCreate
+ #define traceENTER_xTaskCreate( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, pxCreatedTask )
+#endif
+
+#ifndef traceRETURN_xTaskCreate
+ #define traceRETURN_xTaskCreate( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskCreateAffinitySet
+ #define traceENTER_xTaskCreateAffinitySet( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, uxCoreAffinityMask, pxCreatedTask )
+#endif
+
+#ifndef traceRETURN_xTaskCreateAffinitySet
+ #define traceRETURN_xTaskCreateAffinitySet( xReturn )
+#endif
+
+#ifndef traceENTER_vTaskDelete
+ #define traceENTER_vTaskDelete( xTaskToDelete )
+#endif
+
+#ifndef traceRETURN_vTaskDelete
+ #define traceRETURN_vTaskDelete()
+#endif
+
+#ifndef traceENTER_xTaskDelayUntil
+ #define traceENTER_xTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement )
+#endif
+
+#ifndef traceRETURN_xTaskDelayUntil
+ #define traceRETURN_xTaskDelayUntil( xShouldDelay )
+#endif
+
+#ifndef traceENTER_vTaskDelay
+ #define traceENTER_vTaskDelay( xTicksToDelay )
+#endif
+
+#ifndef traceRETURN_vTaskDelay
+ #define traceRETURN_vTaskDelay()
+#endif
+
+#ifndef traceENTER_eTaskGetState
+ #define traceENTER_eTaskGetState( xTask )
+#endif
+
+#ifndef traceRETURN_eTaskGetState
+ #define traceRETURN_eTaskGetState( eReturn )
+#endif
+
+#ifndef traceENTER_uxTaskPriorityGet
+ #define traceENTER_uxTaskPriorityGet( xTask )
+#endif
+
+#ifndef traceRETURN_uxTaskPriorityGet
+ #define traceRETURN_uxTaskPriorityGet( uxReturn )
+#endif
+
+#ifndef traceENTER_uxTaskPriorityGetFromISR
+ #define traceENTER_uxTaskPriorityGetFromISR( xTask )
+#endif
+
+#ifndef traceRETURN_uxTaskPriorityGetFromISR
+ #define traceRETURN_uxTaskPriorityGetFromISR( uxReturn )
+#endif
+
+#ifndef traceENTER_uxTaskBasePriorityGet
+ #define traceENTER_uxTaskBasePriorityGet( xTask )
+#endif
+
+#ifndef traceRETURN_uxTaskBasePriorityGet
+ #define traceRETURN_uxTaskBasePriorityGet( uxReturn )
+#endif
+
+#ifndef traceENTER_uxTaskBasePriorityGetFromISR
+ #define traceENTER_uxTaskBasePriorityGetFromISR( xTask )
+#endif
+
+#ifndef traceRETURN_uxTaskBasePriorityGetFromISR
+ #define traceRETURN_uxTaskBasePriorityGetFromISR( uxReturn )
+#endif
+
+#ifndef traceENTER_vTaskPrioritySet
+ #define traceENTER_vTaskPrioritySet( xTask, uxNewPriority )
+#endif
+
+#ifndef traceRETURN_vTaskPrioritySet
+ #define traceRETURN_vTaskPrioritySet()
+#endif
+
+#ifndef traceENTER_vTaskCoreAffinitySet
+ #define traceENTER_vTaskCoreAffinitySet( xTask, uxCoreAffinityMask )
+#endif
+
+#ifndef traceRETURN_vTaskCoreAffinitySet
+ #define traceRETURN_vTaskCoreAffinitySet()
+#endif
+
+#ifndef traceENTER_vTaskCoreAffinityGet
+ #define traceENTER_vTaskCoreAffinityGet( xTask )
+#endif
+
+#ifndef traceRETURN_vTaskCoreAffinityGet
+ #define traceRETURN_vTaskCoreAffinityGet( uxCoreAffinityMask )
+#endif
+
+#ifndef traceENTER_vTaskPreemptionDisable
+ #define traceENTER_vTaskPreemptionDisable( xTask )
+#endif
+
+#ifndef traceRETURN_vTaskPreemptionDisable
+ #define traceRETURN_vTaskPreemptionDisable()
+#endif
+
+#ifndef traceENTER_vTaskPreemptionEnable
+ #define traceENTER_vTaskPreemptionEnable( xTask )
+#endif
+
+#ifndef traceRETURN_vTaskPreemptionEnable
+ #define traceRETURN_vTaskPreemptionEnable()
+#endif
+
+#ifndef traceENTER_vTaskSuspend
+ #define traceENTER_vTaskSuspend( xTaskToSuspend )
+#endif
+
+#ifndef traceRETURN_vTaskSuspend
+ #define traceRETURN_vTaskSuspend()
+#endif
+
+#ifndef traceENTER_vTaskResume
+ #define traceENTER_vTaskResume( xTaskToResume )
+#endif
+
+#ifndef traceRETURN_vTaskResume
+ #define traceRETURN_vTaskResume()
+#endif
+
+#ifndef traceENTER_xTaskResumeFromISR
+ #define traceENTER_xTaskResumeFromISR( xTaskToResume )
+#endif
+
+#ifndef traceRETURN_xTaskResumeFromISR
+ #define traceRETURN_xTaskResumeFromISR( xYieldRequired )
+#endif
+
+#ifndef traceENTER_vTaskStartScheduler
+ #define traceENTER_vTaskStartScheduler()
+#endif
+
+#ifndef traceRETURN_vTaskStartScheduler
+ #define traceRETURN_vTaskStartScheduler()
+#endif
+
+#ifndef traceENTER_vTaskEndScheduler
+ #define traceENTER_vTaskEndScheduler()
+#endif
+
+#ifndef traceRETURN_vTaskEndScheduler
+ #define traceRETURN_vTaskEndScheduler()
+#endif
+
+#ifndef traceENTER_vTaskSuspendAll
+ #define traceENTER_vTaskSuspendAll()
+#endif
+
+#ifndef traceRETURN_vTaskSuspendAll
+ #define traceRETURN_vTaskSuspendAll()
+#endif
+
+#ifndef traceENTER_xTaskResumeAll
+ #define traceENTER_xTaskResumeAll()
+#endif
+
+#ifndef traceRETURN_xTaskResumeAll
+ #define traceRETURN_xTaskResumeAll( xAlreadyYielded )
+#endif
+
+#ifndef traceENTER_xTaskGetTickCount
+ #define traceENTER_xTaskGetTickCount()
+#endif
+
+#ifndef traceRETURN_xTaskGetTickCount
+ #define traceRETURN_xTaskGetTickCount( xTicks )
+#endif
+
+#ifndef traceENTER_xTaskGetTickCountFromISR
+ #define traceENTER_xTaskGetTickCountFromISR()
+#endif
+
+#ifndef traceRETURN_xTaskGetTickCountFromISR
+ #define traceRETURN_xTaskGetTickCountFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_uxTaskGetNumberOfTasks
+ #define traceENTER_uxTaskGetNumberOfTasks()
+#endif
+
+#ifndef traceRETURN_uxTaskGetNumberOfTasks
+ #define traceRETURN_uxTaskGetNumberOfTasks( uxCurrentNumberOfTasks )
+#endif
+
+#ifndef traceENTER_pcTaskGetName
+ #define traceENTER_pcTaskGetName( xTaskToQuery )
+#endif
+
+#ifndef traceRETURN_pcTaskGetName
+ #define traceRETURN_pcTaskGetName( pcTaskName )
+#endif
+
+#ifndef traceENTER_xTaskGetHandle
+ #define traceENTER_xTaskGetHandle( pcNameToQuery )
+#endif
+
+#ifndef traceRETURN_xTaskGetHandle
+ #define traceRETURN_xTaskGetHandle( pxTCB )
+#endif
+
+#ifndef traceENTER_xTaskGetStaticBuffers
+ #define traceENTER_xTaskGetStaticBuffers( xTask, ppuxStackBuffer, ppxTaskBuffer )
+#endif
+
+#ifndef traceRETURN_xTaskGetStaticBuffers
+ #define traceRETURN_xTaskGetStaticBuffers( xReturn )
+#endif
+
+#ifndef traceENTER_uxTaskGetSystemState
+ #define traceENTER_uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, pulTotalRunTime )
+#endif
+
+#ifndef traceRETURN_uxTaskGetSystemState
+ #define traceRETURN_uxTaskGetSystemState( uxTask )
+#endif
+
+#if ( configNUMBER_OF_CORES == 1 )
+ #ifndef traceENTER_xTaskGetIdleTaskHandle
+ #define traceENTER_xTaskGetIdleTaskHandle()
+ #endif
+#endif
+
+#if ( configNUMBER_OF_CORES == 1 )
+ #ifndef traceRETURN_xTaskGetIdleTaskHandle
+ #define traceRETURN_xTaskGetIdleTaskHandle( xIdleTaskHandle )
+ #endif
+#endif
+
+#ifndef traceENTER_xTaskGetIdleTaskHandleForCore
+ #define traceENTER_xTaskGetIdleTaskHandleForCore( xCoreID )
+#endif
+
+#ifndef traceRETURN_xTaskGetIdleTaskHandleForCore
+ #define traceRETURN_xTaskGetIdleTaskHandleForCore( xIdleTaskHandle )
+#endif
+
+#ifndef traceENTER_vTaskStepTick
+ #define traceENTER_vTaskStepTick( xTicksToJump )
+#endif
+
+#ifndef traceRETURN_vTaskStepTick
+ #define traceRETURN_vTaskStepTick()
+#endif
+
+#ifndef traceENTER_xTaskCatchUpTicks
+ #define traceENTER_xTaskCatchUpTicks( xTicksToCatchUp )
+#endif
+
+#ifndef traceRETURN_xTaskCatchUpTicks
+ #define traceRETURN_xTaskCatchUpTicks( xYieldOccurred )
+#endif
+
+#ifndef traceENTER_xTaskAbortDelay
+ #define traceENTER_xTaskAbortDelay( xTask )
+#endif
+
+#ifndef traceRETURN_xTaskAbortDelay
+ #define traceRETURN_xTaskAbortDelay( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskIncrementTick
+ #define traceENTER_xTaskIncrementTick()
+#endif
+
+#ifndef traceRETURN_xTaskIncrementTick
+ #define traceRETURN_xTaskIncrementTick( xSwitchRequired )
+#endif
+
+#ifndef traceENTER_vTaskSetApplicationTaskTag
+ #define traceENTER_vTaskSetApplicationTaskTag( xTask, pxHookFunction )
+#endif
+
+#ifndef traceRETURN_vTaskSetApplicationTaskTag
+ #define traceRETURN_vTaskSetApplicationTaskTag()
+#endif
+
+#ifndef traceENTER_xTaskGetApplicationTaskTag
+ #define traceENTER_xTaskGetApplicationTaskTag( xTask )
+#endif
+
+#ifndef traceRETURN_xTaskGetApplicationTaskTag
+ #define traceRETURN_xTaskGetApplicationTaskTag( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskGetApplicationTaskTagFromISR
+ #define traceENTER_xTaskGetApplicationTaskTagFromISR( xTask )
+#endif
+
+#ifndef traceRETURN_xTaskGetApplicationTaskTagFromISR
+ #define traceRETURN_xTaskGetApplicationTaskTagFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskCallApplicationTaskHook
+ #define traceENTER_xTaskCallApplicationTaskHook( xTask, pvParameter )
+#endif
+
+#ifndef traceRETURN_xTaskCallApplicationTaskHook
+ #define traceRETURN_xTaskCallApplicationTaskHook( xReturn )
+#endif
+
+#ifndef traceENTER_vTaskSwitchContext
+ #define traceENTER_vTaskSwitchContext()
+#endif
+
+#ifndef traceRETURN_vTaskSwitchContext
+ #define traceRETURN_vTaskSwitchContext()
+#endif
+
+#ifndef traceENTER_vTaskPlaceOnEventList
+ #define traceENTER_vTaskPlaceOnEventList( pxEventList, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_vTaskPlaceOnEventList
+ #define traceRETURN_vTaskPlaceOnEventList()
+#endif
+
+#ifndef traceENTER_vTaskPlaceOnUnorderedEventList
+ #define traceENTER_vTaskPlaceOnUnorderedEventList( pxEventList, xItemValue, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_vTaskPlaceOnUnorderedEventList
+ #define traceRETURN_vTaskPlaceOnUnorderedEventList()
+#endif
+
+#ifndef traceENTER_vTaskPlaceOnEventListRestricted
+ #define traceENTER_vTaskPlaceOnEventListRestricted( pxEventList, xTicksToWait, xWaitIndefinitely )
+#endif
+
+#ifndef traceRETURN_vTaskPlaceOnEventListRestricted
+ #define traceRETURN_vTaskPlaceOnEventListRestricted()
+#endif
+
+#ifndef traceENTER_xTaskRemoveFromEventList
+ #define traceENTER_xTaskRemoveFromEventList( pxEventList )
+#endif
+
+#ifndef traceRETURN_xTaskRemoveFromEventList
+ #define traceRETURN_xTaskRemoveFromEventList( xReturn )
+#endif
+
+#ifndef traceENTER_vTaskRemoveFromUnorderedEventList
+ #define traceENTER_vTaskRemoveFromUnorderedEventList( pxEventListItem, xItemValue )
+#endif
+
+#ifndef traceRETURN_vTaskRemoveFromUnorderedEventList
+ #define traceRETURN_vTaskRemoveFromUnorderedEventList()
+#endif
+
+#ifndef traceENTER_vTaskSetTimeOutState
+ #define traceENTER_vTaskSetTimeOutState( pxTimeOut )
+#endif
+
+#ifndef traceRETURN_vTaskSetTimeOutState
+ #define traceRETURN_vTaskSetTimeOutState()
+#endif
+
+#ifndef traceENTER_vTaskInternalSetTimeOutState
+ #define traceENTER_vTaskInternalSetTimeOutState( pxTimeOut )
+#endif
+
+#ifndef traceRETURN_vTaskInternalSetTimeOutState
+ #define traceRETURN_vTaskInternalSetTimeOutState()
+#endif
+
+#ifndef traceENTER_xTaskCheckForTimeOut
+ #define traceENTER_xTaskCheckForTimeOut( pxTimeOut, pxTicksToWait )
+#endif
+
+#ifndef traceRETURN_xTaskCheckForTimeOut
+ #define traceRETURN_xTaskCheckForTimeOut( xReturn )
+#endif
+
+#ifndef traceENTER_vTaskMissedYield
+ #define traceENTER_vTaskMissedYield()
+#endif
+
+#ifndef traceRETURN_vTaskMissedYield
+ #define traceRETURN_vTaskMissedYield()
+#endif
+
+#ifndef traceENTER_uxTaskGetTaskNumber
+ #define traceENTER_uxTaskGetTaskNumber( xTask )
+#endif
+
+#ifndef traceRETURN_uxTaskGetTaskNumber
+ #define traceRETURN_uxTaskGetTaskNumber( uxReturn )
+#endif
+
+#ifndef traceENTER_vTaskSetTaskNumber
+ #define traceENTER_vTaskSetTaskNumber( xTask, uxHandle )
+#endif
+
+#ifndef traceRETURN_vTaskSetTaskNumber
+ #define traceRETURN_vTaskSetTaskNumber()
+#endif
+
+#ifndef traceENTER_eTaskConfirmSleepModeStatus
+ #define traceENTER_eTaskConfirmSleepModeStatus()
+#endif
+
+#ifndef traceRETURN_eTaskConfirmSleepModeStatus
+ #define traceRETURN_eTaskConfirmSleepModeStatus( eReturn )
+#endif
+
+#ifndef traceENTER_vTaskSetThreadLocalStoragePointer
+ #define traceENTER_vTaskSetThreadLocalStoragePointer( xTaskToSet, xIndex, pvValue )
+#endif
+
+#ifndef traceRETURN_vTaskSetThreadLocalStoragePointer
+ #define traceRETURN_vTaskSetThreadLocalStoragePointer()
+#endif
+
+#ifndef traceENTER_pvTaskGetThreadLocalStoragePointer
+ #define traceENTER_pvTaskGetThreadLocalStoragePointer( xTaskToQuery, xIndex )
+#endif
+
+#ifndef traceRETURN_pvTaskGetThreadLocalStoragePointer
+ #define traceRETURN_pvTaskGetThreadLocalStoragePointer( pvReturn )
+#endif
+
+#ifndef traceENTER_vTaskAllocateMPURegions
+ #define traceENTER_vTaskAllocateMPURegions( xTaskToModify, pxRegions )
+#endif
+
+#ifndef traceRETURN_vTaskAllocateMPURegions
+ #define traceRETURN_vTaskAllocateMPURegions()
+#endif
+
+#ifndef traceENTER_vTaskGetInfo
+ #define traceENTER_vTaskGetInfo( xTask, pxTaskStatus, xGetFreeStackSpace, eState )
+#endif
+
+#ifndef traceRETURN_vTaskGetInfo
+ #define traceRETURN_vTaskGetInfo()
+#endif
+
+#ifndef traceENTER_uxTaskGetStackHighWaterMark2
+ #define traceENTER_uxTaskGetStackHighWaterMark2( xTask )
+#endif
+
+#ifndef traceRETURN_uxTaskGetStackHighWaterMark2
+ #define traceRETURN_uxTaskGetStackHighWaterMark2( uxReturn )
+#endif
+
+#ifndef traceENTER_uxTaskGetStackHighWaterMark
+ #define traceENTER_uxTaskGetStackHighWaterMark( xTask )
+#endif
+
+#ifndef traceRETURN_uxTaskGetStackHighWaterMark
+ #define traceRETURN_uxTaskGetStackHighWaterMark( uxReturn )
+#endif
+
+#ifndef traceENTER_xTaskGetCurrentTaskHandle
+ #define traceENTER_xTaskGetCurrentTaskHandle()
+#endif
+
+#ifndef traceRETURN_xTaskGetCurrentTaskHandle
+ #define traceRETURN_xTaskGetCurrentTaskHandle( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskGetCurrentTaskHandleForCore
+ #define traceENTER_xTaskGetCurrentTaskHandleForCore( xCoreID )
+#endif
+
+#ifndef traceRETURN_xTaskGetCurrentTaskHandleForCore
+ #define traceRETURN_xTaskGetCurrentTaskHandleForCore( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskGetSchedulerState
+ #define traceENTER_xTaskGetSchedulerState()
+#endif
+
+#ifndef traceRETURN_xTaskGetSchedulerState
+ #define traceRETURN_xTaskGetSchedulerState( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskPriorityInherit
+ #define traceENTER_xTaskPriorityInherit( pxMutexHolder )
+#endif
+
+#ifndef traceRETURN_xTaskPriorityInherit
+ #define traceRETURN_xTaskPriorityInherit( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskPriorityDisinherit
+ #define traceENTER_xTaskPriorityDisinherit( pxMutexHolder )
+#endif
+
+#ifndef traceRETURN_xTaskPriorityDisinherit
+ #define traceRETURN_xTaskPriorityDisinherit( xReturn )
+#endif
+
+#ifndef traceENTER_vTaskPriorityDisinheritAfterTimeout
+ #define traceENTER_vTaskPriorityDisinheritAfterTimeout( pxMutexHolder, uxHighestPriorityWaitingTask )
+#endif
+
+#ifndef traceRETURN_vTaskPriorityDisinheritAfterTimeout
+ #define traceRETURN_vTaskPriorityDisinheritAfterTimeout()
+#endif
+
+#ifndef traceENTER_vTaskYieldWithinAPI
+ #define traceENTER_vTaskYieldWithinAPI()
+#endif
+
+#ifndef traceRETURN_vTaskYieldWithinAPI
+ #define traceRETURN_vTaskYieldWithinAPI()
+#endif
+
+#ifndef traceENTER_vTaskEnterCritical
+ #define traceENTER_vTaskEnterCritical()
+#endif
+
+#ifndef traceRETURN_vTaskEnterCritical
+ #define traceRETURN_vTaskEnterCritical()
+#endif
+
+#ifndef traceENTER_vTaskEnterCriticalFromISR
+ #define traceENTER_vTaskEnterCriticalFromISR()
+#endif
+
+#ifndef traceRETURN_vTaskEnterCriticalFromISR
+ #define traceRETURN_vTaskEnterCriticalFromISR( uxSavedInterruptStatus )
+#endif
+
+#ifndef traceENTER_vTaskExitCritical
+ #define traceENTER_vTaskExitCritical()
+#endif
+
+#ifndef traceRETURN_vTaskExitCritical
+ #define traceRETURN_vTaskExitCritical()
+#endif
+
+#ifndef traceENTER_vTaskExitCriticalFromISR
+ #define traceENTER_vTaskExitCriticalFromISR( uxSavedInterruptStatus )
+#endif
+
+#ifndef traceRETURN_vTaskExitCriticalFromISR
+ #define traceRETURN_vTaskExitCriticalFromISR()
+#endif
+
+#ifndef traceENTER_vTaskListTasks
+ #define traceENTER_vTaskListTasks( pcWriteBuffer, uxBufferLength )
+#endif
+
+#ifndef traceRETURN_vTaskListTasks
+ #define traceRETURN_vTaskListTasks()
+#endif
+
+#ifndef traceENTER_vTaskGetRunTimeStatistics
+ #define traceENTER_vTaskGetRunTimeStatistics( pcWriteBuffer, uxBufferLength )
+#endif
+
+#ifndef traceRETURN_vTaskGetRunTimeStatistics
+ #define traceRETURN_vTaskGetRunTimeStatistics()
+#endif
+
+#ifndef traceENTER_uxTaskResetEventItemValue
+ #define traceENTER_uxTaskResetEventItemValue()
+#endif
+
+#ifndef traceRETURN_uxTaskResetEventItemValue
+ #define traceRETURN_uxTaskResetEventItemValue( uxReturn )
+#endif
+
+#ifndef traceENTER_pvTaskIncrementMutexHeldCount
+ #define traceENTER_pvTaskIncrementMutexHeldCount()
+#endif
+
+#ifndef traceRETURN_pvTaskIncrementMutexHeldCount
+ #define traceRETURN_pvTaskIncrementMutexHeldCount( pxTCB )
+#endif
+
+#ifndef traceENTER_ulTaskGenericNotifyTake
+ #define traceENTER_ulTaskGenericNotifyTake( uxIndexToWaitOn, xClearCountOnExit, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_ulTaskGenericNotifyTake
+ #define traceRETURN_ulTaskGenericNotifyTake( ulReturn )
+#endif
+
+#ifndef traceENTER_xTaskGenericNotifyWait
+ #define traceENTER_xTaskGenericNotifyWait( uxIndexToWaitOn, ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_xTaskGenericNotifyWait
+ #define traceRETURN_xTaskGenericNotifyWait( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskGenericNotify
+ #define traceENTER_xTaskGenericNotify( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotificationValue )
+#endif
+
+#ifndef traceRETURN_xTaskGenericNotify
+ #define traceRETURN_xTaskGenericNotify( xReturn )
+#endif
+
+#ifndef traceENTER_xTaskGenericNotifyFromISR
+ #define traceENTER_xTaskGenericNotifyFromISR( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken )
+#endif
+
+#ifndef traceRETURN_xTaskGenericNotifyFromISR
+ #define traceRETURN_xTaskGenericNotifyFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_vTaskGenericNotifyGiveFromISR
+ #define traceENTER_vTaskGenericNotifyGiveFromISR( xTaskToNotify, uxIndexToNotify, pxHigherPriorityTaskWoken )
+#endif
+
+#ifndef traceRETURN_vTaskGenericNotifyGiveFromISR
+ #define traceRETURN_vTaskGenericNotifyGiveFromISR()
+#endif
+
+#ifndef traceENTER_xTaskGenericNotifyStateClear
+ #define traceENTER_xTaskGenericNotifyStateClear( xTask, uxIndexToClear )
+#endif
+
+#ifndef traceRETURN_xTaskGenericNotifyStateClear
+ #define traceRETURN_xTaskGenericNotifyStateClear( xReturn )
+#endif
+
+#ifndef traceENTER_ulTaskGenericNotifyValueClear
+ #define traceENTER_ulTaskGenericNotifyValueClear( xTask, uxIndexToClear, ulBitsToClear )
+#endif
+
+#ifndef traceRETURN_ulTaskGenericNotifyValueClear
+ #define traceRETURN_ulTaskGenericNotifyValueClear( ulReturn )
+#endif
+
+#ifndef traceENTER_ulTaskGetRunTimeCounter
+ #define traceENTER_ulTaskGetRunTimeCounter( xTask )
+#endif
+
+#ifndef traceRETURN_ulTaskGetRunTimeCounter
+ #define traceRETURN_ulTaskGetRunTimeCounter( ulRunTimeCounter )
+#endif
+
+#ifndef traceENTER_ulTaskGetRunTimePercent
+ #define traceENTER_ulTaskGetRunTimePercent( xTask )
+#endif
+
+#ifndef traceRETURN_ulTaskGetRunTimePercent
+ #define traceRETURN_ulTaskGetRunTimePercent( ulReturn )
+#endif
+
+#ifndef traceENTER_ulTaskGetIdleRunTimeCounter
+ #define traceENTER_ulTaskGetIdleRunTimeCounter()
+#endif
+
+#ifndef traceRETURN_ulTaskGetIdleRunTimeCounter
+ #define traceRETURN_ulTaskGetIdleRunTimeCounter( ulReturn )
+#endif
+
+#ifndef traceENTER_ulTaskGetIdleRunTimePercent
+ #define traceENTER_ulTaskGetIdleRunTimePercent()
+#endif
+
+#ifndef traceRETURN_ulTaskGetIdleRunTimePercent
+ #define traceRETURN_ulTaskGetIdleRunTimePercent( ulReturn )
+#endif
+
+#ifndef traceENTER_xTaskGetMPUSettings
+ #define traceENTER_xTaskGetMPUSettings( xTask )
+#endif
+
+#ifndef traceRETURN_xTaskGetMPUSettings
+ #define traceRETURN_xTaskGetMPUSettings( xMPUSettings )
+#endif
+
+#ifndef traceENTER_xStreamBufferGenericCreate
+ #define traceENTER_xStreamBufferGenericCreate( xBufferSizeBytes, xTriggerLevelBytes, xStreamBufferType, pxSendCompletedCallback, pxReceiveCompletedCallback )
+#endif
+
+#ifndef traceRETURN_xStreamBufferGenericCreate
+ #define traceRETURN_xStreamBufferGenericCreate( pvAllocatedMemory )
+#endif
+
+#ifndef traceENTER_xStreamBufferGenericCreateStatic
+ #define traceENTER_xStreamBufferGenericCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, xStreamBufferType, pucStreamBufferStorageArea, pxStaticStreamBuffer, pxSendCompletedCallback, pxReceiveCompletedCallback )
+#endif
+
+#ifndef traceRETURN_xStreamBufferGenericCreateStatic
+ #define traceRETURN_xStreamBufferGenericCreateStatic( xReturn )
+#endif
+
+#ifndef traceENTER_xStreamBufferGetStaticBuffers
+ #define traceENTER_xStreamBufferGetStaticBuffers( xStreamBuffer, ppucStreamBufferStorageArea, ppxStaticStreamBuffer )
+#endif
+
+#ifndef traceRETURN_xStreamBufferGetStaticBuffers
+ #define traceRETURN_xStreamBufferGetStaticBuffers( xReturn )
+#endif
+
+#ifndef traceENTER_vStreamBufferDelete
+ #define traceENTER_vStreamBufferDelete( xStreamBuffer )
+#endif
+
+#ifndef traceRETURN_vStreamBufferDelete
+ #define traceRETURN_vStreamBufferDelete()
+#endif
+
+#ifndef traceENTER_xStreamBufferReset
+ #define traceENTER_xStreamBufferReset( xStreamBuffer )
+#endif
+
+#ifndef traceRETURN_xStreamBufferReset
+ #define traceRETURN_xStreamBufferReset( xReturn )
+#endif
+
+#ifndef traceENTER_xStreamBufferResetFromISR
+ #define traceENTER_xStreamBufferResetFromISR( xStreamBuffer )
+#endif
+
+#ifndef traceRETURN_xStreamBufferResetFromISR
+ #define traceRETURN_xStreamBufferResetFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_xStreamBufferSetTriggerLevel
+ #define traceENTER_xStreamBufferSetTriggerLevel( xStreamBuffer, xTriggerLevel )
+#endif
+
+#ifndef traceRETURN_xStreamBufferSetTriggerLevel
+ #define traceRETURN_xStreamBufferSetTriggerLevel( xReturn )
+#endif
+
+#ifndef traceENTER_xStreamBufferSpacesAvailable
+ #define traceENTER_xStreamBufferSpacesAvailable( xStreamBuffer )
+#endif
+
+#ifndef traceRETURN_xStreamBufferSpacesAvailable
+ #define traceRETURN_xStreamBufferSpacesAvailable( xSpace )
+#endif
+
+#ifndef traceENTER_xStreamBufferBytesAvailable
+ #define traceENTER_xStreamBufferBytesAvailable( xStreamBuffer )
+#endif
+
+#ifndef traceRETURN_xStreamBufferBytesAvailable
+ #define traceRETURN_xStreamBufferBytesAvailable( xReturn )
+#endif
+
+#ifndef traceENTER_xStreamBufferSend
+ #define traceENTER_xStreamBufferSend( xStreamBuffer, pvTxData, xDataLengthBytes, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_xStreamBufferSend
+ #define traceRETURN_xStreamBufferSend( xReturn )
+#endif
+
+#ifndef traceENTER_xStreamBufferSendFromISR
+ #define traceENTER_xStreamBufferSendFromISR( xStreamBuffer, pvTxData, xDataLengthBytes, pxHigherPriorityTaskWoken )
+#endif
+
+#ifndef traceRETURN_xStreamBufferSendFromISR
+ #define traceRETURN_xStreamBufferSendFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_xStreamBufferReceive
+ #define traceENTER_xStreamBufferReceive( xStreamBuffer, pvRxData, xBufferLengthBytes, xTicksToWait )
+#endif
+
+#ifndef traceRETURN_xStreamBufferReceive
+ #define traceRETURN_xStreamBufferReceive( xReceivedLength )
+#endif
+
+#ifndef traceENTER_xStreamBufferNextMessageLengthBytes
+ #define traceENTER_xStreamBufferNextMessageLengthBytes( xStreamBuffer )
+#endif
+
+#ifndef traceRETURN_xStreamBufferNextMessageLengthBytes
+ #define traceRETURN_xStreamBufferNextMessageLengthBytes( xReturn )
+#endif
+
+#ifndef traceENTER_xStreamBufferReceiveFromISR
+ #define traceENTER_xStreamBufferReceiveFromISR( xStreamBuffer, pvRxData, xBufferLengthBytes, pxHigherPriorityTaskWoken )
+#endif
+
+#ifndef traceRETURN_xStreamBufferReceiveFromISR
+ #define traceRETURN_xStreamBufferReceiveFromISR( xReceivedLength )
+#endif
+
+#ifndef traceENTER_xStreamBufferIsEmpty
+ #define traceENTER_xStreamBufferIsEmpty( xStreamBuffer )
+#endif
+
+#ifndef traceRETURN_xStreamBufferIsEmpty
+ #define traceRETURN_xStreamBufferIsEmpty( xReturn )
+#endif
+
+#ifndef traceENTER_xStreamBufferIsFull
+ #define traceENTER_xStreamBufferIsFull( xStreamBuffer )
+#endif
+
+#ifndef traceRETURN_xStreamBufferIsFull
+ #define traceRETURN_xStreamBufferIsFull( xReturn )
+#endif
+
+#ifndef traceENTER_xStreamBufferSendCompletedFromISR
+ #define traceENTER_xStreamBufferSendCompletedFromISR( xStreamBuffer, pxHigherPriorityTaskWoken )
+#endif
+
+#ifndef traceRETURN_xStreamBufferSendCompletedFromISR
+ #define traceRETURN_xStreamBufferSendCompletedFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_xStreamBufferReceiveCompletedFromISR
+ #define traceENTER_xStreamBufferReceiveCompletedFromISR( xStreamBuffer, pxHigherPriorityTaskWoken )
+#endif
+
+#ifndef traceRETURN_xStreamBufferReceiveCompletedFromISR
+ #define traceRETURN_xStreamBufferReceiveCompletedFromISR( xReturn )
+#endif
+
+#ifndef traceENTER_uxStreamBufferGetStreamBufferNotificationIndex
+ #define traceENTER_uxStreamBufferGetStreamBufferNotificationIndex( xStreamBuffer )
+#endif
+
+#ifndef traceRETURN_uxStreamBufferGetStreamBufferNotificationIndex
+ #define traceRETURN_uxStreamBufferGetStreamBufferNotificationIndex( uxNotificationIndex )
+#endif
+
+#ifndef traceENTER_vStreamBufferSetStreamBufferNotificationIndex
+ #define traceENTER_vStreamBufferSetStreamBufferNotificationIndex( xStreamBuffer, uxNotificationIndex )
+#endif
+
+#ifndef traceRETURN_vStreamBufferSetStreamBufferNotificationIndex
+ #define traceRETURN_vStreamBufferSetStreamBufferNotificationIndex()
+#endif
+
+#ifndef traceENTER_uxStreamBufferGetStreamBufferNumber
+ #define traceENTER_uxStreamBufferGetStreamBufferNumber( xStreamBuffer )
+#endif
+
+#ifndef traceRETURN_uxStreamBufferGetStreamBufferNumber
+ #define traceRETURN_uxStreamBufferGetStreamBufferNumber( uxStreamBufferNumber )
+#endif
+
+#ifndef traceENTER_vStreamBufferSetStreamBufferNumber
+ #define traceENTER_vStreamBufferSetStreamBufferNumber( xStreamBuffer, uxStreamBufferNumber )
+#endif
+
+#ifndef traceRETURN_vStreamBufferSetStreamBufferNumber
+ #define traceRETURN_vStreamBufferSetStreamBufferNumber()
+#endif
+
+#ifndef traceENTER_ucStreamBufferGetStreamBufferType
+ #define traceENTER_ucStreamBufferGetStreamBufferType( xStreamBuffer )
+#endif
+
+#ifndef traceRETURN_ucStreamBufferGetStreamBufferType
+ #define traceRETURN_ucStreamBufferGetStreamBufferType( ucStreamBufferType )
+#endif
+
+#ifndef traceENTER_vListInitialise
+ #define traceENTER_vListInitialise( pxList )
+#endif
+
+#ifndef traceRETURN_vListInitialise
+ #define traceRETURN_vListInitialise()
+#endif
+
+#ifndef traceENTER_vListInitialiseItem
+ #define traceENTER_vListInitialiseItem( pxItem )
+#endif
+
+#ifndef traceRETURN_vListInitialiseItem
+ #define traceRETURN_vListInitialiseItem()
+#endif
+
+#ifndef traceENTER_vListInsertEnd
+ #define traceENTER_vListInsertEnd( pxList, pxNewListItem )
+#endif
+
+#ifndef traceRETURN_vListInsertEnd
+ #define traceRETURN_vListInsertEnd()
+#endif
+
+#ifndef traceENTER_vListInsert
+ #define traceENTER_vListInsert( pxList, pxNewListItem )
+#endif
+
+#ifndef traceRETURN_vListInsert
+ #define traceRETURN_vListInsert()
+#endif
+
+#ifndef traceENTER_uxListRemove
+ #define traceENTER_uxListRemove( pxItemToRemove )
+#endif
+
+#ifndef traceRETURN_uxListRemove
+ #define traceRETURN_uxListRemove( uxNumberOfItems )
+#endif
+
+#ifndef traceENTER_xCoRoutineCreate
+ #define traceENTER_xCoRoutineCreate( pxCoRoutineCode, uxPriority, uxIndex )
+#endif
+
+#ifndef traceRETURN_xCoRoutineCreate
+ #define traceRETURN_xCoRoutineCreate( xReturn )
+#endif
+
+#ifndef traceENTER_vCoRoutineAddToDelayedList
+ #define traceENTER_vCoRoutineAddToDelayedList( xTicksToDelay, pxEventList )
+#endif
+
+#ifndef traceRETURN_vCoRoutineAddToDelayedList
+ #define traceRETURN_vCoRoutineAddToDelayedList()
+#endif
+
+#ifndef traceENTER_vCoRoutineSchedule
+ #define traceENTER_vCoRoutineSchedule()
+#endif
+
+#ifndef traceRETURN_vCoRoutineSchedule
+ #define traceRETURN_vCoRoutineSchedule()
+#endif
+
+#ifndef traceENTER_xCoRoutineRemoveFromEventList
+ #define traceENTER_xCoRoutineRemoveFromEventList( pxEventList )
+#endif
+
+#ifndef traceRETURN_xCoRoutineRemoveFromEventList
+ #define traceRETURN_xCoRoutineRemoveFromEventList( xReturn )
+#endif
+
+#ifndef configGENERATE_RUN_TIME_STATS
+ #define configGENERATE_RUN_TIME_STATS 0
+#endif
+
+#if ( configGENERATE_RUN_TIME_STATS == 1 )
+
+ #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
+ #error If configGENERATE_RUN_TIME_STATS is defined then portCONFIGURE_TIMER_FOR_RUN_TIME_STATS must also be defined. portCONFIGURE_TIMER_FOR_RUN_TIME_STATS should call a port layer function to setup a peripheral timer/counter that can then be used as the run time counter time base.
+ #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */
+
+ #ifndef portGET_RUN_TIME_COUNTER_VALUE
+ #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE
+ #error If configGENERATE_RUN_TIME_STATS is defined then either portGET_RUN_TIME_COUNTER_VALUE or portALT_GET_RUN_TIME_COUNTER_VALUE must also be defined. See the examples provided and the FreeRTOS web site for more information.
+ #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */
+ #endif /* portGET_RUN_TIME_COUNTER_VALUE */
+
+#endif /* configGENERATE_RUN_TIME_STATS */
+
+#ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
+ #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
+#endif
+
+#ifndef portPRIVILEGE_BIT
+ #define portPRIVILEGE_BIT ( ( UBaseType_t ) 0x00 )
+#endif
+
+#ifndef portYIELD_WITHIN_API
+ #define portYIELD_WITHIN_API portYIELD
+#endif
+
+#ifndef portSUPPRESS_TICKS_AND_SLEEP
+ #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )
+#endif
+
+#ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP
+ #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
+#endif
+
+#if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2
+ #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2
+#endif
+
+#ifndef configUSE_TICKLESS_IDLE
+ #define configUSE_TICKLESS_IDLE 0
+#endif
+
+#ifndef configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING
+ #define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x )
+#endif
+
+#ifndef configPRE_SLEEP_PROCESSING
+ #define configPRE_SLEEP_PROCESSING( x )
+#endif
+
+#ifndef configPOST_SLEEP_PROCESSING
+ #define configPOST_SLEEP_PROCESSING( x )
+#endif
+
+#ifndef configUSE_QUEUE_SETS
+ #define configUSE_QUEUE_SETS 0
+#endif
+
+#ifndef portTASK_USES_FLOATING_POINT
+ #define portTASK_USES_FLOATING_POINT()
+#endif
+
+#ifndef portALLOCATE_SECURE_CONTEXT
+ #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize )
+#endif
+
+#ifndef portDONT_DISCARD
+ #define portDONT_DISCARD
+#endif
+
+#ifndef configUSE_TIME_SLICING
+ #define configUSE_TIME_SLICING 1
+#endif
+
+#ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS
+ #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0
+#endif
+
+#ifndef configUSE_STATS_FORMATTING_FUNCTIONS
+ #define configUSE_STATS_FORMATTING_FUNCTIONS 0
+#endif
+
+#ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID
+ #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID()
+#endif
+
+#ifndef configUSE_TRACE_FACILITY
+ #define configUSE_TRACE_FACILITY 0
+#endif
+
+#ifndef mtCOVERAGE_TEST_MARKER
+ #define mtCOVERAGE_TEST_MARKER()
+#endif
+
+#ifndef mtCOVERAGE_TEST_DELAY
+ #define mtCOVERAGE_TEST_DELAY()
+#endif
+
+#ifndef portASSERT_IF_IN_ISR
+ #define portASSERT_IF_IN_ISR()
+#endif
+
+#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
+ #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
+#endif
+
+#ifndef configAPPLICATION_ALLOCATED_HEAP
+ #define configAPPLICATION_ALLOCATED_HEAP 0
+#endif
+
+#ifndef configENABLE_HEAP_PROTECTOR
+ #define configENABLE_HEAP_PROTECTOR 0
+#endif
+
+#ifndef configUSE_TASK_NOTIFICATIONS
+ #define configUSE_TASK_NOTIFICATIONS 1
+#endif
+
+#ifndef configTASK_NOTIFICATION_ARRAY_ENTRIES
+ #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1
+#endif
+
+#if configTASK_NOTIFICATION_ARRAY_ENTRIES < 1
+ #error configTASK_NOTIFICATION_ARRAY_ENTRIES must be at least 1
+#endif
+
+#ifndef configUSE_POSIX_ERRNO
+ #define configUSE_POSIX_ERRNO 0
+#endif
+
+#ifndef configUSE_SB_COMPLETED_CALLBACK
+
+/* By default per-instance callbacks are not enabled for stream buffer or message buffer. */
+ #define configUSE_SB_COMPLETED_CALLBACK 0
+#endif
+
+#ifndef portTICK_TYPE_IS_ATOMIC
+ #define portTICK_TYPE_IS_ATOMIC 0
+#endif
+
+#ifndef configSUPPORT_STATIC_ALLOCATION
+ /* Defaults to 0 for backward compatibility. */
+ #define configSUPPORT_STATIC_ALLOCATION 0
+#endif
+
+#ifndef configKERNEL_PROVIDED_STATIC_MEMORY
+ #define configKERNEL_PROVIDED_STATIC_MEMORY 0
+#endif
+
+#ifndef configSUPPORT_DYNAMIC_ALLOCATION
+ /* Defaults to 1 for backward compatibility. */
+ #define configSUPPORT_DYNAMIC_ALLOCATION 1
+#endif
+
+#if ( ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION != 1 ) )
+ #error configUSE_STATS_FORMATTING_FUNCTIONS cannot be used without dynamic allocation, but configSUPPORT_DYNAMIC_ALLOCATION is not set to 1.
+#endif
+
+#if ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 )
+ #if ( ( configUSE_TRACE_FACILITY != 1 ) && ( configGENERATE_RUN_TIME_STATS != 1 ) )
+ #error configUSE_STATS_FORMATTING_FUNCTIONS is 1 but the functions it enables are not used because neither configUSE_TRACE_FACILITY or configGENERATE_RUN_TIME_STATS are 1. Set configUSE_STATS_FORMATTING_FUNCTIONS to 0 in FreeRTOSConfig.h.
+ #endif
+#endif
+
+#ifndef configSTATS_BUFFER_MAX_LENGTH
+ #define configSTATS_BUFFER_MAX_LENGTH 0xFFFF
+#endif
+
+#ifndef configSTACK_DEPTH_TYPE
+
+/* Defaults to StackType_t for backward compatibility, but can be overridden
+ * in FreeRTOSConfig.h if StackType_t is too restrictive. */
+ #define configSTACK_DEPTH_TYPE StackType_t
+#endif
+
+#ifndef configRUN_TIME_COUNTER_TYPE
+
+/* Defaults to uint32_t for backward compatibility, but can be overridden in
+ * FreeRTOSConfig.h if uint32_t is too restrictive. */
+
+ #define configRUN_TIME_COUNTER_TYPE uint32_t
+#endif
+
+#ifndef configMESSAGE_BUFFER_LENGTH_TYPE
+
+/* Defaults to size_t for backward compatibility, but can be overridden
+ * in FreeRTOSConfig.h if lengths will always be less than the number of bytes
+ * in a size_t. */
+ #define configMESSAGE_BUFFER_LENGTH_TYPE size_t
+#endif
+
+/* Sanity check the configuration. */
+#if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
+ #error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.
+#endif
+
+#if ( ( configUSE_RECURSIVE_MUTEXES == 1 ) && ( configUSE_MUTEXES != 1 ) )
+ #error configUSE_MUTEXES must be set to 1 to use recursive mutexes
+#endif
+
+#if ( ( configRUN_MULTIPLE_PRIORITIES == 0 ) && ( configUSE_TASK_PREEMPTION_DISABLE != 0 ) )
+ #error configRUN_MULTIPLE_PRIORITIES must be set to 1 to use task preemption disable
+#endif
+
+#if ( ( configUSE_PREEMPTION == 0 ) && ( configUSE_TASK_PREEMPTION_DISABLE != 0 ) )
+ #error configUSE_PREEMPTION must be set to 1 to use task preemption disable
+#endif
+
+#if ( ( configNUMBER_OF_CORES == 1 ) && ( configUSE_TASK_PREEMPTION_DISABLE != 0 ) )
+ #error configUSE_TASK_PREEMPTION_DISABLE is not supported in single core FreeRTOS
+#endif
+
+#if ( ( configNUMBER_OF_CORES == 1 ) && ( configUSE_CORE_AFFINITY != 0 ) )
+ #error configUSE_CORE_AFFINITY is not supported in single core FreeRTOS
+#endif
+
+#if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_PORT_OPTIMISED_TASK_SELECTION != 0 ) )
+ #error configUSE_PORT_OPTIMISED_TASK_SELECTION is not supported in SMP FreeRTOS
+#endif
+
+#ifndef configINITIAL_TICK_COUNT
+ #define configINITIAL_TICK_COUNT 0
+#endif
+
+#if ( portTICK_TYPE_IS_ATOMIC == 0 )
+
+/* Either variables of tick type cannot be read atomically, or
+ * portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when
+ * the tick count is returned to the standard critical section macros. */
+ #define portTICK_TYPE_ENTER_CRITICAL() portENTER_CRITICAL()
+ #define portTICK_TYPE_EXIT_CRITICAL() portEXIT_CRITICAL()
+ #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
+ #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )
+#else
+
+/* The tick type can be read atomically, so critical sections used when the
+ * tick count is returned can be defined away. */
+ #define portTICK_TYPE_ENTER_CRITICAL()
+ #define portTICK_TYPE_EXIT_CRITICAL()
+ #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0
+ #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) ( void ) ( x )
#endif /* if ( portTICK_TYPE_IS_ATOMIC == 0 ) */
/* Definitions to allow backward compatibility with FreeRTOS versions prior to
@@ -1141,6 +3019,11 @@
#define configRUN_ADDITIONAL_TESTS 0
#endif
+/* The following config allows infinite loop control. For example, control the
+ * infinite loop in idle task function when performing unit tests. */
+#ifndef configCONTROL_INFINITE_LOOP
+ #define configCONTROL_INFINITE_LOOP()
+#endif
/* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using
* dynamically allocated RAM, in which case when any task is deleted it is known
@@ -1259,10 +3142,20 @@ typedef struct xSTATIC_TCB
#if ( portUSING_MPU_WRAPPERS == 1 )
xMPU_SETTINGS xDummy2;
#endif
+ #if ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 )
+ UBaseType_t uxDummy26;
+ #endif
StaticListItem_t xDummy3[ 2 ];
UBaseType_t uxDummy5;
void * pxDummy6;
+ #if ( configNUMBER_OF_CORES > 1 )
+ BaseType_t xDummy23;
+ UBaseType_t uxDummy24;
+ #endif
uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ];
+ #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
+ BaseType_t xDummy25;
+ #endif
#if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
void * pxDummy8;
#endif
@@ -1284,7 +3177,7 @@ typedef struct xSTATIC_TCB
#if ( configGENERATE_RUN_TIME_STATS == 1 )
configRUN_TIME_COUNTER_TYPE ulDummy16;
#endif
- #if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
+ #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
configTLS_BLOCK_TYPE xDummy17;
#endif
#if ( configUSE_TASK_NOTIFICATIONS == 1 )
@@ -1426,6 +3319,7 @@ typedef struct xSTATIC_STREAM_BUFFER
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
void * pvDummy5[ 2 ];
#endif
+ UBaseType_t uxDummy6;
} StaticStreamBuffer_t;
/* Message buffers are built on stream buffers. */
diff --git a/third-party/freertos/include/StackMacros.h b/third-party/freertos/include/StackMacros.h
index 099ac0c75f4a4242d85b962c70b00051c703a07f..f47b1c420adf114a9ef0f34dcaa91b57f49c68b8 100644
--- a/third-party/freertos/include/StackMacros.h
+++ b/third-party/freertos/include/StackMacros.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
diff --git a/third-party/freertos/include/atomic.h b/third-party/freertos/include/atomic.h
index 8e356e1fee39264a5997e7203c43b339236218c3..c2480d19faae2c09795c0ecf790ee7acf9a36a00 100644
--- a/third-party/freertos/include/atomic.h
+++ b/third-party/freertos/include/atomic.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -33,6 +33,14 @@
* This file implements atomic functions by disabling interrupts globally.
* Implementations with architecture specific atomic instructions can be
* provided under each compiler directory.
+ *
+ * The atomic interface can be used in FreeRTOS tasks on all FreeRTOS ports. It
+ * can also be used in Interrupt Service Routines (ISRs) on FreeRTOS ports that
+ * support nested interrupts (i.e. portHAS_NESTED_INTERRUPTS is set to 1). The
+ * atomic interface must not be used in ISRs on FreeRTOS ports that do not
+ * support nested interrupts (i.e. portHAS_NESTED_INTERRUPTS is set to 0)
+ * because ISRs on these ports cannot be interrupted and therefore, do not need
+ * atomics in ISRs.
*/
#ifndef ATOMIC_H
@@ -59,7 +67,7 @@
* ATOMIC_ENTER_CRITICAL().
*
*/
-#if defined( portSET_INTERRUPT_MASK_FROM_ISR )
+#if ( portHAS_NESTED_INTERRUPTS == 1 )
/* Nested interrupt scheme is supported in this port. */
#define ATOMIC_ENTER_CRITICAL() \
diff --git a/third-party/freertos/include/croutine.h b/third-party/freertos/include/croutine.h
index 48e6f035b71e32df895219a5118bc2f078a22fcd..6cbb743c5e6671d90738a6cd372cb45102e05885 100644
--- a/third-party/freertos/include/croutine.h
+++ b/third-party/freertos/include/croutine.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -47,17 +47,17 @@
typedef void * CoRoutineHandle_t;
/* Defines the prototype to which co-routine functions must conform. */
-typedef void (* crCOROUTINE_CODE)( CoRoutineHandle_t,
- UBaseType_t );
+typedef void (* crCOROUTINE_CODE)( CoRoutineHandle_t xHandle,
+ UBaseType_t uxIndex );
typedef struct corCoRoutineControlBlock
{
crCOROUTINE_CODE pxCoRoutineFunction;
- ListItem_t xGenericListItem; /*< List item used to place the CRCB in ready and blocked queues. */
- ListItem_t xEventListItem; /*< List item used to place the CRCB in event lists. */
- UBaseType_t uxPriority; /*< The priority of the co-routine in relation to other co-routines. */
- UBaseType_t uxIndex; /*< Used to distinguish between co-routines when multiple co-routines use the same co-routine function. */
- uint16_t uxState; /*< Used internally by the co-routine implementation. */
+ ListItem_t xGenericListItem; /**< List item used to place the CRCB in ready and blocked queues. */
+ ListItem_t xEventListItem; /**< List item used to place the CRCB in event lists. */
+ UBaseType_t uxPriority; /**< The priority of the co-routine in relation to other co-routines. */
+ UBaseType_t uxIndex; /**< Used to distinguish between co-routines when multiple co-routines use the same co-routine function. */
+ uint16_t uxState; /**< Used internally by the co-routine implementation. */
} CRCB_t; /* Co-routine control block. Note must be identical in size down to uxPriority with TCB_t. */
/**
@@ -307,12 +307,14 @@ void vCoRoutineSchedule( void );
* \defgroup crDELAY crDELAY
* \ingroup Tasks
*/
-#define crDELAY( xHandle, xTicksToDelay ) \
- if( ( xTicksToDelay ) > 0 ) \
- { \
- vCoRoutineAddToDelayedList( ( xTicksToDelay ), NULL ); \
- } \
- crSET_STATE0( ( xHandle ) );
+#define crDELAY( xHandle, xTicksToDelay ) \
+ do { \
+ if( ( xTicksToDelay ) > 0 ) \
+ { \
+ vCoRoutineAddToDelayedList( ( xTicksToDelay ), NULL ); \
+ } \
+ crSET_STATE0( ( xHandle ) ); \
+ } while( 0 )
/**
* @code{c}
@@ -400,7 +402,7 @@ void vCoRoutineSchedule( void );
* \ingroup Tasks
*/
#define crQUEUE_SEND( xHandle, pxQueue, pvItemToQueue, xTicksToWait, pxResult ) \
- { \
+ do { \
*( pxResult ) = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), ( xTicksToWait ) ); \
if( *( pxResult ) == errQUEUE_BLOCKED ) \
{ \
@@ -412,7 +414,7 @@ void vCoRoutineSchedule( void );
crSET_STATE1( ( xHandle ) ); \
*pxResult = pdPASS; \
} \
- }
+ } while( 0 )
/**
* croutine. h
@@ -494,7 +496,7 @@ void vCoRoutineSchedule( void );
* \ingroup Tasks
*/
#define crQUEUE_RECEIVE( xHandle, pxQueue, pvBuffer, xTicksToWait, pxResult ) \
- { \
+ do { \
*( pxResult ) = xQueueCRReceive( ( pxQueue ), ( pvBuffer ), ( xTicksToWait ) ); \
if( *( pxResult ) == errQUEUE_BLOCKED ) \
{ \
@@ -506,7 +508,7 @@ void vCoRoutineSchedule( void );
crSET_STATE1( ( xHandle ) ); \
*( pxResult ) = pdPASS; \
} \
- }
+ } while( 0 )
/**
* croutine. h
@@ -744,6 +746,13 @@ void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay,
*/
BaseType_t xCoRoutineRemoveFromEventList( const List_t * pxEventList );
+
+/*
+ * This function resets the internal state of the coroutine module. It must be
+ * called by the application before restarting the scheduler.
+ */
+void vCoRoutineResetState( void ) PRIVILEGED_FUNCTION;
+
/* *INDENT-OFF* */
#ifdef __cplusplus
}
diff --git a/third-party/freertos/include/deprecated_definitions.h b/third-party/freertos/include/deprecated_definitions.h
index 1cb93728ee29b5af968a95a8ccbfcec95d30839a..ebf8fe46341515815c84937425ea06488b9c46df 100644
--- a/third-party/freertos/include/deprecated_definitions.h
+++ b/third-party/freertos/include/deprecated_definitions.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
diff --git a/third-party/freertos/include/event_groups.h b/third-party/freertos/include/event_groups.h
index 275f316bdcae562b86bf90ebfea33b00704e940a..e872cf23bd80333b9fcae9caeacb4269992a98af 100644
--- a/third-party/freertos/include/event_groups.h
+++ b/third-party/freertos/include/event_groups.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -36,6 +36,26 @@
/* FreeRTOS includes. */
#include "timers.h"
+/* The following bit fields convey control information in a task's event list
+ * item value. It is important they don't clash with the
+ * taskEVENT_LIST_ITEM_VALUE_IN_USE definition. */
+#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
+ #define eventCLEAR_EVENTS_ON_EXIT_BIT ( ( uint16_t ) 0x0100U )
+ #define eventUNBLOCKED_DUE_TO_BIT_SET ( ( uint16_t ) 0x0200U )
+ #define eventWAIT_FOR_ALL_BITS ( ( uint16_t ) 0x0400U )
+ #define eventEVENT_BITS_CONTROL_BYTES ( ( uint16_t ) 0xff00U )
+#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
+ #define eventCLEAR_EVENTS_ON_EXIT_BIT ( ( uint32_t ) 0x01000000U )
+ #define eventUNBLOCKED_DUE_TO_BIT_SET ( ( uint32_t ) 0x02000000U )
+ #define eventWAIT_FOR_ALL_BITS ( ( uint32_t ) 0x04000000U )
+ #define eventEVENT_BITS_CONTROL_BYTES ( ( uint32_t ) 0xff000000U )
+#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
+ #define eventCLEAR_EVENTS_ON_EXIT_BIT ( ( uint64_t ) 0x0100000000000000U )
+ #define eventUNBLOCKED_DUE_TO_BIT_SET ( ( uint64_t ) 0x0200000000000000U )
+ #define eventWAIT_FOR_ALL_BITS ( ( uint64_t ) 0x0400000000000000U )
+ #define eventEVENT_BITS_CONTROL_BYTES ( ( uint64_t ) 0xff00000000000000U )
+#endif /* if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS ) */
+
/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
@@ -84,8 +104,8 @@ typedef struct EventGroupDef_t * EventGroupHandle_t;
/*
* The type that holds event bits always matches TickType_t - therefore the
- * number of bits it holds is set by configUSE_16_BIT_TICKS (16 bits if set to 1,
- * 32 bits if set to 0.
+ * number of bits it holds is set by configTICK_TYPE_WIDTH_IN_BITS (16 bits if set to 0,
+ * 32 bits if set to 1, 64 bits if set to 2.
*
* \defgroup EventBits_t EventBits_t
* \ingroup EventGroup
@@ -112,11 +132,15 @@ typedef TickType_t EventBits_t;
*
* Although event groups are not related to ticks, for internal implementation
* reasons the number of bits available for use in an event group is dependent
- * on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h. If
- * configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit
- * 0 to bit 7). If configUSE_16_BIT_TICKS is set to 0 then each event group has
- * 24 usable bits (bit 0 to bit 23). The EventBits_t type is used to store
- * event bits within an event group.
+ * on the configTICK_TYPE_WIDTH_IN_BITS setting in FreeRTOSConfig.h. If
+ * configTICK_TYPE_WIDTH_IN_BITS is 0 then each event group contains 8 usable bits (bit
+ * 0 to bit 7). If configTICK_TYPE_WIDTH_IN_BITS is set to 1 then each event group has
+ * 24 usable bits (bit 0 to bit 23). If configTICK_TYPE_WIDTH_IN_BITS is set to 2 then
+ * each event group has 56 usable bits (bit 0 to bit 53). The EventBits_t type
+ * is used to store event bits within an event group.
+ *
+ * The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupCreate()
+ * to be available.
*
* @return If the event group was created then a handle to the event group is
* returned. If there was insufficient FreeRTOS heap available to create the
@@ -168,11 +192,15 @@ typedef TickType_t EventBits_t;
*
* Although event groups are not related to ticks, for internal implementation
* reasons the number of bits available for use in an event group is dependent
- * on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h. If
- * configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit
- * 0 to bit 7). If configUSE_16_BIT_TICKS is set to 0 then each event group has
- * 24 usable bits (bit 0 to bit 23). The EventBits_t type is used to store
- * event bits within an event group.
+ * on the configTICK_TYPE_WIDTH_IN_BITS setting in FreeRTOSConfig.h. If
+ * configTICK_TYPE_WIDTH_IN_BITS is 0 then each event group contains 8 usable bits (bit
+ * 0 to bit 7). If configTICK_TYPE_WIDTH_IN_BITS is set to 1 then each event group has
+ * 24 usable bits (bit 0 to bit 23). If configTICK_TYPE_WIDTH_IN_BITS is set to 2 then
+ * each event group has 56 usable bits (bit 0 to bit 53). The EventBits_t type
+ * is used to store event bits within an event group.
+ *
+ * The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupCreateStatic()
+ * to be available.
*
* @param pxEventGroupBuffer pxEventGroupBuffer must point to a variable of type
* StaticEventGroup_t, which will be then be used to hold the event group's data
@@ -216,6 +244,9 @@ typedef TickType_t EventBits_t;
*
* This function cannot be called from an interrupt.
*
+ * The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupWaitBits()
+ * to be available.
+ *
* @param xEventGroup The event group in which the bits are being tested. The
* event group must have previously been created using a call to
* xEventGroupCreate().
@@ -309,6 +340,9 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
* Clear bits within an event group. This function cannot be called from an
* interrupt.
*
+ * The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupClearBits()
+ * to be available.
+ *
* @param xEventGroup The event group in which the bits are to be cleared.
*
* @param uxBitsToClear A bitwise value that indicates the bit or bits to clear
@@ -439,6 +473,9 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
* Setting bits in an event group will automatically unblock tasks that are
* blocked waiting for the bits.
*
+ * The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupSetBits()
+ * to be available.
+ *
* @param xEventGroup The event group in which the bits are to be set.
*
* @param uxBitsToSet A bitwise value that indicates the bit or bits to set.
@@ -603,6 +640,9 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
* this case all the bits specified by uxBitsToWait will be automatically
* cleared before the function returns.
*
+ * The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupSync()
+ * to be available.
+ *
* @param xEventGroup The event group in which the bits are being tested. The
* event group must have previously been created using a call to
* xEventGroupCreate().
@@ -721,6 +761,9 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
* Returns the current value of the bits in an event group. This function
* cannot be used from an interrupt.
*
+ * The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupGetBits()
+ * to be available.
+ *
* @param xEventGroup The event group being queried.
*
* @return The event group bits at the time xEventGroupGetBits() was called.
@@ -738,6 +781,9 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
*
* A version of xEventGroupGetBits() that can be called from an ISR.
*
+ * The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupGetBitsFromISR()
+ * to be available.
+ *
* @param xEventGroup The event group being queried.
*
* @return The event group bits at the time xEventGroupGetBitsFromISR() was called.
@@ -757,15 +803,43 @@ EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup ) PRIVILEG
* xEventGroupCreate(). Tasks that are blocked on the event group will be
* unblocked and obtain 0 as the event group's value.
*
+ * The configUSE_EVENT_GROUPS configuration constant must be set to 1 for vEventGroupDelete()
+ * to be available.
+ *
* @param xEventGroup The event group being deleted.
*/
void vEventGroupDelete( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
+/**
+ * event_groups.h
+ * @code{c}
+ * BaseType_t xEventGroupGetStaticBuffer( EventGroupHandle_t xEventGroup,
+ * StaticEventGroup_t ** ppxEventGroupBuffer );
+ * @endcode
+ *
+ * Retrieve a pointer to a statically created event groups's data structure
+ * buffer. It is the same buffer that is supplied at the time of creation.
+ *
+ * The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupGetStaticBuffer()
+ * to be available.
+ *
+ * @param xEventGroup The event group for which to retrieve the buffer.
+ *
+ * @param ppxEventGroupBuffer Used to return a pointer to the event groups's
+ * data structure buffer.
+ *
+ * @return pdTRUE if the buffer was retrieved, pdFALSE otherwise.
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ BaseType_t xEventGroupGetStaticBuffer( EventGroupHandle_t xEventGroup,
+ StaticEventGroup_t ** ppxEventGroupBuffer ) PRIVILEGED_FUNCTION;
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+
/* For internal use only. */
void vEventGroupSetBitsCallback( void * pvEventGroup,
- const uint32_t ulBitsToSet ) PRIVILEGED_FUNCTION;
+ uint32_t ulBitsToSet ) PRIVILEGED_FUNCTION;
void vEventGroupClearBitsCallback( void * pvEventGroup,
- const uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
+ uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
#if ( configUSE_TRACE_FACILITY == 1 )
diff --git a/third-party/freertos/include/list.h b/third-party/freertos/include/list.h
index 9ffd5b89df3c65a942f47433063470759d6167d0..e5e6583b4635ac745f953c3c33ce2fca34c4c7e9 100644
--- a/third-party/freertos/include/list.h
+++ b/third-party/freertos/include/list.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -143,20 +143,20 @@
struct xLIST;
struct xLIST_ITEM
{
- listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
- configLIST_VOLATILE TickType_t xItemValue; /*< The value being listed. In most cases this is used to sort the list in ascending order. */
- struct xLIST_ITEM * configLIST_VOLATILE pxNext; /*< Pointer to the next ListItem_t in the list. */
- struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; /*< Pointer to the previous ListItem_t in the list. */
- void * pvOwner; /*< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */
- struct xLIST * configLIST_VOLATILE pxContainer; /*< Pointer to the list in which this list item is placed (if any). */
- listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
+ listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
+ configLIST_VOLATILE TickType_t xItemValue; /**< The value being listed. In most cases this is used to sort the list in ascending order. */
+ struct xLIST_ITEM * configLIST_VOLATILE pxNext; /**< Pointer to the next ListItem_t in the list. */
+ struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; /**< Pointer to the previous ListItem_t in the list. */
+ void * pvOwner; /**< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */
+ struct xLIST * configLIST_VOLATILE pxContainer; /**< Pointer to the list in which this list item is placed (if any). */
+ listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE /**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
};
-typedef struct xLIST_ITEM ListItem_t; /* For some reason lint wants this as two separate definitions. */
+typedef struct xLIST_ITEM ListItem_t;
#if ( configUSE_MINI_LIST_ITEM == 1 )
struct xMINI_LIST_ITEM
{
- listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
+ listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
configLIST_VOLATILE TickType_t xItemValue;
struct xLIST_ITEM * configLIST_VOLATILE pxNext;
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious;
@@ -171,11 +171,11 @@ typedef struct xLIST_ITEM ListItem_t; /* For some reason lint
*/
typedef struct xLIST
{
- listFIRST_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
- volatile UBaseType_t uxNumberOfItems;
- ListItem_t * configLIST_VOLATILE pxIndex; /*< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
- MiniListItem_t xListEnd; /*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
- listSECOND_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
+ listFIRST_LIST_INTEGRITY_CHECK_VALUE /**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
+ configLIST_VOLATILE UBaseType_t uxNumberOfItems;
+ ListItem_t * configLIST_VOLATILE pxIndex; /**< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
+ MiniListItem_t xListEnd; /**< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
+ listSECOND_LIST_INTEGRITY_CHECK_VALUE /**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
} List_t;
/*
@@ -282,18 +282,26 @@ typedef struct xLIST
* \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY
* \ingroup LinkedList
*/
-#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
- { \
+#if ( configNUMBER_OF_CORES == 1 )
+ #define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
+ do { \
List_t * const pxConstList = ( pxList ); \
/* Increment the index to the next item and return the item, ensuring */ \
/* we don't return the marker used at the end of the list. */ \
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
if( ( void * ) ( pxConstList )->pxIndex == ( void * ) &( ( pxConstList )->xListEnd ) ) \
{ \
- ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
+ ( pxConstList )->pxIndex = ( pxConstList )->xListEnd.pxNext; \
} \
( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \
- }
+ } while( 0 )
+#else /* #if ( configNUMBER_OF_CORES == 1 ) */
+
+/* This function is not required in SMP. FreeRTOS SMP scheduler doesn't use
+ * pxIndex and it should always point to the xListEnd. Not defining this macro
+ * here to prevent updating pxIndex.
+ */
+#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
/*
* Version of uxListRemove() that does not return a value. Provided as a slight
@@ -312,22 +320,22 @@ typedef struct xLIST
* \ingroup LinkedList
*/
#define listREMOVE_ITEM( pxItemToRemove ) \
- { \
+ do { \
/* The list item knows which list it is in. Obtain the list from the list \
- * item. */ \
- List_t * const pxList = ( pxItemToRemove )->pxContainer; \
- \
- ( pxItemToRemove )->pxNext->pxPrevious = ( pxItemToRemove )->pxPrevious; \
- ( pxItemToRemove )->pxPrevious->pxNext = ( pxItemToRemove )->pxNext; \
- /* Make sure the index is left pointing to a valid item. */ \
- if( pxList->pxIndex == ( pxItemToRemove ) ) \
- { \
- pxList->pxIndex = ( pxItemToRemove )->pxPrevious; \
- } \
- \
- ( pxItemToRemove )->pxContainer = NULL; \
- ( pxList->uxNumberOfItems )--; \
- }
+ * item. */ \
+ List_t * const pxList = ( pxItemToRemove )->pxContainer; \
+ \
+ ( pxItemToRemove )->pxNext->pxPrevious = ( pxItemToRemove )->pxPrevious; \
+ ( pxItemToRemove )->pxPrevious->pxNext = ( pxItemToRemove )->pxNext; \
+ /* Make sure the index is left pointing to a valid item. */ \
+ if( pxList->pxIndex == ( pxItemToRemove ) ) \
+ { \
+ pxList->pxIndex = ( pxItemToRemove )->pxPrevious; \
+ } \
+ \
+ ( pxItemToRemove )->pxContainer = NULL; \
+ ( ( pxList )->uxNumberOfItems ) = ( UBaseType_t ) ( ( ( pxList )->uxNumberOfItems ) - 1U ); \
+ } while( 0 )
/*
* Inline version of vListInsertEnd() to provide slight optimisation for
@@ -352,7 +360,7 @@ typedef struct xLIST
* \ingroup LinkedList
*/
#define listINSERT_END( pxList, pxNewListItem ) \
- { \
+ do { \
ListItem_t * const pxIndex = ( pxList )->pxIndex; \
\
/* Only effective when configASSERT() is also defined, these tests may catch \
@@ -363,18 +371,18 @@ typedef struct xLIST
\
/* Insert a new list item into ( pxList ), but rather than sort the list, \
* makes the new list item the last item to be removed by a call to \
- * listGET_OWNER_OF_NEXT_ENTRY(). */ \
- ( pxNewListItem )->pxNext = pxIndex; \
- ( pxNewListItem )->pxPrevious = pxIndex->pxPrevious; \
- \
- pxIndex->pxPrevious->pxNext = ( pxNewListItem ); \
- pxIndex->pxPrevious = ( pxNewListItem ); \
- \
- /* Remember which list the item is in. */ \
- ( pxNewListItem )->pxContainer = ( pxList ); \
- \
- ( ( pxList )->uxNumberOfItems )++; \
- }
+ * listGET_OWNER_OF_NEXT_ENTRY(). */ \
+ ( pxNewListItem )->pxNext = pxIndex; \
+ ( pxNewListItem )->pxPrevious = pxIndex->pxPrevious; \
+ \
+ pxIndex->pxPrevious->pxNext = ( pxNewListItem ); \
+ pxIndex->pxPrevious = ( pxNewListItem ); \
+ \
+ /* Remember which list the item is in. */ \
+ ( pxNewListItem )->pxContainer = ( pxList ); \
+ \
+ ( ( pxList )->uxNumberOfItems ) = ( UBaseType_t ) ( ( ( pxList )->uxNumberOfItems ) + 1U ); \
+ } while( 0 )
/*
* Access function to obtain the owner of the first entry in a list. Lists
@@ -494,17 +502,6 @@ void vListInsertEnd( List_t * const pxList,
*/
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) PRIVILEGED_FUNCTION;
-/**
- * container_of - 通过结构体的一个成员获取容器结构体的指针
- * @ptr: 指向成员的指针。
- * @type: 成员所嵌入的容器结构体类型。
- * @member: 结构体中的成员名。
- *
- */
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
-
/* *INDENT-OFF* */
#ifdef __cplusplus
}
@@ -512,4 +509,3 @@ UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) PRIVILEGED_FUNCTIO
/* *INDENT-ON* */
#endif /* ifndef LIST_H */
-
diff --git a/third-party/freertos/include/message_buffer.h b/third-party/freertos/include/message_buffer.h
index bb8a7f7d1d512e36073337a130828081db984a08..a47ce467f8ecd35aa212b5630ba6eb44f12c331c 100644
--- a/third-party/freertos/include/message_buffer.h
+++ b/third-party/freertos/include/message_buffer.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -100,6 +100,8 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
*
* configSUPPORT_DYNAMIC_ALLOCATION must be set to 1 or left undefined in
* FreeRTOSConfig.h for xMessageBufferCreate() to be available.
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferCreate() to be available.
*
* @param xBufferSizeBytes The total number of bytes (not messages) the message
* buffer will be able to hold at any one time. When a message is written to
@@ -156,11 +158,11 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* \ingroup MessageBufferManagement
*/
#define xMessageBufferCreate( xBufferSizeBytes ) \
- xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( size_t ) 0, pdTRUE, NULL, NULL )
+ xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( size_t ) 0, sbTYPE_MESSAGE_BUFFER, NULL, NULL )
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
#define xMessageBufferCreateWithCallback( xBufferSizeBytes, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
- xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( size_t ) 0, pdTRUE, ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
+ xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( size_t ) 0, sbTYPE_MESSAGE_BUFFER, ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
#endif
/**
@@ -168,12 +170,15 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
*
* @code{c}
* MessageBufferHandle_t xMessageBufferCreateStatic( size_t xBufferSizeBytes,
- * uint8_t *pucMessageBufferStorageArea,
- * StaticMessageBuffer_t *pxStaticMessageBuffer );
+ * uint8_t *pucMessageBufferStorageArea,
+ * StaticMessageBuffer_t *pxStaticMessageBuffer );
* @endcode
* Creates a new message buffer using statically allocated memory. See
* xMessageBufferCreate() for a version that uses dynamically allocated memory.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferCreateStatic() to be available.
+ *
* @param xBufferSizeBytes The size, in bytes, of the buffer pointed to by the
* pucMessageBufferStorageArea parameter. When a message is written to the
* message buffer an additional sizeof( size_t ) bytes are also written to store
@@ -238,21 +243,55 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* \ingroup MessageBufferManagement
*/
#define xMessageBufferCreateStatic( xBufferSizeBytes, pucMessageBufferStorageArea, pxStaticMessageBuffer ) \
- xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), 0, pdTRUE, ( pucMessageBufferStorageArea ), ( pxStaticMessageBuffer ), NULL, NULL )
+ xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), 0, sbTYPE_MESSAGE_BUFFER, ( pucMessageBufferStorageArea ), ( pxStaticMessageBuffer ), NULL, NULL )
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
#define xMessageBufferCreateStaticWithCallback( xBufferSizeBytes, pucMessageBufferStorageArea, pxStaticMessageBuffer, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
- xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), 0, pdTRUE, ( pucMessageBufferStorageArea ), ( pxStaticMessageBuffer ), ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
+ xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), 0, sbTYPE_MESSAGE_BUFFER, ( pucMessageBufferStorageArea ), ( pxStaticMessageBuffer ), ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
#endif
+/**
+ * message_buffer.h
+ *
+ * @code{c}
+ * BaseType_t xMessageBufferGetStaticBuffers( MessageBufferHandle_t xMessageBuffer,
+ * uint8_t ** ppucMessageBufferStorageArea,
+ * StaticMessageBuffer_t ** ppxStaticMessageBuffer );
+ * @endcode
+ *
+ * Retrieve pointers to a statically created message buffer's data structure
+ * buffer and storage area buffer. These are the same buffers that are supplied
+ * at the time of creation.
+ *
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferGetStaticBuffers() to be available.
+ *
+ * @param xMessageBuffer The message buffer for which to retrieve the buffers.
+ *
+ * @param ppucMessageBufferStorageArea Used to return a pointer to the
+ * message buffer's storage area buffer.
+ *
+ * @param ppxStaticMessageBuffer Used to return a pointer to the message
+ * buffer's data structure buffer.
+ *
+ * @return pdTRUE if buffers were retrieved, pdFALSE otherwise..
+ *
+ * \defgroup xMessageBufferGetStaticBuffers xMessageBufferGetStaticBuffers
+ * \ingroup MessageBufferManagement
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ #define xMessageBufferGetStaticBuffers( xMessageBuffer, ppucMessageBufferStorageArea, ppxStaticMessageBuffer ) \
+ xStreamBufferGetStaticBuffers( ( xMessageBuffer ), ( ppucMessageBufferStorageArea ), ( ppxStaticMessageBuffer ) )
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+
/**
* message_buffer.h
*
* @code{c}
* size_t xMessageBufferSend( MessageBufferHandle_t xMessageBuffer,
- * const void *pvTxData,
- * size_t xDataLengthBytes,
- * TickType_t xTicksToWait );
+ * const void *pvTxData,
+ * size_t xDataLengthBytes,
+ * TickType_t xTicksToWait );
* @endcode
*
* Sends a discrete message to the message buffer. The message can be any
@@ -278,6 +317,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* xMessageBufferSendFromISR() to write to a message buffer from an interrupt
* service routine (ISR).
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferSend() to be available.
+ *
* @param xMessageBuffer The handle of the message buffer to which a message is
* being sent.
*
@@ -350,9 +392,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
*
* @code{c}
* size_t xMessageBufferSendFromISR( MessageBufferHandle_t xMessageBuffer,
- * const void *pvTxData,
- * size_t xDataLengthBytes,
- * BaseType_t *pxHigherPriorityTaskWoken );
+ * const void *pvTxData,
+ * size_t xDataLengthBytes,
+ * BaseType_t *pxHigherPriorityTaskWoken );
* @endcode
*
* Interrupt safe version of the API function that sends a discrete message to
@@ -378,6 +420,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* xMessageBufferSendFromISR() to write to a message buffer from an interrupt
* service routine (ISR).
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferSendFromISR() to be available.
+ *
* @param xMessageBuffer The handle of the message buffer to which a message is
* being sent.
*
@@ -455,9 +500,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
*
* @code{c}
* size_t xMessageBufferReceive( MessageBufferHandle_t xMessageBuffer,
- * void *pvRxData,
- * size_t xBufferLengthBytes,
- * TickType_t xTicksToWait );
+ * void *pvRxData,
+ * size_t xBufferLengthBytes,
+ * TickType_t xTicksToWait );
* @endcode
*
* Receives a discrete message from a message buffer. Messages can be of
@@ -482,6 +527,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* xMessageBufferReceiveFromISR() to read from a message buffer from an
* interrupt service routine (ISR).
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferReceive() to be available.
+ *
* @param xMessageBuffer The handle of the message buffer from which a message
* is being received.
*
@@ -545,9 +593,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
*
* @code{c}
* size_t xMessageBufferReceiveFromISR( MessageBufferHandle_t xMessageBuffer,
- * void *pvRxData,
- * size_t xBufferLengthBytes,
- * BaseType_t *pxHigherPriorityTaskWoken );
+ * void *pvRxData,
+ * size_t xBufferLengthBytes,
+ * BaseType_t *pxHigherPriorityTaskWoken );
* @endcode
*
* An interrupt safe version of the API function that receives a discrete
@@ -573,6 +621,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* xMessageBufferReceiveFromISR() to read from a message buffer from an
* interrupt service routine (ISR).
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferReceiveFromISR() to be available.
+ *
* @param xMessageBuffer The handle of the message buffer from which a message
* is being received.
*
@@ -656,6 +707,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* A message buffer handle must not be used after the message buffer has been
* deleted.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * vMessageBufferDelete() to be available.
+ *
* @param xMessageBuffer The handle of the message buffer to be deleted.
*
*/
@@ -672,6 +726,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* cannot accept any more messages, of any size, until space is made available
* by a message being removed from the message buffer.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferIsFull() to be available.
+ *
* @param xMessageBuffer The handle of the message buffer being queried.
*
* @return If the message buffer referenced by xMessageBuffer is full then
@@ -688,6 +745,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
*
* Tests to see if a message buffer is empty (does not contain any messages).
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferIsEmpty() to be available.
+ *
* @param xMessageBuffer The handle of the message buffer being queried.
*
* @return If the message buffer referenced by xMessageBuffer is empty then
@@ -708,6 +768,13 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
*
* A message buffer can only be reset if there are no tasks blocked on it.
*
+ * Use xMessageBufferReset() to reset a message buffer from a task.
+ * Use xMessageBufferResetFromISR() to reset a message buffer from an
+ * interrupt service routine (ISR).
+ *
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferReset() to be available.
+ *
* @param xMessageBuffer The handle of the message buffer being reset.
*
* @return If the message buffer was reset then pdPASS is returned. If the
@@ -722,6 +789,38 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
xStreamBufferReset( xMessageBuffer )
+/**
+ * message_buffer.h
+ * @code{c}
+ * BaseType_t xMessageBufferResetFromISR( MessageBufferHandle_t xMessageBuffer );
+ * @endcode
+ *
+ * An interrupt safe version of the API function that resets the message buffer.
+ * Resets a message buffer to its initial empty state, discarding any message it
+ * contained.
+ *
+ * A message buffer can only be reset if there are no tasks blocked on it.
+ *
+ * Use xMessageBufferReset() to reset a message buffer from a task.
+ * Use xMessageBufferResetFromISR() to reset a message buffer from an
+ * interrupt service routine (ISR).
+ *
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferResetFromISR() to be available.
+ *
+ * @param xMessageBuffer The handle of the message buffer being reset.
+ *
+ * @return If the message buffer was reset then pdPASS is returned. If the
+ * message buffer could not be reset because either there was a task blocked on
+ * the message queue to wait for space to become available, or to wait for a
+ * a message to be available, then pdFAIL is returned.
+ *
+ * \defgroup xMessageBufferResetFromISR xMessageBufferResetFromISR
+ * \ingroup MessageBufferManagement
+ */
+#define xMessageBufferResetFromISR( xMessageBuffer ) \
+ xStreamBufferResetFromISR( xMessageBuffer )
+
/**
* message_buffer.h
* @code{c}
@@ -729,6 +828,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* @endcode
* Returns the number of bytes of free space in the message buffer.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferSpaceAvailable() to be available.
+ *
* @param xMessageBuffer The handle of the message buffer being queried.
*
* @return The number of bytes that can be written to the message buffer before
@@ -755,6 +857,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* Useful if xMessageBufferReceive() returned 0 because the size of the buffer
* passed into xMessageBufferReceive() was too small to hold the next message.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferNextLengthBytes() to be available.
+ *
* @param xMessageBuffer The handle of the message buffer being queried.
*
* @return The length (in bytes) of the next message in the message buffer, or 0
@@ -764,7 +869,7 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* \ingroup MessageBufferManagement
*/
#define xMessageBufferNextLengthBytes( xMessageBuffer ) \
- xStreamBufferNextMessageLengthBytes( xMessageBuffer ) PRIVILEGED_FUNCTION;
+ xStreamBufferNextMessageLengthBytes( xMessageBuffer )
/**
* message_buffer.h
@@ -786,6 +891,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for
* additional information.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferSendCompletedFromISR() to be available.
+ *
* @param xMessageBuffer The handle of the stream buffer to which data was
* written.
*
@@ -827,6 +935,9 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for
* additional information.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xMessageBufferReceiveCompletedFromISR() to be available.
+ *
* @param xMessageBuffer The handle of the stream buffer from which data was
* read.
*
diff --git a/third-party/freertos/include/mpu_prototypes.h b/third-party/freertos/include/mpu_prototypes.h
index 933794c4c5acbc21c144eaafa2614619ce3227ff..0f42d6b9121897006bd7165362624b5b5800a298 100644
--- a/third-party/freertos/include/mpu_prototypes.h
+++ b/third-party/freertos/include/mpu_prototypes.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -38,21 +38,43 @@
#ifndef MPU_PROTOTYPES_H
#define MPU_PROTOTYPES_H
+typedef struct xTaskGenericNotifyParams
+{
+ TaskHandle_t xTaskToNotify;
+ UBaseType_t uxIndexToNotify;
+ uint32_t ulValue;
+ eNotifyAction eAction;
+ uint32_t * pulPreviousNotificationValue;
+} xTaskGenericNotifyParams_t;
+
+typedef struct xTaskGenericNotifyWaitParams
+{
+ UBaseType_t uxIndexToWaitOn;
+ uint32_t ulBitsToClearOnEntry;
+ uint32_t ulBitsToClearOnExit;
+ uint32_t * pulNotificationValue;
+ TickType_t xTicksToWait;
+} xTaskGenericNotifyWaitParams_t;
+
+typedef struct xTimerGenericCommandFromTaskParams
+{
+ TimerHandle_t xTimer;
+ BaseType_t xCommandID;
+ TickType_t xOptionalValue;
+ BaseType_t * pxHigherPriorityTaskWoken;
+ TickType_t xTicksToWait;
+} xTimerGenericCommandFromTaskParams_t;
+
+typedef struct xEventGroupWaitBitsParams
+{
+ EventGroupHandle_t xEventGroup;
+ EventBits_t uxBitsToWaitFor;
+ BaseType_t xClearOnExit;
+ BaseType_t xWaitForAllBits;
+ TickType_t xTicksToWait;
+} xEventGroupWaitBitsParams_t;
+
/* MPU versions of task.h API functions. */
-BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode,
- const char * const pcName,
- const uint16_t usStackDepth,
- void * const pvParameters,
- UBaseType_t uxPriority,
- TaskHandle_t * const pxCreatedTask ) FREERTOS_SYSTEM_CALL;
-TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode,
- const char * const pcName,
- const uint32_t ulStackDepth,
- void * const pvParameters,
- UBaseType_t uxPriority,
- StackType_t * const puxStackBuffer,
- StaticTask_t * const pxTaskBuffer ) FREERTOS_SYSTEM_CALL;
-void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskDelay( const TickType_t xTicksToDelay ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
const TickType_t xTimeIncrement ) FREERTOS_SYSTEM_CALL;
@@ -63,17 +85,10 @@ void MPU_vTaskGetInfo( TaskHandle_t xTask,
TaskStatus_t * pxTaskStatus,
BaseType_t xGetFreeStackSpace,
eTaskState eState ) FREERTOS_SYSTEM_CALL;
-void MPU_vTaskPrioritySet( TaskHandle_t xTask,
- UBaseType_t uxNewPriority ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskResume( TaskHandle_t xTaskToResume ) FREERTOS_SYSTEM_CALL;
-void MPU_vTaskStartScheduler( void ) FREERTOS_SYSTEM_CALL;
-void MPU_vTaskSuspendAll( void ) FREERTOS_SYSTEM_CALL;
-BaseType_t MPU_xTaskResumeAll( void ) FREERTOS_SYSTEM_CALL;
TickType_t MPU_xTaskGetTickCount( void ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxTaskGetNumberOfTasks( void ) FREERTOS_SYSTEM_CALL;
-char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery ) FREERTOS_SYSTEM_CALL;
-TaskHandle_t MPU_xTaskGetHandle( const char * pcNameToQuery ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
configSTACK_DEPTH_TYPE MPU_uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask,
@@ -84,26 +99,26 @@ void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet,
void * pvValue ) FREERTOS_SYSTEM_CALL;
void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery,
BaseType_t xIndex ) FREERTOS_SYSTEM_CALL;
-BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask,
- void * pvParameter ) FREERTOS_SYSTEM_CALL;
TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
const UBaseType_t uxArraySize,
configRUN_TIME_COUNTER_TYPE * const pulTotalRunTime ) FREERTOS_SYSTEM_CALL;
+configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimeCounter( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
+configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimePercent( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimeCounter( void ) FREERTOS_SYSTEM_CALL;
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimePercent( void ) FREERTOS_SYSTEM_CALL;
-void MPU_vTaskList( char * pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
-void MPU_vTaskGetRunTimeStats( char * pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify,
UBaseType_t uxIndexToNotify,
uint32_t ulValue,
eNotifyAction eAction,
uint32_t * pulPreviousNotificationValue ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTaskGenericNotifyEntry( const xTaskGenericNotifyParams_t * pxParams ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskGenericNotifyWait( UBaseType_t uxIndexToWaitOn,
uint32_t ulBitsToClearOnEntry,
uint32_t ulBitsToClearOnExit,
uint32_t * pulNotificationValue,
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTaskGenericNotifyWaitEntry( const xTaskGenericNotifyWaitParams_t * pxParams ) FREERTOS_SYSTEM_CALL;
uint32_t MPU_ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
BaseType_t xClearCountOnExit,
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
@@ -112,14 +127,58 @@ BaseType_t MPU_xTaskGenericNotifyStateClear( TaskHandle_t xTask,
uint32_t MPU_ulTaskGenericNotifyValueClear( TaskHandle_t xTask,
UBaseType_t uxIndexToClear,
uint32_t ulBitsToClear ) FREERTOS_SYSTEM_CALL;
-BaseType_t MPU_xTaskIncrementTick( void ) FREERTOS_SYSTEM_CALL;
-TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
TickType_t * const pxTicksToWait ) FREERTOS_SYSTEM_CALL;
-void MPU_vTaskMissedYield( void ) FREERTOS_SYSTEM_CALL;
+TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskGetSchedulerState( void ) FREERTOS_SYSTEM_CALL;
-BaseType_t MPU_xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) FREERTOS_SYSTEM_CALL;
+
+/* Privileged only wrappers for Task APIs. These are needed so that
+ * the application can use opaque handles maintained in mpu_wrappers.c
+ * with all the APIs. */
+BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;
+TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ StackType_t * const puxStackBuffer,
+ StaticTask_t * const pxTaskBuffer ) PRIVILEGED_FUNCTION;
+void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) PRIVILEGED_FUNCTION;
+void MPU_vTaskPrioritySet( TaskHandle_t xTask,
+ UBaseType_t uxNewPriority ) PRIVILEGED_FUNCTION;
+TaskHandle_t MPU_xTaskGetHandle( const char * pcNameToQuery ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask,
+ void * pvParameter ) PRIVILEGED_FUNCTION;
+char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition,
+ TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition,
+ TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
+void MPU_vTaskAllocateMPURegions( TaskHandle_t xTaskToModify,
+ const MemoryRegion_t * const xRegions ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xTaskGetStaticBuffers( TaskHandle_t xTask,
+ StackType_t ** ppuxStackBuffer,
+ StaticTask_t ** ppxTaskBuffer ) PRIVILEGED_FUNCTION;
+UBaseType_t MPU_uxTaskPriorityGetFromISR( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+UBaseType_t MPU_uxTaskBasePriorityGet( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+UBaseType_t MPU_uxTaskBasePriorityGetFromISR( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
+TaskHookFunction_t MPU_xTaskGetApplicationTaskTagFromISR( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xTaskGenericNotifyFromISR( TaskHandle_t xTaskToNotify,
+ UBaseType_t uxIndexToNotify,
+ uint32_t ulValue,
+ eNotifyAction eAction,
+ uint32_t * pulPreviousNotificationValue,
+ BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+void MPU_vTaskGenericNotifyGiveFromISR( TaskHandle_t xTaskToNotify,
+ UBaseType_t uxIndexToNotify,
+ BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
/* MPU versions of queue.h API functions. */
BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue,
@@ -136,15 +195,6 @@ BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue,
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
-void MPU_vQueueDelete( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
-QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
-QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType,
- StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL;
-QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
- const UBaseType_t uxInitialCount ) FREERTOS_SYSTEM_CALL;
-QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
- const UBaseType_t uxInitialCount,
- StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL;
TaskHandle_t MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex,
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
@@ -153,70 +203,109 @@ void MPU_vQueueAddToRegistry( QueueHandle_t xQueue,
const char * pcName ) FREERTOS_SYSTEM_CALL;
void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
const char * MPU_pcQueueGetName( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
-QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength,
- const UBaseType_t uxItemSize,
- const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
-QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength,
- const UBaseType_t uxItemSize,
- uint8_t * pucQueueStorage,
- StaticQueue_t * pxStaticQueue,
- const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
-QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
-BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
- QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
-BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue,
- BaseType_t xNewQueue ) FREERTOS_SYSTEM_CALL;
void MPU_vQueueSetQueueNumber( QueueHandle_t xQueue,
UBaseType_t uxQueueNumber ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxQueueGetQueueNumber( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
uint8_t MPU_ucQueueGetQueueType( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
+/* Privileged only wrappers for Queue APIs. These are needed so that
+ * the application can use opaque handles maintained in mpu_wrappers.c
+ * with all the APIs. */
+void MPU_vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
+QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType,
+ StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
+QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
+ const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
+QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
+ const UBaseType_t uxInitialCount,
+ StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
+QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength,
+ const UBaseType_t uxItemSize,
+ const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
+QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength,
+ const UBaseType_t uxItemSize,
+ uint8_t * pucQueueStorage,
+ StaticQueue_t * pxStaticQueue,
+ const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
+QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
+ QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue,
+ BaseType_t xNewQueue ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xQueueGenericGetStaticBuffers( QueueHandle_t xQueue,
+ uint8_t ** ppucQueueStorage,
+ StaticQueue_t ** ppxStaticQueue ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xQueueGenericSendFromISR( QueueHandle_t xQueue,
+ const void * const pvItemToQueue,
+ BaseType_t * const pxHigherPriorityTaskWoken,
+ const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xQueueGiveFromISR( QueueHandle_t xQueue,
+ BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xQueuePeekFromISR( QueueHandle_t xQueue,
+ void * const pvBuffer ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xQueueReceiveFromISR( QueueHandle_t xQueue,
+ void * const pvBuffer,
+ BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+UBaseType_t MPU_uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+TaskHandle_t MPU_xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
+QueueSetMemberHandle_t MPU_xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+
/* MPU versions of timers.h API functions. */
-TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName,
- const TickType_t xTimerPeriodInTicks,
- const UBaseType_t uxAutoReload,
- void * const pvTimerID,
- TimerCallbackFunction_t pxCallbackFunction ) FREERTOS_SYSTEM_CALL;
-TimerHandle_t MPU_xTimerCreateStatic( const char * const pcTimerName,
- const TickType_t xTimerPeriodInTicks,
- const UBaseType_t uxAutoReload,
- void * const pvTimerID,
- TimerCallbackFunction_t pxCallbackFunction,
- StaticTimer_t * pxTimerBuffer ) FREERTOS_SYSTEM_CALL;
void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
void MPU_vTimerSetTimerID( TimerHandle_t xTimer,
void * pvNewID ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) FREERTOS_SYSTEM_CALL;
-BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
- void * pvParameter1,
- uint32_t ulParameter2,
- TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTimerGenericCommandFromTask( TimerHandle_t xTimer,
+ const BaseType_t xCommandID,
+ const TickType_t xOptionalValue,
+ BaseType_t * const pxHigherPriorityTaskWoken,
+ const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTimerGenericCommandFromTaskEntry( const xTimerGenericCommandFromTaskParams_t * pxParams ) FREERTOS_SYSTEM_CALL;
const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
void MPU_vTimerSetReloadMode( TimerHandle_t xTimer,
- const UBaseType_t uxAutoReload ) FREERTOS_SYSTEM_CALL;
+ const BaseType_t uxAutoReload ) FREERTOS_SYSTEM_CALL;
+BaseType_t MPU_xTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
-BaseType_t MPU_xTimerCreateTimerTask( void ) FREERTOS_SYSTEM_CALL;
-BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
- const BaseType_t xCommandID,
- const TickType_t xOptionalValue,
- BaseType_t * const pxHigherPriorityTaskWoken,
- const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+
+/* Privileged only wrappers for Timer APIs. These are needed so that
+ * the application can use opaque handles maintained in mpu_wrappers.c
+ * with all the APIs. */
+TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName,
+ const TickType_t xTimerPeriodInTicks,
+ const UBaseType_t uxAutoReload,
+ void * const pvTimerID,
+ TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION;
+TimerHandle_t MPU_xTimerCreateStatic( const char * const pcTimerName,
+ const TickType_t xTimerPeriodInTicks,
+ const UBaseType_t uxAutoReload,
+ void * const pvTimerID,
+ TimerCallbackFunction_t pxCallbackFunction,
+ StaticTimer_t * pxTimerBuffer ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xTimerGetStaticBuffer( TimerHandle_t xTimer,
+ StaticTimer_t ** ppxTimerBuffer ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xTimerGenericCommandFromISR( TimerHandle_t xTimer,
+ const BaseType_t xCommandID,
+ const TickType_t xOptionalValue,
+ BaseType_t * const pxHigherPriorityTaskWoken,
+ const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
/* MPU versions of event_group.h API functions. */
-EventGroupHandle_t MPU_xEventGroupCreate( void ) FREERTOS_SYSTEM_CALL;
-EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) FREERTOS_SYSTEM_CALL;
EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToWaitFor,
const BaseType_t xClearOnExit,
const BaseType_t xWaitForAllBits,
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
+EventBits_t MPU_xEventGroupWaitBitsEntry( const xEventGroupWaitBitsParams_t * pxParams ) FREERTOS_SYSTEM_CALL;
EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToClear ) FREERTOS_SYSTEM_CALL;
EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup,
@@ -225,8 +314,26 @@ EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToSet,
const EventBits_t uxBitsToWaitFor,
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
-void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) FREERTOS_SYSTEM_CALL;
-UBaseType_t MPU_uxEventGroupGetNumber( void * xEventGroup ) FREERTOS_SYSTEM_CALL;
+#if ( configUSE_TRACE_FACILITY == 1 )
+ UBaseType_t MPU_uxEventGroupGetNumber( void * xEventGroup ) FREERTOS_SYSTEM_CALL;
+ void MPU_vEventGroupSetNumber( void * xEventGroup,
+ UBaseType_t uxEventGroupNumber ) FREERTOS_SYSTEM_CALL;
+#endif /* ( configUSE_TRACE_FACILITY == 1 )*/
+
+/* Privileged only wrappers for Event Group APIs. These are needed so that
+ * the application can use opaque handles maintained in mpu_wrappers.c
+ * with all the APIs. */
+EventGroupHandle_t MPU_xEventGroupCreate( void ) PRIVILEGED_FUNCTION;
+EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) PRIVILEGED_FUNCTION;
+void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xEventGroupGetStaticBuffer( EventGroupHandle_t xEventGroup,
+ StaticEventGroup_t ** ppxEventGroupBuffer ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup,
+ const EventBits_t uxBitsToSet,
+ BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+EventBits_t MPU_xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
/* MPU versions of message/stream_buffer.h API functions. */
size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
@@ -237,28 +344,46 @@ size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
void * pvRxData,
size_t xBufferLengthBytes,
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
-size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
-void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
-BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
size_t xTriggerLevel ) FREERTOS_SYSTEM_CALL;
+size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
+
+/* Privileged only wrappers for Stream Buffer APIs. These are needed so that
+ * the application can use opaque handles maintained in mpu_wrappers.c
+ * with all the APIs. */
StreamBufferHandle_t MPU_xStreamBufferGenericCreate( size_t xBufferSizeBytes,
size_t xTriggerLevelBytes,
- BaseType_t xIsMessageBuffer,
+ BaseType_t xStreamBufferType,
StreamBufferCallbackFunction_t pxSendCompletedCallback,
- StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) FREERTOS_SYSTEM_CALL;
+ StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION;
StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
size_t xTriggerLevelBytes,
- BaseType_t xIsMessageBuffer,
+ BaseType_t xStreamBufferType,
uint8_t * const pucStreamBufferStorageArea,
StaticStreamBuffer_t * const pxStaticStreamBuffer,
StreamBufferCallbackFunction_t pxSendCompletedCallback,
- StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) FREERTOS_SYSTEM_CALL;
-
-
+ StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION;
+void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xStreamBufferGetStaticBuffers( StreamBufferHandle_t xStreamBuffers,
+ uint8_t * ppucStreamBufferStorageArea,
+ StaticStreamBuffer_t * ppxStaticStreamBuffer ) PRIVILEGED_FUNCTION;
+size_t MPU_xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
+ const void * pvTxData,
+ size_t xDataLengthBytes,
+ BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+size_t MPU_xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
+ void * pvRxData,
+ size_t xBufferLengthBytes,
+ BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer,
+ BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xStreamBufferReceiveCompletedFromISR( StreamBufferHandle_t xStreamBuffer,
+ BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+BaseType_t MPU_xStreamBufferResetFromISR( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
#endif /* MPU_PROTOTYPES_H */
diff --git a/third-party/freertos/include/mpu_syscall_numbers.h b/third-party/freertos/include/mpu_syscall_numbers.h
new file mode 100644
index 0000000000000000000000000000000000000000..82092342908bff3bb31f7265f2c220a03c53273c
--- /dev/null
+++ b/third-party/freertos/include/mpu_syscall_numbers.h
@@ -0,0 +1,105 @@
+/*
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef MPU_SYSCALL_NUMBERS_H
+#define MPU_SYSCALL_NUMBERS_H
+
+/* Numbers assigned to various system calls. */
+#define SYSTEM_CALL_xTaskGenericNotify 0
+#define SYSTEM_CALL_xTaskGenericNotifyWait 1
+#define SYSTEM_CALL_xTimerGenericCommandFromTask 2
+#define SYSTEM_CALL_xEventGroupWaitBits 3
+#define SYSTEM_CALL_xTaskDelayUntil 4
+#define SYSTEM_CALL_xTaskAbortDelay 5
+#define SYSTEM_CALL_vTaskDelay 6
+#define SYSTEM_CALL_uxTaskPriorityGet 7
+#define SYSTEM_CALL_eTaskGetState 8
+#define SYSTEM_CALL_vTaskGetInfo 9
+#define SYSTEM_CALL_xTaskGetIdleTaskHandle 10
+#define SYSTEM_CALL_vTaskSuspend 11
+#define SYSTEM_CALL_vTaskResume 12
+#define SYSTEM_CALL_xTaskGetTickCount 13
+#define SYSTEM_CALL_uxTaskGetNumberOfTasks 14
+#define SYSTEM_CALL_ulTaskGetRunTimeCounter 15
+#define SYSTEM_CALL_ulTaskGetRunTimePercent 16
+#define SYSTEM_CALL_ulTaskGetIdleRunTimePercent 17
+#define SYSTEM_CALL_ulTaskGetIdleRunTimeCounter 18
+#define SYSTEM_CALL_vTaskSetApplicationTaskTag 19
+#define SYSTEM_CALL_xTaskGetApplicationTaskTag 20
+#define SYSTEM_CALL_vTaskSetThreadLocalStoragePointer 21
+#define SYSTEM_CALL_pvTaskGetThreadLocalStoragePointer 22
+#define SYSTEM_CALL_uxTaskGetSystemState 23
+#define SYSTEM_CALL_uxTaskGetStackHighWaterMark 24
+#define SYSTEM_CALL_uxTaskGetStackHighWaterMark2 25
+#define SYSTEM_CALL_xTaskGetCurrentTaskHandle 26
+#define SYSTEM_CALL_xTaskGetSchedulerState 27
+#define SYSTEM_CALL_vTaskSetTimeOutState 28
+#define SYSTEM_CALL_xTaskCheckForTimeOut 29
+#define SYSTEM_CALL_ulTaskGenericNotifyTake 30
+#define SYSTEM_CALL_xTaskGenericNotifyStateClear 31
+#define SYSTEM_CALL_ulTaskGenericNotifyValueClear 32
+#define SYSTEM_CALL_xQueueGenericSend 33
+#define SYSTEM_CALL_uxQueueMessagesWaiting 34
+#define SYSTEM_CALL_uxQueueSpacesAvailable 35
+#define SYSTEM_CALL_xQueueReceive 36
+#define SYSTEM_CALL_xQueuePeek 37
+#define SYSTEM_CALL_xQueueSemaphoreTake 38
+#define SYSTEM_CALL_xQueueGetMutexHolder 39
+#define SYSTEM_CALL_xQueueTakeMutexRecursive 40
+#define SYSTEM_CALL_xQueueGiveMutexRecursive 41
+#define SYSTEM_CALL_xQueueSelectFromSet 42
+#define SYSTEM_CALL_xQueueAddToSet 43
+#define SYSTEM_CALL_vQueueAddToRegistry 44
+#define SYSTEM_CALL_vQueueUnregisterQueue 45
+#define SYSTEM_CALL_pcQueueGetName 46
+#define SYSTEM_CALL_pvTimerGetTimerID 47
+#define SYSTEM_CALL_vTimerSetTimerID 48
+#define SYSTEM_CALL_xTimerIsTimerActive 49
+#define SYSTEM_CALL_xTimerGetTimerDaemonTaskHandle 50
+#define SYSTEM_CALL_pcTimerGetName 51
+#define SYSTEM_CALL_vTimerSetReloadMode 52
+#define SYSTEM_CALL_xTimerGetReloadMode 53
+#define SYSTEM_CALL_uxTimerGetReloadMode 54
+#define SYSTEM_CALL_xTimerGetPeriod 55
+#define SYSTEM_CALL_xTimerGetExpiryTime 56
+#define SYSTEM_CALL_xEventGroupClearBits 57
+#define SYSTEM_CALL_xEventGroupSetBits 58
+#define SYSTEM_CALL_xEventGroupSync 59
+#define SYSTEM_CALL_uxEventGroupGetNumber 60
+#define SYSTEM_CALL_vEventGroupSetNumber 61
+#define SYSTEM_CALL_xStreamBufferSend 62
+#define SYSTEM_CALL_xStreamBufferReceive 63
+#define SYSTEM_CALL_xStreamBufferIsFull 64
+#define SYSTEM_CALL_xStreamBufferIsEmpty 65
+#define SYSTEM_CALL_xStreamBufferSpacesAvailable 66
+#define SYSTEM_CALL_xStreamBufferBytesAvailable 67
+#define SYSTEM_CALL_xStreamBufferSetTriggerLevel 68
+#define SYSTEM_CALL_xStreamBufferNextMessageLengthBytes 69
+#define NUM_SYSTEM_CALLS 70 /* Total number of system calls. */
+
+#endif /* MPU_SYSCALL_NUMBERS_H */
diff --git a/third-party/freertos/include/mpu_wrappers.h b/third-party/freertos/include/mpu_wrappers.h
index af06ab3bb228d474033fbf188f7e6e365be75b5a..5b5057266161f3c67547260e6bc53868b2c169b6 100644
--- a/third-party/freertos/include/mpu_wrappers.h
+++ b/third-party/freertos/include/mpu_wrappers.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -47,131 +47,223 @@
*/
/* Map standard task.h API functions to the MPU equivalents. */
- #define xTaskCreate MPU_xTaskCreate
- #define xTaskCreateStatic MPU_xTaskCreateStatic
- #define vTaskDelete MPU_vTaskDelete
- #define vTaskDelay MPU_vTaskDelay
- #define xTaskDelayUntil MPU_xTaskDelayUntil
- #define xTaskAbortDelay MPU_xTaskAbortDelay
- #define uxTaskPriorityGet MPU_uxTaskPriorityGet
- #define eTaskGetState MPU_eTaskGetState
- #define vTaskGetInfo MPU_vTaskGetInfo
- #define vTaskPrioritySet MPU_vTaskPrioritySet
- #define vTaskSuspend MPU_vTaskSuspend
- #define vTaskResume MPU_vTaskResume
- #define vTaskSuspendAll MPU_vTaskSuspendAll
- #define xTaskResumeAll MPU_xTaskResumeAll
- #define xTaskGetTickCount MPU_xTaskGetTickCount
- #define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks
- #define pcTaskGetName MPU_pcTaskGetName
- #define xTaskGetHandle MPU_xTaskGetHandle
- #define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark
- #define uxTaskGetStackHighWaterMark2 MPU_uxTaskGetStackHighWaterMark2
- #define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag
- #define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag
- #define vTaskSetThreadLocalStoragePointer MPU_vTaskSetThreadLocalStoragePointer
- #define pvTaskGetThreadLocalStoragePointer MPU_pvTaskGetThreadLocalStoragePointer
- #define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook
- #define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle
- #define uxTaskGetSystemState MPU_uxTaskGetSystemState
- #define vTaskList MPU_vTaskList
- #define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats
- #define ulTaskGetIdleRunTimeCounter MPU_ulTaskGetIdleRunTimeCounter
- #define ulTaskGetIdleRunTimePercent MPU_ulTaskGetIdleRunTimePercent
- #define xTaskGenericNotify MPU_xTaskGenericNotify
- #define xTaskGenericNotifyWait MPU_xTaskGenericNotifyWait
- #define ulTaskGenericNotifyTake MPU_ulTaskGenericNotifyTake
- #define xTaskGenericNotifyStateClear MPU_xTaskGenericNotifyStateClear
- #define ulTaskGenericNotifyValueClear MPU_ulTaskGenericNotifyValueClear
- #define xTaskCatchUpTicks MPU_xTaskCatchUpTicks
-
- #define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle
- #define vTaskSetTimeOutState MPU_vTaskSetTimeOutState
- #define xTaskCheckForTimeOut MPU_xTaskCheckForTimeOut
- #define xTaskGetSchedulerState MPU_xTaskGetSchedulerState
+ #define vTaskDelay MPU_vTaskDelay
+ #define xTaskDelayUntil MPU_xTaskDelayUntil
+ #define xTaskAbortDelay MPU_xTaskAbortDelay
+ #define uxTaskPriorityGet MPU_uxTaskPriorityGet
+ #define eTaskGetState MPU_eTaskGetState
+ #define vTaskGetInfo MPU_vTaskGetInfo
+ #define vTaskSuspend MPU_vTaskSuspend
+ #define vTaskResume MPU_vTaskResume
+ #define xTaskGetTickCount MPU_xTaskGetTickCount
+ #define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks
+ #define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark
+ #define uxTaskGetStackHighWaterMark2 MPU_uxTaskGetStackHighWaterMark2
+ #define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag
+ #define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag
+ #define vTaskSetThreadLocalStoragePointer MPU_vTaskSetThreadLocalStoragePointer
+ #define pvTaskGetThreadLocalStoragePointer MPU_pvTaskGetThreadLocalStoragePointer
+ #define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle
+ #define uxTaskGetSystemState MPU_uxTaskGetSystemState
+ #define ulTaskGetIdleRunTimeCounter MPU_ulTaskGetIdleRunTimeCounter
+ #define ulTaskGetIdleRunTimePercent MPU_ulTaskGetIdleRunTimePercent
+ #define xTaskGenericNotify MPU_xTaskGenericNotify
+ #define xTaskGenericNotifyWait MPU_xTaskGenericNotifyWait
+ #define ulTaskGenericNotifyTake MPU_ulTaskGenericNotifyTake
+ #define xTaskGenericNotifyStateClear MPU_xTaskGenericNotifyStateClear
+ #define ulTaskGenericNotifyValueClear MPU_ulTaskGenericNotifyValueClear
+ #define vTaskSetTimeOutState MPU_vTaskSetTimeOutState
+ #define xTaskCheckForTimeOut MPU_xTaskCheckForTimeOut
+ #define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle
+ #define xTaskGetSchedulerState MPU_xTaskGetSchedulerState
+
+ #if ( configUSE_MPU_WRAPPERS_V1 == 0 )
+ #define ulTaskGetRunTimeCounter MPU_ulTaskGetRunTimeCounter
+ #define ulTaskGetRunTimePercent MPU_ulTaskGetRunTimePercent
+ #endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
+
+/* Privileged only wrappers for Task APIs. These are needed so that
+ * the application can use opaque handles maintained in mpu_wrappers.c
+ * with all the APIs. */
+ #define xTaskCreate MPU_xTaskCreate
+ #define xTaskCreateStatic MPU_xTaskCreateStatic
+ #define vTaskDelete MPU_vTaskDelete
+ #define vTaskPrioritySet MPU_vTaskPrioritySet
+ #define xTaskGetHandle MPU_xTaskGetHandle
+ #define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook
+
+ #if ( configUSE_MPU_WRAPPERS_V1 == 0 )
+ #define pcTaskGetName MPU_pcTaskGetName
+ #define xTaskCreateRestricted MPU_xTaskCreateRestricted
+ #define xTaskCreateRestrictedStatic MPU_xTaskCreateRestrictedStatic
+ #define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions
+ #define xTaskGetStaticBuffers MPU_xTaskGetStaticBuffers
+ #define uxTaskPriorityGetFromISR MPU_uxTaskPriorityGetFromISR
+ #define uxTaskBasePriorityGet MPU_uxTaskBasePriorityGet
+ #define uxTaskBasePriorityGetFromISR MPU_uxTaskBasePriorityGetFromISR
+ #define xTaskResumeFromISR MPU_xTaskResumeFromISR
+ #define xTaskGetApplicationTaskTagFromISR MPU_xTaskGetApplicationTaskTagFromISR
+ #define xTaskGenericNotifyFromISR MPU_xTaskGenericNotifyFromISR
+ #define vTaskGenericNotifyGiveFromISR MPU_vTaskGenericNotifyGiveFromISR
+ #endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
/* Map standard queue.h API functions to the MPU equivalents. */
- #define xQueueGenericSend MPU_xQueueGenericSend
- #define xQueueReceive MPU_xQueueReceive
- #define xQueuePeek MPU_xQueuePeek
- #define xQueueSemaphoreTake MPU_xQueueSemaphoreTake
- #define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting
- #define uxQueueSpacesAvailable MPU_uxQueueSpacesAvailable
+ #define xQueueGenericSend MPU_xQueueGenericSend
+ #define xQueueReceive MPU_xQueueReceive
+ #define xQueuePeek MPU_xQueuePeek
+ #define xQueueSemaphoreTake MPU_xQueueSemaphoreTake
+ #define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting
+ #define uxQueueSpacesAvailable MPU_uxQueueSpacesAvailable
+ #define xQueueGetMutexHolder MPU_xQueueGetMutexHolder
+ #define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive
+ #define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive
+ #define xQueueAddToSet MPU_xQueueAddToSet
+ #define xQueueSelectFromSet MPU_xQueueSelectFromSet
+
+ #if ( configQUEUE_REGISTRY_SIZE > 0 )
+ #define vQueueAddToRegistry MPU_vQueueAddToRegistry
+ #define vQueueUnregisterQueue MPU_vQueueUnregisterQueue
+ #define pcQueueGetName MPU_pcQueueGetName
+ #endif /* #if ( configQUEUE_REGISTRY_SIZE > 0 ) */
+
+/* Privileged only wrappers for Queue APIs. These are needed so that
+ * the application can use opaque handles maintained in mpu_wrappers.c
+ * with all the APIs. */
#define vQueueDelete MPU_vQueueDelete
#define xQueueCreateMutex MPU_xQueueCreateMutex
#define xQueueCreateMutexStatic MPU_xQueueCreateMutexStatic
#define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore
#define xQueueCreateCountingSemaphoreStatic MPU_xQueueCreateCountingSemaphoreStatic
- #define xQueueGetMutexHolder MPU_xQueueGetMutexHolder
- #define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive
- #define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive
#define xQueueGenericCreate MPU_xQueueGenericCreate
#define xQueueGenericCreateStatic MPU_xQueueGenericCreateStatic
+ #define xQueueGenericReset MPU_xQueueGenericReset
#define xQueueCreateSet MPU_xQueueCreateSet
- #define xQueueAddToSet MPU_xQueueAddToSet
#define xQueueRemoveFromSet MPU_xQueueRemoveFromSet
- #define xQueueSelectFromSet MPU_xQueueSelectFromSet
- #define xQueueGenericReset MPU_xQueueGenericReset
- #if ( configQUEUE_REGISTRY_SIZE > 0 )
- #define vQueueAddToRegistry MPU_vQueueAddToRegistry
- #define vQueueUnregisterQueue MPU_vQueueUnregisterQueue
- #define pcQueueGetName MPU_pcQueueGetName
- #endif
+ #if ( configUSE_MPU_WRAPPERS_V1 == 0 )
+ #define xQueueGenericGetStaticBuffers MPU_xQueueGenericGetStaticBuffers
+ #define xQueueGenericSendFromISR MPU_xQueueGenericSendFromISR
+ #define xQueueGiveFromISR MPU_xQueueGiveFromISR
+ #define xQueuePeekFromISR MPU_xQueuePeekFromISR
+ #define xQueueReceiveFromISR MPU_xQueueReceiveFromISR
+ #define xQueueIsQueueEmptyFromISR MPU_xQueueIsQueueEmptyFromISR
+ #define xQueueIsQueueFullFromISR MPU_xQueueIsQueueFullFromISR
+ #define uxQueueMessagesWaitingFromISR MPU_uxQueueMessagesWaitingFromISR
+ #define xQueueGetMutexHolderFromISR MPU_xQueueGetMutexHolderFromISR
+ #define xQueueSelectFromSetFromISR MPU_xQueueSelectFromSetFromISR
+ #endif /* if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
/* Map standard timer.h API functions to the MPU equivalents. */
- #define pvTimerGetTimerID MPU_pvTimerGetTimerID
- #define vTimerSetTimerID MPU_vTimerSetTimerID
- #define xTimerIsTimerActive MPU_xTimerIsTimerActive
- #define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
- #define pcTimerGetName MPU_pcTimerGetName
- #define vTimerSetReloadMode MPU_vTimerSetReloadMode
- #define uxTimerGetReloadMode MPU_uxTimerGetReloadMode
- #define xTimerGetPeriod MPU_xTimerGetPeriod
- #define xTimerGetExpiryTime MPU_xTimerGetExpiryTime
- #define xTimerGenericCommand MPU_xTimerGenericCommand
+ #define pvTimerGetTimerID MPU_pvTimerGetTimerID
+ #define vTimerSetTimerID MPU_vTimerSetTimerID
+ #define xTimerIsTimerActive MPU_xTimerIsTimerActive
+ #define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
+ #define xTimerGenericCommandFromTask MPU_xTimerGenericCommandFromTask
+ #define pcTimerGetName MPU_pcTimerGetName
+ #define vTimerSetReloadMode MPU_vTimerSetReloadMode
+ #define uxTimerGetReloadMode MPU_uxTimerGetReloadMode
+ #define xTimerGetPeriod MPU_xTimerGetPeriod
+ #define xTimerGetExpiryTime MPU_xTimerGetExpiryTime
+
+/* Privileged only wrappers for Timer APIs. These are needed so that
+ * the application can use opaque handles maintained in mpu_wrappers.c
+ * with all the APIs. */
+ #if ( configUSE_MPU_WRAPPERS_V1 == 0 )
+ #define xTimerGetReloadMode MPU_xTimerGetReloadMode
+ #define xTimerCreate MPU_xTimerCreate
+ #define xTimerCreateStatic MPU_xTimerCreateStatic
+ #define xTimerGetStaticBuffer MPU_xTimerGetStaticBuffer
+ #define xTimerGenericCommandFromISR MPU_xTimerGenericCommandFromISR
+ #endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
/* Map standard event_group.h API functions to the MPU equivalents. */
- #define xEventGroupCreate MPU_xEventGroupCreate
- #define xEventGroupCreateStatic MPU_xEventGroupCreateStatic
- #define xEventGroupWaitBits MPU_xEventGroupWaitBits
- #define xEventGroupClearBits MPU_xEventGroupClearBits
- #define xEventGroupSetBits MPU_xEventGroupSetBits
- #define xEventGroupSync MPU_xEventGroupSync
- #define vEventGroupDelete MPU_vEventGroupDelete
+ #define xEventGroupWaitBits MPU_xEventGroupWaitBits
+ #define xEventGroupClearBits MPU_xEventGroupClearBits
+ #define xEventGroupSetBits MPU_xEventGroupSetBits
+ #define xEventGroupSync MPU_xEventGroupSync
+
+ #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
+ #define uxEventGroupGetNumber MPU_uxEventGroupGetNumber
+ #define vEventGroupSetNumber MPU_vEventGroupSetNumber
+ #endif /* #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) ) */
+
+/* Privileged only wrappers for Event Group APIs. These are needed so that
+ * the application can use opaque handles maintained in mpu_wrappers.c
+ * with all the APIs. */
+ #define xEventGroupCreate MPU_xEventGroupCreate
+ #define xEventGroupCreateStatic MPU_xEventGroupCreateStatic
+ #define vEventGroupDelete MPU_vEventGroupDelete
+
+ #if ( configUSE_MPU_WRAPPERS_V1 == 0 )
+ #define xEventGroupGetStaticBuffer MPU_xEventGroupGetStaticBuffer
+ #define xEventGroupClearBitsFromISR MPU_xEventGroupClearBitsFromISR
+ #define xEventGroupSetBitsFromISR MPU_xEventGroupSetBitsFromISR
+ #define xEventGroupGetBitsFromISR MPU_xEventGroupGetBitsFromISR
+ #endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
/* Map standard message/stream_buffer.h API functions to the MPU
* equivalents. */
#define xStreamBufferSend MPU_xStreamBufferSend
#define xStreamBufferReceive MPU_xStreamBufferReceive
- #define xStreamBufferNextMessageLengthBytes MPU_xStreamBufferNextMessageLengthBytes
- #define vStreamBufferDelete MPU_vStreamBufferDelete
#define xStreamBufferIsFull MPU_xStreamBufferIsFull
#define xStreamBufferIsEmpty MPU_xStreamBufferIsEmpty
- #define xStreamBufferReset MPU_xStreamBufferReset
#define xStreamBufferSpacesAvailable MPU_xStreamBufferSpacesAvailable
#define xStreamBufferBytesAvailable MPU_xStreamBufferBytesAvailable
#define xStreamBufferSetTriggerLevel MPU_xStreamBufferSetTriggerLevel
- #define xStreamBufferGenericCreate MPU_xStreamBufferGenericCreate
- #define xStreamBufferGenericCreateStatic MPU_xStreamBufferGenericCreateStatic
+ #define xStreamBufferNextMessageLengthBytes MPU_xStreamBufferNextMessageLengthBytes
+
+/* Privileged only wrappers for Stream Buffer APIs. These are needed so that
+ * the application can use opaque handles maintained in mpu_wrappers.c
+ * with all the APIs. */
+
+ #define xStreamBufferGenericCreate MPU_xStreamBufferGenericCreate
+ #define xStreamBufferGenericCreateStatic MPU_xStreamBufferGenericCreateStatic
+ #define vStreamBufferDelete MPU_vStreamBufferDelete
+ #define xStreamBufferReset MPU_xStreamBufferReset
+
+ #if ( configUSE_MPU_WRAPPERS_V1 == 0 )
+ #define xStreamBufferGetStaticBuffers MPU_xStreamBufferGetStaticBuffers
+ #define xStreamBufferSendFromISR MPU_xStreamBufferSendFromISR
+ #define xStreamBufferReceiveFromISR MPU_xStreamBufferReceiveFromISR
+ #define xStreamBufferSendCompletedFromISR MPU_xStreamBufferSendCompletedFromISR
+ #define xStreamBufferReceiveCompletedFromISR MPU_xStreamBufferReceiveCompletedFromISR
+ #define xStreamBufferResetFromISR MPU_xStreamBufferResetFromISR
+ #endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
+
+ #if ( ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configENABLE_ACCESS_CONTROL_LIST == 1 ) )
+ #define vGrantAccessToTask( xTask, xTaskToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xTaskToGrantAccess ) )
+ #define vRevokeAccessToTask( xTask, xTaskToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xTaskToRevokeAccess ) )
-/* Remove the privileged function macro, but keep the PRIVILEGED_DATA
- * macro so applications can place data in privileged access sections
- * (useful when using statically allocated objects). */
- #define PRIVILEGED_FUNCTION
- #define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
- #define FREERTOS_SYSTEM_CALL
+ #define vGrantAccessToSemaphore( xTask, xSemaphoreToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xSemaphoreToGrantAccess ) )
+ #define vRevokeAccessToSemaphore( xTask, xSemaphoreToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xSemaphoreToRevokeAccess ) )
- #else /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
+ #define vGrantAccessToQueue( xTask, xQueueToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xQueueToGrantAccess ) )
+ #define vRevokeAccessToQueue( xTask, xQueueToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xQueueToRevokeAccess ) )
-/* Ensure API functions go in the privileged execution section. */
- #define PRIVILEGED_FUNCTION __attribute__( ( section( "privileged_functions" ) ) )
- #define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
- #define FREERTOS_SYSTEM_CALL __attribute__( ( section( "freertos_system_calls" ) ) )
+ #define vGrantAccessToQueueSet( xTask, xQueueSetToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xQueueSetToGrantAccess ) )
+ #define vRevokeAccessToQueueSet( xTask, xQueueSetToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xQueueSetToRevokeAccess ) )
+
+ #define vGrantAccessToEventGroup( xTask, xEventGroupToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xEventGroupToGrantAccess ) )
+ #define vRevokeAccessToEventGroup( xTask, xEventGroupToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xEventGroupToRevokeAccess ) )
+
+ #define vGrantAccessToStreamBuffer( xTask, xStreamBufferToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xStreamBufferToGrantAccess ) )
+ #define vRevokeAccessToStreamBuffer( xTask, xStreamBufferToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xStreamBufferToRevokeAccess ) )
+
+ #define vGrantAccessToMessageBuffer( xTask, xMessageBufferToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xMessageBufferToGrantAccess ) )
+ #define vRevokeAccessToMessageBuffer( xTask, xMessageBufferToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xMessageBufferToRevokeAccess ) )
+
+ #define vGrantAccessToTimer( xTask, xTimerToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xTimerToGrantAccess ) )
+ #define vRevokeAccessToTimer( xTask, xTimerToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xTimerToRevokeAccess ) )
+
+ #endif /* #if ( ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configENABLE_ACCESS_CONTROL_LIST == 1 ) ) */
#endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
+ #define PRIVILEGED_FUNCTION __attribute__( ( section( "privileged_functions" ) ) )
+ #define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
+ #define FREERTOS_SYSTEM_CALL __attribute__( ( section( "freertos_system_calls" ) ) )
+
#else /* portUSING_MPU_WRAPPERS */
#define PRIVILEGED_FUNCTION
diff --git a/third-party/freertos/include/newlib-freertos.h b/third-party/freertos/include/newlib-freertos.h
new file mode 100644
index 0000000000000000000000000000000000000000..2b51ee712031c0e11903f65e50fcfb5394e9f58c
--- /dev/null
+++ b/third-party/freertos/include/newlib-freertos.h
@@ -0,0 +1,62 @@
+/*
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef INC_NEWLIB_FREERTOS_H
+#define INC_NEWLIB_FREERTOS_H
+
+/* Note Newlib support has been included by popular demand, but is not
+ * used by the FreeRTOS maintainers themselves. FreeRTOS is not
+ * responsible for resulting newlib operation. User must be familiar with
+ * newlib and must provide system-wide implementations of the necessary
+ * stubs. Be warned that (at the time of writing) the current newlib design
+ * implements a system-wide malloc() that must be provided with locks.
+ *
+ * See the third party link http://www.nadler.com/embedded/newlibAndFreeRTOS.html
+ * for additional information. */
+
+#include
+
+#define configUSE_C_RUNTIME_TLS_SUPPORT 1
+
+#ifndef configTLS_BLOCK_TYPE
+ #define configTLS_BLOCK_TYPE struct _reent
+#endif
+
+#ifndef configINIT_TLS_BLOCK
+ #define configINIT_TLS_BLOCK( xTLSBlock, pxTopOfStack ) _REENT_INIT_PTR( &( xTLSBlock ) )
+#endif
+
+#ifndef configSET_TLS_BLOCK
+ #define configSET_TLS_BLOCK( xTLSBlock ) ( _impure_ptr = &( xTLSBlock ) )
+#endif
+
+#ifndef configDEINIT_TLS_BLOCK
+ #define configDEINIT_TLS_BLOCK( xTLSBlock ) _reclaim_reent( &( xTLSBlock ) )
+#endif
+
+#endif /* INC_NEWLIB_FREERTOS_H */
diff --git a/third-party/freertos/include/picolibc-freertos.h b/third-party/freertos/include/picolibc-freertos.h
new file mode 100644
index 0000000000000000000000000000000000000000..9a3b5a866db25a9ace5968b3f97569929e7e40a8
--- /dev/null
+++ b/third-party/freertos/include/picolibc-freertos.h
@@ -0,0 +1,91 @@
+/*
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
+ *
+ */
+
+#ifndef INC_PICOLIBC_FREERTOS_H
+#define INC_PICOLIBC_FREERTOS_H
+
+/* Use picolibc TLS support to allocate space for __thread variables,
+ * initialize them at thread creation and set the TLS context at
+ * thread switch time.
+ *
+ * See the picolibc TLS docs:
+ * https://github.com/picolibc/picolibc/blob/main/doc/tls.md
+ * for additional information. */
+
+#include
+
+#define configUSE_C_RUNTIME_TLS_SUPPORT 1
+
+#define configTLS_BLOCK_TYPE void *
+
+#define picolibcTLS_SIZE ( ( portPOINTER_SIZE_TYPE ) _tls_size() )
+#define picolibcSTACK_ALIGNMENT_MASK ( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK )
+
+#if __PICOLIBC_MAJOR__ > 1 || __PICOLIBC_MINOR__ >= 8
+
+/* Picolibc 1.8 and newer have explicit alignment values provided
+ * by the _tls_align() inline */
+ #define picolibcTLS_ALIGNMENT_MASK ( ( portPOINTER_SIZE_TYPE ) ( _tls_align() - 1 ) )
+#else
+
+/* For older Picolibc versions, use the general port alignment value */
+ #define picolibcTLS_ALIGNMENT_MASK ( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK )
+#endif
+
+/* Allocate thread local storage block off the end of the
+ * stack. The picolibcTLS_SIZE macro returns the size (in
+ * bytes) of the total TLS area used by the application.
+ * Calculate the top of stack address. */
+#if ( portSTACK_GROWTH < 0 )
+
+ #define configINIT_TLS_BLOCK( xTLSBlock, pxTopOfStack ) \
+ do { \
+ xTLSBlock = ( void * ) ( ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack ) - \
+ picolibcTLS_SIZE ) & \
+ ~picolibcTLS_ALIGNMENT_MASK ); \
+ pxTopOfStack = ( StackType_t * ) ( ( ( ( portPOINTER_SIZE_TYPE ) xTLSBlock ) - 1 ) & \
+ ~picolibcSTACK_ALIGNMENT_MASK ); \
+ _init_tls( xTLSBlock ); \
+ } while( 0 )
+#else /* portSTACK_GROWTH */
+ #define configINIT_TLS_BLOCK( xTLSBlock, pxTopOfStack ) \
+ do { \
+ xTLSBlock = ( void * ) ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack + \
+ picolibcTLS_ALIGNMENT_MASK ) & ~picolibcTLS_ALIGNMENT_MASK ); \
+ pxTopOfStack = ( StackType_t * ) ( ( ( ( ( portPOINTER_SIZE_TYPE ) xTLSBlock ) + \
+ picolibcTLS_SIZE ) + picolibcSTACK_ALIGNMENT_MASK ) & \
+ ~picolibcSTACK_ALIGNMENT_MASK ); \
+ _init_tls( xTLSBlock ); \
+ } while( 0 )
+#endif /* portSTACK_GROWTH */
+
+#define configSET_TLS_BLOCK( xTLSBlock ) _set_tls( xTLSBlock )
+
+#define configDEINIT_TLS_BLOCK( xTLSBlock )
+
+#endif /* INC_PICOLIBC_FREERTOS_H */
diff --git a/third-party/freertos/include/portable.h b/third-party/freertos/include/portable.h
index e7ec7bd0b7be826f57158b5748638fcce7d21112..1cbb4fc38b5f3c7a5da1e5aac950ae08b5fe94ba 100644
--- a/third-party/freertos/include/portable.h
+++ b/third-party/freertos/include/portable.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -85,6 +85,10 @@
#define portARCH_NAME NULL
#endif
+#ifndef configSTACK_DEPTH_TYPE
+ #define configSTACK_DEPTH_TYPE StackType_t
+#endif
+
#ifndef configSTACK_ALLOCATION_FROM_SEPARATE_HEAP
/* Defaults to 0 for backward compatibility. */
#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
@@ -110,13 +114,15 @@
StackType_t * pxEndOfStack,
TaskFunction_t pxCode,
void * pvParameters,
- BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
+ BaseType_t xRunPrivileged,
+ xMPU_SETTINGS * xMPUSettings ) PRIVILEGED_FUNCTION;
#else
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
TaskFunction_t pxCode,
void * pvParameters,
- BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
- #endif
+ BaseType_t xRunPrivileged,
+ xMPU_SETTINGS * xMPUSettings ) PRIVILEGED_FUNCTION;
+ #endif /* if ( portHAS_STACK_OVERFLOW_CHECKING == 1 ) */
#else /* if ( portUSING_MPU_WRAPPERS == 1 ) */
#if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
@@ -172,7 +178,7 @@ void vPortGetHeapStats( HeapStats_t * pxHeapStats );
/*
* Map to the memory management routines required for the port.
*/
-void * pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
+void * pvPortMalloc( size_t xWantedSize ) PRIVILEGED_FUNCTION;
void * pvPortCalloc( size_t xNum,
size_t xSize ) PRIVILEGED_FUNCTION;
void vPortFree( void * pv ) PRIVILEGED_FUNCTION;
@@ -188,6 +194,12 @@ size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
#define vPortFreeStack vPortFree
#endif
+/*
+ * This function resets the internal state of the heap module. It must be called
+ * by the application before restarting the scheduler.
+ */
+void vPortHeapResetState( void ) PRIVILEGED_FUNCTION;
+
#if ( configUSE_MALLOC_FAILED_HOOK == 1 )
/**
@@ -198,7 +210,7 @@ size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
*
* This hook function is called when allocation failed.
*/
- void vApplicationMallocFailedHook( void ); /*lint !e526 Symbol not defined as it is an application callback. */
+ void vApplicationMallocFailedHook( void );
#endif
/*
@@ -226,7 +238,38 @@ void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
const struct xMEMORY_REGION * const xRegions,
StackType_t * pxBottomOfStack,
- uint32_t ulStackDepth ) PRIVILEGED_FUNCTION;
+ configSTACK_DEPTH_TYPE uxStackDepth ) PRIVILEGED_FUNCTION;
+#endif
+
+/**
+ * @brief Checks if the calling task is authorized to access the given buffer.
+ *
+ * @param pvBuffer The buffer which the calling task wants to access.
+ * @param ulBufferLength The length of the pvBuffer.
+ * @param ulAccessRequested The permissions that the calling task wants.
+ *
+ * @return pdTRUE if the calling task is authorized to access the buffer,
+ * pdFALSE otherwise.
+ */
+#if ( portUSING_MPU_WRAPPERS == 1 )
+ BaseType_t xPortIsAuthorizedToAccessBuffer( const void * pvBuffer,
+ uint32_t ulBufferLength,
+ uint32_t ulAccessRequested ) PRIVILEGED_FUNCTION;
+#endif
+
+/**
+ * @brief Checks if the calling task is authorized to access the given kernel object.
+ *
+ * @param lInternalIndexOfKernelObject The index of the kernel object in the kernel
+ * object handle pool.
+ *
+ * @return pdTRUE if the calling task is authorized to access the kernel object,
+ * pdFALSE otherwise.
+ */
+#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
+
+ BaseType_t xPortIsAuthorizedToAccessKernelObject( int32_t lInternalIndexOfKernelObject ) PRIVILEGED_FUNCTION;
+
#endif
/* *INDENT-OFF* */
diff --git a/third-party/freertos/include/projdefs.h b/third-party/freertos/include/projdefs.h
index aa49e5903547b01ab9ec46b48ea15218a69b474f..d55dfde2bbd03d47cf58bd9305b75ae5b930275c 100644
--- a/third-party/freertos/include/projdefs.h
+++ b/third-party/freertos/include/projdefs.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -33,17 +33,28 @@
* Defines the prototype to which task functions must conform. Defined in this
* file to ensure the type is known before portable.h is included.
*/
-typedef void (* TaskFunction_t)( void * );
+typedef void (* TaskFunction_t)( void * arg );
/* Converts a time in milliseconds to a time in ticks. This macro can be
* overridden by a macro of the same name defined in FreeRTOSConfig.h in case the
* definition here is not suitable for your application. */
#ifndef pdMS_TO_TICKS
- #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000U ) )
+ #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( uint64_t ) ( xTimeInMs ) * ( uint64_t ) configTICK_RATE_HZ ) / ( uint64_t ) 1000U ) )
+#endif
+
+/* Converts a time in ticks to a time in milliseconds. This macro can be
+ * overridden by a macro of the same name defined in FreeRTOSConfig.h in case the
+ * definition here is not suitable for your application. */
+#ifndef pdTICKS_TO_MS
+ #define pdTICKS_TO_MS( xTimeInTicks ) ( ( TickType_t ) ( ( ( uint64_t ) ( xTimeInTicks ) * ( uint64_t ) 1000U ) / ( uint64_t ) configTICK_RATE_HZ ) )
#endif
#define pdFALSE ( ( BaseType_t ) 0 )
#define pdTRUE ( ( BaseType_t ) 1 )
+#define pdFALSE_SIGNED ( ( BaseType_t ) 0 )
+#define pdTRUE_SIGNED ( ( BaseType_t ) 1 )
+#define pdFALSE_UNSIGNED ( ( UBaseType_t ) 0 )
+#define pdTRUE_UNSIGNED ( ( UBaseType_t ) 1 )
#define pdPASS ( pdTRUE )
#define pdFAIL ( pdFALSE )
@@ -60,10 +71,14 @@ typedef void (* TaskFunction_t)( void * );
#define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0
#endif
-#if ( configUSE_16_BIT_TICKS == 1 )
+#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
#define pdINTEGRITY_CHECK_VALUE 0x5a5a
-#else
+#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
#define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL
+#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
+ #define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5a5a5a5a5aULL
+#else
+ #error configTICK_TYPE_WIDTH_IN_BITS set to unsupported tick type width.
#endif
/* The following errno values are used by FreeRTOS+ components, not FreeRTOS
@@ -96,6 +111,7 @@ typedef void (* TaskFunction_t)( void * );
#define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */
#define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */
#define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
+#define pdFREERTOS_ERRNO_EAFNOSUPPORT 97 /* Address family not supported by protocol */
#define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */
#define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */
#define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */
diff --git a/third-party/freertos/include/queue.h b/third-party/freertos/include/queue.h
index df572e16fb7ba3e62dc592edd8271d917e20ba62..1e5cf2bb8dbf1dfc3ed053c3d97504289730ff03 100644
--- a/third-party/freertos/include/queue.h
+++ b/third-party/freertos/include/queue.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -238,7 +238,36 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/**
* queue. h
* @code{c}
- * BaseType_t xQueueSendToToFront(
+ * BaseType_t xQueueGetStaticBuffers( QueueHandle_t xQueue,
+ * uint8_t ** ppucQueueStorage,
+ * StaticQueue_t ** ppxStaticQueue );
+ * @endcode
+ *
+ * Retrieve pointers to a statically created queue's data structure buffer
+ * and storage area buffer. These are the same buffers that are supplied
+ * at the time of creation.
+ *
+ * @param xQueue The queue for which to retrieve the buffers.
+ *
+ * @param ppucQueueStorage Used to return a pointer to the queue's storage
+ * area buffer.
+ *
+ * @param ppxStaticQueue Used to return a pointer to the queue's data
+ * structure buffer.
+ *
+ * @return pdTRUE if buffers were retrieved, pdFALSE otherwise.
+ *
+ * \defgroup xQueueGetStaticBuffers xQueueGetStaticBuffers
+ * \ingroup QueueManagement
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ #define xQueueGetStaticBuffers( xQueue, ppucQueueStorage, ppxStaticQueue ) xQueueGenericGetStaticBuffers( ( xQueue ), ( ppucQueueStorage ), ( ppxStaticQueue ) )
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+
+/**
+ * queue. h
+ * @code{c}
+ * BaseType_t xQueueSendToFront(
* QueueHandle_t xQueue,
* const void *pvItemToQueue,
* TickType_t xTicksToWait
@@ -273,7 +302,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* char ucData[ 20 ];
* } xMessage;
*
- * uint32_t ulVar = 10UL;
+ * uint32_t ulVar = 10U;
*
* void vATask( void *pvParameters )
* {
@@ -356,7 +385,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* char ucData[ 20 ];
* } xMessage;
*
- * uint32_t ulVar = 10UL;
+ * uint32_t ulVar = 10U;
*
* void vATask( void *pvParameters )
* {
@@ -441,7 +470,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* char ucData[ 20 ];
* } xMessage;
*
- * uint32_t ulVar = 10UL;
+ * uint32_t ulVar = 10U;
*
* void vATask( void *pvParameters )
* {
@@ -614,7 +643,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* char ucData[ 20 ];
* } xMessage;
*
- * uint32_t ulVar = 10UL;
+ * uint32_t ulVar = 10U;
*
* void vATask( void *pvParameters )
* {
@@ -966,7 +995,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* @param pxHigherPriorityTaskWoken xQueueSendToFrontFromISR() will set
* *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
* to unblock, and the unblocked task has a priority higher than the currently
- * running task. If xQueueSendToFromFromISR() sets this value to pdTRUE then
+ * running task. If xQueueSendToFrontFromISR() sets this value to pdTRUE then
* a context switch should be requested before the interrupt is exited.
*
* @return pdTRUE if the data was successfully sent to the queue, otherwise
@@ -1156,9 +1185,12 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* {
* // Writing to the queue caused a task to unblock and the unblocked task
* // has a priority higher than or equal to the priority of the currently
- * // executing task (the task this interrupt interrupted). Perform a context
+ * // executing task (the task this interrupt interrupted). Perform a context
* // switch so this interrupt returns directly to the unblocked task.
- * portYIELD_FROM_ISR(); // or portEND_SWITCHING_ISR() depending on the port.
+ * // The macro used is port specific and will be either
+ * // portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() - refer to the documentation
+ * // page for the port being used.
+ * portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
* }
* }
* @endcode
@@ -1231,8 +1263,11 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* // Now the buffer is empty we can switch context if necessary.
* if( xHigherPriorityTaskWoken )
* {
- * // Actual macro used here is port specific.
- * portYIELD_FROM_ISR ();
+ * // As xHigherPriorityTaskWoken is now set to pdTRUE then a context
+ * // switch should be requested. The macro used is port specific and
+ * // will be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() -
+ * // refer to the documentation page for the port being used.
+ * portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
* }
* }
* @endcode
@@ -1308,11 +1343,14 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
*
* } while( portINPUT_BYTE( BUFFER_COUNT ) );
*
- * // Now the buffer is empty we can switch context if necessary. Note that the
- * // name of the yield function required is port specific.
+ * // Now the buffer is empty we can switch context if necessary.
* if( xHigherPriorityTaskWokenByPost )
* {
- * portYIELD_FROM_ISR();
+ * // As xHigherPriorityTaskWokenByPost is now set to pdTRUE then a context
+ * // switch should be requested. The macro used is port specific and
+ * // will be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() -
+ * // refer to the documentation page for the port being used.
+ * portYIELD_FROM_ISR( xHigherPriorityTaskWokenByPost );
* }
* }
* @endcode
@@ -1346,9 +1384,9 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
* @param pvBuffer Pointer to the buffer into which the received item will
* be copied.
*
- * @param pxTaskWoken A task may be blocked waiting for space to become
- * available on the queue. If xQueueReceiveFromISR causes such a task to
- * unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will
+ * @param pxHigherPriorityTaskWoken A task may be blocked waiting for space to
+ * become available on the queue. If xQueueReceiveFromISR causes such a task
+ * to unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will
* remain unchanged.
*
* @return pdTRUE if an item was successfully received from the queue,
@@ -1426,6 +1464,8 @@ BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FU
BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+#if ( configUSE_CO_ROUTINES == 1 )
+
/*
* The functions defined above are for passing data to and from tasks. The
* functions below are the equivalents for passing data to and from
@@ -1435,18 +1475,20 @@ UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEG
* should not be called directly from application code. Instead use the macro
* wrappers defined within croutine.h.
*/
-BaseType_t xQueueCRSendFromISR( QueueHandle_t xQueue,
- const void * pvItemToQueue,
- BaseType_t xCoRoutinePreviouslyWoken );
-BaseType_t xQueueCRReceiveFromISR( QueueHandle_t xQueue,
- void * pvBuffer,
- BaseType_t * pxTaskWoken );
-BaseType_t xQueueCRSend( QueueHandle_t xQueue,
- const void * pvItemToQueue,
- TickType_t xTicksToWait );
-BaseType_t xQueueCRReceive( QueueHandle_t xQueue,
- void * pvBuffer,
- TickType_t xTicksToWait );
+ BaseType_t xQueueCRSendFromISR( QueueHandle_t xQueue,
+ const void * pvItemToQueue,
+ BaseType_t xCoRoutinePreviouslyWoken );
+ BaseType_t xQueueCRReceiveFromISR( QueueHandle_t xQueue,
+ void * pvBuffer,
+ BaseType_t * pxTaskWoken );
+ BaseType_t xQueueCRSend( QueueHandle_t xQueue,
+ const void * pvItemToQueue,
+ TickType_t xTicksToWait );
+ BaseType_t xQueueCRReceive( QueueHandle_t xQueue,
+ void * pvBuffer,
+ TickType_t xTicksToWait );
+
+#endif /* if ( configUSE_CO_ROUTINES == 1 ) */
/*
* For internal use only. Use xSemaphoreCreateMutex(),
@@ -1454,21 +1496,34 @@ BaseType_t xQueueCRReceive( QueueHandle_t xQueue,
* these functions directly.
*/
QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
-QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType,
- StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
-QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
- const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
-QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
- const UBaseType_t uxInitialCount,
- StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
+
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType,
+ StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
+#endif
+
+#if ( configUSE_COUNTING_SEMAPHORES == 1 )
+ QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
+ const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
+#endif
+
+#if ( ( configUSE_COUNTING_SEMAPHORES == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
+ QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
+ const UBaseType_t uxInitialCount,
+ StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
+#endif
+
BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
-TaskHandle_t xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
-TaskHandle_t xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
+
+#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
+ TaskHandle_t xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
+ TaskHandle_t xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
+#endif
/*
- * For internal use only. Use xSemaphoreTakeMutexRecursive() or
- * xSemaphoreGiveMutexRecursive() instead of calling these functions directly.
+ * For internal use only. Use xSemaphoreTakeRecursive() or
+ * xSemaphoreGiveRecursive() instead of calling these functions directly.
*/
BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex,
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
@@ -1508,7 +1563,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
*/
#if ( configQUEUE_REGISTRY_SIZE > 0 )
void vQueueAddToRegistry( QueueHandle_t xQueue,
- const char * pcQueueName ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ const char * pcQueueName ) PRIVILEGED_FUNCTION;
#endif
/*
@@ -1537,7 +1592,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
* returned.
*/
#if ( configQUEUE_REGISTRY_SIZE > 0 )
- const char * pcQueueGetName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ const char * pcQueueGetName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
#endif
/*
@@ -1564,6 +1619,18 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
#endif
+/*
+ * Generic version of the function used to retrieve the buffers of statically
+ * created queues. This is called by other functions and macros that retrieve
+ * the buffers of other statically created RTOS objects that use the queue
+ * structure as their base.
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ BaseType_t xQueueGenericGetStaticBuffers( QueueHandle_t xQueue,
+ uint8_t ** ppucQueueStorage,
+ StaticQueue_t ** ppxStaticQueue ) PRIVILEGED_FUNCTION;
+#endif
+
/*
* Queue sets provide a mechanism to allow a task to block (pend) on a read
* operation from multiple queues or semaphores simultaneously.
@@ -1612,7 +1679,9 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
* @return If the queue set is created successfully then a handle to the created
* queue set is returned. Otherwise NULL is returned.
*/
-QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION;
+#if ( ( configUSE_QUEUE_SETS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
+ QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION;
+#endif
/*
* Adds a queue or semaphore to a queue set that was previously created by a
@@ -1636,8 +1705,10 @@ QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILE
* queue set because it is already a member of a different queue set then pdFAIL
* is returned.
*/
-BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
- QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+#if ( configUSE_QUEUE_SETS == 1 )
+ BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
+ QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+#endif
/*
* Removes a queue or semaphore from a queue set. A queue or semaphore can only
@@ -1656,8 +1727,10 @@ BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
* then pdPASS is returned. If the queue was not in the queue set, or the
* queue (or semaphore) was not empty, then pdFAIL is returned.
*/
-BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
- QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+#if ( configUSE_QUEUE_SETS == 1 )
+ BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
+ QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+#endif
/*
* xQueueSelectFromSet() selects from the members of a queue set a queue or
@@ -1693,13 +1766,17 @@ BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
* in the queue set that is available, or NULL if no such queue or semaphore
* exists before before the specified block time expires.
*/
-QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
- const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+#if ( configUSE_QUEUE_SETS == 1 )
+ QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
+ const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+#endif
/*
* A version of xQueueSelectFromSet() that can be used from an ISR.
*/
-QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+#if ( configUSE_QUEUE_SETS == 1 )
+ QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
+#endif
/* Not public API functions. */
void vQueueWaitForMessageRestricted( QueueHandle_t xQueue,
@@ -1707,11 +1784,22 @@ void vQueueWaitForMessageRestricted( QueueHandle_t xQueue,
const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;
BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
BaseType_t xNewQueue ) PRIVILEGED_FUNCTION;
-void vQueueSetQueueNumber( QueueHandle_t xQueue,
- UBaseType_t uxQueueNumber ) PRIVILEGED_FUNCTION;
-UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
-uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+#if ( configUSE_TRACE_FACILITY == 1 )
+ void vQueueSetQueueNumber( QueueHandle_t xQueue,
+ UBaseType_t uxQueueNumber ) PRIVILEGED_FUNCTION;
+#endif
+
+#if ( configUSE_TRACE_FACILITY == 1 )
+ UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+#endif
+
+#if ( configUSE_TRACE_FACILITY == 1 )
+ uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+#endif
+
+UBaseType_t uxQueueGetQueueItemSize( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
+UBaseType_t uxQueueGetQueueLength( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
/* *INDENT-OFF* */
#ifdef __cplusplus
diff --git a/third-party/freertos/include/semphr.h b/third-party/freertos/include/semphr.h
index d3165d8d1e58fea00f13daff5d9d8e144e5d7d5d..13e01339d1f2a96f527f51fa3514df60d5cb7547 100644
--- a/third-party/freertos/include/semphr.h
+++ b/third-party/freertos/include/semphr.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -95,13 +95,13 @@ typedef QueueHandle_t SemaphoreHandle_t;
*/
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
#define vSemaphoreCreateBinary( xSemaphore ) \
- { \
+ do { \
( xSemaphore ) = xQueueGenericCreate( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_BINARY_SEMAPHORE ); \
if( ( xSemaphore ) != NULL ) \
{ \
( void ) xSemaphoreGive( ( xSemaphore ) ); \
} \
- }
+ } while( 0 )
#endif
/**
@@ -1190,4 +1190,26 @@ typedef QueueHandle_t SemaphoreHandle_t;
*/
#define uxSemaphoreGetCountFromISR( xSemaphore ) uxQueueMessagesWaitingFromISR( ( QueueHandle_t ) ( xSemaphore ) )
+/**
+ * semphr.h
+ * @code{c}
+ * BaseType_t xSemaphoreGetStaticBuffer( SemaphoreHandle_t xSemaphore,
+ * StaticSemaphore_t ** ppxSemaphoreBuffer );
+ * @endcode
+ *
+ * Retrieve pointer to a statically created binary semaphore, counting semaphore,
+ * or mutex semaphore's data structure buffer. This is the same buffer that is
+ * supplied at the time of creation.
+ *
+ * @param xSemaphore The semaphore for which to retrieve the buffer.
+ *
+ * @param ppxSemaphoreBuffer Used to return a pointer to the semaphore's
+ * data structure buffer.
+ *
+ * @return pdTRUE if buffer was retrieved, pdFALSE otherwise.
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ #define xSemaphoreGetStaticBuffer( xSemaphore, ppxSemaphoreBuffer ) xQueueGenericGetStaticBuffers( ( QueueHandle_t ) ( xSemaphore ), NULL, ( ppxSemaphoreBuffer ) )
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+
#endif /* SEMAPHORE_H */
diff --git a/third-party/freertos/include/stack_macros.h b/third-party/freertos/include/stack_macros.h
index 2455674249cce0d7e3a4659e95d166ed0123f821..393c95c8e263e9042264e88c297b80c42114a1cc 100644
--- a/third-party/freertos/include/stack_macros.h
+++ b/third-party/freertos/include/stack_macros.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -56,14 +56,15 @@
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) )
/* Only the current stack state is to be checked. */
- #define taskCHECK_FOR_STACK_OVERFLOW() \
- { \
- /* Is the currently saved stack pointer within the stack limit? */ \
- if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) \
- { \
- vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
- } \
- }
+ #define taskCHECK_FOR_STACK_OVERFLOW() \
+ do { \
+ /* Is the currently saved stack pointer within the stack limit? */ \
+ if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) \
+ { \
+ char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
+ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
+ } \
+ } while( 0 )
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
/*-----------------------------------------------------------*/
@@ -71,34 +72,36 @@
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) )
/* Only the current stack state is to be checked. */
- #define taskCHECK_FOR_STACK_OVERFLOW() \
- { \
- \
- /* Is the currently saved stack pointer within the stack limit? */ \
- if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) \
- { \
- vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
- } \
- }
+ #define taskCHECK_FOR_STACK_OVERFLOW() \
+ do { \
+ \
+ /* Is the currently saved stack pointer within the stack limit? */ \
+ if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) \
+ { \
+ char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
+ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
+ } \
+ } while( 0 )
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
/*-----------------------------------------------------------*/
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) )
- #define taskCHECK_FOR_STACK_OVERFLOW() \
- { \
- const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
- const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \
- \
- if( ( pulStack[ 0 ] != ulCheckValue ) || \
- ( pulStack[ 1 ] != ulCheckValue ) || \
- ( pulStack[ 2 ] != ulCheckValue ) || \
- ( pulStack[ 3 ] != ulCheckValue ) ) \
- { \
- vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
- } \
- }
+ #define taskCHECK_FOR_STACK_OVERFLOW() \
+ do { \
+ const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
+ const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5U; \
+ \
+ if( ( pulStack[ 0 ] != ulCheckValue ) || \
+ ( pulStack[ 1 ] != ulCheckValue ) || \
+ ( pulStack[ 2 ] != ulCheckValue ) || \
+ ( pulStack[ 3 ] != ulCheckValue ) ) \
+ { \
+ char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
+ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
+ } \
+ } while( 0 )
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
/*-----------------------------------------------------------*/
@@ -106,7 +109,7 @@
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) )
#define taskCHECK_FOR_STACK_OVERFLOW() \
- { \
+ do { \
int8_t * pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \
static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
@@ -120,9 +123,10 @@
/* Has the extremity of the task stack ever been written over? */ \
if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
{ \
- vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
+ char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
+ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
} \
- }
+ } while( 0 )
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
/*-----------------------------------------------------------*/
diff --git a/third-party/freertos/include/stdint.readme b/third-party/freertos/include/stdint.readme
index ef2b7f7f8cd7e1288fb4e1d52eeff8f9522bfe01..5a0822c2ba4147e55422d6508eeb81e815e11976 100644
--- a/third-party/freertos/include/stdint.readme
+++ b/third-party/freertos/include/stdint.readme
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
diff --git a/third-party/freertos/include/stream_buffer.h b/third-party/freertos/include/stream_buffer.h
index bf5019e68d975c8ef7f1eaf6c16439d2efce2a91..84fde67c6bf8f1ac7795b4808f09b6c988e1095b 100644
--- a/third-party/freertos/include/stream_buffer.h
+++ b/third-party/freertos/include/stream_buffer.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -62,6 +62,13 @@
#endif
/* *INDENT-ON* */
+/**
+ * Type of stream buffer. For internal use only.
+ */
+#define sbTYPE_STREAM_BUFFER ( ( BaseType_t ) 0 )
+#define sbTYPE_MESSAGE_BUFFER ( ( BaseType_t ) 1 )
+#define sbTYPE_STREAM_BATCHING_BUFFER ( ( BaseType_t ) 2 )
+
/**
* Type by which stream buffers are referenced. For example, a call to
* xStreamBufferCreate() returns an StreamBufferHandle_t variable that can
@@ -91,6 +98,8 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
*
* configSUPPORT_DYNAMIC_ALLOCATION must be set to 1 or left undefined in
* FreeRTOSConfig.h for xStreamBufferCreate() to be available.
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferCreate() to be available.
*
* @param xBufferSizeBytes The total number of bytes the stream buffer will be
* able to hold at any one time.
@@ -155,11 +164,11 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
*/
#define xStreamBufferCreate( xBufferSizeBytes, xTriggerLevelBytes ) \
- xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), pdFALSE, NULL, NULL )
+ xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BUFFER, NULL, NULL )
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
#define xStreamBufferCreateWithCallback( xBufferSizeBytes, xTriggerLevelBytes, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
- xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), pdFALSE, ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
+ xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BUFFER, ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
#endif
/**
@@ -167,15 +176,17 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
*
* @code{c}
* StreamBufferHandle_t xStreamBufferCreateStatic( size_t xBufferSizeBytes,
- * size_t xTriggerLevelBytes,
- * uint8_t *pucStreamBufferStorageArea,
- * StaticStreamBuffer_t *pxStaticStreamBuffer );
+ * size_t xTriggerLevelBytes,
+ * uint8_t *pucStreamBufferStorageArea,
+ * StaticStreamBuffer_t *pxStaticStreamBuffer );
* @endcode
* Creates a new stream buffer using statically allocated memory. See
* xStreamBufferCreate() for a version that uses dynamically allocated memory.
*
* configSUPPORT_STATIC_ALLOCATION must be set to 1 in FreeRTOSConfig.h for
- * xStreamBufferCreateStatic() to be available.
+ * xStreamBufferCreateStatic() to be available. configUSE_STREAM_BUFFERS must be
+ * set to 1 in for FreeRTOSConfig.h for xStreamBufferCreateStatic() to be
+ * available.
*
* @param xBufferSizeBytes The size, in bytes, of the buffer pointed to by the
* pucStreamBufferStorageArea parameter.
@@ -253,21 +264,244 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
*/
#define xStreamBufferCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, pucStreamBufferStorageArea, pxStaticStreamBuffer ) \
- xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), pdFALSE, ( pucStreamBufferStorageArea ), ( pxStaticStreamBuffer ), NULL, NULL )
+ xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BUFFER, ( pucStreamBufferStorageArea ), ( pxStaticStreamBuffer ), NULL, NULL )
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
#define xStreamBufferCreateStaticWithCallback( xBufferSizeBytes, xTriggerLevelBytes, pucStreamBufferStorageArea, pxStaticStreamBuffer, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
- xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), pdFALSE, ( pucStreamBufferStorageArea ), ( pxStaticStreamBuffer ), ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
+ xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BUFFER, ( pucStreamBufferStorageArea ), ( pxStaticStreamBuffer ), ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
+#endif
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * StreamBufferHandle_t xStreamBatchingBufferCreate( size_t xBufferSizeBytes, size_t xTriggerLevelBytes );
+ * @endcode
+ *
+ * Creates a new stream batching buffer using dynamically allocated memory. See
+ * xStreamBatchingBufferCreateStatic() for a version that uses statically
+ * allocated memory (memory that is allocated at compile time).
+ *
+ * configSUPPORT_DYNAMIC_ALLOCATION must be set to 1 or left undefined in
+ * FreeRTOSConfig.h for xStreamBatchingBufferCreate() to be available.
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBatchingBufferCreate() to be available.
+ *
+ * The difference between a stream buffer and a stream batching buffer is when
+ * a task performs read on a non-empty buffer:
+ * - The task reading from a non-empty stream buffer returns immediately
+ * regardless of the amount of data in the buffer.
+ * - The task reading from a non-empty steam batching buffer blocks until the
+ * amount of data in the buffer exceeds the trigger level or the block time
+ * expires.
+ *
+ * @param xBufferSizeBytes The total number of bytes the stream batching buffer
+ * will be able to hold at any one time.
+ *
+ * @param xTriggerLevelBytes The number of bytes that must be in the stream
+ * batching buffer to unblock a task calling xStreamBufferReceive before the
+ * block time expires.
+ *
+ * @param pxSendCompletedCallback Callback invoked when number of bytes at least
+ * equal to trigger level is sent to the stream batching buffer. If the
+ * parameter is NULL, it will use the default implementation provided by
+ * sbSEND_COMPLETED macro. To enable the callback, configUSE_SB_COMPLETED_CALLBACK
+ * must be set to 1 in FreeRTOSConfig.h.
+ *
+ * @param pxReceiveCompletedCallback Callback invoked when more than zero bytes
+ * are read from a stream batching buffer. If the parameter is NULL, it will use
+ * the default implementation provided by sbRECEIVE_COMPLETED macro. To enable
+ * the callback, configUSE_SB_COMPLETED_CALLBACK must be set to 1 in
+ * FreeRTOSConfig.h.
+ *
+ * @return If NULL is returned, then the stream batching buffer cannot be created
+ * because there is insufficient heap memory available for FreeRTOS to allocate
+ * the stream batching buffer data structures and storage area. A non-NULL value
+ * being returned indicates that the stream batching buffer has been created
+ * successfully - the returned value should be stored as the handle to the
+ * created stream batching buffer.
+ *
+ * Example use:
+ * @code{c}
+ *
+ * void vAFunction( void )
+ * {
+ * StreamBufferHandle_t xStreamBatchingBuffer;
+ * const size_t xStreamBufferSizeBytes = 100, xTriggerLevel = 10;
+ *
+ * // Create a stream batching buffer that can hold 100 bytes. The memory used
+ * // to hold both the stream batching buffer structure and the data in the stream
+ * // batching buffer is allocated dynamically.
+ * xStreamBatchingBuffer = xStreamBatchingBufferCreate( xStreamBufferSizeBytes, xTriggerLevel );
+ *
+ * if( xStreamBatchingBuffer == NULL )
+ * {
+ * // There was not enough heap memory space available to create the
+ * // stream batching buffer.
+ * }
+ * else
+ * {
+ * // The stream batching buffer was created successfully and can now be used.
+ * }
+ * }
+ * @endcode
+ * \defgroup xStreamBatchingBufferCreate xStreamBatchingBufferCreate
+ * \ingroup StreamBatchingBufferManagement
+ */
+
+#define xStreamBatchingBufferCreate( xBufferSizeBytes, xTriggerLevelBytes ) \
+ xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BATCHING_BUFFER, NULL, NULL )
+
+#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
+ #define xStreamBatchingBufferCreateWithCallback( xBufferSizeBytes, xTriggerLevelBytes, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
+ xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BATCHING_BUFFER, ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
+#endif
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * StreamBufferHandle_t xStreamBatchingBufferCreateStatic( size_t xBufferSizeBytes,
+ * size_t xTriggerLevelBytes,
+ * uint8_t *pucStreamBufferStorageArea,
+ * StaticStreamBuffer_t *pxStaticStreamBuffer );
+ * @endcode
+ * Creates a new stream batching buffer using statically allocated memory. See
+ * xStreamBatchingBufferCreate() for a version that uses dynamically allocated
+ * memory.
+ *
+ * configSUPPORT_STATIC_ALLOCATION must be set to 1 in FreeRTOSConfig.h for
+ * xStreamBatchingBufferCreateStatic() to be available. configUSE_STREAM_BUFFERS
+ * must be set to 1 in for FreeRTOSConfig.h for xStreamBatchingBufferCreateStatic()
+ * to be available.
+ *
+ * The difference between a stream buffer and a stream batching buffer is when
+ * a task performs read on a non-empty buffer:
+ * - The task reading from a non-empty stream buffer returns immediately
+ * regardless of the amount of data in the buffer.
+ * - The task reading from a non-empty steam batching buffer blocks until the
+ * amount of data in the buffer exceeds the trigger level or the block time
+ * expires.
+ *
+ * @param xBufferSizeBytes The size, in bytes, of the buffer pointed to by the
+ * pucStreamBufferStorageArea parameter.
+ *
+ * @param xTriggerLevelBytes The number of bytes that must be in the stream
+ * batching buffer to unblock a task calling xStreamBufferReceive before the
+ * block time expires.
+ *
+ * @param pucStreamBufferStorageArea Must point to a uint8_t array that is at
+ * least xBufferSizeBytes big. This is the array to which streams are
+ * copied when they are written to the stream batching buffer.
+ *
+ * @param pxStaticStreamBuffer Must point to a variable of type
+ * StaticStreamBuffer_t, which will be used to hold the stream batching buffer's
+ * data structure.
+ *
+ * @param pxSendCompletedCallback Callback invoked when number of bytes at least
+ * equal to trigger level is sent to the stream batching buffer. If the parameter
+ * is NULL, it will use the default implementation provided by sbSEND_COMPLETED
+ * macro. To enable the callback, configUSE_SB_COMPLETED_CALLBACK must be set to
+ * 1 in FreeRTOSConfig.h.
+ *
+ * @param pxReceiveCompletedCallback Callback invoked when more than zero bytes
+ * are read from a stream batching buffer. If the parameter is NULL, it will use
+ * the default implementation provided by sbRECEIVE_COMPLETED macro. To enable
+ * the callback, configUSE_SB_COMPLETED_CALLBACK must be set to 1 in
+ * FreeRTOSConfig.h.
+ *
+ * @return If the stream batching buffer is created successfully then a handle
+ * to the created stream batching buffer is returned. If either pucStreamBufferStorageArea
+ * or pxStaticstreamBuffer are NULL then NULL is returned.
+ *
+ * Example use:
+ * @code{c}
+ *
+ * // Used to dimension the array used to hold the streams. The available space
+ * // will actually be one less than this, so 999.
+ * #define STORAGE_SIZE_BYTES 1000
+ *
+ * // Defines the memory that will actually hold the streams within the stream
+ * // batching buffer.
+ * static uint8_t ucStorageBuffer[ STORAGE_SIZE_BYTES ];
+ *
+ * // The variable used to hold the stream batching buffer structure.
+ * StaticStreamBuffer_t xStreamBufferStruct;
+ *
+ * void MyFunction( void )
+ * {
+ * StreamBufferHandle_t xStreamBatchingBuffer;
+ * const size_t xTriggerLevel = 1;
+ *
+ * xStreamBatchingBuffer = xStreamBatchingBufferCreateStatic( sizeof( ucStorageBuffer ),
+ * xTriggerLevel,
+ * ucStorageBuffer,
+ * &xStreamBufferStruct );
+ *
+ * // As neither the pucStreamBufferStorageArea or pxStaticStreamBuffer
+ * // parameters were NULL, xStreamBatchingBuffer will not be NULL, and can be
+ * // used to reference the created stream batching buffer in other stream
+ * // buffer API calls.
+ *
+ * // Other code that uses the stream batching buffer can go here.
+ * }
+ *
+ * @endcode
+ * \defgroup xStreamBatchingBufferCreateStatic xStreamBatchingBufferCreateStatic
+ * \ingroup StreamBatchingBufferManagement
+ */
+
+#define xStreamBatchingBufferCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, pucStreamBufferStorageArea, pxStaticStreamBuffer ) \
+ xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BATCHING_BUFFER, ( pucStreamBufferStorageArea ), ( pxStaticStreamBuffer ), NULL, NULL )
+
+#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
+ #define xStreamBatchingBufferCreateStaticWithCallback( xBufferSizeBytes, xTriggerLevelBytes, pucStreamBufferStorageArea, pxStaticStreamBuffer, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
+ xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BATCHING_BUFFER, ( pucStreamBufferStorageArea ), ( pxStaticStreamBuffer ), ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
#endif
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * BaseType_t xStreamBufferGetStaticBuffers( StreamBufferHandle_t xStreamBuffer,
+ * uint8_t ** ppucStreamBufferStorageArea,
+ * StaticStreamBuffer_t ** ppxStaticStreamBuffer );
+ * @endcode
+ *
+ * Retrieve pointers to a statically created stream buffer's data structure
+ * buffer and storage area buffer. These are the same buffers that are supplied
+ * at the time of creation.
+ *
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferGetStaticBuffers() to be available.
+ *
+ * @param xStreamBuffer The stream buffer for which to retrieve the buffers.
+ *
+ * @param ppucStreamBufferStorageArea Used to return a pointer to the stream
+ * buffer's storage area buffer.
+ *
+ * @param ppxStaticStreamBuffer Used to return a pointer to the stream
+ * buffer's data structure buffer.
+ *
+ * @return pdTRUE if buffers were retrieved, pdFALSE otherwise.
+ *
+ * \defgroup xStreamBufferGetStaticBuffers xStreamBufferGetStaticBuffers
+ * \ingroup StreamBufferManagement
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ BaseType_t xStreamBufferGetStaticBuffers( StreamBufferHandle_t xStreamBuffer,
+ uint8_t ** ppucStreamBufferStorageArea,
+ StaticStreamBuffer_t ** ppxStaticStreamBuffer ) PRIVILEGED_FUNCTION;
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+
/**
* stream_buffer.h
*
* @code{c}
* size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
- * const void *pvTxData,
- * size_t xDataLengthBytes,
- * TickType_t xTicksToWait );
+ * const void *pvTxData,
+ * size_t xDataLengthBytes,
+ * TickType_t xTicksToWait );
* @endcode
*
* Sends bytes to a stream buffer. The bytes are copied into the stream buffer.
@@ -291,6 +525,9 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
* xStreamBufferSendFromISR() to write to a stream buffer from an interrupt
* service routine (ISR).
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferSend() to be available.
+ *
* @param xStreamBuffer The handle of the stream buffer to which a stream is
* being sent.
*
@@ -362,9 +599,9 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
*
* @code{c}
* size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
- * const void *pvTxData,
- * size_t xDataLengthBytes,
- * BaseType_t *pxHigherPriorityTaskWoken );
+ * const void *pvTxData,
+ * size_t xDataLengthBytes,
+ * BaseType_t *pxHigherPriorityTaskWoken );
* @endcode
*
* Interrupt safe version of the API function that sends a stream of bytes to
@@ -389,6 +626,9 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
* xStreamBufferSendFromISR() to write to a stream buffer from an interrupt
* service routine (ISR).
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferSendFromISR() to be available.
+ *
* @param xStreamBuffer The handle of the stream buffer to which a stream is
* being sent.
*
@@ -463,9 +703,9 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
*
* @code{c}
* size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
- * void *pvRxData,
- * size_t xBufferLengthBytes,
- * TickType_t xTicksToWait );
+ * void *pvRxData,
+ * size_t xBufferLengthBytes,
+ * TickType_t xTicksToWait );
* @endcode
*
* Receives bytes from a stream buffer.
@@ -489,6 +729,9 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
* xStreamBufferReceiveFromISR() to read from a stream buffer from an
* interrupt service routine (ISR).
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferReceive() to be available.
+ *
* @param xStreamBuffer The handle of the stream buffer from which bytes are to
* be received.
*
@@ -552,9 +795,9 @@ size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
*
* @code{c}
* size_t xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
- * void *pvRxData,
- * size_t xBufferLengthBytes,
- * BaseType_t *pxHigherPriorityTaskWoken );
+ * void *pvRxData,
+ * size_t xBufferLengthBytes,
+ * BaseType_t *pxHigherPriorityTaskWoken );
* @endcode
*
* An interrupt safe version of the API function that receives bytes from a
@@ -564,6 +807,9 @@ size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
* Use xStreamBufferReceiveFromISR() to read bytes from a stream buffer from an
* interrupt service routine (ISR).
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferReceiveFromISR() to be available.
+ *
* @param xStreamBuffer The handle of the stream buffer from which a stream
* is being received.
*
@@ -648,6 +894,9 @@ size_t xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
* A stream buffer handle must not be used after the stream buffer has been
* deleted.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * vStreamBufferDelete() to be available.
+ *
* @param xStreamBuffer The handle of the stream buffer to be deleted.
*
* \defgroup vStreamBufferDelete vStreamBufferDelete
@@ -665,6 +914,9 @@ void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTI
* Queries a stream buffer to see if it is full. A stream buffer is full if it
* does not have any free space, and therefore cannot accept any more data.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferIsFull() to be available.
+ *
* @param xStreamBuffer The handle of the stream buffer being queried.
*
* @return If the stream buffer is full then pdTRUE is returned. Otherwise
@@ -685,6 +937,9 @@ BaseType_t xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_
* Queries a stream buffer to see if it is empty. A stream buffer is empty if
* it does not contain any data.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferIsEmpty() to be available.
+ *
* @param xStreamBuffer The handle of the stream buffer being queried.
*
* @return If the stream buffer is empty then pdTRUE is returned. Otherwise
@@ -707,6 +962,13 @@ BaseType_t xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED
* are no tasks blocked waiting to either send to or receive from the stream
* buffer.
*
+ * Use xStreamBufferReset() to reset a stream buffer from a task.
+ * Use xStreamBufferResetFromISR() to reset a stream buffer from an
+ * interrupt service routine (ISR).
+ *
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferReset() to be available.
+ *
* @param xStreamBuffer The handle of the stream buffer being reset.
*
* @return If the stream buffer is reset then pdPASS is returned. If there was
@@ -718,6 +980,38 @@ BaseType_t xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED
*/
BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * BaseType_t xStreamBufferResetFromISR( StreamBufferHandle_t xStreamBuffer );
+ * @endcode
+ *
+ * An interrupt safe version of the API function that resets the stream buffer.
+ *
+ * Resets a stream buffer to its initial, empty, state. Any data that was in
+ * the stream buffer is discarded. A stream buffer can only be reset if there
+ * are no tasks blocked waiting to either send to or receive from the stream
+ * buffer.
+ *
+ * Use xStreamBufferReset() to reset a stream buffer from a task.
+ * Use xStreamBufferResetFromISR() to reset a stream buffer from an
+ * interrupt service routine (ISR).
+ *
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferResetFromISR() to be available.
+ *
+ * @param xStreamBuffer The handle of the stream buffer being reset.
+ *
+ * @return If the stream buffer is reset then pdPASS is returned. If there was
+ * a task blocked waiting to send to or read from the stream buffer then the
+ * stream buffer is not reset and pdFAIL is returned.
+ *
+ * \defgroup xStreamBufferResetFromISR xStreamBufferResetFromISR
+ * \ingroup StreamBufferManagement
+ */
+BaseType_t xStreamBufferResetFromISR( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+
/**
* stream_buffer.h
*
@@ -729,6 +1023,9 @@ BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_F
* equal to the amount of data that can be sent to the stream buffer before it
* is full.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferSpacesAvailable() to be available.
+ *
* @param xStreamBuffer The handle of the stream buffer being queried.
*
* @return The number of bytes that can be written to the stream buffer before
@@ -750,6 +1047,9 @@ size_t xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) PRIVIL
* the number of bytes that can be read from the stream buffer before the stream
* buffer would be empty.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferBytesAvailable() to be available.
+ *
* @param xStreamBuffer The handle of the stream buffer being queried.
*
* @return The number of bytes that can be read from the stream buffer before
@@ -784,6 +1084,9 @@ size_t xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) PRIVILE
* A trigger level is set when the stream buffer is created, and can be modified
* using xStreamBufferSetTriggerLevel().
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferSetTriggerLevel() to be available.
+ *
* @param xStreamBuffer The handle of the stream buffer being updated.
*
* @param xTriggerLevel The new trigger level for the stream buffer.
@@ -818,6 +1121,9 @@ BaseType_t xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
* See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for
* additional information.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferSendCompletedFromISR() to be available.
+ *
* @param xStreamBuffer The handle of the stream buffer to which data was
* written.
*
@@ -859,6 +1165,9 @@ BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer
* See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for
* additional information.
*
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * xStreamBufferReceiveCompletedFromISR() to be available.
+ *
* @param xStreamBuffer The handle of the stream buffer from which data was
* read.
*
@@ -879,21 +1188,79 @@ BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer
BaseType_t xStreamBufferReceiveCompletedFromISR( StreamBufferHandle_t xStreamBuffer,
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * UBaseType_t uxStreamBufferGetStreamBufferNotificationIndex( StreamBufferHandle_t xStreamBuffer );
+ * @endcode
+ *
+ * Get the task notification index used for the supplied stream buffer which can
+ * be set using vStreamBufferSetStreamBufferNotificationIndex. If the task
+ * notification index for the stream buffer is not changed using
+ * vStreamBufferSetStreamBufferNotificationIndex, this function returns the
+ * default value (tskDEFAULT_INDEX_TO_NOTIFY).
+ *
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * uxStreamBufferGetStreamBufferNotificationIndex() to be available.
+ *
+ * @param xStreamBuffer The handle of the stream buffer for which the task
+ * notification index is retrieved.
+ *
+ * @return The task notification index for the stream buffer.
+ *
+ * \defgroup uxStreamBufferGetStreamBufferNotificationIndex uxStreamBufferGetStreamBufferNotificationIndex
+ * \ingroup StreamBufferManagement
+ */
+UBaseType_t uxStreamBufferGetStreamBufferNotificationIndex( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
+
+/**
+ * stream_buffer.h
+ *
+ * @code{c}
+ * void vStreamBufferSetStreamBufferNotificationIndex ( StreamBuffer_t xStreamBuffer, UBaseType_t uxNotificationIndex );
+ * @endcode
+ *
+ * Set the task notification index used for the supplied stream buffer.
+ * Successive calls to stream buffer APIs (like xStreamBufferSend or
+ * xStreamBufferReceive) for this stream buffer will use this new index for
+ * their task notifications.
+ *
+ * If this function is not called, the default index (tskDEFAULT_INDEX_TO_NOTIFY)
+ * is used for task notifications. It is recommended to call this function
+ * before attempting to send or receive data from the stream buffer to avoid
+ * inconsistencies.
+ *
+ * configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
+ * vStreamBufferSetStreamBufferNotificationIndex() to be available.
+ *
+ * @param xStreamBuffer The handle of the stream buffer for which the task
+ * notification index is set.
+ *
+ * @param uxNotificationIndex The task notification index to set.
+ *
+ * \defgroup vStreamBufferSetStreamBufferNotificationIndex vStreamBufferSetStreamBufferNotificationIndex
+ * \ingroup StreamBufferManagement
+ */
+void vStreamBufferSetStreamBufferNotificationIndex( StreamBufferHandle_t xStreamBuffer,
+ UBaseType_t uxNotificationIndex ) PRIVILEGED_FUNCTION;
+
/* Functions below here are not part of the public API. */
StreamBufferHandle_t xStreamBufferGenericCreate( size_t xBufferSizeBytes,
size_t xTriggerLevelBytes,
- BaseType_t xIsMessageBuffer,
+ BaseType_t xStreamBufferType,
StreamBufferCallbackFunction_t pxSendCompletedCallback,
StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION;
-
-StreamBufferHandle_t xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
- size_t xTriggerLevelBytes,
- BaseType_t xIsMessageBuffer,
- uint8_t * const pucStreamBufferStorageArea,
- StaticStreamBuffer_t * const pxStaticStreamBuffer,
- StreamBufferCallbackFunction_t pxSendCompletedCallback,
- StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION;
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ StreamBufferHandle_t xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
+ size_t xTriggerLevelBytes,
+ BaseType_t xStreamBufferType,
+ uint8_t * const pucStreamBufferStorageArea,
+ StaticStreamBuffer_t * const pxStaticStreamBuffer,
+ StreamBufferCallbackFunction_t pxSendCompletedCallback,
+ StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION;
+#endif
size_t xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
diff --git a/third-party/freertos/include/task.h b/third-party/freertos/include/task.h
index ab8eeb82f7fad460e10be0f61b93ee63a6d20a1b..d9639a1c6fcd5c6397b71a4eab93d51307e5b953 100644
--- a/third-party/freertos/include/task.h
+++ b/third-party/freertos/include/task.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -53,18 +53,23 @@
* The tskKERNEL_VERSION_MAJOR, tskKERNEL_VERSION_MINOR, tskKERNEL_VERSION_BUILD
* values will reflect the last released version number.
*/
-#define tskKERNEL_VERSION_NUMBER "V10.5.1"
-#define tskKERNEL_VERSION_MAJOR 10
-#define tskKERNEL_VERSION_MINOR 5
-#define tskKERNEL_VERSION_BUILD 1
+#define tskKERNEL_VERSION_NUMBER "11.1.0"
+#define tskKERNEL_VERSION_MAJOR 11
+#define tskKERNEL_VERSION_MINOR 1
+#define tskKERNEL_VERSION_BUILD 0
/* MPU region parameters passed in ulParameters
* of MemoryRegion_t struct. */
-#define tskMPU_REGION_READ_ONLY ( 1UL << 0UL )
-#define tskMPU_REGION_READ_WRITE ( 1UL << 1UL )
-#define tskMPU_REGION_EXECUTE_NEVER ( 1UL << 2UL )
-#define tskMPU_REGION_NORMAL_MEMORY ( 1UL << 3UL )
-#define tskMPU_REGION_DEVICE_MEMORY ( 1UL << 4UL )
+#define tskMPU_REGION_READ_ONLY ( 1U << 0U )
+#define tskMPU_REGION_READ_WRITE ( 1U << 1U )
+#define tskMPU_REGION_EXECUTE_NEVER ( 1U << 2U )
+#define tskMPU_REGION_NORMAL_MEMORY ( 1U << 3U )
+#define tskMPU_REGION_DEVICE_MEMORY ( 1U << 4U )
+
+/* MPU region permissions stored in MPU settings to
+ * authorize access requests. */
+#define tskMPU_READ_PERMISSION ( 1U << 0U )
+#define tskMPU_WRITE_PERMISSION ( 1U << 1U )
/* The direct to task notification feature used to have only a single notification
* per task. Now there is an array of notifications per task that is dimensioned by
@@ -84,13 +89,14 @@
* \ingroup Tasks
*/
struct tskTaskControlBlock; /* The old naming convention is used to prevent breaking kernel aware debuggers. */
-typedef struct tskTaskControlBlock * TaskHandle_t;
+typedef struct tskTaskControlBlock * TaskHandle_t;
+typedef const struct tskTaskControlBlock * ConstTaskHandle_t;
/*
* Defines the prototype to which the application task hook function must
* conform.
*/
-typedef BaseType_t (* TaskHookFunction_t)( void * );
+typedef BaseType_t (* TaskHookFunction_t)( void * arg );
/* Task states returned by eTaskGetState. */
typedef enum
@@ -138,7 +144,7 @@ typedef struct xMEMORY_REGION
typedef struct xTASK_PARAMETERS
{
TaskFunction_t pvTaskCode;
- const char * pcName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ const char * pcName;
configSTACK_DEPTH_TYPE usStackDepth;
void * pvParameters;
UBaseType_t uxPriority;
@@ -154,26 +160,30 @@ typedef struct xTASK_PARAMETERS
typedef struct xTASK_STATUS
{
TaskHandle_t xHandle; /* The handle of the task to which the rest of the information in the structure relates. */
- const char * pcTaskName; /* A pointer to the task's name. This value will be invalid if the task was deleted since the structure was populated! */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ const char * pcTaskName; /* A pointer to the task's name. This value will be invalid if the task was deleted since the structure was populated! */
UBaseType_t xTaskNumber; /* A number unique to the task. */
eTaskState eCurrentState; /* The state in which the task existed when the structure was populated. */
UBaseType_t uxCurrentPriority; /* The priority at which the task was running (may be inherited) when the structure was populated. */
UBaseType_t uxBasePriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */
configRUN_TIME_COUNTER_TYPE ulRunTimeCounter; /* The total run time allocated to the task so far, as defined by the run time stats clock. See https://www.FreeRTOS.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
StackType_t * pxStackBase; /* Points to the lowest address of the task's stack area. */
- #if ( ( portSTACK_GROWTH > 0 ) && ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
+ #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
StackType_t * pxTopOfStack; /* Points to the top address of the task's stack area. */
StackType_t * pxEndOfStack; /* Points to the end address of the task's stack area. */
#endif
configSTACK_DEPTH_TYPE usStackHighWaterMark; /* The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */
+ #if ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
+ UBaseType_t uxCoreAffinityMask; /* The core affinity mask for the task */
+ #endif
} TaskStatus_t;
/* Possible return values for eTaskConfirmSleepModeStatus(). */
typedef enum
{
- eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPRESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */
- eStandardSleep, /* Enter a sleep mode that will not last any longer than the expected idle time. */
+ eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPRESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */
+ eStandardSleep /* Enter a sleep mode that will not last any longer than the expected idle time. */
#if ( INCLUDE_vTaskSuspend == 1 )
+ ,
eNoTasksWaitingTimeout /* No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an external interrupt. */
#endif /* INCLUDE_vTaskSuspend */
} eSleepModeStatus;
@@ -185,6 +195,13 @@ typedef enum
*/
#define tskIDLE_PRIORITY ( ( UBaseType_t ) 0U )
+/**
+ * Defines affinity to all available cores.
+ *
+ * \ingroup TaskUtils
+ */
+#define tskNO_AFFINITY ( ( UBaseType_t ) -1 )
+
/**
* task. h
*
@@ -193,7 +210,7 @@ typedef enum
* \defgroup taskYIELD taskYIELD
* \ingroup SchedulerControl
*/
-#define taskYIELD() portYIELD()
+#define taskYIELD() portYIELD()
/**
* task. h
@@ -207,8 +224,12 @@ typedef enum
* \defgroup taskENTER_CRITICAL taskENTER_CRITICAL
* \ingroup SchedulerControl
*/
-#define taskENTER_CRITICAL() portENTER_CRITICAL()
-#define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
+#define taskENTER_CRITICAL() portENTER_CRITICAL()
+#if ( configNUMBER_OF_CORES == 1 )
+ #define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
+#else
+ #define taskENTER_CRITICAL_FROM_ISR() portENTER_CRITICAL_FROM_ISR()
+#endif
/**
* task. h
@@ -222,8 +243,12 @@ typedef enum
* \defgroup taskEXIT_CRITICAL taskEXIT_CRITICAL
* \ingroup SchedulerControl
*/
-#define taskEXIT_CRITICAL() portEXIT_CRITICAL()
-#define taskEXIT_CRITICAL_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( x )
+#define taskEXIT_CRITICAL() portEXIT_CRITICAL()
+#if ( configNUMBER_OF_CORES == 1 )
+ #define taskEXIT_CRITICAL_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( x )
+#else
+ #define taskEXIT_CRITICAL_FROM_ISR( x ) portEXIT_CRITICAL_FROM_ISR( x )
+#endif
/**
* task. h
@@ -233,7 +258,7 @@ typedef enum
* \defgroup taskDISABLE_INTERRUPTS taskDISABLE_INTERRUPTS
* \ingroup SchedulerControl
*/
-#define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS()
+#define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS()
/**
* task. h
@@ -243,7 +268,7 @@ typedef enum
* \defgroup taskENABLE_INTERRUPTS taskENABLE_INTERRUPTS
* \ingroup SchedulerControl
*/
-#define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()
+#define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()
/* Definitions returned by xTaskGetSchedulerState(). taskSCHEDULER_SUSPENDED is
* 0 to generate more optimal code when configASSERT() is defined as the constant
@@ -252,6 +277,8 @@ typedef enum
#define taskSCHEDULER_NOT_STARTED ( ( BaseType_t ) 1 )
#define taskSCHEDULER_RUNNING ( ( BaseType_t ) 2 )
+/* Checks if core ID is valid. */
+#define taskVALID_CORE_ID( xCoreID ) ( ( ( ( ( BaseType_t ) 0 <= ( xCoreID ) ) && ( ( xCoreID ) < ( BaseType_t ) configNUMBER_OF_CORES ) ) ) ? ( pdTRUE ) : ( pdFALSE ) )
/*-----------------------------------------------------------
* TASK CREATION API
@@ -262,8 +289,8 @@ typedef enum
* @code{c}
* BaseType_t xTaskCreate(
* TaskFunction_t pxTaskCode,
- * const char *pcName,
- * configSTACK_DEPTH_TYPE usStackDepth,
+ * const char * const pcName,
+ * const configSTACK_DEPTH_TYPE uxStackDepth,
* void *pvParameters,
* UBaseType_t uxPriority,
* TaskHandle_t *pxCreatedTask
@@ -297,9 +324,9 @@ typedef enum
* facilitate debugging. Max length defined by configMAX_TASK_NAME_LEN - default
* is 16.
*
- * @param usStackDepth The size of the task stack specified as the number of
+ * @param uxStackDepth The size of the task stack specified as the number of
* variables the stack can hold - not the number of bytes. For example, if
- * the stack is 16 bits wide and usStackDepth is defined as 100, 200 bytes
+ * the stack is 16 bits wide and uxStackDepth is defined as 100, 200 bytes
* will be allocated for stack storage.
*
* @param pvParameters Pointer that will be used as the parameter for the task
@@ -353,19 +380,29 @@ typedef enum
*/
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
BaseType_t xTaskCreate( TaskFunction_t pxTaskCode,
- const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
- const configSTACK_DEPTH_TYPE usStackDepth,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
void * const pvParameters,
UBaseType_t uxPriority,
TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;
#endif
+#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ BaseType_t xTaskCreateAffinitySet( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ UBaseType_t uxCoreAffinityMask,
+ TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;
+#endif
+
/**
* task. h
* @code{c}
* TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,
- * const char *pcName,
- * uint32_t ulStackDepth,
+ * const char * const pcName,
+ * const configSTACK_DEPTH_TYPE uxStackDepth,
* void *pvParameters,
* UBaseType_t uxPriority,
* StackType_t *puxStackBuffer,
@@ -391,9 +428,9 @@ typedef enum
* facilitate debugging. The maximum length of the string is defined by
* configMAX_TASK_NAME_LEN in FreeRTOSConfig.h.
*
- * @param ulStackDepth The size of the task stack specified as the number of
+ * @param uxStackDepth The size of the task stack specified as the number of
* variables the stack can hold - not the number of bytes. For example, if
- * the stack is 32-bits wide and ulStackDepth is defined as 100 then 400 bytes
+ * the stack is 32-bits wide and uxStackDepth is defined as 100 then 400 bytes
* will be allocated for stack storage.
*
* @param pvParameters Pointer that will be used as the parameter for the task
@@ -402,7 +439,7 @@ typedef enum
* @param uxPriority The priority at which the task will run.
*
* @param puxStackBuffer Must point to a StackType_t array that has at least
- * ulStackDepth indexes - the array will then be used as the task's stack,
+ * uxStackDepth indexes - the array will then be used as the task's stack,
* removing the need for the stack to be allocated dynamically.
*
* @param pxTaskBuffer Must point to a variable of type StaticTask_t, which will
@@ -436,7 +473,7 @@ typedef enum
* {
* // The parameter value is expected to be 1 as 1 is passed in the
* // pvParameters value in the call to xTaskCreateStatic().
- * configASSERT( ( uint32_t ) pvParameters == 1UL );
+ * configASSERT( ( uint32_t ) pvParameters == 1U );
*
* for( ;; )
* {
@@ -470,14 +507,25 @@ typedef enum
*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,
- const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
- const uint32_t ulStackDepth,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
void * const pvParameters,
UBaseType_t uxPriority,
StackType_t * const puxStackBuffer,
StaticTask_t * const pxTaskBuffer ) PRIVILEGED_FUNCTION;
#endif /* configSUPPORT_STATIC_ALLOCATION */
+#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ TaskHandle_t xTaskCreateStaticAffinitySet( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ StackType_t * const puxStackBuffer,
+ StaticTask_t * const pxTaskBuffer,
+ UBaseType_t uxCoreAffinityMask ) PRIVILEGED_FUNCTION;
+#endif
+
/**
* task. h
* @code{c}
@@ -514,9 +562,9 @@ typedef enum
* {
* vATask, // pvTaskCode - the function that implements the task.
* "ATask", // pcName - just a text name for the task to assist debugging.
- * 100, // usStackDepth - the stack size DEFINED IN WORDS.
+ * 100, // uxStackDepth - the stack size DEFINED IN WORDS.
* NULL, // pvParameters - passed into the task function as the function parameters.
- * ( 1UL | portPRIVILEGE_BIT ),// uxPriority - task priority, set the portPRIVILEGE_BIT if the task should run in a privileged state.
+ * ( 1U | portPRIVILEGE_BIT ),// uxPriority - task priority, set the portPRIVILEGE_BIT if the task should run in a privileged state.
* cStackBuffer,// puxStackBuffer - the buffer to be used as the task stack.
*
* // xRegions - Allocate up to three separate memory regions for access by
@@ -556,6 +604,12 @@ typedef enum
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
#endif
+#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ BaseType_t xTaskCreateRestrictedAffinitySet( const TaskParameters_t * const pxTaskDefinition,
+ UBaseType_t uxCoreAffinityMask,
+ TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
+#endif
+
/**
* task. h
* @code{c}
@@ -602,9 +656,9 @@ typedef enum
* {
* vATask, // pvTaskCode - the function that implements the task.
* "ATask", // pcName - just a text name for the task to assist debugging.
- * 100, // usStackDepth - the stack size DEFINED IN WORDS.
+ * 100, // uxStackDepth - the stack size DEFINED IN WORDS.
* NULL, // pvParameters - passed into the task function as the function parameters.
- * ( 1UL | portPRIVILEGE_BIT ),// uxPriority - task priority, set the portPRIVILEGE_BIT if the task should run in a privileged state.
+ * ( 1U | portPRIVILEGE_BIT ),// uxPriority - task priority, set the portPRIVILEGE_BIT if the task should run in a privileged state.
* cStackBuffer,// puxStackBuffer - the buffer to be used as the task stack.
*
* // xRegions - Allocate up to three separate memory regions for access by
@@ -646,6 +700,12 @@ typedef enum
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
#endif
+#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ BaseType_t xTaskCreateRestrictedStaticAffinitySet( const TaskParameters_t * const pxTaskDefinition,
+ UBaseType_t uxCoreAffinityMask,
+ TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
+#endif
+
/**
* task. h
* @code{c}
@@ -656,9 +716,9 @@ typedef enum
* a call to xTaskCreateRestricted(). These regions can be redefined using
* vTaskAllocateMPURegions().
*
- * @param xTask The handle of the task being updated.
+ * @param xTaskToModify The handle of the task being updated.
*
- * @param xRegions A pointer to a MemoryRegion_t structure that contains the
+ * @param[in] pxRegions A pointer to a MemoryRegion_t structure that contains the
* new memory region definitions.
*
* Example usage:
@@ -693,8 +753,10 @@ typedef enum
* \defgroup vTaskAllocateMPURegions vTaskAllocateMPURegions
* \ingroup Tasks
*/
-void vTaskAllocateMPURegions( TaskHandle_t xTask,
- const MemoryRegion_t * const pxRegions ) PRIVILEGED_FUNCTION;
+#if ( portUSING_MPU_WRAPPERS == 1 )
+ void vTaskAllocateMPURegions( TaskHandle_t xTaskToModify,
+ const MemoryRegion_t * const pxRegions ) PRIVILEGED_FUNCTION;
+#endif
/**
* task. h
@@ -901,7 +963,9 @@ BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
* \defgroup xTaskAbortDelay xTaskAbortDelay
* \ingroup TaskCtrl
*/
-BaseType_t xTaskAbortDelay( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+#if ( INCLUDE_xTaskAbortDelay == 1 )
+ BaseType_t xTaskAbortDelay( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+#endif
/**
* task. h
@@ -962,6 +1026,37 @@ UBaseType_t uxTaskPriorityGet( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
*/
UBaseType_t uxTaskPriorityGetFromISR( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+/**
+ * task. h
+ * @code{c}
+ * UBaseType_t uxTaskBasePriorityGet( const TaskHandle_t xTask );
+ * @endcode
+ *
+ * INCLUDE_uxTaskPriorityGet and configUSE_MUTEXES must be defined as 1 for this
+ * function to be available. See the configuration section for more information.
+ *
+ * Obtain the base priority of any task.
+ *
+ * @param xTask Handle of the task to be queried. Passing a NULL
+ * handle results in the base priority of the calling task being returned.
+ *
+ * @return The base priority of xTask.
+ *
+ * \defgroup uxTaskPriorityGet uxTaskBasePriorityGet
+ * \ingroup TaskCtrl
+ */
+UBaseType_t uxTaskBasePriorityGet( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+
+/**
+ * task. h
+ * @code{c}
+ * UBaseType_t uxTaskBasePriorityGetFromISR( const TaskHandle_t xTask );
+ * @endcode
+ *
+ * A version of uxTaskBasePriorityGet() that can be used from an ISR.
+ */
+UBaseType_t uxTaskBasePriorityGetFromISR( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+
/**
* task. h
* @code{c}
@@ -980,7 +1075,9 @@ UBaseType_t uxTaskPriorityGetFromISR( const TaskHandle_t xTask ) PRIVILEGED_FUNC
* state of the task might change between the function being called, and the
* functions return value being tested by the calling task.
*/
-eTaskState eTaskGetState( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+#if ( ( INCLUDE_eTaskGetState == 1 ) || ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_xTaskAbortDelay == 1 ) )
+ eTaskState eTaskGetState( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+#endif
/**
* task. h
@@ -1038,10 +1135,12 @@ eTaskState eTaskGetState( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
* \defgroup vTaskGetInfo vTaskGetInfo
* \ingroup TaskCtrl
*/
-void vTaskGetInfo( TaskHandle_t xTask,
- TaskStatus_t * pxTaskStatus,
- BaseType_t xGetFreeStackSpace,
- eTaskState eState ) PRIVILEGED_FUNCTION;
+#if ( configUSE_TRACE_FACILITY == 1 )
+ void vTaskGetInfo( TaskHandle_t xTask,
+ TaskStatus_t * pxTaskStatus,
+ BaseType_t xGetFreeStackSpace,
+ eTaskState eState ) PRIVILEGED_FUNCTION;
+#endif
/**
* task. h
@@ -1223,6 +1322,164 @@ void vTaskResume( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
*/
BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
+#if ( configUSE_CORE_AFFINITY == 1 )
+
+/**
+ * @brief Sets the core affinity mask for a task.
+ *
+ * It sets the cores on which a task can run. configUSE_CORE_AFFINITY must
+ * be defined as 1 for this function to be available.
+ *
+ * @param xTask The handle of the task to set the core affinity mask for.
+ * Passing NULL will set the core affinity mask for the calling task.
+ *
+ * @param uxCoreAffinityMask A bitwise value that indicates the cores on
+ * which the task can run. Cores are numbered from 0 to configNUMBER_OF_CORES - 1.
+ * For example, to ensure that a task can run on core 0 and core 1, set
+ * uxCoreAffinityMask to 0x03.
+ *
+ * Example usage:
+ *
+ * // The function that creates task.
+ * void vAFunction( void )
+ * {
+ * TaskHandle_t xHandle;
+ * UBaseType_t uxCoreAffinityMask;
+ *
+ * // Create a task, storing the handle.
+ * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &( xHandle ) );
+ *
+ * // Define the core affinity mask such that this task can only run
+ * // on core 0 and core 2.
+ * uxCoreAffinityMask = ( ( 1 << 0 ) | ( 1 << 2 ) );
+ *
+ * //Set the core affinity mask for the task.
+ * vTaskCoreAffinitySet( xHandle, uxCoreAffinityMask );
+ * }
+ */
+ void vTaskCoreAffinitySet( const TaskHandle_t xTask,
+ UBaseType_t uxCoreAffinityMask );
+#endif
+
+#if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+
+/**
+ * @brief Gets the core affinity mask for a task.
+ *
+ * configUSE_CORE_AFFINITY must be defined as 1 for this function to be
+ * available.
+ *
+ * @param xTask The handle of the task to get the core affinity mask for.
+ * Passing NULL will get the core affinity mask for the calling task.
+ *
+ * @return The core affinity mask which is a bitwise value that indicates
+ * the cores on which a task can run. Cores are numbered from 0 to
+ * configNUMBER_OF_CORES - 1. For example, if a task can run on core 0 and core 1,
+ * the core affinity mask is 0x03.
+ *
+ * Example usage:
+ *
+ * // Task handle of the networking task - it is populated elsewhere.
+ * TaskHandle_t xNetworkingTaskHandle;
+ *
+ * void vAFunction( void )
+ * {
+ * TaskHandle_t xHandle;
+ * UBaseType_t uxNetworkingCoreAffinityMask;
+ *
+ * // Create a task, storing the handle.
+ * xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &( xHandle ) );
+ *
+ * //Get the core affinity mask for the networking task.
+ * uxNetworkingCoreAffinityMask = vTaskCoreAffinityGet( xNetworkingTaskHandle );
+ *
+ * // Here is a hypothetical scenario, just for the example. Assume that we
+ * // have 2 cores - Core 0 and core 1. We want to pin the application task to
+ * // the core different than the networking task to ensure that the
+ * // application task does not interfere with networking.
+ * if( ( uxNetworkingCoreAffinityMask & ( 1 << 0 ) ) != 0 )
+ * {
+ * // The networking task can run on core 0, pin our task to core 1.
+ * vTaskCoreAffinitySet( xHandle, ( 1 << 1 ) );
+ * }
+ * else
+ * {
+ * // Otherwise, pin our task to core 0.
+ * vTaskCoreAffinitySet( xHandle, ( 1 << 0 ) );
+ * }
+ * }
+ */
+ UBaseType_t vTaskCoreAffinityGet( ConstTaskHandle_t xTask );
+#endif
+
+#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
+
+/**
+ * @brief Disables preemption for a task.
+ *
+ * @param xTask The handle of the task to disable preemption. Passing NULL
+ * disables preemption for the calling task.
+ *
+ * Example usage:
+ *
+ * void vTaskCode( void *pvParameters )
+ * {
+ * // Silence warnings about unused parameters.
+ * ( void ) pvParameters;
+ *
+ * for( ;; )
+ * {
+ * // ... Perform some function here.
+ *
+ * // Disable preemption for this task.
+ * vTaskPreemptionDisable( NULL );
+ *
+ * // The task will not be preempted when it is executing in this portion ...
+ *
+ * // ... until the preemption is enabled again.
+ * vTaskPreemptionEnable( NULL );
+ *
+ * // The task can be preempted when it is executing in this portion.
+ * }
+ * }
+ */
+ void vTaskPreemptionDisable( const TaskHandle_t xTask );
+#endif
+
+#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
+
+/**
+ * @brief Enables preemption for a task.
+ *
+ * @param xTask The handle of the task to enable preemption. Passing NULL
+ * enables preemption for the calling task.
+ *
+ * Example usage:
+ *
+ * void vTaskCode( void *pvParameters )
+ * {
+ * // Silence warnings about unused parameters.
+ * ( void ) pvParameters;
+ *
+ * for( ;; )
+ * {
+ * // ... Perform some function here.
+ *
+ * // Disable preemption for this task.
+ * vTaskPreemptionDisable( NULL );
+ *
+ * // The task will not be preempted when it is executing in this portion ...
+ *
+ * // ... until the preemption is enabled again.
+ * vTaskPreemptionEnable( NULL );
+ *
+ * // The task can be preempted when it is executing in this portion.
+ * }
+ * }
+ */
+ void vTaskPreemptionEnable( const TaskHandle_t xTask );
+#endif
+
/*-----------------------------------------------------------
* SCHEDULER CONTROL
*----------------------------------------------------------*/
@@ -1489,7 +1746,7 @@ UBaseType_t uxTaskGetNumberOfTasks( void ) PRIVILEGED_FUNCTION;
* \defgroup pcTaskGetName pcTaskGetName
* \ingroup TaskUtils
*/
-char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION;
/**
* task. h
@@ -1507,7 +1764,39 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; /*lint !e
* \defgroup pcTaskGetHandle pcTaskGetHandle
* \ingroup TaskUtils
*/
-TaskHandle_t xTaskGetHandle( const char * pcNameToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+#if ( INCLUDE_xTaskGetHandle == 1 )
+ TaskHandle_t xTaskGetHandle( const char * pcNameToQuery ) PRIVILEGED_FUNCTION;
+#endif
+
+/**
+ * task. h
+ * @code{c}
+ * BaseType_t xTaskGetStaticBuffers( TaskHandle_t xTask,
+ * StackType_t ** ppuxStackBuffer,
+ * StaticTask_t ** ppxTaskBuffer );
+ * @endcode
+ *
+ * Retrieve pointers to a statically created task's data structure
+ * buffer and stack buffer. These are the same buffers that are supplied
+ * at the time of creation.
+ *
+ * @param xTask The task for which to retrieve the buffers.
+ *
+ * @param ppuxStackBuffer Used to return a pointer to the task's stack buffer.
+ *
+ * @param ppxTaskBuffer Used to return a pointer to the task's data structure
+ * buffer.
+ *
+ * @return pdTRUE if buffers were retrieved, pdFALSE otherwise.
+ *
+ * \defgroup xTaskGetStaticBuffers xTaskGetStaticBuffers
+ * \ingroup TaskUtils
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ BaseType_t xTaskGetStaticBuffers( TaskHandle_t xTask,
+ StackType_t ** ppuxStackBuffer,
+ StaticTask_t ** ppxTaskBuffer ) PRIVILEGED_FUNCTION;
+#endif /* configSUPPORT_STATIC_ALLOCATION */
/**
* task.h
@@ -1536,7 +1825,9 @@ TaskHandle_t xTaskGetHandle( const char * pcNameToQuery ) PRIVILEGED_FUNCTION; /
* actual spaces on the stack rather than bytes) since the task referenced by
* xTask was created.
*/
-UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+#if ( INCLUDE_uxTaskGetStackHighWaterMark == 1 )
+ UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+#endif
/**
* task.h
@@ -1565,7 +1856,9 @@ UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) PRIVILEGED_FUNCTIO
* actual spaces on the stack rather than bytes) since the task referenced by
* xTask was created.
*/
-configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+#if ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 )
+ configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+#endif
/* When using trace macros it is sometimes necessary to include task.h before
* FreeRTOS.h. When this is done TaskHookFunction_t will not yet have been defined,
@@ -1634,7 +1927,7 @@ configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVIL
/**
* task.h
* @code{c}
- * void vApplicationStackOverflowHook( TaskHandle_t xTask char *pcTaskName);
+ * void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName);
* @endcode
*
* The application stack overflow hook is called when a stack overflow is detected for a task.
@@ -1644,12 +1937,36 @@ configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVIL
* @param xTask the task that just exceeded its stack boundaries.
* @param pcTaskName A character string containing the name of the offending task.
*/
+ /* MISRA Ref 8.6.1 [External linkage] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
+ /* coverity[misra_c_2012_rule_8_6_violation] */
void vApplicationStackOverflowHook( TaskHandle_t xTask,
char * pcTaskName );
#endif
-#if ( configUSE_TICK_HOOK > 0 )
+#if ( configUSE_IDLE_HOOK == 1 )
+
+/**
+ * task.h
+ * @code{c}
+ * void vApplicationIdleHook( void );
+ * @endcode
+ *
+ * The application idle hook is called by the idle task.
+ * This allows the application designer to add background functionality without
+ * the overhead of a separate task.
+ * NOTE: vApplicationIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES, CALL A FUNCTION THAT MIGHT BLOCK.
+ */
+ /* MISRA Ref 8.6.1 [External linkage] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
+ /* coverity[misra_c_2012_rule_8_6_violation] */
+ void vApplicationIdleHook( void );
+
+#endif
+
+
+#if ( configUSE_TICK_HOOK != 0 )
/**
* task.h
@@ -1659,7 +1976,10 @@ configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVIL
*
* This hook function is called in the system tick handler after any OS work is completed.
*/
- void vApplicationTickHook( void ); /*lint !e526 Symbol not defined as it is an application callback. */
+ /* MISRA Ref 8.6.1 [External linkage] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
+ /* coverity[misra_c_2012_rule_8_6_violation] */
+ void vApplicationTickHook( void );
#endif
@@ -1668,7 +1988,7 @@ configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVIL
/**
* task.h
* @code{c}
- * void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer, StackType_t ** ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize )
+ * void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer, StackType_t ** ppxIdleTaskStackBuffer, configSTACK_DEPTH_TYPE * puxIdleTaskStackSize )
* @endcode
*
* This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Idle Task TCB. This function is required when
@@ -1676,12 +1996,43 @@ configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVIL
*
* @param ppxIdleTaskTCBBuffer A handle to a statically allocated TCB buffer
* @param ppxIdleTaskStackBuffer A handle to a statically allocated Stack buffer for the idle task
- * @param pulIdleTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
+ * @param puxIdleTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
*/
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
StackType_t ** ppxIdleTaskStackBuffer,
- uint32_t * pulIdleTaskStackSize ); /*lint !e526 Symbol not defined as it is an application callback. */
-#endif
+ configSTACK_DEPTH_TYPE * puxIdleTaskStackSize );
+
+/**
+ * task.h
+ * @code{c}
+ * void vApplicationGetPassiveIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer, StackType_t ** ppxIdleTaskStackBuffer, configSTACK_DEPTH_TYPE * puxIdleTaskStackSize, BaseType_t xCoreID )
+ * @endcode
+ *
+ * This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Idle Tasks TCB. This function is required when
+ * configSUPPORT_STATIC_ALLOCATION is set. For more information see this URI: https://www.FreeRTOS.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
+ *
+ * In the FreeRTOS SMP, there are a total of configNUMBER_OF_CORES idle tasks:
+ * 1. 1 Active idle task which does all the housekeeping.
+ * 2. ( configNUMBER_OF_CORES - 1 ) Passive idle tasks which do nothing.
+ * These idle tasks are created to ensure that each core has an idle task to run when
+ * no other task is available to run.
+ *
+ * The function vApplicationGetPassiveIdleTaskMemory is called with passive idle
+ * task index 0, 1 ... ( configNUMBER_OF_CORES - 2 ) to get memory for passive idle
+ * tasks.
+ *
+ * @param ppxIdleTaskTCBBuffer A handle to a statically allocated TCB buffer
+ * @param ppxIdleTaskStackBuffer A handle to a statically allocated Stack buffer for the idle task
+ * @param puxIdleTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
+ * @param xPassiveIdleTaskIndex The passive idle task index of the idle task buffer
+ */
+ #if ( configNUMBER_OF_CORES > 1 )
+ void vApplicationGetPassiveIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
+ StackType_t ** ppxIdleTaskStackBuffer,
+ configSTACK_DEPTH_TYPE * puxIdleTaskStackSize,
+ BaseType_t xPassiveIdleTaskIndex );
+ #endif /* #if ( configNUMBER_OF_CORES > 1 ) */
+#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/**
* task.h
@@ -1696,17 +2047,35 @@ configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVIL
* wants. The return value is the value returned by the task hook function
* registered by the user.
*/
-BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask,
- void * pvParameter ) PRIVILEGED_FUNCTION;
+#if ( configUSE_APPLICATION_TASK_TAG == 1 )
+ BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask,
+ void * pvParameter ) PRIVILEGED_FUNCTION;
+#endif
/**
* xTaskGetIdleTaskHandle() is only available if
* INCLUDE_xTaskGetIdleTaskHandle is set to 1 in FreeRTOSConfig.h.
*
- * Simply returns the handle of the idle task. It is not valid to call
- * xTaskGetIdleTaskHandle() before the scheduler has been started.
+ * In single-core FreeRTOS, this function simply returns the handle of the idle
+ * task. It is not valid to call xTaskGetIdleTaskHandle() before the scheduler
+ * has been started.
+ *
+ * In the FreeRTOS SMP, there are a total of configNUMBER_OF_CORES idle tasks:
+ * 1. 1 Active idle task which does all the housekeeping.
+ * 2. ( configNUMBER_OF_CORES - 1 ) Passive idle tasks which do nothing.
+ * These idle tasks are created to ensure that each core has an idle task to run when
+ * no other task is available to run. Call xTaskGetIdleTaskHandle() or
+ * xTaskGetIdleTaskHandleForCore() with xCoreID set to 0 to get the Active
+ * idle task handle. Call xTaskGetIdleTaskHandleForCore() with xCoreID set to
+ * 1,2 ... ( configNUMBER_OF_CORES - 1 ) to get the Passive idle task handles.
*/
-TaskHandle_t xTaskGetIdleTaskHandle( void ) PRIVILEGED_FUNCTION;
+#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 )
+ #if ( configNUMBER_OF_CORES == 1 )
+ TaskHandle_t xTaskGetIdleTaskHandle( void ) PRIVILEGED_FUNCTION;
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+
+ TaskHandle_t xTaskGetIdleTaskHandleForCore( BaseType_t xCoreID ) PRIVILEGED_FUNCTION;
+#endif /* #if ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) */
/**
* configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for
@@ -1770,7 +2139,7 @@ TaskHandle_t xTaskGetIdleTaskHandle( void ) PRIVILEGED_FUNCTION;
* uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalRunTime );
*
* // For percentage calculations.
- * ulTotalRunTime /= 100UL;
+ * ulTotalRunTime /= 100U;
*
* // Avoid divide by zero errors.
* if( ulTotalRunTime > 0 )
@@ -1784,7 +2153,7 @@ TaskHandle_t xTaskGetIdleTaskHandle( void ) PRIVILEGED_FUNCTION;
* // ulTotalRunTimeDiv100 has already been divided by 100.
* ulStatsAsPercentage = pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalRunTime;
*
- * if( ulStatsAsPercentage > 0UL )
+ * if( ulStatsAsPercentage > 0U )
* {
* sprintf( pcWriteBuffer, "%s\t\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter, ulStatsAsPercentage );
* }
@@ -1805,9 +2174,67 @@ TaskHandle_t xTaskGetIdleTaskHandle( void ) PRIVILEGED_FUNCTION;
* }
* @endcode
*/
-UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
- const UBaseType_t uxArraySize,
- configRUN_TIME_COUNTER_TYPE * const pulTotalRunTime ) PRIVILEGED_FUNCTION;
+#if ( configUSE_TRACE_FACILITY == 1 )
+ UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
+ const UBaseType_t uxArraySize,
+ configRUN_TIME_COUNTER_TYPE * const pulTotalRunTime ) PRIVILEGED_FUNCTION;
+#endif
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskListTasks( char *pcWriteBuffer, size_t uxBufferLength );
+ * @endcode
+ *
+ * configUSE_TRACE_FACILITY and configUSE_STATS_FORMATTING_FUNCTIONS must
+ * both be defined as 1 for this function to be available. See the
+ * configuration section of the FreeRTOS.org website for more information.
+ *
+ * NOTE 1: This function will disable interrupts for its duration. It is
+ * not intended for normal application runtime use but as a debug aid.
+ *
+ * Lists all the current tasks, along with their current state and stack
+ * usage high water mark.
+ *
+ * Tasks are reported as blocked ('B'), ready ('R'), deleted ('D') or
+ * suspended ('S').
+ *
+ * PLEASE NOTE:
+ *
+ * This function is provided for convenience only, and is used by many of the
+ * demo applications. Do not consider it to be part of the scheduler.
+ *
+ * vTaskListTasks() calls uxTaskGetSystemState(), then formats part of the
+ * uxTaskGetSystemState() output into a human readable table that displays task:
+ * names, states, priority, stack usage and task number.
+ * Stack usage specified as the number of unused StackType_t words stack can hold
+ * on top of stack - not the number of bytes.
+ *
+ * vTaskListTasks() has a dependency on the snprintf() C library function that might
+ * bloat the code size, use a lot of stack, and provide different results on
+ * different platforms. An alternative, tiny, third party, and limited
+ * functionality implementation of snprintf() is provided in many of the
+ * FreeRTOS/Demo sub-directories in a file called printf-stdarg.c (note
+ * printf-stdarg.c does not provide a full snprintf() implementation!).
+ *
+ * It is recommended that production systems call uxTaskGetSystemState()
+ * directly to get access to raw stats data, rather than indirectly through a
+ * call to vTaskListTasks().
+ *
+ * @param pcWriteBuffer A buffer into which the above mentioned details
+ * will be written, in ASCII form. This buffer is assumed to be large
+ * enough to contain the generated report. Approximately 40 bytes per
+ * task should be sufficient.
+ *
+ * @param uxBufferLength Length of the pcWriteBuffer.
+ *
+ * \defgroup vTaskListTasks vTaskListTasks
+ * \ingroup TaskUtils
+ */
+#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )
+ void vTaskListTasks( char * pcWriteBuffer,
+ size_t uxBufferLength ) PRIVILEGED_FUNCTION;
+#endif
/**
* task. h
@@ -1819,6 +2246,11 @@ UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
* both be defined as 1 for this function to be available. See the
* configuration section of the FreeRTOS.org website for more information.
*
+ * WARN: This function assumes that the pcWriteBuffer is of length
+ * configSTATS_BUFFER_MAX_LENGTH. This function is there only for
+ * backward compatibility. New applications are recommended to
+ * use vTaskListTasks and supply the length of the pcWriteBuffer explicitly.
+ *
* NOTE 1: This function will disable interrupts for its duration. It is
* not intended for normal application runtime use but as a debug aid.
*
@@ -1839,10 +2271,10 @@ UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
* Stack usage specified as the number of unused StackType_t words stack can hold
* on top of stack - not the number of bytes.
*
- * vTaskList() has a dependency on the sprintf() C library function that might
+ * vTaskList() has a dependency on the snprintf() C library function that might
* bloat the code size, use a lot of stack, and provide different results on
* different platforms. An alternative, tiny, third party, and limited
- * functionality implementation of sprintf() is provided in many of the
+ * functionality implementation of snprintf() is provided in many of the
* FreeRTOS/Demo sub-directories in a file called printf-stdarg.c (note
* printf-stdarg.c does not provide a full snprintf() implementation!).
*
@@ -1858,7 +2290,68 @@ UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
* \defgroup vTaskList vTaskList
* \ingroup TaskUtils
*/
-void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+#define vTaskList( pcWriteBuffer ) vTaskListTasks( ( pcWriteBuffer ), configSTATS_BUFFER_MAX_LENGTH )
+
+/**
+ * task. h
+ * @code{c}
+ * void vTaskGetRunTimeStatistics( char *pcWriteBuffer, size_t uxBufferLength );
+ * @endcode
+ *
+ * configGENERATE_RUN_TIME_STATS and configUSE_STATS_FORMATTING_FUNCTIONS
+ * must both be defined as 1 for this function to be available. The application
+ * must also then provide definitions for
+ * portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and portGET_RUN_TIME_COUNTER_VALUE()
+ * to configure a peripheral timer/counter and return the timers current count
+ * value respectively. The counter should be at least 10 times the frequency of
+ * the tick count.
+ *
+ * NOTE 1: This function will disable interrupts for its duration. It is
+ * not intended for normal application runtime use but as a debug aid.
+ *
+ * Setting configGENERATE_RUN_TIME_STATS to 1 will result in a total
+ * accumulated execution time being stored for each task. The resolution
+ * of the accumulated time value depends on the frequency of the timer
+ * configured by the portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() macro.
+ * Calling vTaskGetRunTimeStatistics() writes the total execution time of each
+ * task into a buffer, both as an absolute count value and as a percentage
+ * of the total system execution time.
+ *
+ * NOTE 2:
+ *
+ * This function is provided for convenience only, and is used by many of the
+ * demo applications. Do not consider it to be part of the scheduler.
+ *
+ * vTaskGetRunTimeStatistics() calls uxTaskGetSystemState(), then formats part of
+ * the uxTaskGetSystemState() output into a human readable table that displays the
+ * amount of time each task has spent in the Running state in both absolute and
+ * percentage terms.
+ *
+ * vTaskGetRunTimeStatistics() has a dependency on the snprintf() C library function
+ * that might bloat the code size, use a lot of stack, and provide different
+ * results on different platforms. An alternative, tiny, third party, and
+ * limited functionality implementation of snprintf() is provided in many of the
+ * FreeRTOS/Demo sub-directories in a file called printf-stdarg.c (note
+ * printf-stdarg.c does not provide a full snprintf() implementation!).
+ *
+ * It is recommended that production systems call uxTaskGetSystemState() directly
+ * to get access to raw stats data, rather than indirectly through a call to
+ * vTaskGetRunTimeStatistics().
+ *
+ * @param pcWriteBuffer A buffer into which the execution times will be
+ * written, in ASCII form. This buffer is assumed to be large enough to
+ * contain the generated report. Approximately 40 bytes per task should
+ * be sufficient.
+ *
+ * @param uxBufferLength Length of the pcWriteBuffer.
+ *
+ * \defgroup vTaskGetRunTimeStatistics vTaskGetRunTimeStatistics
+ * \ingroup TaskUtils
+ */
+#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configUSE_TRACE_FACILITY == 1 ) )
+ void vTaskGetRunTimeStatistics( char * pcWriteBuffer,
+ size_t uxBufferLength ) PRIVILEGED_FUNCTION;
+#endif
/**
* task. h
@@ -1874,6 +2367,12 @@ void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unquali
* value respectively. The counter should be at least 10 times the frequency of
* the tick count.
*
+ * WARN: This function assumes that the pcWriteBuffer is of length
+ * configSTATS_BUFFER_MAX_LENGTH. This function is there only for
+ * backward compatiblity. New applications are recommended to use
+ * vTaskGetRunTimeStatistics and supply the length of the pcWriteBuffer
+ * explicitly.
+ *
* NOTE 1: This function will disable interrupts for its duration. It is
* not intended for normal application runtime use but as a debug aid.
*
@@ -1895,10 +2394,10 @@ void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unquali
* amount of time each task has spent in the Running state in both absolute and
* percentage terms.
*
- * vTaskGetRunTimeStats() has a dependency on the sprintf() C library function
+ * vTaskGetRunTimeStats() has a dependency on the snprintf() C library function
* that might bloat the code size, use a lot of stack, and provide different
* results on different platforms. An alternative, tiny, third party, and
- * limited functionality implementation of sprintf() is provided in many of the
+ * limited functionality implementation of snprintf() is provided in many of the
* FreeRTOS/Demo sub-directories in a file called printf-stdarg.c (note
* printf-stdarg.c does not provide a full snprintf() implementation!).
*
@@ -1914,7 +2413,45 @@ void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unquali
* \defgroup vTaskGetRunTimeStats vTaskGetRunTimeStats
* \ingroup TaskUtils
*/
-void vTaskGetRunTimeStats( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+#define vTaskGetRunTimeStats( pcWriteBuffer ) vTaskGetRunTimeStatistics( ( pcWriteBuffer ), configSTATS_BUFFER_MAX_LENGTH )
+
+/**
+ * task. h
+ * @code{c}
+ * configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimeCounter( const TaskHandle_t xTask );
+ * configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimePercent( const TaskHandle_t xTask );
+ * @endcode
+ *
+ * configGENERATE_RUN_TIME_STATS must be defined as 1 for these functions to be
+ * available. The application must also then provide definitions for
+ * portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and
+ * portGET_RUN_TIME_COUNTER_VALUE() to configure a peripheral timer/counter and
+ * return the timers current count value respectively. The counter should be
+ * at least 10 times the frequency of the tick count.
+ *
+ * Setting configGENERATE_RUN_TIME_STATS to 1 will result in a total
+ * accumulated execution time being stored for each task. The resolution
+ * of the accumulated time value depends on the frequency of the timer
+ * configured by the portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() macro.
+ * While uxTaskGetSystemState() and vTaskGetRunTimeStats() writes the total
+ * execution time of each task into a buffer, ulTaskGetRunTimeCounter()
+ * returns the total execution time of just one task and
+ * ulTaskGetRunTimePercent() returns the percentage of the CPU time used by
+ * just one task.
+ *
+ * @return The total run time of the given task or the percentage of the total
+ * run time consumed by the given task. This is the amount of time the task
+ * has actually been executing. The unit of time is dependent on the frequency
+ * configured using the portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and
+ * portGET_RUN_TIME_COUNTER_VALUE() macros.
+ *
+ * \defgroup ulTaskGetRunTimeCounter ulTaskGetRunTimeCounter
+ * \ingroup TaskUtils
+ */
+#if ( configGENERATE_RUN_TIME_STATS == 1 )
+ configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimeCounter( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+ configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimePercent( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+#endif
/**
* task. h
@@ -1923,13 +2460,12 @@ void vTaskGetRunTimeStats( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e
* configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercent( void );
* @endcode
*
- * configGENERATE_RUN_TIME_STATS, configUSE_STATS_FORMATTING_FUNCTIONS and
- * INCLUDE_xTaskGetIdleTaskHandle must all be defined as 1 for these functions
- * to be available. The application must also then provide definitions for
- * portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and portGET_RUN_TIME_COUNTER_VALUE()
- * to configure a peripheral timer/counter and return the timers current count
- * value respectively. The counter should be at least 10 times the frequency of
- * the tick count.
+ * configGENERATE_RUN_TIME_STATS must be defined as 1 for these functions to be
+ * available. The application must also then provide definitions for
+ * portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and
+ * portGET_RUN_TIME_COUNTER_VALUE() to configure a peripheral timer/counter and
+ * return the timers current count value respectively. The counter should be
+ * at least 10 times the frequency of the tick count.
*
* Setting configGENERATE_RUN_TIME_STATS to 1 will result in a total
* accumulated execution time being stored for each task. The resolution
@@ -1954,8 +2490,10 @@ void vTaskGetRunTimeStats( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e
* \defgroup ulTaskGetIdleRunTimeCounter ulTaskGetIdleRunTimeCounter
* \ingroup TaskUtils
*/
-configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimeCounter( void ) PRIVILEGED_FUNCTION;
-configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercent( void ) PRIVILEGED_FUNCTION;
+#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) )
+ configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimeCounter( void ) PRIVILEGED_FUNCTION;
+ configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercent( void ) PRIVILEGED_FUNCTION;
+#endif
/**
* task. h
@@ -2325,7 +2863,7 @@ BaseType_t xTaskGenericNotifyFromISR( TaskHandle_t xTaskToNotify,
* will be cleared in the calling task's notification value before the task
* checks to see if any notifications are pending, and optionally blocks if no
* notifications are pending. Setting ulBitsToClearOnEntry to ULONG_MAX (if
- * limits.h is included) or 0xffffffffUL (if limits.h is not included) will have
+ * limits.h is included) or 0xffffffffU (if limits.h is not included) will have
* the effect of resetting the task's notification value to 0. Setting
* ulBitsToClearOnEntry to 0 will leave the task's notification value unchanged.
*
@@ -2901,11 +3439,31 @@ BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
*/
BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) PRIVILEGED_FUNCTION;
+/**
+ * task.h
+ * @code{c}
+ * void vTaskResetState( void );
+ * @endcode
+ *
+ * This function resets the internal state of the task. It must be called by the
+ * application before restarting the scheduler.
+ *
+ * \defgroup vTaskResetState vTaskResetState
+ * \ingroup SchedulerControl
+ */
+void vTaskResetState( void ) PRIVILEGED_FUNCTION;
+
/*-----------------------------------------------------------
* SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES
*----------------------------------------------------------*/
+#if ( configNUMBER_OF_CORES == 1 )
+ #define taskYIELD_WITHIN_API() portYIELD_WITHIN_API()
+#else /* #if ( configNUMBER_OF_CORES == 1 ) */
+ #define taskYIELD_WITHIN_API() vTaskYieldWithinAPI()
+#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+
/*
* THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
* INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
@@ -3011,7 +3569,11 @@ void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
* Sets the pointer to the current TCB to the TCB of the highest priority task
* that is ready to run.
*/
-portDONT_DISCARD void vTaskSwitchContext( void ) PRIVILEGED_FUNCTION;
+#if ( configNUMBER_OF_CORES == 1 )
+ portDONT_DISCARD void vTaskSwitchContext( void ) PRIVILEGED_FUNCTION;
+#else
+ portDONT_DISCARD void vTaskSwitchContext( BaseType_t xCoreID ) PRIVILEGED_FUNCTION;
+#endif
/*
* THESE FUNCTIONS MUST NOT BE USED FROM APPLICATION CODE. THEY ARE USED BY
@@ -3024,6 +3586,11 @@ TickType_t uxTaskResetEventItemValue( void ) PRIVILEGED_FUNCTION;
*/
TaskHandle_t xTaskGetCurrentTaskHandle( void ) PRIVILEGED_FUNCTION;
+/*
+ * Return the handle of the task running on specified core.
+ */
+TaskHandle_t xTaskGetCurrentTaskHandleForCore( BaseType_t xCoreID ) PRIVILEGED_FUNCTION;
+
/*
* Shortcut used by the queue implementation to prevent unnecessary call to
* taskYIELD();
@@ -3062,14 +3629,18 @@ void vTaskPriorityDisinheritAfterTimeout( TaskHandle_t const pxMutexHolder,
/*
* Get the uxTaskNumber assigned to the task referenced by the xTask parameter.
*/
-UBaseType_t uxTaskGetTaskNumber( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+#if ( configUSE_TRACE_FACILITY == 1 )
+ UBaseType_t uxTaskGetTaskNumber( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+#endif
/*
* Set the uxTaskNumber of the task referenced by the xTask parameter to
* uxHandle.
*/
-void vTaskSetTaskNumber( TaskHandle_t xTask,
- const UBaseType_t uxHandle ) PRIVILEGED_FUNCTION;
+#if ( configUSE_TRACE_FACILITY == 1 )
+ void vTaskSetTaskNumber( TaskHandle_t xTask,
+ const UBaseType_t uxHandle ) PRIVILEGED_FUNCTION;
+#endif
/*
* Only available when configUSE_TICKLESS_IDLE is set to 1.
@@ -3079,7 +3650,9 @@ void vTaskSetTaskNumber( TaskHandle_t xTask,
* to date with the actual execution time by being skipped forward by a time
* equal to the idle period.
*/
-void vTaskStepTick( TickType_t xTicksToJump ) PRIVILEGED_FUNCTION;
+#if ( configUSE_TICKLESS_IDLE != 0 )
+ void vTaskStepTick( TickType_t xTicksToJump ) PRIVILEGED_FUNCTION;
+#endif
/*
* Only available when configUSE_TICKLESS_IDLE is set to 1.
@@ -3095,7 +3668,9 @@ void vTaskStepTick( TickType_t xTicksToJump ) PRIVILEGED_FUNCTION;
* critical section between the timer being stopped and the sleep mode being
* entered to ensure it is ok to proceed into the sleep mode.
*/
-eSleepModeStatus eTaskConfirmSleepModeStatus( void ) PRIVILEGED_FUNCTION;
+#if ( configUSE_TICKLESS_IDLE != 0 )
+ eSleepModeStatus eTaskConfirmSleepModeStatus( void ) PRIVILEGED_FUNCTION;
+#endif
/*
* For internal use only. Increment the mutex held count when a mutex is
@@ -3109,6 +3684,87 @@ TaskHandle_t pvTaskIncrementMutexHeldCount( void ) PRIVILEGED_FUNCTION;
*/
void vTaskInternalSetTimeOutState( TimeOut_t * const pxTimeOut ) PRIVILEGED_FUNCTION;
+/*
+ * For internal use only. Same as portYIELD_WITHIN_API() in single core FreeRTOS.
+ * For SMP this is not defined by the port.
+ */
+#if ( configNUMBER_OF_CORES > 1 )
+ void vTaskYieldWithinAPI( void );
+#endif
+
+/*
+ * This function is only intended for use when implementing a port of the scheduler
+ * and is only available when portCRITICAL_NESTING_IN_TCB is set to 1 or configNUMBER_OF_CORES
+ * is greater than 1. This function can be used in the implementation of portENTER_CRITICAL
+ * if port wants to maintain critical nesting count in TCB in single core FreeRTOS.
+ * It should be used in the implementation of portENTER_CRITICAL if port is running a
+ * multiple core FreeRTOS.
+ */
+#if ( ( portCRITICAL_NESTING_IN_TCB == 1 ) || ( configNUMBER_OF_CORES > 1 ) )
+ void vTaskEnterCritical( void );
+#endif
+
+/*
+ * This function is only intended for use when implementing a port of the scheduler
+ * and is only available when portCRITICAL_NESTING_IN_TCB is set to 1 or configNUMBER_OF_CORES
+ * is greater than 1. This function can be used in the implementation of portEXIT_CRITICAL
+ * if port wants to maintain critical nesting count in TCB in single core FreeRTOS.
+ * It should be used in the implementation of portEXIT_CRITICAL if port is running a
+ * multiple core FreeRTOS.
+ */
+#if ( ( portCRITICAL_NESTING_IN_TCB == 1 ) || ( configNUMBER_OF_CORES > 1 ) )
+ void vTaskExitCritical( void );
+#endif
+
+/*
+ * This function is only intended for use when implementing a port of the scheduler
+ * and is only available when configNUMBER_OF_CORES is greater than 1. This function
+ * should be used in the implementation of portENTER_CRITICAL_FROM_ISR if port is
+ * running a multiple core FreeRTOS.
+ */
+#if ( configNUMBER_OF_CORES > 1 )
+ UBaseType_t vTaskEnterCriticalFromISR( void );
+#endif
+
+/*
+ * This function is only intended for use when implementing a port of the scheduler
+ * and is only available when configNUMBER_OF_CORES is greater than 1. This function
+ * should be used in the implementation of portEXIT_CRITICAL_FROM_ISR if port is
+ * running a multiple core FreeRTOS.
+ */
+#if ( configNUMBER_OF_CORES > 1 )
+ void vTaskExitCriticalFromISR( UBaseType_t uxSavedInterruptStatus );
+#endif
+
+#if ( portUSING_MPU_WRAPPERS == 1 )
+
+/*
+ * For internal use only. Get MPU settings associated with a task.
+ */
+ xMPU_SETTINGS * xTaskGetMPUSettings( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
+
+#endif /* portUSING_MPU_WRAPPERS */
+
+
+#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configENABLE_ACCESS_CONTROL_LIST == 1 ) )
+
+/*
+ * For internal use only. Grant/Revoke a task's access to a kernel object.
+ */
+ void vGrantAccessToKernelObject( TaskHandle_t xExternalTaskHandle,
+ int32_t lExternalKernelObjectHandle ) PRIVILEGED_FUNCTION;
+ void vRevokeAccessToKernelObject( TaskHandle_t xExternalTaskHandle,
+ int32_t lExternalKernelObjectHandle ) PRIVILEGED_FUNCTION;
+
+/*
+ * For internal use only. Grant/Revoke a task's access to a kernel object.
+ */
+ void vPortGrantAccessToKernelObject( TaskHandle_t xInternalTaskHandle,
+ int32_t lInternalIndexOfKernelObject ) PRIVILEGED_FUNCTION;
+ void vPortRevokeAccessToKernelObject( TaskHandle_t xInternalTaskHandle,
+ int32_t lInternalIndexOfKernelObject ) PRIVILEGED_FUNCTION;
+
+#endif /* #if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configENABLE_ACCESS_CONTROL_LIST == 1 ) ) */
/* *INDENT-OFF* */
#ifdef __cplusplus
diff --git a/third-party/freertos/include/timers.h b/third-party/freertos/include/timers.h
index 4b73908bd1b2dddd3a11564833b8e4e64de9621f..e12a424e84640adf75bcf0f642822caa33a8e135 100644
--- a/third-party/freertos/include/timers.h
+++ b/third-party/freertos/include/timers.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -34,10 +34,8 @@
#error "include FreeRTOS.h must appear in source files before include timers.h"
#endif
-/*lint -save -e537 This headers are only multiply included if the application code
- * happens to also be including task.h. */
#include "task.h"
-/*lint -restore */
+
/* *INDENT-OFF* */
#ifdef __cplusplus
@@ -88,8 +86,8 @@ typedef void (* TimerCallbackFunction_t)( TimerHandle_t xTimer );
* Defines the prototype to which functions used with the
* xTimerPendFunctionCallFromISR() function must conform.
*/
-typedef void (* PendedFunction_t)( void *,
- uint32_t );
+typedef void (* PendedFunction_t)( void * arg1,
+ uint32_t arg2 );
/**
* TimerHandle_t xTimerCreate( const char * const pcTimerName,
@@ -229,7 +227,7 @@ typedef void (* PendedFunction_t)( void *,
* @endverbatim
*/
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
- TimerHandle_t xTimerCreate( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ TimerHandle_t xTimerCreate( const char * const pcTimerName,
const TickType_t xTimerPeriodInTicks,
const BaseType_t xAutoReload,
void * const pvTimerID,
@@ -359,7 +357,7 @@ typedef void (* PendedFunction_t)( void *,
* @endverbatim
*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
- TimerHandle_t xTimerCreateStatic( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ TimerHandle_t xTimerCreateStatic( const char * const pcTimerName,
const TickType_t xTimerPeriodInTicks,
const BaseType_t xAutoReload,
void * const pvTimerID,
@@ -1198,10 +1196,12 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
* }
* @endverbatim
*/
-BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend,
- void * pvParameter1,
- uint32_t ulParameter2,
- BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+#if ( INCLUDE_xTimerPendFunctionCall == 1 )
+ BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend,
+ void * pvParameter1,
+ uint32_t ulParameter2,
+ BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
+#endif
/**
* BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
@@ -1235,10 +1235,12 @@ BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend,
* timer daemon task, otherwise pdFALSE is returned.
*
*/
-BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
- void * pvParameter1,
- uint32_t ulParameter2,
- TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+#if ( INCLUDE_xTimerPendFunctionCall == 1 )
+ BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
+ void * pvParameter1,
+ uint32_t ulParameter2,
+ TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+#endif
/**
* const char * const pcTimerGetName( TimerHandle_t xTimer );
@@ -1249,7 +1251,7 @@ BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
*
* @return The name assigned to the timer specified by the xTimer parameter.
*/
-const char * pcTimerGetName( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+const char * pcTimerGetName( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
/**
* void vTimerSetReloadMode( TimerHandle_t xTimer, const BaseType_t xAutoReload );
@@ -1323,17 +1325,54 @@ TickType_t xTimerGetPeriod( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
*/
TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
+/**
+ * BaseType_t xTimerGetStaticBuffer( TimerHandle_t xTimer,
+ * StaticTimer_t ** ppxTimerBuffer );
+ *
+ * Retrieve pointer to a statically created timer's data structure
+ * buffer. This is the same buffer that is supplied at the time of
+ * creation.
+ *
+ * @param xTimer The timer for which to retrieve the buffer.
+ *
+ * @param ppxTaskBuffer Used to return a pointer to the timers's data
+ * structure buffer.
+ *
+ * @return pdTRUE if the buffer was retrieved, pdFALSE otherwise.
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ BaseType_t xTimerGetStaticBuffer( TimerHandle_t xTimer,
+ StaticTimer_t ** ppxTimerBuffer ) PRIVILEGED_FUNCTION;
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+
/*
* Functions beyond this part are not part of the public API and are intended
* for use by the kernel only.
*/
BaseType_t xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION;
-BaseType_t xTimerGenericCommand( TimerHandle_t xTimer,
- const BaseType_t xCommandID,
- const TickType_t xOptionalValue,
- BaseType_t * const pxHigherPriorityTaskWoken,
- const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+/*
+ * Splitting the xTimerGenericCommand into two sub functions and making it a macro
+ * removes a recursion path when called from ISRs. This is primarily for the XCore
+ * XCC port which detects the recursion path and throws an error during compilation
+ * when this is not split.
+ */
+BaseType_t xTimerGenericCommandFromTask( TimerHandle_t xTimer,
+ const BaseType_t xCommandID,
+ const TickType_t xOptionalValue,
+ BaseType_t * const pxHigherPriorityTaskWoken,
+ const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+BaseType_t xTimerGenericCommandFromISR( TimerHandle_t xTimer,
+ const BaseType_t xCommandID,
+ const TickType_t xOptionalValue,
+ BaseType_t * const pxHigherPriorityTaskWoken,
+ const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+#define xTimerGenericCommand( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait ) \
+ ( ( xCommandID ) < tmrFIRST_FROM_ISR_COMMAND ? \
+ xTimerGenericCommandFromTask( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait ) : \
+ xTimerGenericCommandFromISR( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait ) )
#if ( configUSE_TRACE_FACILITY == 1 )
void vTimerSetTimerNumber( TimerHandle_t xTimer,
UBaseType_t uxTimerNumber ) PRIVILEGED_FUNCTION;
@@ -1345,7 +1384,7 @@ BaseType_t xTimerGenericCommand( TimerHandle_t xTimer,
/**
* task.h
* @code{c}
- * void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize )
+ * void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, configSTACK_DEPTH_TYPE * puxTimerTaskStackSize )
* @endcode
*
* This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Timer Task TCB. This function is required when
@@ -1353,14 +1392,37 @@ BaseType_t xTimerGenericCommand( TimerHandle_t xTimer,
*
* @param ppxTimerTaskTCBBuffer A handle to a statically allocated TCB buffer
* @param ppxTimerTaskStackBuffer A handle to a statically allocated Stack buffer for the idle task
- * @param pulTimerTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
+ * @param puxTimerTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
*/
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
StackType_t ** ppxTimerTaskStackBuffer,
- uint32_t * pulTimerTaskStackSize );
+ configSTACK_DEPTH_TYPE * puxTimerTaskStackSize );
+
+#endif
+
+#if ( configUSE_DAEMON_TASK_STARTUP_HOOK != 0 )
+
+/**
+ * timers.h
+ * @code{c}
+ * void vApplicationDaemonTaskStartupHook( void );
+ * @endcode
+ *
+ * This hook function is called form the timer task once when the task starts running.
+ */
+ /* MISRA Ref 8.6.1 [External linkage] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
+ /* coverity[misra_c_2012_rule_8_6_violation] */
+ void vApplicationDaemonTaskStartupHook( void );
#endif
+/*
+ * This function resets the internal state of the timer module. It must be called
+ * by the application before restarting the scheduler.
+ */
+void vTimerResetState( void ) PRIVILEGED_FUNCTION;
+
/* *INDENT-OFF* */
#ifdef __cplusplus
}
diff --git a/third-party/freertos/list.c b/third-party/freertos/list.c
index 0f4f42e4023868c916b94dbffa5b297cd60ee9bb..622710644fdc429482704070e803f738e4d02e5a 100644
--- a/third-party/freertos/list.c
+++ b/third-party/freertos/list.c
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -37,11 +37,10 @@
#include "FreeRTOS.h"
#include "list.h"
-/* Lint e9021, e961 and e750 are suppressed as a MISRA exception justified
- * because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be
+/* The MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be
* defined for the header files above, but not in this file, in order to
* generate the correct privileged Vs unprivileged linkage and placement. */
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/*-----------------------------------------------------------
* PUBLIC LIST API documented in list.h
@@ -49,10 +48,12 @@
void vListInitialise( List_t * const pxList )
{
+ traceENTER_vListInitialise( pxList );
+
/* The list structure contains a list item which is used to mark the
* end of the list. To initialise the list the list end is inserted
* as the only list entry. */
- pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
+ pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd );
listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( &( pxList->xListEnd ) );
@@ -62,8 +63,8 @@ void vListInitialise( List_t * const pxList )
/* The list end next and previous pointers point to itself so we know
* when the list is empty. */
- pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
- pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
+ pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd );
+ pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd );
/* Initialize the remaining fields of xListEnd when it is a proper ListItem_t */
#if ( configUSE_MINI_LIST_ITEM == 0 )
@@ -80,11 +81,15 @@ void vListInitialise( List_t * const pxList )
* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList );
listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList );
+
+ traceRETURN_vListInitialise();
}
/*-----------------------------------------------------------*/
void vListInitialiseItem( ListItem_t * const pxItem )
{
+ traceENTER_vListInitialiseItem( pxItem );
+
/* Make sure the list item is not recorded as being on a list. */
pxItem->pxContainer = NULL;
@@ -92,6 +97,8 @@ void vListInitialiseItem( ListItem_t * const pxItem )
* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
+
+ traceRETURN_vListInitialiseItem();
}
/*-----------------------------------------------------------*/
@@ -100,6 +107,8 @@ void vListInsertEnd( List_t * const pxList,
{
ListItem_t * const pxIndex = pxList->pxIndex;
+ traceENTER_vListInsertEnd( pxList, pxNewListItem );
+
/* Only effective when configASSERT() is also defined, these tests may catch
* the list data structures being overwritten in memory. They will not catch
* data errors caused by incorrect configuration or use of FreeRTOS. */
@@ -121,7 +130,9 @@ void vListInsertEnd( List_t * const pxList,
/* Remember which list the item is in. */
pxNewListItem->pxContainer = pxList;
- ( pxList->uxNumberOfItems )++;
+ ( pxList->uxNumberOfItems ) = ( UBaseType_t ) ( pxList->uxNumberOfItems + 1U );
+
+ traceRETURN_vListInsertEnd();
}
/*-----------------------------------------------------------*/
@@ -131,6 +142,8 @@ void vListInsert( List_t * const pxList,
ListItem_t * pxIterator;
const TickType_t xValueOfInsertion = pxNewListItem->xItemValue;
+ traceENTER_vListInsert( pxList, pxNewListItem );
+
/* Only effective when configASSERT() is also defined, these tests may catch
* the list data structures being overwritten in memory. They will not catch
* data errors caused by incorrect configuration or use of FreeRTOS. */
@@ -176,7 +189,7 @@ void vListInsert( List_t * const pxList,
* configMAX_SYSCALL_INTERRUPT_PRIORITY.
**********************************************************************/
- for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. *//*lint !e440 The iterator moves to a different value, not xValueOfInsertion. */
+ for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext )
{
/* There is nothing to do here, just iterating to the wanted
* insertion position. */
@@ -192,16 +205,21 @@ void vListInsert( List_t * const pxList,
* item later. */
pxNewListItem->pxContainer = pxList;
- ( pxList->uxNumberOfItems )++;
+ ( pxList->uxNumberOfItems ) = ( UBaseType_t ) ( pxList->uxNumberOfItems + 1U );
+
+ traceRETURN_vListInsert();
}
/*-----------------------------------------------------------*/
+
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
{
-/* The list item knows which list it is in. Obtain the list from the list
- * item. */
+ /* The list item knows which list it is in. Obtain the list from the list
+ * item. */
List_t * const pxList = pxItemToRemove->pxContainer;
+ traceENTER_uxListRemove( pxItemToRemove );
+
pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
@@ -219,7 +237,9 @@ UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
}
pxItemToRemove->pxContainer = NULL;
- ( pxList->uxNumberOfItems )--;
+ ( pxList->uxNumberOfItems ) = ( UBaseType_t ) ( pxList->uxNumberOfItems - 1U );
+
+ traceRETURN_uxListRemove( pxList->uxNumberOfItems );
return pxList->uxNumberOfItems;
}
diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch32/port.c b/third-party/freertos/portable/GCC/ft_platform/aarch32/port.c
index eca71542a7f846257f3d28cd2ea307b207563dca..eb079dd9265912820c929f2efbeb0efea17af63b 100644
--- a/third-party/freertos/portable/GCC/ft_platform/aarch32/port.c
+++ b/third-party/freertos/portable/GCC/ft_platform/aarch32/port.c
@@ -1,6 +1,8 @@
/*
- * FreeRTOS Kernel V10.4.2
- * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -22,7 +24,6 @@
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
- * 1 tab == 4 spaces!
*/
/* Standard includes. */
@@ -37,98 +38,95 @@
#include "fgic_v3.h"
#ifndef configINTERRUPT_CONTROLLER_BASE_ADDRESS
- #error configINTERRUPT_CONTROLLER_BASE_ADDRESS must be defined. See https://www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
+ #error "configINTERRUPT_CONTROLLER_BASE_ADDRESS must be defined. See www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html"
#endif
#ifndef configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET
- #error configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET must be defined. See https://www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
+ #error "configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET must be defined. See www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html"
#endif
#ifndef configUNIQUE_INTERRUPT_PRIORITIES
- #error configUNIQUE_INTERRUPT_PRIORITIES must be defined. See https://www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
+ #error "configUNIQUE_INTERRUPT_PRIORITIES must be defined. See www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html"
#endif
#ifndef configSETUP_TICK_INTERRUPT
- #error configSETUP_TICK_INTERRUPT() must be defined. See https://www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
+ #error "configSETUP_TICK_INTERRUPT() must be defined. See www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html"
#endif /* configSETUP_TICK_INTERRUPT */
#ifndef configMAX_API_CALL_INTERRUPT_PRIORITY
- #error configMAX_API_CALL_INTERRUPT_PRIORITY must be defined. See https://www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
+ #error "configMAX_API_CALL_INTERRUPT_PRIORITY must be defined. See www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html"
#endif
#if configMAX_API_CALL_INTERRUPT_PRIORITY == 0
- #error configMAX_API_CALL_INTERRUPT_PRIORITY must not be set to 0
+ #error "configMAX_API_CALL_INTERRUPT_PRIORITY must not be set to 0"
#endif
#if configMAX_API_CALL_INTERRUPT_PRIORITY > configUNIQUE_INTERRUPT_PRIORITIES
- #error configMAX_API_CALL_INTERRUPT_PRIORITY must be less than or equal to configUNIQUE_INTERRUPT_PRIORITIES as the lower the numeric priority value the higher the logical interrupt priority
+ #error "configMAX_API_CALL_INTERRUPT_PRIORITY must be less than or equal to configUNIQUE_INTERRUPT_PRIORITIES as the lower the numeric priority value the higher the logical interrupt priority"
#endif
#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
/* Check the configuration. */
- #if (configMAX_PRIORITIES > 32)
- #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
+ #if ( configMAX_PRIORITIES > 32 )
+ #error "configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice."
#endif
#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
/* In case security extensions are implemented. */
-#if configMAX_API_CALL_INTERRUPT_PRIORITY <= (configUNIQUE_INTERRUPT_PRIORITIES / 2)
- #error configMAX_API_CALL_INTERRUPT_PRIORITY must be greater than ( configUNIQUE_INTERRUPT_PRIORITIES / 2 )
+#if configMAX_API_CALL_INTERRUPT_PRIORITY <= ( configUNIQUE_INTERRUPT_PRIORITIES / 2 )
+ #error "configMAX_API_CALL_INTERRUPT_PRIORITY must be greater than ( configUNIQUE_INTERRUPT_PRIORITIES / 2 )"
#endif
/* Some vendor specific files default configCLEAR_TICK_INTERRUPT() in
-portmacro.h. */
+ * portmacro.h. */
#ifndef configCLEAR_TICK_INTERRUPT
#define configCLEAR_TICK_INTERRUPT()
#endif
/* A critical section is exited when the critical section nesting count reaches
-this value. */
-#define portNO_CRITICAL_NESTING ((uint32_t)0)
+ * this value. */
+#define portNO_CRITICAL_NESTING ( ( uint32_t ) 0 )
/* In all GICs 255 can be written to the priority mask register to unmask all
-(but the lowest) interrupt priority. */
-#define portUNMASK_VALUE (0xFFUL)
+ * (but the lowest) interrupt priority. */
+#define portUNMASK_VALUE ( 0xFFUL )
/* Tasks are not created with a floating point context, but can be given a
-floating point context after they have been created. A variable is stored as
-part of the tasks context that holds portNO_FLOATING_POINT_CONTEXT if the task
-does not have an FPU context, or any other value if the task does have an FPU
-context. */
-#define portNO_FLOATING_POINT_CONTEXT ((StackType_t)0)
+ * floating point context after they have been created. A variable is stored as
+ * part of the tasks context that holds portNO_FLOATING_POINT_CONTEXT if the task
+ * does not have an FPU context, or any other value if the task does have an FPU
+ * context. */
+#define portNO_FLOATING_POINT_CONTEXT ( ( StackType_t ) 0 )
/* Constants required to setup the initial task context. */
-#define portINITIAL_SPSR ((StackType_t)0x13) /* Supervisor mode, ARM mode, IRQ enabled FIQ enabled. */
-#define portTHUMB_MODE_BIT ((StackType_t)0x20)
-#define portINTERRUPT_ENABLE_BIT (0x80UL)
-#define portTHUMB_MODE_ADDRESS (0x01UL)
+#define portINITIAL_SPSR ((StackType_t)0x13) /* Supervisor mode, ARM mode, IRQ enabled FIQ enabled. */
+#define portTHUMB_MODE_BIT ( ( StackType_t ) 0x20 )
+#define portINTERRUPT_ENABLE_BIT ( 0x80UL )
+#define portTHUMB_MODE_ADDRESS ( 0x01UL )
/* Used by portASSERT_IF_INTERRUPT_PRIORITY_INVALID() when ensuring the binary
-point is zero. */
-#define portBINARY_POINT_BITS ((uint8_t)0x03)
+ * point is zero. */
+#define portBINARY_POINT_BITS ( ( uint8_t ) 0x03 )
/* Masks all bits in the APSR other than the mode bits. */
-#define portAPSR_MODE_BITS_MASK (0x1F)
+#define portAPSR_MODE_BITS_MASK ( 0x1F )
/* The value of the mode bits in the APSR when the CPU is executing in user
-mode. */
-#define portAPSR_USER_MODE (0x10)
-
+ * mode. */
+#define portAPSR_USER_MODE ( 0x10 )
/* The critical section macros only mask interrupts up to an application
-determined priority level. Sometimes it is necessary to turn interrupt off in
-the CPU itself before modifying certain hardware registers. */
-#define portCPU_IRQ_DISABLE() \
- __asm volatile("CPSID i" :: \
- : "memory"); \
- __asm volatile("DSB"); \
- __asm volatile("ISB");
-
-#define portCPU_IRQ_ENABLE() \
- __asm volatile("CPSIE i" :: \
- : "memory"); \
- __asm volatile("DSB"); \
- __asm volatile("ISB");
+ * determined priority level. Sometimes it is necessary to turn interrupt off in
+ * the CPU itself before modifying certain hardware registers. */
+#define portCPU_IRQ_DISABLE() \
+ __asm volatile ( "CPSID i" ::: "memory" ); \
+ __asm volatile ( "DSB" ); \
+ __asm volatile ( "ISB" );
+
+#define portCPU_IRQ_ENABLE() \
+ __asm volatile ( "CPSIE i" ::: "memory" ); \
+ __asm volatile ( "DSB" ); \
+ __asm volatile ( "ISB" );
/* Macro to unmask all interrupt priorities. */
#define portCLEAR_INTERRUPT_MASK() \
@@ -140,23 +138,22 @@ the CPU itself before modifying certain hardware registers. */
portCPU_IRQ_ENABLE(); \
}
-/* Hardware specifics used when sanity checking the configuration. */
-#define portINTERRUPT_PRIORITY_REGISTER_OFFSET (0x400UL + 32UL) //
-#define portMAX_8_BIT_VALUE ((uint8_t)0xff)
-#define portBIT_0_SET ((uint8_t)0x01)
+#define portINTERRUPT_PRIORITY_REGISTER_OFFSET 0x400UL
+#define portMAX_8_BIT_VALUE ( ( uint8_t ) 0xff )
+#define portBIT_0_SET ( ( uint8_t ) 0x01 )
/* Let the user override the pre-loading of the initial LR with the address of
-prvTaskExitError() in case it messes up unwinding of the stack in the
-debugger. */
+ * prvTaskExitError() in case it messes up unwinding of the stack in the
+ * debugger. */
#ifdef configTASK_RETURN_ADDRESS
- #define portTASK_RETURN_ADDRESS configTASK_RETURN_ADDRESS
+ #define portTASK_RETURN_ADDRESS configTASK_RETURN_ADDRESS
#else
- #define portTASK_RETURN_ADDRESS prvTaskExitError
+ #define portTASK_RETURN_ADDRESS prvTaskExitError
#endif
/* The space on the stack required to hold the FPU registers. This is 32 64-bit
-registers, plus a 32-bit status register. */
-#define portFPU_REGISTER_WORDS ((32 * 2) + 1)
+ * registers, plus a 32-bit status register. */
+#define portFPU_REGISTER_WORDS ( ( 32 * 2 ) + 1 )
/*-----------------------------------------------------------*/
@@ -164,13 +161,12 @@ registers, plus a 32-bit status register. */
* Starts the first task executing. This function is necessarily written in
* assembly code so is implemented in portASM.s.
*/
-extern void vPortRestoreTaskContext(void);
+extern void vPortRestoreTaskContext( void );
/*
* Used to catch tasks that attempt to return from their implementing function.
*/
-static void prvTaskExitError(void);
-
+static void prvTaskExitError( void );
/*
* If the application provides an implementation of vApplicationIRQHandler(),
@@ -191,26 +187,26 @@ static void prvTaskExitError(void);
* FPU registers to be saved on interrupt entry their IRQ handler must be
* called vApplicationIRQHandler().
*/
-void vApplicationFPUSafeIRQHandler(uint32_t ulICCIAR) __attribute__((weak));
+void vApplicationFPUSafeIRQHandler( uint32_t ulICCIAR ) __attribute__( ( weak ) );
/*-----------------------------------------------------------*/
/* A variable is used to keep track of the critical section nesting. This
-variable has to be stored as part of the task context and must be initialised to
-a non zero value to ensure interrupts don't inadvertently become unmasked before
-the scheduler starts. As it is stored as part of the task context it will
-automatically be set to 0 when the first task is started. */
+ * variable has to be stored as part of the task context and must be initialised to
+ * a non zero value to ensure interrupts don't inadvertently become unmasked before
+ * the scheduler starts. As it is stored as part of the task context it will
+ * automatically be set to 0 when the first task is started. */
volatile uint32_t ulCriticalNesting = 9999UL;
/* Saved as part of the task context. If ulPortTaskHasFPUContext is non-zero then
-a floating point context must be saved and restored for the task. */
+ * a floating point context must be saved and restored for the task. */
volatile uint32_t ulPortTaskHasFPUContext = pdFALSE;
/* Set to 1 to pend a context switch from an ISR. */
volatile uint32_t ulPortYieldRequired = pdFALSE;
/* Counts the interrupt nesting depth. A context switch is only performed if
-if the nesting depth is 0. */
+ * if the nesting depth is 0. */
volatile uint32_t ulPortInterruptNesting = 0UL;
/* Used in the asm file. */
@@ -227,22 +223,25 @@ static void vPortPriorityConfigCheck(void);
/*
* See header file for description.
*/
-StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters)
+StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
+ TaskFunction_t pxCode,
+ void * pvParameters )
{
/* Setup the initial stack of the task. The stack is set exactly as
- expected by the portRESTORE_CONTEXT() macro.
- The fist real value on the stack is the status register, which is set for
- system mode, with interrupts enabled. A few NULLs are added first to ensure
- GDB does not try decoding a non-existent return address. */
- *pxTopOfStack = (StackType_t)NULL;
+ * expected by the portRESTORE_CONTEXT() macro.
+ *
+ * The fist real value on the stack is the status register, which is set for
+ * system mode, with interrupts enabled. A few NULLs are added first to ensure
+ * GDB does not try decoding a non-existent return address. */
+ *pxTopOfStack = ( StackType_t ) NULL;
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)NULL;
+ *pxTopOfStack = ( StackType_t ) NULL;
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)NULL;
+ *pxTopOfStack = ( StackType_t ) NULL;
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)portINITIAL_SPSR;
+ *pxTopOfStack = ( StackType_t ) portINITIAL_SPSR;
- if (((uint32_t)pxCode & portTHUMB_MODE_ADDRESS) != 0x00UL)
+ if( ( ( uint32_t ) pxCode & portTHUMB_MODE_ADDRESS ) != 0x00UL )
{
/* The task will start in THUMB mode. */
*pxTopOfStack |= portTHUMB_MODE_BIT;
@@ -251,88 +250,90 @@ StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, TaskFunction_t pxC
pxTopOfStack--;
/* Next the return address, which in this case is the start of the task. */
- *pxTopOfStack = (StackType_t)pxCode;
+ *pxTopOfStack = ( StackType_t ) pxCode;
pxTopOfStack--;
/* Next all the registers other than the stack pointer. */
- *pxTopOfStack = (StackType_t)portTASK_RETURN_ADDRESS; /* R14 */
+ *pxTopOfStack = ( StackType_t ) portTASK_RETURN_ADDRESS; /* R14 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)0x12121212; /* R12 */
+ *pxTopOfStack = ( StackType_t ) 0x12121212; /* R12 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)0x11111111; /* R11 */
+ *pxTopOfStack = ( StackType_t ) 0x11111111; /* R11 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)0x10101010; /* R10 */
+ *pxTopOfStack = ( StackType_t ) 0x10101010; /* R10 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)0x09090909; /* R9 */
+ *pxTopOfStack = ( StackType_t ) 0x09090909; /* R9 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)0x08080808; /* R8 */
+ *pxTopOfStack = ( StackType_t ) 0x08080808; /* R8 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)0x07070707; /* R7 */
+ *pxTopOfStack = ( StackType_t ) 0x07070707; /* R7 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)0x06060606; /* R6 */
+ *pxTopOfStack = ( StackType_t ) 0x06060606; /* R6 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)0x05050505; /* R5 */
+ *pxTopOfStack = ( StackType_t ) 0x05050505; /* R5 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)0x04040404; /* R4 */
+ *pxTopOfStack = ( StackType_t ) 0x04040404; /* R4 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)0x03030303; /* R3 */
+ *pxTopOfStack = ( StackType_t ) 0x03030303; /* R3 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)0x02020202; /* R2 */
+ *pxTopOfStack = ( StackType_t ) 0x02020202; /* R2 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)0x01010101; /* R1 */
+ *pxTopOfStack = ( StackType_t ) 0x01010101; /* R1 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)pvParameters; /* R0 */
+ *pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
pxTopOfStack--;
/* The task will start with a critical nesting count of 0 as interrupts are
- enabled. */
+ * enabled. */
*pxTopOfStack = portNO_CRITICAL_NESTING;
-#if (configUSE_TASK_FPU_SUPPORT == 1)
+ #if ( configUSE_TASK_FPU_SUPPORT == 1 )
{
/* The task will start without a floating point context. A task that
- uses the floating point hardware must call vPortTaskUsesFPU() before
- executing any floating point instructions. */
+ * uses the floating point hardware must call vPortTaskUsesFPU() before
+ * executing any floating point instructions. */
pxTopOfStack--;
*pxTopOfStack = portNO_FLOATING_POINT_CONTEXT;
}
-#elif (configUSE_TASK_FPU_SUPPORT == 2)
+ #elif ( configUSE_TASK_FPU_SUPPORT == 2 )
{
/* The task will start with a floating point context. Leave enough
- space for the registers - and ensure they are initialised to 0. */
+ * space for the registers - and ensure they are initialised to 0. */
pxTopOfStack -= portFPU_REGISTER_WORDS;
- memset(pxTopOfStack, 0x00, portFPU_REGISTER_WORDS * sizeof(StackType_t));
+ memset( pxTopOfStack, 0x00, portFPU_REGISTER_WORDS * sizeof( StackType_t ) );
pxTopOfStack--;
*pxTopOfStack = pdTRUE;
ulPortTaskHasFPUContext = pdTRUE;
}
-#else
+ #else /* if ( configUSE_TASK_FPU_SUPPORT == 1 ) */
{
-#error Invalid configUSE_TASK_FPU_SUPPORT setting - configUSE_TASK_FPU_SUPPORT must be set to 1, 2, or left undefined.
+ #error "Invalid configUSE_TASK_FPU_SUPPORT setting - configUSE_TASK_FPU_SUPPORT must be set to 1, 2, or left undefined."
}
-#endif
+ #endif /* if ( configUSE_TASK_FPU_SUPPORT == 1 ) */
return pxTopOfStack;
}
/*-----------------------------------------------------------*/
-static void prvTaskExitError(void)
+static void prvTaskExitError( void )
{
/* A function that implements a task must not exit or attempt to return to
- its caller as there is nothing to return to. If a task wants to exit it
- should instead call vTaskDelete( NULL ).
-
- Artificially force an assert() to be triggered if configASSERT() is
- defined, then stop here so application writers can catch the error. */
- configASSERT(ulPortInterruptNesting == ~0UL);
+ * its caller as there is nothing to return to. If a task wants to exit it
+ * should instead call vTaskDelete( NULL ).
+ *
+ * Artificially force an assert() to be triggered if configASSERT() is
+ * defined, then stop here so application writers can catch the error. */
+ configASSERT( ulPortInterruptNesting == ~0UL );
portDISABLE_INTERRUPTS();
- for (;;)
- ;
+
+ for( ; ; )
+ {
+ }
}
/*-----------------------------------------------------------*/
-BaseType_t xPortStartScheduler(void)
+BaseType_t xPortStartScheduler( void )
{
uint32_t ulAPSR;
@@ -340,105 +341,102 @@ BaseType_t xPortStartScheduler(void)
vPortPriorityConfigCheck();
/* Only continue if the CPU is not in User mode. The CPU must be in a
- Privileged mode for the scheduler to start. */
- __asm volatile("MRS %0, APSR"
- : "=r"(ulAPSR)::"memory");
-
+ * Privileged mode for the scheduler to start. */
+ __asm volatile ( "MRS %0, APSR" : "=r" ( ulAPSR )::"memory" );
ulAPSR &= portAPSR_MODE_BITS_MASK;
+ configASSERT( ulAPSR != portAPSR_USER_MODE );
- configASSERT(ulAPSR != portAPSR_USER_MODE);
-
- if (ulAPSR != portAPSR_USER_MODE)
+ if( ulAPSR != portAPSR_USER_MODE )
{
/* Only continue if the binary point value is set to its lowest possible
- setting. See the comments in vPortValidateInterruptPriority() below for
- more information. */
+ * setting. See the comments in vPortValidateInterruptPriority() below for
+ * more information. */
configASSERT((FGicGetICC_BPR1() & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE);
if ((FGicGetICC_BPR1() & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE)
{
/* Interrupts are turned off in the CPU itself to ensure tick does
- not execute while the scheduler is being started. Interrupts are
- automatically turned back on in the CPU when the first task starts
- executing. */
+ * not execute while the scheduler is being started. Interrupts are
+ * automatically turned back on in the CPU when the first task starts
+ * executing. */
portCPU_IRQ_DISABLE();
/* Start the timer that generates the tick ISR. */
configSETUP_TICK_INTERRUPT();
- /* Start the first task executing. */
+ /* Start the first task executing. */
vPortRestoreTaskContext();
}
}
/* Will only get here if vTaskStartScheduler() was called with the CPU in
- a non-privileged mode or the binary point register was not set to its lowest
- possible value. prvTaskExitError() is referenced to prevent a compiler
- warning about it being defined but not referenced in the case that the user
- defines their own exit address. */
- (void)prvTaskExitError;
+ * a non-privileged mode or the binary point register was not set to its lowest
+ * possible value. prvTaskExitError() is referenced to prevent a compiler
+ * warning about it being defined but not referenced in the case that the user
+ * defines their own exit address. */
+ ( void ) prvTaskExitError;
return 0;
}
/*-----------------------------------------------------------*/
-void vPortEndScheduler(void)
+void vPortEndScheduler( void )
{
/* Not implemented in ports where there is nothing to return to.
- Artificially force an assert. */
- configASSERT(ulCriticalNesting == 1000UL);
+ * Artificially force an assert. */
+ configASSERT( ulCriticalNesting == 1000UL );
}
/*-----------------------------------------------------------*/
-void vPortEnterCritical(void)
+void vPortEnterCritical( void )
{
/* Mask interrupts up to the max syscall interrupt priority. */
ulPortSetInterruptMask();
- /* Now interrupts are disabled ulCriticalNesting can be accessed
- directly. Increment ulCriticalNesting to keep a count of how many times
- portENTER_CRITICAL() has been called. */
+ /* Now that interrupts are disabled, ulCriticalNesting can be accessed
+ * directly. Increment ulCriticalNesting to keep a count of how many times
+ * portENTER_CRITICAL() has been called. */
ulCriticalNesting++;
/* This is not the interrupt safe version of the enter critical function so
- assert() if it is being called from an interrupt context. Only API
- functions that end in "FromISR" can be used in an interrupt. Only assert if
- the critical nesting count is 1 to protect against recursive calls if the
- assert function also uses a critical section. */
- if (ulCriticalNesting == 1)
+ * assert() if it is being called from an interrupt context. Only API
+ * functions that end in "FromISR" can be used in an interrupt. Only assert if
+ * the critical nesting count is 1 to protect against recursive calls if the
+ * assert function also uses a critical section. */
+ if( ulCriticalNesting == 1 )
{
- configASSERT(ulPortInterruptNesting == 0);
+ configASSERT( ulPortInterruptNesting == 0 );
}
}
/*-----------------------------------------------------------*/
-void vPortExitCritical(void)
+void vPortExitCritical( void )
{
- if (ulCriticalNesting > portNO_CRITICAL_NESTING)
+ if( ulCriticalNesting > portNO_CRITICAL_NESTING )
{
/* Decrement the nesting count as the critical section is being
- exited. */
+ * exited. */
ulCriticalNesting--;
/* If the nesting level has reached zero then all interrupt
- priorities must be re-enabled. */
- if (ulCriticalNesting == portNO_CRITICAL_NESTING)
+ * priorities must be re-enabled. */
+ if( ulCriticalNesting == portNO_CRITICAL_NESTING )
{
/* Critical nesting has reached zero so all interrupt priorities
- should be unmasked. */
+ * should be unmasked. */
portCLEAR_INTERRUPT_MASK();
}
}
}
/*-----------------------------------------------------------*/
-void FreeRTOS_Tick_Handler(void)
+void FreeRTOS_Tick_Handler( void )
{
/* Set interrupt mask before altering scheduler structures. The tick
- handler runs at the lowest priority, so interrupts cannot already be masked,
- so there is no need to save and restore the current mask value. It is
- necessary to turn off interrupts in the CPU itself while the ICCPMR is being
- updated. */
+ * handler runs at the lowest priority, so interrupts cannot already be masked,
+ * so there is no need to save and restore the current mask value. It is
+ * necessary to turn off interrupts in the CPU itself while the ICCPMR is being
+ * updated. */
InterruptSetPriorityMask((uint32_t)(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT));
@@ -447,7 +445,7 @@ void FreeRTOS_Tick_Handler(void)
: "memory");
/* Increment the RTOS tick. */
- if (xTaskIncrementTick() != pdFALSE)
+ if( xTaskIncrementTick() != pdFALSE )
{
ulPortYieldRequired = pdTRUE;
}
@@ -460,39 +458,38 @@ void FreeRTOS_Tick_Handler(void)
}
/*-----------------------------------------------------------*/
-#if (configUSE_TASK_FPU_SUPPORT != 2)
+#if ( configUSE_TASK_FPU_SUPPORT != 2 )
-void vPortTaskUsesFPU(void)
-{
- uint32_t ulInitialFPSCR = 0;
+ void vPortTaskUsesFPU( void )
+ {
+ uint32_t ulInitialFPSCR = 0;
- /* A task is registering the fact that it needs an FPU context. Set the
- FPU flag (which is saved as part of the task context). */
- ulPortTaskHasFPUContext = pdTRUE;
+ /* A task is registering the fact that it needs an FPU context. Set the
+ * FPU flag (which is saved as part of the task context). */
+ ulPortTaskHasFPUContext = pdTRUE;
- /* Initialise the floating point status register. */
- __asm volatile("FMXR FPSCR, %0" ::"r"(ulInitialFPSCR)
- : "memory");
-}
+ /* Initialise the floating point status register. */
+ __asm volatile ( "FMXR FPSCR, %0" ::"r" ( ulInitialFPSCR ) : "memory" );
+ }
#endif /* configUSE_TASK_FPU_SUPPORT */
/*-----------------------------------------------------------*/
-void vPortClearInterruptMask(uint32_t ulNewMaskValue)
+void vPortClearInterruptMask( uint32_t ulNewMaskValue )
{
- if (ulNewMaskValue == pdFALSE)
+ if( ulNewMaskValue == pdFALSE )
{
portCLEAR_INTERRUPT_MASK();
}
}
/*-----------------------------------------------------------*/
-uint32_t ulPortSetInterruptMask(void)
+uint32_t ulPortSetInterruptMask( void )
{
uint32_t ulReturn;
/* Interrupt in the CPU must be turned off while the ICCPMR is being
- updated. */
+ * updated. */
portCPU_IRQ_DISABLE();
if (InterruptGetPriorityMask() == (uint32_t)(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT))
{
@@ -507,56 +504,49 @@ uint32_t ulPortSetInterruptMask(void)
"isb \n" ::
: "memory");
}
+
portCPU_IRQ_ENABLE();
+
return ulReturn;
}
/*-----------------------------------------------------------*/
-#if (configASSERT_DEFINED == 1)
+#if ( configASSERT_DEFINED == 1 )
-void vPortValidateInterruptPriority(void)
-{
- /* The following assertion will fail if a service routine (ISR) for
- an interrupt that has been assigned a priority above
- configMAX_SYSCALL_INTERRUPT_PRIORITY calls an ISR safe FreeRTOS API
- function. ISR safe FreeRTOS API functions must *only* be called
- from interrupts that have been assigned a priority at or below
- configMAX_SYSCALL_INTERRUPT_PRIORITY.
-
- Numerically low interrupt priority numbers represent logically high
- interrupt priorities, therefore the priority of the interrupt must
- be set to a value equal to or numerically *higher* than
- configMAX_SYSCALL_INTERRUPT_PRIORITY.
-
- FreeRTOS maintains separate thread and ISR API functions to ensure
- interrupt entry is as fast and simple as possible. */
- configASSERT(InterruptGetCurrentPriority() >= (uint32_t)(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT));
-
- /* Priority grouping: The interrupt controller (GIC) allows the bits
- that define each interrupt's priority to be split between bits that
- define the interrupt's pre-emption priority bits and bits that define
- the interrupt's sub-priority. For simplicity all bits must be defined
- to be pre-emption priority bits. The following assertion will fail if
- this is not the case (if some bits represent a sub-priority).
-
- The priority grouping is configured by the GIC's binary point register
- (ICCBPR). Writting 0 to ICCBPR will ensure it is set to its lowest
- possible value (which may be above 0). */
- configASSERT((FGicGetICC_BPR1() & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE);
+ void vPortValidateInterruptPriority( void )
+ {
+ /* The following assertion will fail if a service routine (ISR) for
+ * an interrupt that has been assigned a priority above
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY calls an ISR safe FreeRTOS API
+ * function. ISR safe FreeRTOS API functions must *only* be called
+ * from interrupts that have been assigned a priority at or below
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY.
+ *
+ * Numerically low interrupt priority numbers represent logically high
+ * interrupt priorities, therefore the priority of the interrupt must
+ * be set to a value equal to or numerically *higher* than
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY.
+ *
+ * FreeRTOS maintains separate thread and ISR API functions to ensure
+ * interrupt entry is as fast and simple as possible. */
+ configASSERT(InterruptGetCurrentPriority() >= (uint32_t)(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT));
+
+ /* Priority grouping: The interrupt controller (GIC) allows the bits
+ * that define each interrupt's priority to be split between bits that
+ * define the interrupt's pre-emption priority bits and bits that define
+ * the interrupt's sub-priority. For simplicity all bits must be defined
+ * to be pre-emption priority bits. The following assertion will fail if
+ * this is not the case (if some bits represent a sub-priority).
+ *
+ * The priority grouping is configured by the GIC's binary point register
+ * (ICCBPR). Writting 0 to ICCBPR will ensure it is set to its lowest
+ * possible value (which may be above 0). */
+ configASSERT((FGicGetICC_BPR1() & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE);
}
#endif /* configASSERT_DEFINED */
/*-----------------------------------------------------------*/
-_WEAK void vApplicationTickHook(void)
-{
-}
-
-_WEAK void vApplicationIdleHook(void)
-{
-}
-
-
static void vPortPriorityConfigCheck(void)
{
ucPriorityConfig = InterruptGetPriorityConfig();
diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch32/portASM.S b/third-party/freertos/portable/GCC/ft_platform/aarch32/portASM.S
index 00bc08a905df908e9410f40e03f3c6e6507c390c..390f4ef78f80451f34aafb81e65bf1c43a22f2d9 100644
--- a/third-party/freertos/portable/GCC/ft_platform/aarch32/portASM.S
+++ b/third-party/freertos/portable/GCC/ft_platform/aarch32/portASM.S
@@ -1,6 +1,8 @@
/*
- * FreeRTOS Kernel V10.4.2
- * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -22,33 +24,32 @@
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
- * 1 tab == 4 spaces!
*/
- #include "FreeRTOSConfig.h"
+ .eabi_attribute Tag_ABI_align_preserved, 1
+ .text
+ .arm
- .eabi_attribute Tag_ABI_align_preserved, 1
- .text
- .arm
+ .set SYS_MODE, 0x1f
+ .set SVC_MODE, 0x13
+ .set IRQ_MODE, 0x12
- .set SYS_MODE, 0x1f
- .set SVC_MODE, 0x13
- .set IRQ_MODE, 0x12
+ /* Hardware registers. */
+
+ /* Variables and functions. */
+ .extern ulMaxAPIPriorityMask
+ .extern _freertos_vector_table
+ .extern pxCurrentTCB
+ .extern vTaskSwitchContext
+ .extern vApplicationIRQHandler
+ .extern ulPortInterruptNesting
+ .extern ulPortTaskHasFPUContext
+ .extern ulPortUnmask
+
+ .global FreeRTOS_IRQ_Handler
+ .global FreeRTOS_SWI_Handler
+ .global vPortRestoreTaskContext
- /* Hardware registers. */
-
- /* Variables and functions. */
- .extern ulMaxAPIPriorityMask
- .extern _freertos_vector_table
- .extern pxCurrentTCB
- .extern vTaskSwitchContext
- .extern vApplicationIRQHandler
- .extern ulPortInterruptNesting
- .extern ulPortTaskHasFPUContext
- .extern ulPortUnmask
- .global FreeRTOS_IRQ_Handler
- .global FreeRTOS_SWI_Handler
- .global vPortRestoreTaskContext
.macro portSAVE_CONTEXT
@@ -57,52 +58,51 @@
Supervisor mode to save the remaining Supervisor mode registers. */
SRSDB sp!, #SVC_MODE
CPS #SVC_MODE
- PUSH {R0-R12, R14}
-
- /* Push the critical nesting count. */
- LDR R2, ulCriticalNestingConst
- LDR R1, [R2]
- PUSH {R1}
-
- /* Does the task have a floating point context that needs saving? If
- ulPortTaskHasFPUContext is 0 then no. */
- LDR R2, ulPortTaskHasFPUContextConst
- LDR R3, [R2]
- CMP R3, #0
-
- /* Save the floating point context, if any. */
- FMRXNE R1, FPSCR
- VPUSHNE {D0-D15}
- VPUSHNE {D16-D31}
+ PUSH {R0-R12, R14}
+
+ /* Push the critical nesting count. */
+ LDR R2, ulCriticalNestingConst
+ LDR R1, [R2]
+ PUSH {R1}
+
+ /* Does the task have a floating point context that needs saving? If
+ ulPortTaskHasFPUContext is 0 then no. */
+ LDR R2, ulPortTaskHasFPUContextConst
+ LDR R3, [R2]
+ CMP R3, #0
+
+ /* Save the floating point context, if any. */
+ FMRXNE R1, FPSCR
+ VPUSHNE {D0-D15}
+ VPUSHNE {D16-D31}
PUSHNE {R1}
+ /* Save ulPortTaskHasFPUContext itself. */
+ PUSH {R3}
- /* Save ulPortTaskHasFPUContext itself. */
- PUSH {R3}
-
-
- /* Save the stack pointer in the TCB. */
- LDR R0, pxCurrentTCBConst
- LDR R1, [R0]
- STR SP, [R1]
+ /* Save the stack pointer in the TCB. */
+ LDR R0, pxCurrentTCBConst
+ LDR R1, [R0]
+ STR SP, [R1]
- .endm
+ .endm
; /**********************************************************************/
.macro portRESTORE_CONTEXT
- /* Set the SP to point to the stack of the task being restored. */
- LDR R0, pxCurrentTCBConst
- LDR R1, [R0]
- LDR SP, [R1]
-
- /* Is there a floating point context to restore? If the restored
- ulPortTaskHasFPUContext is zero then no. */
- LDR R0, ulPortTaskHasFPUContextConst
- POP {R1}
- STR R1, [R0]
- CMP R1, #0
+
+ /* Set the SP to point to the stack of the task being restored. */
+ LDR R0, pxCurrentTCBConst
+ LDR R1, [R0]
+ LDR SP, [R1]
+
+ /* Is there a floating point context to restore? If the restored
+ ulPortTaskHasFPUContext is zero then no. */
+ LDR R0, ulPortTaskHasFPUContextConst
+ POP {R1}
+ STR R1, [R0]
+ CMP R1, #0
/* Restore the floating point context, if any. */
@@ -112,13 +112,12 @@
VMSRNE FPSCR, R0
- /* Restore the critical section nesting depth. */
- LDR R0, ulCriticalNestingConst
- POP {R1}
- STR R1, [R0]
-
+ /* Restore the critical section nesting depth. */
+ LDR R0, ulCriticalNestingConst
+ POP {R1}
+ STR R1, [R0]
- /* Ensure the priority mask is correct for the critical nesting depth. */
+ /* Ensure the priority mask is correct for the critical nesting depth. */
CMP R1, #0
LDREQ R4, ulPortUnmaskConst
LDREQ R4, [R4]
@@ -128,14 +127,14 @@
ISB
- /* Restore all system mode registers other than the SP (which is already
- being used). */
- POP {R0-R12, R14}
+ /* Restore all system mode registers other than the SP (which is already
+ being used). */
+ POP {R0-R12, R14}
- /* Return to the task code, loading CPSR on the way. */
- RFEIA sp!
+ /* Return to the task code, loading CPSR on the way. */
+ RFEIA sp!
- .endm
+ .endm
@@ -146,11 +145,14 @@
.align 4
.type FreeRTOS_SWI_Handler, %function
FreeRTOS_SWI_Handler:
- /* Save the context of the current task and select a new task to run. */
- portSAVE_CONTEXT
- LDR R0, vTaskSwitchContextConst
- BLX R0
- portRESTORE_CONTEXT
+ /* Save the context of the current task and select a new task to run. */
+ portSAVE_CONTEXT
+
+
+ LDR R0, vTaskSwitchContextConst
+ BLX R0
+
+ portRESTORE_CONTEXT
/******************************************************************************
@@ -167,98 +169,98 @@ vPortRestoreTaskContext:
.align 4
.type FreeRTOS_IRQ_Handler, %function
FreeRTOS_IRQ_Handler:
- /* Return to the interrupted instruction. */
- SUB lr, lr, #4
+ /* Return to the interrupted instruction. */
+ SUB lr, lr, #4
- /* Push the return address and SPSR. */
- PUSH {lr}
- MRS lr, SPSR
- PUSH {lr}
+ /* Push the return address and SPSR. */
+ PUSH {lr}
+ MRS lr, SPSR
+ PUSH {lr}
- /* Push used registers. */
- PUSH {r0-r4, r12}
+ /* Push used registers. */
+ PUSH {r0-r4, r12}
- /* Increment nesting count. r3 holds the address of ulPortInterruptNesting
- for future use. r1 holds the original ulPortInterruptNesting value for
- future use. */
- LDR r3, ulPortInterruptNestingConst
- LDR r1, [r3]
- ADD r4, r1, #1
- STR r4, [r3]
+ /* Increment nesting count. r3 holds the address of ulPortInterruptNesting
+ for future use. r1 holds the original ulPortInterruptNesting value for
+ future use. */
+ LDR r3, ulPortInterruptNestingConst
+ LDR r1, [r3]
+ ADD r4, r1, #1
+ STR r4, [r3]
/* Read value from the interrupt acknowledge register, which is stored in r0
for future parameter and interrupt clearing use. */
mrc p15, 0, r0, c12, c12, 0
isb
- /* Ensure bit 2 of the stack pointer is clear. r2 holds the bit 2 value for
- future use. _RB_ Does this ever actually need to be done provided the start
- of the stack is 8-byte aligned? */
- MOV r2, sp
- AND r2, r2, #4
- SUB sp, sp, r2
+ /* Ensure bit 2 of the stack pointer is clear. r2 holds the bit 2 value for
+ future use. _RB_ Does this ever actually need to be done provided the start
+ of the stack is 8-byte aligned? */
+ MOV r2, sp
+ AND r2, r2, #4
+ SUB sp, sp, r2
- /* Call the interrupt handler. r4 pushed to maintain alignment. */
- PUSH {r0-r4, lr}
- LDR r1, vApplicationIRQHandlerConst
- BLX r1
- POP {r0-r4, lr}
- ADD sp, sp, r2
+ /* Call the interrupt handler. r4 pushed to maintain alignment. */
+ PUSH {r0-r4, lr}
+ LDR r1, vApplicationIRQHandlerConst
+ BLX r1
+ POP {r0-r4, lr}
+ ADD sp, sp, r2
/* Write the value read from ICCIAR to ICCEOIR.*/
mcr p15, 0, r0, c12, c12, 1
isb
- /* Restore the old nesting count. */
- STR r1, [r3]
+ /* Restore the old nesting count. */
+ STR r1, [r3]
- /* A context switch is never performed if the nesting count is not 0. */
- CMP r1, #0
- BNE exit_without_switch
+ /* A context switch is never performed if the nesting count is not 0. */
+ CMP r1, #0
+ BNE exit_without_switch
- /* Did the interrupt request a context switch? r1 holds the address of
- ulPortYieldRequired and r0 the value of ulPortYieldRequired for future
- use. */
- LDR r1, =ulPortYieldRequired
- LDR r0, [r1]
- CMP r0, #0
- BNE switch_before_exit
+ /* Did the interrupt request a context switch? r1 holds the address of
+ ulPortYieldRequired and r0 the value of ulPortYieldRequired for future
+ use. */
+ LDR r1, =ulPortYieldRequired
+ LDR r0, [r1]
+ CMP r0, #0
+ BNE switch_before_exit
exit_without_switch:
- /* No context switch. Restore used registers, LR_irq and SPSR before
- returning. */
- POP {r0-r4, r12}
+ /* No context switch. Restore used registers, LR_irq and SPSR before
+ returning. */
+ POP {r0-r4, r12}
- POP {LR}
- MSR SPSR_cxsf, LR
- POP {LR}
- MOVS PC, LR
+ POP {LR}
+ MSR SPSR_cxsf, LR
+ POP {LR}
+ MOVS PC, LR
switch_before_exit:
- /* A context swtich is to be performed. Clear the context switch pending
- flag. */
- MOV r0, #0
- STR r0, [r1]
+ /* A context switch is to be performed. Clear the context switch pending
+ flag. */
+ MOV r0, #0
+ STR r0, [r1]
- /* Restore used registers, LR-irq and SPSR before saving the context
- to the task stack. */
- POP {r0-r4, r12}
+ /* Restore used registers, LR-irq and SPSR before saving the context
+ to the task stack. */
+ POP {r0-r4, r12}
- POP {LR}
- MSR SPSR_cxsf, LR
- POP {LR}
- portSAVE_CONTEXT
+ POP {LR}
+ MSR SPSR_cxsf, LR
+ POP {LR}
+ portSAVE_CONTEXT
/* Call the function that selects the new task to execute.
vTaskSwitchContext() if vTaskSwitchContext() uses LDRD or STRD
instructions, or 8 byte aligned stack allocated data. LR does not need
saving as a new LR will be loaded by portRESTORE_CONTEXT anyway. */
- LDR R0, vTaskSwitchContextConst
- BLX R0
+ LDR R0, vTaskSwitchContextConst
+ BLX R0
- /* Restore the context of, and branch to, the task selected to execute
- next. */
- portRESTORE_CONTEXT
+ /* Restore the context of, and branch to, the task selected to execute
+ next. */
+ portRESTORE_CONTEXT
/******************************************************************************
* If the application provides an implementation of vApplicationIRQHandler(),
@@ -282,39 +284,21 @@ switch_before_exit:
.weak vApplicationIRQHandler
.type vApplicationIRQHandler, %function
vApplicationIRQHandler:
- PUSH {LR}
- FMRX R1, FPSCR
- VPUSH {D0-D15}
- VPUSH {D16-D31}
- PUSH {R1}
+ PUSH {LR}
+ FMRX R1, FPSCR
+ VPUSH {D0-D15}
+ VPUSH {D16-D31}
+ PUSH {R1}
- LDR r1, vApplicationFPUSafeIRQHandlerConst
- BLX r1
+ LDR r1, vApplicationFPUSafeIRQHandlerConst
+ BLX r1
- POP {R0}
- VPOP {D16-D31}
- VPOP {D0-D15}
- VMSR FPSCR, R0
+ POP {R0}
+ VPOP {D16-D31}
+ VPOP {D0-D15}
+ VMSR FPSCR, R0
- POP {PC}
-
-/******************************************************************************
- * If the application provides an implementation of vApplicationIRQHandler(),
- * then it will get called directly without saving the FPU registers on
- * interrupt entry, and this weak implementation of
- * vApplicationIRQHandler() will not get called.
- *
- * If the application provides its own implementation of
- * vApplicationFPUSafeIRQHandler() then this implementation of
- * vApplicationIRQHandler() will be called, save the FPU registers, and then
- * call vApplicationFPUSafeIRQHandler().
- *
- * Therefore, if the application writer wants FPU registers to be saved on
- * interrupt entry their IRQ handler must be called
- * vApplicationFPUSafeIRQHandler(), and if the application writer does not want
- * FPU registers to be saved on interrupt entry their IRQ handler must be
- * called vApplicationIRQHandler().
- *****************************************************************************/
+ POP {PC}
pxCurrentTCBConst: .word pxCurrentTCB
@@ -328,8 +312,3 @@ vApplicationFPUSafeIRQHandlerConst: .word vApplicationInterruptHandler
ulPortUnmaskConst: .word ulPortUnmask
.end
-
-
-
-
-
diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch32/portmacro.h b/third-party/freertos/portable/GCC/ft_platform/aarch32/portmacro.h
index a8782de867cc9f6b93345e41402a5e2de2ec4295..5cce0641bca4ccbcd14202354752aa7c6e78d27d 100644
--- a/third-party/freertos/portable/GCC/ft_platform/aarch32/portmacro.h
+++ b/third-party/freertos/portable/GCC/ft_platform/aarch32/portmacro.h
@@ -1,6 +1,8 @@
/*
- * FreeRTOS Kernel V10.4.2
- * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -22,16 +24,16 @@
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
- * 1 tab == 4 spaces!
*/
#ifndef PORTMACRO_H
#define PORTMACRO_H
+/* *INDENT-OFF* */
#ifdef __cplusplus
-extern "C"
-{
+ extern "C" {
#endif
+/* *INDENT-ON* */
#include "ftypes.h"
#include "FreeRTOSConfig.h"
/*-----------------------------------------------------------
@@ -45,158 +47,162 @@ extern "C"
*/
/* Type definitions. */
-#define portCHAR char
-#define portFLOAT float
-#define portDOUBLE double
-#define portLONG long
-#define portSHORT short
-#define portSTACK_TYPE uint32_t
-#define portBASE_TYPE long
+#define portCHAR char
+#define portFLOAT float
+#define portDOUBLE double
+#define portLONG long
+#define portSHORT short
+#define portSTACK_TYPE uint32_t
+#define portBASE_TYPE long
-typedef portSTACK_TYPE StackType_t;
-typedef long BaseType_t;
-typedef unsigned long UBaseType_t;
+typedef portSTACK_TYPE StackType_t;
+typedef long BaseType_t;
+typedef unsigned long UBaseType_t;
-typedef uint32_t TickType_t;
-#define portMAX_DELAY (TickType_t)0xffffffffUL
+typedef uint32_t TickType_t;
+#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
/* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
-not need to be guarded with a critical section. */
-#define portTICK_TYPE_IS_ATOMIC 1
+ * not need to be guarded with a critical section. */
+#define portTICK_TYPE_IS_ATOMIC 1
/*-----------------------------------------------------------*/
/* Hardware specifics. */
-#define portSTACK_GROWTH (-1)
-#define portTICK_PERIOD_MS ((TickType_t)1000 / configTICK_RATE_HZ)
-#define portBYTE_ALIGNMENT 32
+#define portSTACK_GROWTH ( -1 )
+#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
+#define portBYTE_ALIGNMENT 32
/*-----------------------------------------------------------*/
/* Task utilities. */
/* Called at the end of an ISR that can cause a context switch. */
-#define portEND_SWITCHING_ISR(xSwitchRequired) \
- { \
- extern uint32_t ulPortYieldRequired; \
- \
- if (xSwitchRequired != pdFALSE) \
- { \
- ulPortYieldRequired = pdTRUE; \
- } \
+#define portEND_SWITCHING_ISR( xSwitchRequired ) \
+ { \
+ extern uint32_t ulPortYieldRequired; \
+ \
+ if( xSwitchRequired != pdFALSE ) \
+ { \
+ ulPortYieldRequired = pdTRUE; \
+ } \
}
-#define portYIELD_FROM_ISR(x) portEND_SWITCHING_ISR(x)
-#define portYIELD() __asm volatile("SWI 0" :: \
- : "memory");
+#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
+#define portYIELD() __asm volatile ( "SWI 0" ::: "memory" );
+
/*-----------------------------------------------------------
* Critical section control
*----------------------------------------------------------*/
-extern void vPortEnterCritical(void);
-extern void vPortExitCritical(void);
-extern uint32_t ulPortSetInterruptMask(void);
-extern void vPortClearInterruptMask(uint32_t ulNewMaskValue);
-extern void vPortInstallFreeRTOSVectorTable(void);
+extern void vPortEnterCritical( void );
+extern void vPortExitCritical( void );
+extern uint32_t ulPortSetInterruptMask( void );
+extern void vPortClearInterruptMask( uint32_t ulNewMaskValue );
+extern void vPortInstallFreeRTOSVectorTable( void );
/* These macros do not globally disable/enable interrupts. They do mask off
-interrupts that have a priority below configMAX_API_CALL_INTERRUPT_PRIORITY. */
-#define portENTER_CRITICAL() vPortEnterCritical();
-#define portEXIT_CRITICAL() vPortExitCritical();
-#define portDISABLE_INTERRUPTS() ulPortSetInterruptMask()
-#define portENABLE_INTERRUPTS() vPortClearInterruptMask(0)
+ * interrupts that have a priority below configMAX_API_CALL_INTERRUPT_PRIORITY. */
+#define portENTER_CRITICAL() vPortEnterCritical();
+#define portEXIT_CRITICAL() vPortExitCritical();
+#define portDISABLE_INTERRUPTS() ulPortSetInterruptMask()
+#define portENABLE_INTERRUPTS() vPortClearInterruptMask( 0 )
+#define portSET_INTERRUPT_MASK_FROM_ISR() ulPortSetInterruptMask()
+#define portCLEAR_INTERRUPT_MASK_FROM_ISR( x ) vPortClearInterruptMask( x )
/*-----------------------------------------------------------*/
/* Task function macros as described on the FreeRTOS.org WEB site. These are
-not required for this port but included in case common demo code that uses these
-macros is used. */
-#define portTASK_FUNCTION_PROTO(vFunction, pvParameters) void vFunction(void *pvParameters)
-#define portTASK_FUNCTION(vFunction, pvParameters) void vFunction(void *pvParameters)
+ * not required for this port but included in case common demo code that uses these
+ * macros is used. */
+#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters )
+#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
/* Prototype of the FreeRTOS tick handler. This must be installed as the
-handler for whichever peripheral is used to generate the RTOS tick. */
-void FreeRTOS_Tick_Handler(void);
+ * handler for whichever peripheral is used to generate the RTOS tick. */
+void FreeRTOS_Tick_Handler( void );
/* If configUSE_TASK_FPU_SUPPORT is set to 1 (or left undefined) then tasks are
-created without an FPU context and must call vPortTaskUsesFPU() to give
-themselves an FPU context before using any FPU instructions. If
-configUSE_TASK_FPU_SUPPORT is set to 2 then all tasks will have an FPU context
-by default. */
-#if (configUSE_TASK_FPU_SUPPORT != 2)
-void vPortTaskUsesFPU(void);
+ * created without an FPU context and must call vPortTaskUsesFPU() to give
+ * themselves an FPU context before using any FPU instructions. If
+ * configUSE_TASK_FPU_SUPPORT is set to 2 then all tasks will have an FPU context
+ * by default. */
+#if ( configUSE_TASK_FPU_SUPPORT != 2 )
+ void vPortTaskUsesFPU( void );
#else
+
/* Each task has an FPU context already, so define this function away to
- nothing to prevent it being called accidentally. */
-#define vPortTaskUsesFPU()
+ * nothing to prevent it being called accidentally. */
+ #define vPortTaskUsesFPU()
#endif
-#define portTASK_USES_FLOATING_POINT() vPortTaskUsesFPU()
+#define portTASK_USES_FLOATING_POINT() vPortTaskUsesFPU()
-#define portLOWEST_INTERRUPT_PRIORITY (((uint32_t)configUNIQUE_INTERRUPT_PRIORITIES) - 1UL)
-#define portLOWEST_USABLE_INTERRUPT_PRIORITY (portLOWEST_INTERRUPT_PRIORITY - 1UL)
+#define portLOWEST_INTERRUPT_PRIORITY ( ( ( uint32_t ) configUNIQUE_INTERRUPT_PRIORITIES ) - 1UL )
+#define portLOWEST_USABLE_INTERRUPT_PRIORITY ( portLOWEST_INTERRUPT_PRIORITY - 1UL )
/* Architecture specific optimisations. */
#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
-#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
+ #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#endif
#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
/* Store/clear the ready priorities in a bit map. */
-#define portRECORD_READY_PRIORITY(uxPriority, uxReadyPriorities) (uxReadyPriorities) |= (1UL << (uxPriority))
-#define portRESET_READY_PRIORITY(uxPriority, uxReadyPriorities) (uxReadyPriorities) &= ~(1UL << (uxPriority))
+ #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
+ #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )
/*-----------------------------------------------------------*/
-#define portGET_HIGHEST_PRIORITY(uxTopPriority, uxReadyPriorities) uxTopPriority = (31UL - (uint32_t)__builtin_clz(uxReadyPriorities))
+ #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - ( uint32_t ) __builtin_clz( uxReadyPriorities ) )
#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
#ifdef configASSERT
-void vPortValidateInterruptPriority(void);
-#define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority()
+ void vPortValidateInterruptPriority( void );
+ #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority()
#endif /* configASSERT */
-#define portNOP() __asm volatile("NOP")
-#define portINLINE __inline
-
-#ifdef __cplusplus
-} /* extern C */
-#endif
+#define portNOP() __asm volatile ( "NOP" )
+#define portINLINE __inline
/* The number of bits to shift for an interrupt priority is dependent on the
-number of bits implemented by the interrupt controller. */
+ * number of bits implemented by the interrupt controller. */
#if configUNIQUE_INTERRUPT_PRIORITIES == 16
- #define portPRIORITY_SHIFT 4
- #define portMAX_BINARY_POINT_VALUE 3
+ #define portPRIORITY_SHIFT 4
+ #define portMAX_BINARY_POINT_VALUE 3
#elif configUNIQUE_INTERRUPT_PRIORITIES == 32
- #define portPRIORITY_SHIFT 3
- #define portMAX_BINARY_POINT_VALUE 2
+ #define portPRIORITY_SHIFT 3
+ #define portMAX_BINARY_POINT_VALUE 2
#elif configUNIQUE_INTERRUPT_PRIORITIES == 64
- #define portPRIORITY_SHIFT 2
- #define portMAX_BINARY_POINT_VALUE 1
+ #define portPRIORITY_SHIFT 2
+ #define portMAX_BINARY_POINT_VALUE 1
#elif configUNIQUE_INTERRUPT_PRIORITIES == 128
- #define portPRIORITY_SHIFT 1
- #define portMAX_BINARY_POINT_VALUE 0
+ #define portPRIORITY_SHIFT 1
+ #define portMAX_BINARY_POINT_VALUE 0
#elif configUNIQUE_INTERRUPT_PRIORITIES == 256
- #define portPRIORITY_SHIFT 0
- #define portMAX_BINARY_POINT_VALUE 0
-#else
+ #define portPRIORITY_SHIFT 0
+ #define portMAX_BINARY_POINT_VALUE 0
+#else /* if configUNIQUE_INTERRUPT_PRIORITIES == 16 */
#error Invalid configUNIQUE_INTERRUPT_PRIORITIES setting. configUNIQUE_INTERRUPT_PRIORITIES must be set to the number of unique priorities implemented by the target hardware
-#endif
+#endif /* if configUNIQUE_INTERRUPT_PRIORITIES == 16 */
/* Interrupt controller access addresses. */
-#define portICCPMR_PRIORITY_MASK_OFFSET (0x04)
-#define portICCIAR_INTERRUPT_ACKNOWLEDGE_OFFSET (0x0C)
-#define portICCEOIR_END_OF_INTERRUPT_OFFSET (0x10)
-#define portICCBPR_BINARY_POINT_OFFSET (0x08)
-#define portICCRPR_RUNNING_PRIORITY_OFFSET (0x14)
+#define portICCPMR_PRIORITY_MASK_OFFSET ( 0x04 )
+#define portICCIAR_INTERRUPT_ACKNOWLEDGE_OFFSET ( 0x0C )
+#define portICCEOIR_END_OF_INTERRUPT_OFFSET ( 0x10 )
+#define portICCBPR_BINARY_POINT_OFFSET ( 0x08 )
+#define portICCRPR_RUNNING_PRIORITY_OFFSET ( 0x14 )
-#define portMEMORY_BARRIER() __asm volatile("" :: \
- : "memory")
+#define portMEMORY_BARRIER() __asm volatile ( "" ::: "memory" )
int xPortIsInsideInterrupt( void );
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ }
+#endif
+/* *INDENT-ON* */
+
#endif /* PORTMACRO_H */
diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch64/port.c b/third-party/freertos/portable/GCC/ft_platform/aarch64/port.c
index 7f56dd7bdef7e3776523b7964ec8f0f8c473e010..939a2cc8e36018ef36a24e609fa6434318fd8a22 100644
--- a/third-party/freertos/portable/GCC/ft_platform/aarch64/port.c
+++ b/third-party/freertos/portable/GCC/ft_platform/aarch64/port.c
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -37,82 +37,90 @@
#include "finterrupt.h"
#include "fgic_v3.h"
+#ifndef configINTERRUPT_CONTROLLER_BASE_ADDRESS
+ #error "configINTERRUPT_CONTROLLER_BASE_ADDRESS must be defined. See www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html"
+#endif
+
+#ifndef configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET
+ #error "configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET must be defined. See www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html"
+#endif
+
#ifndef configUNIQUE_INTERRUPT_PRIORITIES
- #error configUNIQUE_INTERRUPT_PRIORITIES must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
+ #error "configUNIQUE_INTERRUPT_PRIORITIES must be defined. See www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html"
#endif
#ifndef configSETUP_TICK_INTERRUPT
- #error configSETUP_TICK_INTERRUPT() must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
+ #error "configSETUP_TICK_INTERRUPT() must be defined. See www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html"
#endif /* configSETUP_TICK_INTERRUPT */
#ifndef configMAX_API_CALL_INTERRUPT_PRIORITY
- #error configMAX_API_CALL_INTERRUPT_PRIORITY must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
+ #error "configMAX_API_CALL_INTERRUPT_PRIORITY must be defined. See www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html"
#endif
#if configMAX_API_CALL_INTERRUPT_PRIORITY == 0
- #error configMAX_API_CALL_INTERRUPT_PRIORITY must not be set to 0
+ #error "configMAX_API_CALL_INTERRUPT_PRIORITY must not be set to 0"
#endif
#if configMAX_API_CALL_INTERRUPT_PRIORITY > configUNIQUE_INTERRUPT_PRIORITIES
- #error configMAX_API_CALL_INTERRUPT_PRIORITY must be less than or equal to configUNIQUE_INTERRUPT_PRIORITIES as the lower the numeric priority value the higher the logical interrupt priority
+ #error "configMAX_API_CALL_INTERRUPT_PRIORITY must be less than or equal to configUNIQUE_INTERRUPT_PRIORITIES as the lower the numeric priority value the higher the logical interrupt priority"
#endif
#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
/* Check the configuration. */
- #if (configMAX_PRIORITIES > 32)
- #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
+ #if ( configMAX_PRIORITIES > 32 )
+ #error "configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice."
#endif
#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
/* In case security extensions are implemented. */
-#if configMAX_API_CALL_INTERRUPT_PRIORITY <= (configUNIQUE_INTERRUPT_PRIORITIES / 2)
- #error configMAX_API_CALL_INTERRUPT_PRIORITY must be greater than ( configUNIQUE_INTERRUPT_PRIORITIES / 2 )
+#if configMAX_API_CALL_INTERRUPT_PRIORITY <= ( configUNIQUE_INTERRUPT_PRIORITIES / 2 )
+ #error "configMAX_API_CALL_INTERRUPT_PRIORITY must be greater than ( configUNIQUE_INTERRUPT_PRIORITIES / 2 )"
#endif
/* Some vendor specific files default configCLEAR_TICK_INTERRUPT() in
-portmacro.h. */
+ * portmacro.h. */
#ifndef configCLEAR_TICK_INTERRUPT
#define configCLEAR_TICK_INTERRUPT()
#endif
/* A critical section is exited when the critical section nesting count reaches
-this value. */
-#define portNO_CRITICAL_NESTING ((size_t)0)
+ * this value. */
+#define portNO_CRITICAL_NESTING ( ( size_t ) 0 )
/* In all GICs 255 can be written to the priority mask register to unmask all
-(but the lowest) interrupt priority. */
-#define portUNMASK_VALUE (0xFFUL)
+ * (but the lowest) interrupt priority. */
+#define portUNMASK_VALUE ( 0xFFUL )
/* Tasks are not created with a floating point context, but can be given a
-floating point context after they have been created. A variable is stored as
-part of the tasks context that holds portNO_FLOATING_POINT_CONTEXT if the task
-does not have an FPU context, or any other value if the task does have an FPU
-context. */
-#define portNO_FLOATING_POINT_CONTEXT ((StackType_t)0)
+ * floating point context after they have been created. A variable is stored as
+ * part of the tasks context that holds portNO_FLOATING_POINT_CONTEXT if the task
+ * does not have an FPU context, or any other value if the task does have an FPU
+ * context. */
+#define portNO_FLOATING_POINT_CONTEXT ( ( StackType_t ) 0 )
/* Constants required to setup the initial task context. */
-#define portSP_ELx ((StackType_t)0x01)
-#define portSP_EL0 ((StackType_t)0x00)
+#define portSP_ELx ( ( StackType_t ) 0x01 )
+#define portSP_EL0 ( ( StackType_t ) 0x00 )
-#if defined(GUEST)
- #define portEL1 ((StackType_t)0x04)
- #define portINITIAL_PSTATE (portEL1 | portSP_EL0)
+#if defined( GUEST )
+ #define portEL1 ( ( StackType_t ) 0x04 )
+ #define portINITIAL_PSTATE ( portEL1 | portSP_EL0 )
#else
- #define portEL3 ((StackType_t)0x0c)
+ #define portEL3 ( ( StackType_t ) 0x0c )
/* At the time of writing, the BSP only supports EL3. */
- #define portINITIAL_PSTATE (portEL3 | portSP_EL0)
+ #define portINITIAL_PSTATE ( portEL3 | portSP_EL0 )
#endif
+
/* Used by portASSERT_IF_INTERRUPT_PRIORITY_INVALID() when ensuring the binary
-point is zero. */
-#define portBINARY_POINT_BITS ((uint8_t)0x03)
+ * point is zero. */
+#define portBINARY_POINT_BITS ( ( uint8_t ) 0x03 )
/* Masks all bits in the APSR other than the mode bits. */
-#define portAPSR_MODE_BITS_MASK (0x0C)
+#define portAPSR_MODE_BITS_MASK ( 0x0C )
/* The I bit in the DAIF bits. */
-#define portDAIF_I (0x80)
-
+#define portDAIF_I ( 0x80 )
/* Macro to unmask all interrupt priorities. */
#define portCLEAR_INTERRUPT_MASK() \
@@ -125,9 +133,9 @@ point is zero. */
}
/* Hardware specifics used when sanity checking the configuration. */
-#define portINTERRUPT_PRIORITY_REGISTER_OFFSET 0x400UL
-#define portMAX_8_BIT_VALUE ( ( uint8_t ) 0xff )
-#define portBIT_0_SET ( ( uint8_t ) 0x01 )
+#define portINTERRUPT_PRIORITY_REGISTER_OFFSET 0x400UL
+#define portMAX_8_BIT_VALUE ( ( uint8_t ) 0xff )
+#define portBIT_0_SET ( ( uint8_t ) 0x01 )
/* Let the user override the pre-loading of the initial LR with the address of
* prvTaskExitError() in case it messes up unwinding of the stack in the
@@ -145,7 +153,7 @@ point is zero. */
* Starts the first task executing. This function is necessarily written in
* assembly code so is implemented in portASM.s.
*/
-extern void vPortRestoreTaskContext(void);
+extern void vPortRestoreTaskContext( void );
/*
* Used to catch tasks that attempt to return from their implementing function.
@@ -155,21 +163,21 @@ static void prvTaskExitError( void );
/*-----------------------------------------------------------*/
/* A variable is used to keep track of the critical section nesting. This
-variable has to be stored as part of the task context and must be initialised to
-a non zero value to ensure interrupts don't inadvertently become unmasked before
-the scheduler starts. As it is stored as part of the task context it will
-automatically be set to 0 when the first task is started. */
+ * variable has to be stored as part of the task context and must be initialised to
+ * a non zero value to ensure interrupts don't inadvertently become unmasked before
+ * the scheduler starts. As it is stored as part of the task context it will
+ * automatically be set to 0 when the first task is started. */
volatile uint64_t ullCriticalNesting = 9999ULL;
/* Saved as part of the task context. If ullPortTaskHasFPUContext is non-zero
-then floating point context must be saved and restored for the task. */
+ * then floating point context must be saved and restored for the task. */
uint64_t ullPortTaskHasFPUContext = pdFALSE;
/* Set to 1 to pend a context switch from an ISR. */
uint64_t ullPortYieldRequired = pdFALSE;
/* Counts the interrupt nesting depth. A context switch is only performed if
-if the nesting depth is 0. */
+ * if the nesting depth is 0. */
uint64_t ullPortInterruptNesting = 0;
/* The space on the stack required to hold the FPU registers. This is 32 128-bit
@@ -184,79 +192,82 @@ volatile uint64_t ullPortUnmask = portUNMASK_VALUE;
volatile uint8_t ucPriorityConfig = 0;
static void vPortPriorityConfigCheck(void);
+
/*-----------------------------------------------------------*/
/*
* See header file for description.
*/
-StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters)
+StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
+ TaskFunction_t pxCode,
+ void * pvParameters )
{
/* Setup the initial stack of the task. The stack is set exactly as
- expected by the portRESTORE_CONTEXT() macro. */
+ * expected by the portRESTORE_CONTEXT() macro. */
/* First all the general purpose registers. */
pxTopOfStack--;
- *pxTopOfStack = 0x0101010101010101ULL; /* R1 */
+ *pxTopOfStack = 0x0101010101010101ULL; /* R1 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)pvParameters; /* R0 */
+ *pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
pxTopOfStack--;
- *pxTopOfStack = 0x0303030303030303ULL; /* R3 */
+ *pxTopOfStack = 0x0303030303030303ULL; /* R3 */
pxTopOfStack--;
- *pxTopOfStack = 0x0202020202020202ULL; /* R2 */
+ *pxTopOfStack = 0x0202020202020202ULL; /* R2 */
pxTopOfStack--;
- *pxTopOfStack = 0x0505050505050505ULL; /* R5 */
+ *pxTopOfStack = 0x0505050505050505ULL; /* R5 */
pxTopOfStack--;
- *pxTopOfStack = 0x0404040404040404ULL; /* R4 */
+ *pxTopOfStack = 0x0404040404040404ULL; /* R4 */
pxTopOfStack--;
- *pxTopOfStack = 0x0707070707070707ULL; /* R7 */
+ *pxTopOfStack = 0x0707070707070707ULL; /* R7 */
pxTopOfStack--;
- *pxTopOfStack = 0x0606060606060606ULL; /* R6 */
+ *pxTopOfStack = 0x0606060606060606ULL; /* R6 */
pxTopOfStack--;
- *pxTopOfStack = 0x0909090909090909ULL; /* R9 */
+ *pxTopOfStack = 0x0909090909090909ULL; /* R9 */
pxTopOfStack--;
- *pxTopOfStack = 0x0808080808080808ULL; /* R8 */
+ *pxTopOfStack = 0x0808080808080808ULL; /* R8 */
pxTopOfStack--;
- *pxTopOfStack = 0x1111111111111111ULL; /* R11 */
+ *pxTopOfStack = 0x1111111111111111ULL; /* R11 */
pxTopOfStack--;
- *pxTopOfStack = 0x1010101010101010ULL; /* R10 */
+ *pxTopOfStack = 0x1010101010101010ULL; /* R10 */
pxTopOfStack--;
- *pxTopOfStack = 0x1313131313131313ULL; /* R13 */
+ *pxTopOfStack = 0x1313131313131313ULL; /* R13 */
pxTopOfStack--;
- *pxTopOfStack = 0x1212121212121212ULL; /* R12 */
+ *pxTopOfStack = 0x1212121212121212ULL; /* R12 */
pxTopOfStack--;
- *pxTopOfStack = 0x1515151515151515ULL; /* R15 */
+ *pxTopOfStack = 0x1515151515151515ULL; /* R15 */
pxTopOfStack--;
- *pxTopOfStack = 0x1414141414141414ULL; /* R14 */
+ *pxTopOfStack = 0x1414141414141414ULL; /* R14 */
pxTopOfStack--;
- *pxTopOfStack = 0x1717171717171717ULL; /* R17 */
+ *pxTopOfStack = 0x1717171717171717ULL; /* R17 */
pxTopOfStack--;
- *pxTopOfStack = 0x1616161616161616ULL; /* R16 */
+ *pxTopOfStack = 0x1616161616161616ULL; /* R16 */
pxTopOfStack--;
- *pxTopOfStack = 0x1919191919191919ULL; /* R19 */
+ *pxTopOfStack = 0x1919191919191919ULL; /* R19 */
pxTopOfStack--;
- *pxTopOfStack = 0x1818181818181818ULL; /* R18 */
+ *pxTopOfStack = 0x1818181818181818ULL; /* R18 */
pxTopOfStack--;
- *pxTopOfStack = 0x2121212121212121ULL; /* R21 */
+ *pxTopOfStack = 0x2121212121212121ULL; /* R21 */
pxTopOfStack--;
- *pxTopOfStack = 0x2020202020202020ULL; /* R20 */
+ *pxTopOfStack = 0x2020202020202020ULL; /* R20 */
pxTopOfStack--;
- *pxTopOfStack = 0x2323232323232323ULL; /* R23 */
+ *pxTopOfStack = 0x2323232323232323ULL; /* R23 */
pxTopOfStack--;
- *pxTopOfStack = 0x2222222222222222ULL; /* R22 */
+ *pxTopOfStack = 0x2222222222222222ULL; /* R22 */
pxTopOfStack--;
- *pxTopOfStack = 0x2525252525252525ULL; /* R25 */
+ *pxTopOfStack = 0x2525252525252525ULL; /* R25 */
pxTopOfStack--;
- *pxTopOfStack = 0x2424242424242424ULL; /* R24 */
+ *pxTopOfStack = 0x2424242424242424ULL; /* R24 */
pxTopOfStack--;
- *pxTopOfStack = 0x2727272727272727ULL; /* R27 */
+ *pxTopOfStack = 0x2727272727272727ULL; /* R27 */
pxTopOfStack--;
- *pxTopOfStack = 0x2626262626262626ULL; /* R26 */
+ *pxTopOfStack = 0x2626262626262626ULL; /* R26 */
pxTopOfStack--;
- *pxTopOfStack = 0x2929292929292929ULL; /* R29 */
+ *pxTopOfStack = 0x2929292929292929ULL; /* R29 */
pxTopOfStack--;
- *pxTopOfStack = 0x2828282828282828ULL; /* R28 */
+ *pxTopOfStack = 0x2828282828282828ULL; /* R28 */
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)0x00; /* XZR - has no effect, used so there are an even number of registers. */
+ *pxTopOfStack = ( StackType_t ) 0x00; /* XZR - has no effect, used so there are an even number of registers. */
pxTopOfStack--;
*pxTopOfStack = (StackType_t)portTASK_RETURN_ADDRESS; /* R30 - procedure call link register. */
pxTopOfStack--;
@@ -264,7 +275,7 @@ StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, TaskFunction_t pxC
*pxTopOfStack = portINITIAL_PSTATE;
pxTopOfStack--;
- *pxTopOfStack = (StackType_t)pxCode; /* Exception return address. */
+ *pxTopOfStack = ( StackType_t ) pxCode; /* Exception return address. */
pxTopOfStack--;
#if( configUSE_TASK_FPU_SUPPORT == 1 )
@@ -295,7 +306,7 @@ StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, TaskFunction_t pxC
}
#else
{
-#error Invalid configUSE_TASK_FPU_SUPPORT setting - configUSE_TASK_FPU_SUPPORT must be set to 1, 2, or left undefined.
+#error "Invalid configUSE_TASK_FPU_SUPPORT setting - configUSE_TASK_FPU_SUPPORT must be set to 1, 2, or left undefined."
}
#endif
@@ -331,29 +342,33 @@ BaseType_t xPortStartScheduler(void)
__asm volatile("MRS %0, CurrentEL"
: "=r"(ulAPSR));
ulAPSR &= portAPSR_MODE_BITS_MASK;
-#if defined(GUEST)
- configASSERT(ulAPSR == portEL1);
- if (ulAPSR == portEL1)
-#else
- configASSERT(ulAPSR == portEL3);
- if (ulAPSR == portEL3)
-#endif
+
+ #if defined( GUEST )
+ configASSERT( ulAPSR == portEL1 );
+
+ if( ulAPSR == portEL1 )
+ #else
+ configASSERT( ulAPSR == portEL3 );
+
+ if( ulAPSR == portEL3 )
+ #endif
{
/* Only continue if the binary point value is set to its lowest possible
- setting. See the comments in vPortValidateInterruptPriority() below for
- more information. */
+ * setting. See the comments in vPortValidateInterruptPriority() below for
+ * more information. */
configASSERT((FGicGetICC_BPR1() & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE);
if ((FGicGetICC_BPR1() & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE)
{
/* Interrupts are turned off in the CPU itself to ensure a tick does
- not execute while the scheduler is being started. Interrupts are
- automatically turned back on in the CPU when the first task starts
- executing. */
+ * not execute while the scheduler is being started. Interrupts are
+ * automatically turned back on in the CPU when the first task starts
+ * executing. */
portDISABLE_INTERRUPTS();
/* Start the timer that generates the tick ISR. */
configSETUP_TICK_INTERRUPT();
+
/* Start the first task executing. */
vPortRestoreTaskContext();
}
@@ -363,75 +378,74 @@ BaseType_t xPortStartScheduler(void)
}
/*-----------------------------------------------------------*/
-void vPortEndScheduler(void)
+void vPortEndScheduler( void )
{
/* Not implemented in ports where there is nothing to return to.
- Artificially force an assert. */
- configASSERT(ullCriticalNesting == 1000ULL);
+ * Artificially force an assert. */
+ configASSERT( ullCriticalNesting == 1000ULL );
}
/*-----------------------------------------------------------*/
-void vPortEnterCritical(void)
+void vPortEnterCritical( void )
{
/* Mask interrupts up to the max syscall interrupt priority. */
uxPortSetInterruptMask();
/* Now interrupts are disabled ullCriticalNesting can be accessed
- directly. Increment ullCriticalNesting to keep a count of how many times
- portENTER_CRITICAL() has been called. */
+ * directly. Increment ullCriticalNesting to keep a count of how many times
+ * portENTER_CRITICAL() has been called. */
ullCriticalNesting++;
/* This is not the interrupt safe version of the enter critical function so
- assert() if it is being called from an interrupt context. Only API
- functions that end in "FromISR" can be used in an interrupt. Only assert if
- the critical nesting count is 1 to protect against recursive calls if the
- assert function also uses a critical section. */
- if (ullCriticalNesting == 1ULL)
+ * assert() if it is being called from an interrupt context. Only API
+ * functions that end in "FromISR" can be used in an interrupt. Only assert if
+ * the critical nesting count is 1 to protect against recursive calls if the
+ * assert function also uses a critical section. */
+ if( ullCriticalNesting == 1ULL )
{
- configASSERT(ullPortInterruptNesting == 0);
+ configASSERT( ullPortInterruptNesting == 0 );
}
}
/*-----------------------------------------------------------*/
-void vPortExitCritical(void)
+void vPortExitCritical( void )
{
- if (ullCriticalNesting > portNO_CRITICAL_NESTING)
+ if( ullCriticalNesting > portNO_CRITICAL_NESTING )
{
/* Decrement the nesting count as the critical section is being
- exited. */
+ * exited. */
ullCriticalNesting--;
/* If the nesting level has reached zero then all interrupt
- priorities must be re-enabled. */
- if (ullCriticalNesting == portNO_CRITICAL_NESTING)
+ * priorities must be re-enabled. */
+ if( ullCriticalNesting == portNO_CRITICAL_NESTING )
{
/* Critical nesting has reached zero so all interrupt priorities
- should be unmasked. */
+ * should be unmasked. */
portCLEAR_INTERRUPT_MASK();
}
}
}
/*-----------------------------------------------------------*/
-void FreeRTOS_Tick_Handler(void)
+void FreeRTOS_Tick_Handler( void )
{
/* Interrupts should not be enabled before this point. */
-#if (configASSERT_DEFINED == 1)
+ #if ( configASSERT_DEFINED == 1 )
{
uint32_t ulMaskBits;
- __asm volatile("mrs %0, daif"
- : "=r"(ulMaskBits)::"memory");
- configASSERT((ulMaskBits & portDAIF_I) != 0);
+ __asm volatile ( "mrs %0, daif" : "=r" ( ulMaskBits )::"memory" );
+ configASSERT( ( ulMaskBits & portDAIF_I ) != 0 );
}
-#endif /* configASSERT_DEFINED */
+ #endif /* configASSERT_DEFINED */
/* Set interrupt mask before altering scheduler structures. The tick
- handler runs at the lowest priority, so interrupts cannot already be masked,
- so there is no need to save and restore the current mask value. It is
- necessary to turn off interrupts in the CPU itself while the ICCPMR is being
- updated. */
+ * handler runs at the lowest priority, so interrupts cannot already be masked,
+ * so there is no need to save and restore the current mask value. It is
+ * necessary to turn off interrupts in the CPU itself while the ICCPMR is being
+ * updated. */
InterruptSetPriorityMask(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT);
__asm volatile("dsb sy \n"
@@ -453,31 +467,32 @@ void FreeRTOS_Tick_Handler(void)
}
/*-----------------------------------------------------------*/
-void vPortTaskUsesFPU(void)
+void vPortTaskUsesFPU( void )
{
/* A task is registering the fact that it needs an FPU context. Set the
- FPU flag (which is saved as part of the task context). */
+ * FPU flag (which is saved as part of the task context). */
ullPortTaskHasFPUContext = pdTRUE;
+
/* Consider initialising the FPSR here - but probably not necessary in
- AArch64. */
+ * AArch64. */
}
/*-----------------------------------------------------------*/
-void vPortClearInterruptMask(UBaseType_t uxNewMaskValue)
+void vPortClearInterruptMask( UBaseType_t uxNewMaskValue )
{
- if (uxNewMaskValue == pdFALSE)
+ if( uxNewMaskValue == pdFALSE )
{
portCLEAR_INTERRUPT_MASK();
}
}
+/*-----------------------------------------------------------*/
-
-UBaseType_t uxPortSetInterruptMask(void)
+UBaseType_t uxPortSetInterruptMask( void )
{
uint32_t ulReturn;
/* Interrupt in the CPU must be turned off while the ICCPMR is being
- updated. */
+ * updated. */
portDISABLE_INTERRUPTS();
if (InterruptGetPriorityMask() == (uint32_t)(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT))
{
@@ -498,50 +513,42 @@ UBaseType_t uxPortSetInterruptMask(void)
}
/*-----------------------------------------------------------*/
-#if (configASSERT_DEFINED == 1)
+#if ( configASSERT_DEFINED == 1 )
-void vPortValidateInterruptPriority(void)
-{
- /* The following assertion will fail if a service routine (ISR) for
- an interrupt that has been assigned a priority above
- configMAX_SYSCALL_INTERRUPT_PRIORITY calls an ISR safe FreeRTOS API
- function. ISR safe FreeRTOS API functions must *only* be called
- from interrupts that have been assigned a priority at or below
- configMAX_SYSCALL_INTERRUPT_PRIORITY.
-
- Numerically low interrupt priority numbers represent logically high
- interrupt priorities, therefore the priority of the interrupt must
- be set to a value equal to or numerically *higher* than
- configMAX_SYSCALL_INTERRUPT_PRIORITY.
-
- FreeRTOS maintains separate thread and ISR API functions to ensure
- interrupt entry is as fast and simple as possible. */
+ void vPortValidateInterruptPriority( void )
+ {
+ /* The following assertion will fail if a service routine (ISR) for
+ * an interrupt that has been assigned a priority above
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY calls an ISR safe FreeRTOS API
+ * function. ISR safe FreeRTOS API functions must *only* be called
+ * from interrupts that have been assigned a priority at or below
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY.
+ *
+ * Numerically low interrupt priority numbers represent logically high
+ * interrupt priorities, therefore the priority of the interrupt must
+ * be set to a value equal to or numerically *higher* than
+ * configMAX_SYSCALL_INTERRUPT_PRIORITY.
+ *
+ * FreeRTOS maintains separate thread and ISR API functions to ensure
+ * interrupt entry is as fast and simple as possible. */
configASSERT(InterruptGetCurrentPriority() >= (uint32_t)(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT));
- /* Priority grouping: The interrupt controller (GIC) allows the bits
- that define each interrupt's priority to be split between bits that
- define the interrupt's pre-emption priority bits and bits that define
- the interrupt's sub-priority. For simplicity all bits must be defined
- to be pre-emption priority bits. The following assertion will fail if
- this is not the case (if some bits represent a sub-priority).
-
- The priority grouping is configured by the GIC's binary point register
- (ICCBPR). Writting 0 to ICCBPR will ensure it is set to its lowest
- possible value (which may be above 0). */
+ /* Priority grouping: The interrupt controller (GIC) allows the bits
+ * that define each interrupt's priority to be split between bits that
+ * define the interrupt's pre-emption priority bits and bits that define
+ * the interrupt's sub-priority. For simplicity all bits must be defined
+ * to be pre-emption priority bits. The following assertion will fail if
+ * this is not the case (if some bits represent a sub-priority).
+ *
+ * The priority grouping is configured by the GIC's binary point register
+ * (ICCBPR). Writting 0 to ICCBPR will ensure it is set to its lowest
+ * possible value (which may be above 0). */
configASSERT((FGicGetICC_BPR1() & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE);
}
#endif /* configASSERT_DEFINED */
/*-----------------------------------------------------------*/
-_WEAK void vApplicationTickHook(void)
-{
-}
-
-_WEAK void vApplicationIdleHook(void)
-{
-}
-
void vTaskSwitchSPx(void)
{
printf("Switch task in interrupt is error.");
diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch64/portASM.S b/third-party/freertos/portable/GCC/ft_platform/aarch64/portASM.S
index c703e97f41421d1d264b45fd98b5ad9452c27931..729a4e05a8614dc10a07c43f5b38982167941758 100644
--- a/third-party/freertos/portable/GCC/ft_platform/aarch64/portASM.S
+++ b/third-party/freertos/portable/GCC/ft_platform/aarch64/portASM.S
@@ -1,6 +1,8 @@
/*
- * FreeRTOS Kernel V10.0.1
- * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -19,10 +21,9 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * http://www.FreeRTOS.org
- * http://aws.amazon.com/freertos
+ * https://www.FreeRTOS.org
+ * https://github.com/FreeRTOS
*
- * 1 tab == 4 spaces!
*/
#define ICC_EOIR1_EL1 S3_0_C12_C12_1
@@ -118,175 +119,174 @@
.macro portSAVE_CONTEXT
- /* Switch to use the EL0 stack pointer. */
- MSR SPSEL, #0
-
- /* Save the entire context. */
- STP X0, X1, [SP, #-0x10]!
- STP X2, X3, [SP, #-0x10]!
- STP X4, X5, [SP, #-0x10]!
- STP X6, X7, [SP, #-0x10]!
- STP X8, X9, [SP, #-0x10]!
- STP X10, X11, [SP, #-0x10]!
- STP X12, X13, [SP, #-0x10]!
- STP X14, X15, [SP, #-0x10]!
- STP X16, X17, [SP, #-0x10]!
- STP X18, X19, [SP, #-0x10]!
- STP X20, X21, [SP, #-0x10]!
- STP X22, X23, [SP, #-0x10]!
- STP X24, X25, [SP, #-0x10]!
- STP X26, X27, [SP, #-0x10]!
- STP X28, X29, [SP, #-0x10]!
- STP X30, XZR, [SP, #-0x10]!
-
- /* Save the SPSR. */
+
+ /* Switch to use the EL0 stack pointer. */
+ MSR SPSEL, #0
+
+ /* Save the entire context. */
+ STP X0, X1, [SP, #-0x10]!
+ STP X2, X3, [SP, #-0x10]!
+ STP X4, X5, [SP, #-0x10]!
+ STP X6, X7, [SP, #-0x10]!
+ STP X8, X9, [SP, #-0x10]!
+ STP X10, X11, [SP, #-0x10]!
+ STP X12, X13, [SP, #-0x10]!
+ STP X14, X15, [SP, #-0x10]!
+ STP X16, X17, [SP, #-0x10]!
+ STP X18, X19, [SP, #-0x10]!
+ STP X20, X21, [SP, #-0x10]!
+ STP X22, X23, [SP, #-0x10]!
+ STP X24, X25, [SP, #-0x10]!
+ STP X26, X27, [SP, #-0x10]!
+ STP X28, X29, [SP, #-0x10]!
+ STP X30, XZR, [SP, #-0x10]!
+
+ /* Save the SPSR. */
#if defined( GUEST )
- MRS X3, SPSR_EL1
- MRS X2, ELR_EL1
+ MRS X3, SPSR_EL1
+ MRS X2, ELR_EL1
#else
- MRS X3, SPSR_EL3
- /* Save the ELR. */
- MRS X2, ELR_EL3
+ MRS X3, SPSR_EL3
+ /* Save the ELR. */
+ MRS X2, ELR_EL3
#endif
- STP X2, X3, [SP, #-0x10]!
-
- /* Save the critical section nesting depth. */
- LDR X0, ullCriticalNestingConst
- LDR X3, [X0]
-
- /* Save the FPU context indicator. */
- LDR X0, ullPortTaskHasFPUContextConst
- LDR X2, [X0]
-
- /* Save the FPU context, if any (32 128-bit registers). */
- CMP X2, #0
- B.EQ 1f
- STP Q0, Q1, [SP,#-0x20]!
- STP Q2, Q3, [SP,#-0x20]!
- STP Q4, Q5, [SP,#-0x20]!
- STP Q6, Q7, [SP,#-0x20]!
- STP Q8, Q9, [SP,#-0x20]!
- STP Q10, Q11, [SP,#-0x20]!
- STP Q12, Q13, [SP,#-0x20]!
- STP Q14, Q15, [SP,#-0x20]!
- STP Q16, Q17, [SP,#-0x20]!
- STP Q18, Q19, [SP,#-0x20]!
- STP Q20, Q21, [SP,#-0x20]!
- STP Q22, Q23, [SP,#-0x20]!
- STP Q24, Q25, [SP,#-0x20]!
- STP Q26, Q27, [SP,#-0x20]!
- STP Q28, Q29, [SP,#-0x20]!
- STP Q30, Q31, [SP,#-0x20]!
+ STP X2, X3, [SP, #-0x10]!
+
+ /* Save the critical section nesting depth. */
+ LDR X0, ullCriticalNestingConst
+ LDR X3, [X0]
+
+ /* Save the FPU context indicator. */
+ LDR X0, ullPortTaskHasFPUContextConst
+ LDR X2, [X0]
+
+ /* Save the FPU context, if any (32 128-bit registers). */
+ CMP X2, #0
+ B.EQ 1f
+ STP Q0, Q1, [SP,#-0x20]!
+ STP Q2, Q3, [SP,#-0x20]!
+ STP Q4, Q5, [SP,#-0x20]!
+ STP Q6, Q7, [SP,#-0x20]!
+ STP Q8, Q9, [SP,#-0x20]!
+ STP Q10, Q11, [SP,#-0x20]!
+ STP Q12, Q13, [SP,#-0x20]!
+ STP Q14, Q15, [SP,#-0x20]!
+ STP Q16, Q17, [SP,#-0x20]!
+ STP Q18, Q19, [SP,#-0x20]!
+ STP Q20, Q21, [SP,#-0x20]!
+ STP Q22, Q23, [SP,#-0x20]!
+ STP Q24, Q25, [SP,#-0x20]!
+ STP Q26, Q27, [SP,#-0x20]!
+ STP Q28, Q29, [SP,#-0x20]!
+ STP Q30, Q31, [SP,#-0x20]!
1:
- /* Store the critical nesting count and FPU context indicator. */
- STP X2, X3, [SP, #-0x10]!
+ /* Store the critical nesting count and FPU context indicator. */
+ STP X2, X3, [SP, #-0x10]!
- LDR X0, pxCurrentTCBConst
- LDR X1, [X0]
- MOV X0, SP /* Move SP into X0 for saving. */
- STR X0, [X1]
+ LDR X0, pxCurrentTCBConst
+ LDR X1, [X0]
+ MOV X0, SP /* Move SP into X0 for saving. */
+ STR X0, [X1]
- /* Switch to use the ELx stack pointer. */
- MSR SPSEL, #1
+ /* Switch to use the ELx stack pointer. */
+ MSR SPSEL, #1
- .endm
+ .endm
; /**********************************************************************/
-
.macro portRESTORE_CONTEXT
- /* Switch to use the EL0 stack pointer. */
- MSR SPSEL, #0
+ /* Switch to use the EL0 stack pointer. */
+ MSR SPSEL, #0
- /* Set the SP to point to the stack of the task being restored. */
- LDR X0, pxCurrentTCBConst
- LDR X1, [X0]
- LDR X0, [X1]
- MOV SP, X0
+ /* Set the SP to point to the stack of the task being restored. */
+ LDR X0, pxCurrentTCBConst
+ LDR X1, [X0]
+ LDR X0, [X1]
+ MOV SP, X0
- LDP X2, X3, [SP], #0x10 /* Critical nesting and FPU context. */
+ LDP X2, X3, [SP], #0x10 /* Critical nesting and FPU context. */
- /* Set the PMR register to be correct for the current critical nesting
- depth. */
- LDR X0, ullCriticalNestingConst /* X0 holds the address of ullCriticalNesting. */
+ /* Set the PMR register to be correct for the current critical nesting
+ depth. */
+ LDR X0, ullCriticalNestingConst /* X0 holds the address of ullCriticalNesting. */
LDR X1, ullPortUnmaskConst /* X1 holds the unmask value. */
LDR X1, [X1]
CMP X3, #0
- B.EQ 1f
- LDR X6, ullMaxAPIPriorityMaskConst
- LDR X1, [X6] /* X1 holds the mask value. */
+ B.EQ 1f
+ LDR X6, ullMaxAPIPriorityMaskConst
+ LDR X1, [X6] /* X1 holds the mask value. */
1:
//STR W1, [X5] /* Write the mask value to ICCPMR. */
MSR S3_0_C4_C6_0, X1
- DSB SY /* _RB_Barriers probably not required here. */
- ISB SY
- STR X3, [X0] /* Restore the task's critical nesting count. */
-
- /* Restore the FPU context indicator. */
- LDR X0, ullPortTaskHasFPUContextConst
- STR X2, [X0]
-
- /* Restore the FPU context, if any. */
- CMP X2, #0
- B.EQ 1f
-
- LDP Q30, Q31, [SP], #0x20
- LDP Q28, Q29, [SP], #0x20
- LDP Q26, Q27, [SP], #0x20
- LDP Q24, Q25, [SP], #0x20
- LDP Q22, Q23, [SP], #0x20
- LDP Q20, Q21, [SP], #0x20
- LDP Q18, Q19, [SP], #0x20
- LDP Q16, Q17, [SP], #0x20
- LDP Q14, Q15, [SP], #0x20
- LDP Q12, Q13, [SP], #0x20
- LDP Q10, Q11, [SP], #0x20
- LDP Q8, Q9, [SP], #0x20
- LDP Q6, Q7, [SP], #0x20
- LDP Q4, Q5, [SP], #0x20
- LDP Q2, Q3, [SP], #0x20
- LDP Q0, Q1, [SP], #0x20
+ DSB SY /* _RB_Barriers probably not required here. */
+ ISB SY
+ STR X3, [X0] /* Restore the task's critical nesting count. */
+
+ /* Restore the FPU context indicator. */
+ LDR X0, ullPortTaskHasFPUContextConst
+ STR X2, [X0]
+
+ /* Restore the FPU context, if any. */
+ CMP X2, #0
+ B.EQ 1f
+ LDP Q30, Q31, [SP], #0x20
+ LDP Q28, Q29, [SP], #0x20
+ LDP Q26, Q27, [SP], #0x20
+ LDP Q24, Q25, [SP], #0x20
+ LDP Q22, Q23, [SP], #0x20
+ LDP Q20, Q21, [SP], #0x20
+ LDP Q18, Q19, [SP], #0x20
+ LDP Q16, Q17, [SP], #0x20
+ LDP Q14, Q15, [SP], #0x20
+ LDP Q12, Q13, [SP], #0x20
+ LDP Q10, Q11, [SP], #0x20
+ LDP Q8, Q9, [SP], #0x20
+ LDP Q6, Q7, [SP], #0x20
+ LDP Q4, Q5, [SP], #0x20
+ LDP Q2, Q3, [SP], #0x20
+ LDP Q0, Q1, [SP], #0x20
1:
- LDP X2, X3, [SP], #0x10 /* SPSR and ELR. */
+ LDP X2, X3, [SP], #0x10 /* SPSR and ELR. */
#if defined( GUEST )
- /* Restore the SPSR. */
- MSR SPSR_EL1, X3
- /* Restore the ELR. */
- MSR ELR_EL1, X2
+ /* Restore the SPSR. */
+ MSR SPSR_EL1, X3
+ /* Restore the ELR. */
+ MSR ELR_EL1, X2
#else
- /* Restore the SPSR. */
- MSR SPSR_EL3, X3 /*_RB_ Assumes started in EL3. */
- /* Restore the ELR. */
- MSR ELR_EL3, X2
+ /* Restore the SPSR. */
+ MSR SPSR_EL3, X3 /*_RB_ Assumes started in EL3. */
+ /* Restore the ELR. */
+ MSR ELR_EL3, X2
#endif
- LDP X30, XZR, [SP], #0x10
- LDP X28, X29, [SP], #0x10
- LDP X26, X27, [SP], #0x10
- LDP X24, X25, [SP], #0x10
- LDP X22, X23, [SP], #0x10
- LDP X20, X21, [SP], #0x10
- LDP X18, X19, [SP], #0x10
- LDP X16, X17, [SP], #0x10
- LDP X14, X15, [SP], #0x10
- LDP X12, X13, [SP], #0x10
- LDP X10, X11, [SP], #0x10
- LDP X8, X9, [SP], #0x10
- LDP X6, X7, [SP], #0x10
- LDP X4, X5, [SP], #0x10
- LDP X2, X3, [SP], #0x10
- LDP X0, X1, [SP], #0x10
-
- /* Switch to use the ELx stack pointer. _RB_ Might not be required. */
- MSR SPSEL, #1
-
- ERET
+ LDP X30, XZR, [SP], #0x10
+ LDP X28, X29, [SP], #0x10
+ LDP X26, X27, [SP], #0x10
+ LDP X24, X25, [SP], #0x10
+ LDP X22, X23, [SP], #0x10
+ LDP X20, X21, [SP], #0x10
+ LDP X18, X19, [SP], #0x10
+ LDP X16, X17, [SP], #0x10
+ LDP X14, X15, [SP], #0x10
+ LDP X12, X13, [SP], #0x10
+ LDP X10, X11, [SP], #0x10
+ LDP X8, X9, [SP], #0x10
+ LDP X6, X7, [SP], #0x10
+ LDP X4, X5, [SP], #0x10
+ LDP X2, X3, [SP], #0x10
+ LDP X0, X1, [SP], #0x10
+
+ /* Switch to use the ELx stack pointer. _RB_ Might not be required. */
+ MSR SPSEL, #1
- .endm
+ ERET
+
+ .endm
/******************************************************************************
@@ -296,28 +296,29 @@
.type vSynchronousInterruptHandler, %function
vSynchronousInterruptHandler:
- /* store value */
+ /* store X0 X1 value */
STP X0, X1, [SP, #-0x10]!
-
+
+ /* Save the context of the current task and select a new task to run. */
+ portSAVE_CONTEXT
+
#if defined( GUEST )
- MRS X0, ESR_EL1
+ MRS X0, ESR_EL1
#else
- MRS X0, ESR_EL3
+ MRS X0, ESR_EL3
#endif
- LSR X1, X0, #26
+ LSR X1, X0, #26
#if defined( GUEST )
- CMP X1, #0x15 /* 0x15 = SVC instruction. */
+ CMP X1, #0x15 /* 0x15 = SVC instruction. */
#else
- CMP X1, #0x17 /* 0x17 = SMC instruction. */
+ CMP X1, #0x17 /* 0x17 = SMC instruction. */
#endif
B.NE vSynchronousHandler
-
- /* Save the context of the current task and select a new task to run. */
- portSAVE_CONTEXT
-
+
+ /* Restore X0 X1 value. */
LDP X0, X1, [SP], #0x10
BL vTaskSwitchContext
@@ -326,7 +327,7 @@ vSynchronousInterruptHandler:
vSynchronousHandler:
- /* Restore the value. */
+ /* Restore X0 X1 value. */
LDP X0, X1, [SP], #0x10
SaveRegister
@@ -411,20 +412,21 @@ vSErrorInterruptHandler:
.align 8
.type vPortRestoreTaskContext, %function
vPortRestoreTaskContext:
-.set freertos_vector_base, _freertos_vector_table
-
- /* Install the FreeRTOS interrupt handlers. */
- LDR X1, =freertos_vector_base
+.set freertos_vector_base, _freertos_vector_table
+
+ /* Install the FreeRTOS interrupt handlers. */
+ LDR X1, =freertos_vector_base
#if defined( GUEST )
- MSR VBAR_EL1, X1
+ MSR VBAR_EL1, X1
#else
- MSR VBAR_EL3, X1
+ MSR VBAR_EL3, X1
#endif
- DSB SY
- ISB SY
+ DSB SY
+ ISB SY
+
+ /* Start the first task. */
+ portRESTORE_CONTEXT
- /* Start the first task. */
- portRESTORE_CONTEXT
/******************************************************************************
* FreeRTOS_IRQ_Handler handles IRQ entry and exit.
@@ -432,133 +434,133 @@ vPortRestoreTaskContext:
.align 8
.type FreeRTOS_IRQ_Handler, %function
FreeRTOS_IRQ_Handler:
- /* Save volatile registers. */
- STP X0, X1, [SP, #-0x10]!
- STP X2, X3, [SP, #-0x10]!
- STP X4, X5, [SP, #-0x10]!
- STP X6, X7, [SP, #-0x10]!
- STP X8, X9, [SP, #-0x10]!
- STP X10, X11, [SP, #-0x10]!
- STP X12, X13, [SP, #-0x10]!
- STP X14, X15, [SP, #-0x10]!
- STP X16, X17, [SP, #-0x10]!
- STP X18, X19, [SP, #-0x10]!
- STP X29, X30, [SP, #-0x10]!
-
- /* Save the SPSR and ELR. */
+ /* Save volatile registers. */
+ STP X0, X1, [SP, #-0x10]!
+ STP X2, X3, [SP, #-0x10]!
+ STP X4, X5, [SP, #-0x10]!
+ STP X6, X7, [SP, #-0x10]!
+ STP X8, X9, [SP, #-0x10]!
+ STP X10, X11, [SP, #-0x10]!
+ STP X12, X13, [SP, #-0x10]!
+ STP X14, X15, [SP, #-0x10]!
+ STP X16, X17, [SP, #-0x10]!
+ STP X18, X19, [SP, #-0x10]!
+ STP X29, X30, [SP, #-0x10]!
+
+ /* Save the SPSR and ELR. */
#if defined( GUEST )
- MRS X3, SPSR_EL1
- MRS X2, ELR_EL1
+ MRS X3, SPSR_EL1
+ MRS X2, ELR_EL1
#else
- MRS X3, SPSR_EL3
- MRS X2, ELR_EL3
+ MRS X3, SPSR_EL3
+ MRS X2, ELR_EL3
#endif
- STP X2, X3, [SP, #-0x10]!
+ STP X2, X3, [SP, #-0x10]!
- /* Increment the interrupt nesting counter. */
- LDR X5, ullPortInterruptNestingConst
- LDR X1, [X5] /* Old nesting count in X1. */
- ADD X6, X1, #1
- STR X6, [X5] /* Address of nesting count variable in X5. */
+ /* Increment the interrupt nesting counter. */
+ LDR X5, ullPortInterruptNestingConst
+ LDR X1, [X5] /* Old nesting count in X1. */
+ ADD X6, X1, #1
+ STR X6, [X5] /* Address of nesting count variable in X5. */
- /* Maintain the interrupt nesting information across the function call. */
- STP X1, X5, [SP, #-0x10]!
+ /* Maintain the interrupt nesting information across the function call. */
+ STP X1, X5, [SP, #-0x10]!
- /* Read value from the interrupt acknowledge register, which is stored in W0
- for future parameter and interrupt clearing use. */
+ /* Read value from the interrupt acknowledge register, which is stored in W0
+ for future parameter and interrupt clearing use. */
MRS X0, ICC_IAR1_EL1 /* ICCIAR in x0 as parameter. */
- /* Maintain the ICCIAR value across the function call. */
- STP X0, X1, [SP, #-0x10]!
+ /* Maintain the ICCIAR value across the function call. */
+ STP X0, X1, [SP, #-0x10]!
- /* Call the C handler. */
+ /* Call the C handler. */
BL vApplicationInterruptHandler
- /* Disable interrupts. */
- MSR DAIFSET, #2
- DSB SY
- ISB SY
+ /* Disable interrupts. */
+ MSR DAIFSET, #2
+ DSB SY
+ ISB SY
- /* Restore the ICCIAR value. */
- LDP X0, X1, [SP], #0x10
+ /* Restore the ICCIAR value. */
+ LDP X0, X1, [SP], #0x10
- /* End IRQ processing by writing ICCIAR to the EOI register. */
+ /* End IRQ processing by writing ICCIAR to the EOI register. */
MSR ICC_EOIR1_EL1, x0
- /* Restore the critical nesting count. */
- LDP X1, X5, [SP], #0x10
- STR X1, [X5]
+ /* Restore the critical nesting count. */
+ LDP X1, X5, [SP], #0x10
+ STR X1, [X5]
- /* Has interrupt nesting unwound? */
- CMP X1, #0
- B.NE Exit_IRQ_No_Context_Switch
+ /* Has interrupt nesting unwound? */
+ CMP X1, #0
+ B.NE Exit_IRQ_No_Context_Switch
- /* Is a context switch required? */
- LDR X0, ullPortYieldRequiredConst
- LDR X1, [X0]
- CMP X1, #0
- B.EQ Exit_IRQ_No_Context_Switch
+ /* Is a context switch required? */
+ LDR X0, ullPortYieldRequiredConst
+ LDR X1, [X0]
+ CMP X1, #0
+ B.EQ Exit_IRQ_No_Context_Switch
- /* Reset ullPortYieldRequired to 0. */
- MOV X2, #0
- STR X2, [X0]
+ /* Reset ullPortYieldRequired to 0. */
+ MOV X2, #0
+ STR X2, [X0]
- /* Restore volatile registers. */
- LDP X4, X5, [SP], #0x10 /* SPSR and ELR. */
+ /* Restore volatile registers. */
+ LDP X4, X5, [SP], #0x10 /* SPSR and ELR. */
#if defined( GUEST )
- MSR SPSR_EL1, X5
- MSR ELR_EL1, X4
+ MSR SPSR_EL1, X5
+ MSR ELR_EL1, X4
#else
- MSR SPSR_EL3, X5 /*_RB_ Assumes started in EL3. */
- MSR ELR_EL3, X4
+ MSR SPSR_EL3, X5 /*_RB_ Assumes started in EL3. */
+ MSR ELR_EL3, X4
#endif
- DSB SY
- ISB SY
-
- LDP X29, X30, [SP], #0x10
- LDP X18, X19, [SP], #0x10
- LDP X16, X17, [SP], #0x10
- LDP X14, X15, [SP], #0x10
- LDP X12, X13, [SP], #0x10
- LDP X10, X11, [SP], #0x10
- LDP X8, X9, [SP], #0x10
- LDP X6, X7, [SP], #0x10
- LDP X4, X5, [SP], #0x10
- LDP X2, X3, [SP], #0x10
- LDP X0, X1, [SP], #0x10
-
- /* Save the context of the current task and select a new task to run. */
- portSAVE_CONTEXT
- BL vTaskSwitchContext
- portRESTORE_CONTEXT
+ DSB SY
+ ISB SY
+
+ LDP X29, X30, [SP], #0x10
+ LDP X18, X19, [SP], #0x10
+ LDP X16, X17, [SP], #0x10
+ LDP X14, X15, [SP], #0x10
+ LDP X12, X13, [SP], #0x10
+ LDP X10, X11, [SP], #0x10
+ LDP X8, X9, [SP], #0x10
+ LDP X6, X7, [SP], #0x10
+ LDP X4, X5, [SP], #0x10
+ LDP X2, X3, [SP], #0x10
+ LDP X0, X1, [SP], #0x10
+
+ /* Save the context of the current task and select a new task to run. */
+ portSAVE_CONTEXT
+ BL vTaskSwitchContext
+ portRESTORE_CONTEXT
Exit_IRQ_No_Context_Switch:
- /* Restore volatile registers. */
- LDP X4, X5, [SP], #0x10 /* SPSR and ELR. */
+ /* Restore volatile registers. */
+ LDP X4, X5, [SP], #0x10 /* SPSR and ELR. */
#if defined( GUEST )
- MSR SPSR_EL1, X5
- MSR ELR_EL1, X4
+ MSR SPSR_EL1, X5
+ MSR ELR_EL1, X4
#else
- MSR SPSR_EL3, X5 /*_RB_ Assumes started in EL3. */
- MSR ELR_EL3, X4
+ MSR SPSR_EL3, X5 /*_RB_ Assumes started in EL3. */
+ MSR ELR_EL3, X4
#endif
- DSB SY
- ISB SY
-
- LDP X29, X30, [SP], #0x10
- LDP X18, X19, [SP], #0x10
- LDP X16, X17, [SP], #0x10
- LDP X14, X15, [SP], #0x10
- LDP X12, X13, [SP], #0x10
- LDP X10, X11, [SP], #0x10
- LDP X8, X9, [SP], #0x10
- LDP X6, X7, [SP], #0x10
- LDP X4, X5, [SP], #0x10
- LDP X2, X3, [SP], #0x10
- LDP X0, X1, [SP], #0x10
+ DSB SY
+ ISB SY
- ERET
+ LDP X29, X30, [SP], #0x10
+ LDP X18, X19, [SP], #0x10
+ LDP X16, X17, [SP], #0x10
+ LDP X14, X15, [SP], #0x10
+ LDP X12, X13, [SP], #0x10
+ LDP X10, X11, [SP], #0x10
+ LDP X8, X9, [SP], #0x10
+ LDP X6, X7, [SP], #0x10
+ LDP X4, X5, [SP], #0x10
+ LDP X2, X3, [SP], #0x10
+ LDP X0, X1, [SP], #0x10
+
+ ERET
@@ -573,9 +575,4 @@ ullPortInterruptNestingConst: .dword ullPortInterruptNesting
ullPortYieldRequiredConst: .dword ullPortYieldRequired
ullPortUnmaskConst: .dword ullPortUnmask
-.end
-
-
-
-
-
+.end
\ No newline at end of file
diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch64/portmacro.h b/third-party/freertos/portable/GCC/ft_platform/aarch64/portmacro.h
index 8b03a3227212e553e0a21312bf0f7f322d1e6c76..cbe66b1b95e15523efe5f185d91ecd8d80d72aba 100644
--- a/third-party/freertos/portable/GCC/ft_platform/aarch64/portmacro.h
+++ b/third-party/freertos/portable/GCC/ft_platform/aarch64/portmacro.h
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -29,10 +29,11 @@
#ifndef PORTMACRO_H
#define PORTMACRO_H
+/* *INDENT-OFF* */
#ifdef __cplusplus
-extern "C"
-{
+ extern "C" {
#endif
+/* *INDENT-ON* */
#include "ftypes.h"
#include "FreeRTOSConfig.h"
/*-----------------------------------------------------------
@@ -46,158 +47,165 @@ extern "C"
*/
/* Type definitions. */
-#define portCHAR char
-#define portFLOAT float
-#define portDOUBLE double
-#define portLONG long
-#define portSHORT short
-#define portSTACK_TYPE size_t
-#define portBASE_TYPE long
+#define portCHAR char
+#define portFLOAT float
+#define portDOUBLE double
+#define portLONG long
+#define portSHORT short
+#define portSTACK_TYPE size_t
+#define portBASE_TYPE long
-typedef portSTACK_TYPE StackType_t;
-typedef portBASE_TYPE BaseType_t;
-typedef uint64_t UBaseType_t;
+typedef portSTACK_TYPE StackType_t;
+typedef portBASE_TYPE BaseType_t;
+typedef uint64_t UBaseType_t;
-typedef uint64_t TickType_t;
-#define portMAX_DELAY ((TickType_t)0xffffffffffffffff)
+typedef uint64_t TickType_t;
+#define portMAX_DELAY ( ( TickType_t ) 0xffffffffffffffff )
/* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
-not need to be guarded with a critical section. */
-#define portTICK_TYPE_IS_ATOMIC 1
+ * not need to be guarded with a critical section. */
+#define portTICK_TYPE_IS_ATOMIC 1
/*-----------------------------------------------------------*/
/* Hardware specifics. */
-#define portSTACK_GROWTH (-1)
-#define portTICK_PERIOD_MS ((TickType_t)1000 / configTICK_RATE_HZ)
-#define portBYTE_ALIGNMENT 16
-#define portPOINTER_SIZE_TYPE uint64_t
+#define portSTACK_GROWTH ( -1 )
+#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
+#define portBYTE_ALIGNMENT 16
+#define portPOINTER_SIZE_TYPE uint64_t
/*-----------------------------------------------------------*/
/* Task utilities. */
/* Called at the end of an ISR that can cause a context switch. */
-#define portEND_SWITCHING_ISR(xSwitchRequired) \
- { \
- extern uint64_t ullPortYieldRequired; \
- \
- if (xSwitchRequired != pdFALSE) \
- { \
- ullPortYieldRequired = pdTRUE; \
- } \
+#define portEND_SWITCHING_ISR( xSwitchRequired ) \
+ { \
+ extern uint64_t ullPortYieldRequired; \
+ \
+ if( xSwitchRequired != pdFALSE ) \
+ { \
+ ullPortYieldRequired = pdTRUE; \
+ } \
}
-#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
+#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
#if defined( GUEST )
- #define portYIELD() __asm volatile ( "SVC 0" ::: "memory" )
+ #define portYIELD() __asm volatile ( "SVC 0" ::: "memory" )
#else
- #define portYIELD() __asm volatile ( "SMC 0" ::: "memory" )
+ #define portYIELD() __asm volatile ( "SMC 0" ::: "memory" )
#endif
+
/*-----------------------------------------------------------
* Critical section control
*----------------------------------------------------------*/
-extern void vPortEnterCritical(void);
-extern void vPortExitCritical(void);
-extern UBaseType_t uxPortSetInterruptMask(void);
-extern void vPortClearInterruptMask(UBaseType_t uxNewMaskValue);
-extern void vPortInstallFreeRTOSVectorTable(void);
+extern void vPortEnterCritical( void );
+extern void vPortExitCritical( void );
+extern UBaseType_t uxPortSetInterruptMask( void );
+extern void vPortClearInterruptMask( UBaseType_t uxNewMaskValue );
+extern void vPortInstallFreeRTOSVectorTable( void );
+
+#define portDISABLE_INTERRUPTS() \
+ __asm volatile ( "MSR DAIFSET, #2" ::: "memory" ); \
+ __asm volatile ( "DSB SY" ); \
+ __asm volatile ( "ISB SY" );
-#define portDISABLE_INTERRUPTS() \
- __asm volatile ( "MSR DAIFSET, #2" ::: "memory" ); \
- __asm volatile ( "DSB SY" ); \
- __asm volatile ( "ISB SY" );
+#define portENABLE_INTERRUPTS() \
+ __asm volatile ( "MSR DAIFCLR, #2" ::: "memory" ); \
+ __asm volatile ( "DSB SY" ); \
+ __asm volatile ( "ISB SY" );
-#define portENABLE_INTERRUPTS() \
- __asm volatile ( "MSR DAIFCLR, #2" ::: "memory" ); \
- __asm volatile ( "DSB SY" ); \
- __asm volatile ( "ISB SY" );
/* These macros do not globally disable/enable interrupts. They do mask off
-interrupts that have a priority below configMAX_API_CALL_INTERRUPT_PRIORITY. */
-#define portENTER_CRITICAL() vPortEnterCritical();
-#define portEXIT_CRITICAL() vPortExitCritical();
-#define portSET_INTERRUPT_MASK_FROM_ISR() uxPortSetInterruptMask()
-#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortClearInterruptMask(x)
+ * interrupts that have a priority below configMAX_API_CALL_INTERRUPT_PRIORITY. */
+#define portENTER_CRITICAL() vPortEnterCritical();
+#define portEXIT_CRITICAL() vPortExitCritical();
+#define portSET_INTERRUPT_MASK_FROM_ISR() uxPortSetInterruptMask()
+#define portCLEAR_INTERRUPT_MASK_FROM_ISR( x ) vPortClearInterruptMask( x )
/*-----------------------------------------------------------*/
/* Task function macros as described on the FreeRTOS.org WEB site. These are
-not required for this port but included in case common demo code that uses these
-macros is used. */
-#define portTASK_FUNCTION_PROTO(vFunction, pvParameters) void vFunction(void *pvParameters)
-#define portTASK_FUNCTION(vFunction, pvParameters) void vFunction(void *pvParameters)
+ * not required for this port but included in case common demo code that uses these
+ * macros is used. */
+#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters )
+#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
/* Prototype of the FreeRTOS tick handler. This must be installed as the
-handler for whichever peripheral is used to generate the RTOS tick. */
-void FreeRTOS_Tick_Handler(void);
+ * handler for whichever peripheral is used to generate the RTOS tick. */
+void FreeRTOS_Tick_Handler( void );
/* Any task that uses the floating point unit MUST call vPortTaskUsesFPU()
-before any floating point instructions are executed. */
-void vPortTaskUsesFPU(void);
-#define portTASK_USES_FLOATING_POINT() vPortTaskUsesFPU()
+ * before any floating point instructions are executed. */
+void vPortTaskUsesFPU( void );
+#define portTASK_USES_FLOATING_POINT() vPortTaskUsesFPU()
-#define portLOWEST_INTERRUPT_PRIORITY (((uint32_t)configUNIQUE_INTERRUPT_PRIORITIES) - 1UL)
-#define portLOWEST_USABLE_INTERRUPT_PRIORITY (portLOWEST_INTERRUPT_PRIORITY - 1UL)
+#define portLOWEST_INTERRUPT_PRIORITY ( ( ( uint32_t ) configUNIQUE_INTERRUPT_PRIORITIES ) - 1UL )
+#define portLOWEST_USABLE_INTERRUPT_PRIORITY ( portLOWEST_INTERRUPT_PRIORITY - 1UL )
/* Architecture specific optimisations. */
#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
-#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
+ #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#endif
#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
/* Store/clear the ready priorities in a bit map. */
-#define portRECORD_READY_PRIORITY(uxPriority, uxReadyPriorities) (uxReadyPriorities) |= (1UL << (uxPriority))
-#define portRESET_READY_PRIORITY(uxPriority, uxReadyPriorities) (uxReadyPriorities) &= ~(1UL << (uxPriority))
+ #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
+ #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )
/*-----------------------------------------------------------*/
-#define portGET_HIGHEST_PRIORITY(uxTopPriority, uxReadyPriorities) uxTopPriority = (31 - __builtin_clz(uxReadyPriorities))
+ #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - __builtin_clz( uxReadyPriorities ) )
#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
#ifdef configASSERT
-void vPortValidateInterruptPriority(void);
-#define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority()
+ void vPortValidateInterruptPriority( void );
+ #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority()
#endif /* configASSERT */
-#define portNOP() __asm volatile("NOP")
-#define portINLINE __inline
-
-#ifdef __cplusplus
-} /* extern C */
-#endif
+#define portNOP() __asm volatile ( "NOP" )
+#define portINLINE __inline
/* The number of bits to shift for an interrupt priority is dependent on the
-number of bits implemented by the interrupt controller. */
+ * number of bits implemented by the interrupt controller. */
#if configUNIQUE_INTERRUPT_PRIORITIES == 16
- #define portPRIORITY_SHIFT 4
- #define portMAX_BINARY_POINT_VALUE 3
+ #define portPRIORITY_SHIFT 4
+ #define portMAX_BINARY_POINT_VALUE 3
#elif configUNIQUE_INTERRUPT_PRIORITIES == 32
- #define portPRIORITY_SHIFT 3
- #define portMAX_BINARY_POINT_VALUE 2
+ #define portPRIORITY_SHIFT 3
+ #define portMAX_BINARY_POINT_VALUE 2
#elif configUNIQUE_INTERRUPT_PRIORITIES == 64
- #define portPRIORITY_SHIFT 2
- #define portMAX_BINARY_POINT_VALUE 1
+ #define portPRIORITY_SHIFT 2
+ #define portMAX_BINARY_POINT_VALUE 1
#elif configUNIQUE_INTERRUPT_PRIORITIES == 128
- #define portPRIORITY_SHIFT 1
- #define portMAX_BINARY_POINT_VALUE 0
+ #define portPRIORITY_SHIFT 1
+ #define portMAX_BINARY_POINT_VALUE 0
#elif configUNIQUE_INTERRUPT_PRIORITIES == 256
- #define portPRIORITY_SHIFT 0
- #define portMAX_BINARY_POINT_VALUE 0
-#else
+ #define portPRIORITY_SHIFT 0
+ #define portMAX_BINARY_POINT_VALUE 0
+#else /* if configUNIQUE_INTERRUPT_PRIORITIES == 16 */
#error Invalid configUNIQUE_INTERRUPT_PRIORITIES setting. configUNIQUE_INTERRUPT_PRIORITIES must be set to the number of unique priorities implemented by the target hardware
-#endif
+#endif /* if configUNIQUE_INTERRUPT_PRIORITIES == 16 */
/* Interrupt controller access addresses. */
-#define portICCPMR_PRIORITY_MASK_OFFSET (0x04)
-#define portICCIAR_INTERRUPT_ACKNOWLEDGE_OFFSET (0x0C)
-#define portICCEOIR_END_OF_INTERRUPT_OFFSET (0x10)
-#define portICCBPR_BINARY_POINT_OFFSET (0x08)
-#define portICCRPR_RUNNING_PRIORITY_OFFSET (0x14)
+#define portICCPMR_PRIORITY_MASK_OFFSET ( 0x04 )
+#define portICCIAR_INTERRUPT_ACKNOWLEDGE_OFFSET ( 0x0C )
+#define portICCEOIR_END_OF_INTERRUPT_OFFSET ( 0x10 )
+#define portICCBPR_BINARY_POINT_OFFSET ( 0x08 )
+#define portICCRPR_RUNNING_PRIORITY_OFFSET ( 0x14 )
+
+
+#define portMEMORY_BARRIER() __asm volatile ( "" ::: "memory" )
int xPortIsInsideInterrupt( void );
+/* *INDENT-OFF* */
+#ifdef __cplusplus
+ }
+#endif
+/* *INDENT-ON* */
+
#endif /* PORTMACRO_H */
diff --git a/third-party/freertos/portable/MemMang/heap_1.c b/third-party/freertos/portable/MemMang/heap_1.c
index 43a55f94338ee87feff12b9b596a04dab94a8a9e..59b82c769f70b1329614731bc9dd1efa6fd22fb9 100644
--- a/third-party/freertos/portable/MemMang/heap_1.c
+++ b/third-party/freertos/portable/MemMang/heap_1.c
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -64,7 +64,7 @@
#endif /* configAPPLICATION_ALLOCATED_HEAP */
/* Index into the ucHeap array. */
-static size_t xNextFreeByte = ( size_t ) 0;
+static size_t xNextFreeByte = ( size_t ) 0U;
/*-----------------------------------------------------------*/
@@ -150,3 +150,16 @@ size_t xPortGetFreeHeapSize( void )
{
return( configADJUSTED_HEAP_SIZE - xNextFreeByte );
}
+
+/*-----------------------------------------------------------*/
+
+/*
+ * Reset the state in this file. This state is normally initialized at start up.
+ * This function must be called by the application before restarting the
+ * scheduler.
+ */
+void vPortHeapResetState( void )
+{
+ xNextFreeByte = ( size_t ) 0U;
+}
+/*-----------------------------------------------------------*/
diff --git a/third-party/freertos/portable/MemMang/heap_2.c b/third-party/freertos/portable/MemMang/heap_2.c
index 497295d9a52fc700169f0567f3fdf8f1ae6f4e2e..59d91ad343743af0f149871f51679f97cf6475d4 100644
--- a/third-party/freertos/portable/MemMang/heap_2.c
+++ b/third-party/freertos/portable/MemMang/heap_2.c
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -103,8 +103,8 @@ typedef struct A_BLOCK_LINK
} BlockLink_t;
-static const uint16_t heapSTRUCT_SIZE = ( ( sizeof( BlockLink_t ) + ( portBYTE_ALIGNMENT - 1 ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK ) );
-#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( heapSTRUCT_SIZE * 2 ) )
+static const size_t xHeapStructSize = ( ( sizeof( BlockLink_t ) + ( size_t ) ( portBYTE_ALIGNMENT - 1 ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK ) );
+#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( xHeapStructSize * 2 ) )
/* Create a couple of list links to mark the start and end of the list. */
PRIVILEGED_DATA static BlockLink_t xStart, xEnd;
@@ -113,6 +113,9 @@ PRIVILEGED_DATA static BlockLink_t xStart, xEnd;
* fragmentation. */
PRIVILEGED_DATA static size_t xFreeBytesRemaining = configADJUSTED_HEAP_SIZE;
+/* Indicates whether the heap has been initialised or not. */
+PRIVILEGED_DATA static BaseType_t xHeapHasBeenInitialised = pdFALSE;
+
/*-----------------------------------------------------------*/
/*
@@ -155,36 +158,57 @@ void * pvPortMalloc( size_t xWantedSize )
BlockLink_t * pxBlock;
BlockLink_t * pxPreviousBlock;
BlockLink_t * pxNewBlockLink;
- PRIVILEGED_DATA static BaseType_t xHeapHasBeenInitialised = pdFALSE;
void * pvReturn = NULL;
size_t xAdditionalRequiredSize;
- vTaskSuspendAll();
+ if( xWantedSize > 0 )
{
- /* If this is the first call to malloc then the heap will require
- * initialisation to setup the list of free blocks. */
- if( xHeapHasBeenInitialised == pdFALSE )
- {
- prvHeapInit();
- xHeapHasBeenInitialised = pdTRUE;
- }
-
- if( xWantedSize > 0 )
+ /* The wanted size must be increased so it can contain a BlockLink_t
+ * structure in addition to the requested amount of bytes. */
+ if( heapADD_WILL_OVERFLOW( xWantedSize, xHeapStructSize ) == 0 )
{
- /* The wanted size must be increased so it can contain a BlockLink_t
- * structure in addition to the requested amount of bytes. Some
- * additional increment may also be needed for alignment. */
- xAdditionalRequiredSize = heapSTRUCT_SIZE + portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK );
+ xWantedSize += xHeapStructSize;
- if( heapADD_WILL_OVERFLOW( xWantedSize, xAdditionalRequiredSize ) == 0 )
+ /* Ensure that blocks are always aligned to the required number
+ * of bytes. */
+ if( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) != 0x00 )
{
- xWantedSize += xAdditionalRequiredSize;
+ /* Byte alignment required. */
+ xAdditionalRequiredSize = portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK );
+
+ if( heapADD_WILL_OVERFLOW( xWantedSize, xAdditionalRequiredSize ) == 0 )
+ {
+ xWantedSize += xAdditionalRequiredSize;
+ }
+ else
+ {
+ xWantedSize = 0;
+ }
}
else
{
- xWantedSize = 0;
+ mtCOVERAGE_TEST_MARKER();
}
}
+ else
+ {
+ xWantedSize = 0;
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ vTaskSuspendAll();
+ {
+ /* If this is the first call to malloc then the heap will require
+ * initialisation to setup the list of free blocks. */
+ if( xHeapHasBeenInitialised == pdFALSE )
+ {
+ prvHeapInit();
+ xHeapHasBeenInitialised = pdTRUE;
+ }
/* Check the block size we are trying to allocate is not so large that the
* top bit is set. The top bit of the block size member of the BlockLink_t
@@ -210,7 +234,7 @@ void * pvPortMalloc( size_t xWantedSize )
{
/* Return the memory space - jumping over the BlockLink_t structure
* at its start. */
- pvReturn = ( void * ) ( ( ( uint8_t * ) pxPreviousBlock->pxNextFreeBlock ) + heapSTRUCT_SIZE );
+ pvReturn = ( void * ) ( ( ( uint8_t * ) pxPreviousBlock->pxNextFreeBlock ) + xHeapStructSize );
/* This block is being returned for use so must be taken out of the
* list of free blocks. */
@@ -229,7 +253,9 @@ void * pvPortMalloc( size_t xWantedSize )
pxNewBlockLink->xBlockSize = pxBlock->xBlockSize - xWantedSize;
pxBlock->xBlockSize = xWantedSize;
- /* Insert the new block into the list of free blocks. */
+ /* Insert the new block into the list of free blocks.
+ * The list of free blocks is sorted by their size, we have to
+ * iterate to find the right place to insert new block. */
prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );
}
@@ -269,7 +295,7 @@ void vPortFree( void * pv )
{
/* The memory being freed will have an BlockLink_t structure immediately
* before it. */
- puc -= heapSTRUCT_SIZE;
+ puc -= xHeapStructSize;
/* This unexpected casting is to keep some compilers from issuing
* byte alignment warnings. */
@@ -287,7 +313,7 @@ void vPortFree( void * pv )
heapFREE_BLOCK( pxLink );
#if ( configHEAP_CLEAR_MEMORY_ON_FREE == 1 )
{
- ( void ) memset( puc + heapSTRUCT_SIZE, 0, pxLink->xBlockSize - heapSTRUCT_SIZE );
+ ( void ) memset( puc + xHeapStructSize, 0, pxLink->xBlockSize - xHeapStructSize );
}
#endif
@@ -360,3 +386,16 @@ static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
pxFirstFreeBlock->pxNextFreeBlock = &xEnd;
}
/*-----------------------------------------------------------*/
+
+/*
+ * Reset the state in this file. This state is normally initialized at start up.
+ * This function must be called by the application before restarting the
+ * scheduler.
+ */
+void vPortHeapResetState( void )
+{
+ xFreeBytesRemaining = configADJUSTED_HEAP_SIZE;
+
+ xHeapHasBeenInitialised = pdFALSE;
+}
+/*-----------------------------------------------------------*/
diff --git a/third-party/freertos/portable/MemMang/heap_3.c b/third-party/freertos/portable/MemMang/heap_3.c
index 89c011a34ad92f46b59cda5992661e75d41e3052..8524fd7aa28ba8b460c7be9c367111978fd76a6b 100644
--- a/third-party/freertos/portable/MemMang/heap_3.c
+++ b/third-party/freertos/portable/MemMang/heap_3.c
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -92,3 +92,15 @@ void vPortFree( void * pv )
( void ) xTaskResumeAll();
}
}
+/*-----------------------------------------------------------*/
+
+/*
+ * Reset the state in this file. This state is normally initialized at start up.
+ * This function must be called by the application before restarting the
+ * scheduler.
+ */
+void vPortHeapResetState( void )
+{
+ /* No state needs to be re-initialised in heap_3. */
+}
+/*-----------------------------------------------------------*/
diff --git a/third-party/freertos/portable/MemMang/heap_4.c b/third-party/freertos/portable/MemMang/heap_4.c
index 7748f5024ea86ff38d95f8dce9337ca26543dc47..60cffb4ff7e7c680ab28d43b506e0a846236cb4a 100644
--- a/third-party/freertos/portable/MemMang/heap_4.c
+++ b/third-party/freertos/portable/MemMang/heap_4.c
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -65,10 +65,13 @@
#define heapSIZE_MAX ( ~( ( size_t ) 0 ) )
/* Check if multiplying a and b will result in overflow. */
-#define heapMULTIPLY_WILL_OVERFLOW( a, b ) ( ( ( a ) > 0 ) && ( ( b ) > ( heapSIZE_MAX / ( a ) ) ) )
+#define heapMULTIPLY_WILL_OVERFLOW( a, b ) ( ( ( a ) > 0 ) && ( ( b ) > ( heapSIZE_MAX / ( a ) ) ) )
/* Check if adding a and b will result in overflow. */
-#define heapADD_WILL_OVERFLOW( a, b ) ( ( a ) > ( heapSIZE_MAX - ( b ) ) )
+#define heapADD_WILL_OVERFLOW( a, b ) ( ( a ) > ( heapSIZE_MAX - ( b ) ) )
+
+/* Check if the subtraction operation ( a - b ) will result in underflow. */
+#define heapSUBTRACT_WILL_UNDERFLOW( a, b ) ( ( a ) < ( b ) )
/* MSB of the xBlockSize member of an BlockLink_t structure is used to track
* the allocation status of a block. When MSB of the xBlockSize member of
@@ -96,10 +99,42 @@
* of their memory address. */
typedef struct A_BLOCK_LINK
{
- struct A_BLOCK_LINK * pxNextFreeBlock; /*<< The next free block in the list. */
- size_t xBlockSize; /*<< The size of the free block. */
+ struct A_BLOCK_LINK * pxNextFreeBlock; /**< The next free block in the list. */
+ size_t xBlockSize; /**< The size of the free block. */
} BlockLink_t;
+/* Setting configENABLE_HEAP_PROTECTOR to 1 enables heap block pointers
+ * protection using an application supplied canary value to catch heap
+ * corruption should a heap buffer overflow occur.
+ */
+#if ( configENABLE_HEAP_PROTECTOR == 1 )
+
+/**
+ * @brief Application provided function to get a random value to be used as canary.
+ *
+ * @param pxHeapCanary [out] Output parameter to return the canary value.
+ */
+ extern void vApplicationGetRandomHeapCanary( portPOINTER_SIZE_TYPE * pxHeapCanary );
+
+/* Canary value for protecting internal heap pointers. */
+ PRIVILEGED_DATA static portPOINTER_SIZE_TYPE xHeapCanary;
+
+/* Macro to load/store BlockLink_t pointers to memory. By XORing the
+ * pointers with a random canary value, heap overflows will result
+ * in randomly unpredictable pointer values which will be caught by
+ * heapVALIDATE_BLOCK_POINTER assert. */
+ #define heapPROTECT_BLOCK_POINTER( pxBlock ) ( ( BlockLink_t * ) ( ( ( portPOINTER_SIZE_TYPE ) ( pxBlock ) ) ^ xHeapCanary ) )
+#else
+
+ #define heapPROTECT_BLOCK_POINTER( pxBlock ) ( pxBlock )
+
+#endif /* configENABLE_HEAP_PROTECTOR */
+
+/* Assert that a heap block pointer is within the heap bounds. */
+#define heapVALIDATE_BLOCK_POINTER( pxBlock ) \
+ configASSERT( ( ( uint8_t * ) ( pxBlock ) >= &( ucHeap[ 0 ] ) ) && \
+ ( ( uint8_t * ) ( pxBlock ) <= &( ucHeap[ configTOTAL_HEAP_SIZE - 1 ] ) ) )
+
/*-----------------------------------------------------------*/
/*
@@ -128,10 +163,10 @@ PRIVILEGED_DATA static BlockLink_t * pxEnd = NULL;
/* Keeps track of the number of calls to allocate and free memory as well as the
* number of free bytes remaining, but says nothing about fragmentation. */
-PRIVILEGED_DATA static size_t xFreeBytesRemaining = 0U;
-PRIVILEGED_DATA static size_t xMinimumEverFreeBytesRemaining = 0U;
-PRIVILEGED_DATA static size_t xNumberOfSuccessfulAllocations = 0;
-PRIVILEGED_DATA static size_t xNumberOfSuccessfulFrees = 0;
+PRIVILEGED_DATA static size_t xFreeBytesRemaining = ( size_t ) 0U;
+PRIVILEGED_DATA static size_t xMinimumEverFreeBytesRemaining = ( size_t ) 0U;
+PRIVILEGED_DATA static size_t xNumberOfSuccessfulAllocations = ( size_t ) 0U;
+PRIVILEGED_DATA static size_t xNumberOfSuccessfulFrees = ( size_t ) 0U;
/*-----------------------------------------------------------*/
@@ -143,36 +178,54 @@ void * pvPortMalloc( size_t xWantedSize )
void * pvReturn = NULL;
size_t xAdditionalRequiredSize;
- vTaskSuspendAll();
+ if( xWantedSize > 0 )
{
- /* If this is the first call to malloc then the heap will require
- * initialisation to setup the list of free blocks. */
- if( pxEnd == NULL )
+ /* The wanted size must be increased so it can contain a BlockLink_t
+ * structure in addition to the requested amount of bytes. */
+ if( heapADD_WILL_OVERFLOW( xWantedSize, xHeapStructSize ) == 0 )
{
- prvHeapInit();
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
- }
-
- if( xWantedSize > 0 )
- {
- /* The wanted size must be increased so it can contain a BlockLink_t
- * structure in addition to the requested amount of bytes. Some
- * additional increment may also be needed for alignment. */
- xAdditionalRequiredSize = xHeapStructSize + portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK );
+ xWantedSize += xHeapStructSize;
- if( heapADD_WILL_OVERFLOW( xWantedSize, xAdditionalRequiredSize ) == 0 )
+ /* Ensure that blocks are always aligned to the required number
+ * of bytes. */
+ if( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) != 0x00 )
{
- xWantedSize += xAdditionalRequiredSize;
+ /* Byte alignment required. */
+ xAdditionalRequiredSize = portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK );
+
+ if( heapADD_WILL_OVERFLOW( xWantedSize, xAdditionalRequiredSize ) == 0 )
+ {
+ xWantedSize += xAdditionalRequiredSize;
+ }
+ else
+ {
+ xWantedSize = 0;
+ }
}
else
{
- xWantedSize = 0;
+ mtCOVERAGE_TEST_MARKER();
}
}
else
+ {
+ xWantedSize = 0;
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ vTaskSuspendAll();
+ {
+ /* If this is the first call to malloc then the heap will require
+ * initialisation to setup the list of free blocks. */
+ if( pxEnd == NULL )
+ {
+ prvHeapInit();
+ }
+ else
{
mtCOVERAGE_TEST_MARKER();
}
@@ -188,12 +241,14 @@ void * pvPortMalloc( size_t xWantedSize )
/* Traverse the list from the start (lowest address) block until
* one of adequate size is found. */
pxPreviousBlock = &xStart;
- pxBlock = xStart.pxNextFreeBlock;
+ pxBlock = heapPROTECT_BLOCK_POINTER( xStart.pxNextFreeBlock );
+ heapVALIDATE_BLOCK_POINTER( pxBlock );
- while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != NULL ) )
+ while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != heapPROTECT_BLOCK_POINTER( NULL ) ) )
{
pxPreviousBlock = pxBlock;
- pxBlock = pxBlock->pxNextFreeBlock;
+ pxBlock = heapPROTECT_BLOCK_POINTER( pxBlock->pxNextFreeBlock );
+ heapVALIDATE_BLOCK_POINTER( pxBlock );
}
/* If the end marker was reached then a block of adequate size
@@ -202,7 +257,8 @@ void * pvPortMalloc( size_t xWantedSize )
{
/* Return the memory space pointed to - jumping over the
* BlockLink_t structure at its start. */
- pvReturn = ( void * ) ( ( ( uint8_t * ) pxPreviousBlock->pxNextFreeBlock ) + xHeapStructSize );
+ pvReturn = ( void * ) ( ( ( uint8_t * ) heapPROTECT_BLOCK_POINTER( pxPreviousBlock->pxNextFreeBlock ) ) + xHeapStructSize );
+ heapVALIDATE_BLOCK_POINTER( pvReturn );
/* This block is being returned for use so must be taken out
* of the list of free blocks. */
@@ -210,6 +266,8 @@ void * pvPortMalloc( size_t xWantedSize )
/* If the block is larger than required it can be split into
* two. */
+ configASSERT( heapSUBTRACT_WILL_UNDERFLOW( pxBlock->xBlockSize, xWantedSize ) == 0 );
+
if( ( pxBlock->xBlockSize - xWantedSize ) > heapMINIMUM_BLOCK_SIZE )
{
/* This block is to be split into two. Create a new
@@ -225,7 +283,8 @@ void * pvPortMalloc( size_t xWantedSize )
pxBlock->xBlockSize = xWantedSize;
/* Insert the new block into the list of free blocks. */
- prvInsertBlockIntoFreeList( pxNewBlockLink );
+ pxNewBlockLink->pxNextFreeBlock = pxPreviousBlock->pxNextFreeBlock;
+ pxPreviousBlock->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( pxNewBlockLink );
}
else
{
@@ -300,6 +359,7 @@ void vPortFree( void * pv )
/* This casting is to keep the compiler from issuing warnings. */
pxLink = ( void * ) puc;
+ heapVALIDATE_BLOCK_POINTER( pxLink );
configASSERT( heapBLOCK_IS_ALLOCATED( pxLink ) != 0 );
configASSERT( pxLink->pxNextFreeBlock == NULL );
@@ -312,7 +372,12 @@ void vPortFree( void * pv )
heapFREE_BLOCK( pxLink );
#if ( configHEAP_CLEAR_MEMORY_ON_FREE == 1 )
{
- ( void ) memset( puc + xHeapStructSize, 0, pxLink->xBlockSize - xHeapStructSize );
+ /* Check for underflow as this can occur if xBlockSize is
+ * overwritten in a heap block. */
+ if( heapSUBTRACT_WILL_UNDERFLOW( pxLink->xBlockSize, xHeapStructSize ) == 0 )
+ {
+ ( void ) memset( puc + xHeapStructSize, 0, pxLink->xBlockSize - xHeapStructSize );
+ }
}
#endif
@@ -379,41 +444,44 @@ void * pvPortCalloc( size_t xNum,
static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
{
BlockLink_t * pxFirstFreeBlock;
- uint8_t * pucAlignedHeap;
- portPOINTER_SIZE_TYPE uxAddress;
+ portPOINTER_SIZE_TYPE uxStartAddress, uxEndAddress;
size_t xTotalHeapSize = configTOTAL_HEAP_SIZE;
/* Ensure the heap starts on a correctly aligned boundary. */
- uxAddress = ( portPOINTER_SIZE_TYPE ) ucHeap;
+ uxStartAddress = ( portPOINTER_SIZE_TYPE ) ucHeap;
- if( ( uxAddress & portBYTE_ALIGNMENT_MASK ) != 0 )
+ if( ( uxStartAddress & portBYTE_ALIGNMENT_MASK ) != 0 )
{
- uxAddress += ( portBYTE_ALIGNMENT - 1 );
- uxAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
- xTotalHeapSize -= uxAddress - ( portPOINTER_SIZE_TYPE ) ucHeap;
+ uxStartAddress += ( portBYTE_ALIGNMENT - 1 );
+ uxStartAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
+ xTotalHeapSize -= ( size_t ) ( uxStartAddress - ( portPOINTER_SIZE_TYPE ) ucHeap );
}
- pucAlignedHeap = ( uint8_t * ) uxAddress;
+ #if ( configENABLE_HEAP_PROTECTOR == 1 )
+ {
+ vApplicationGetRandomHeapCanary( &( xHeapCanary ) );
+ }
+ #endif
/* xStart is used to hold a pointer to the first item in the list of free
* blocks. The void cast is used to prevent compiler warnings. */
- xStart.pxNextFreeBlock = ( void * ) pucAlignedHeap;
+ xStart.pxNextFreeBlock = ( void * ) heapPROTECT_BLOCK_POINTER( uxStartAddress );
xStart.xBlockSize = ( size_t ) 0;
/* pxEnd is used to mark the end of the list of free blocks and is inserted
* at the end of the heap space. */
- uxAddress = ( ( portPOINTER_SIZE_TYPE ) pucAlignedHeap ) + xTotalHeapSize;
- uxAddress -= xHeapStructSize;
- uxAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
- pxEnd = ( BlockLink_t * ) uxAddress;
+ uxEndAddress = uxStartAddress + ( portPOINTER_SIZE_TYPE ) xTotalHeapSize;
+ uxEndAddress -= ( portPOINTER_SIZE_TYPE ) xHeapStructSize;
+ uxEndAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
+ pxEnd = ( BlockLink_t * ) uxEndAddress;
pxEnd->xBlockSize = 0;
- pxEnd->pxNextFreeBlock = NULL;
+ pxEnd->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( NULL );
/* To start with there is a single free block that is sized to take up the
* entire heap space, minus the space taken by pxEnd. */
- pxFirstFreeBlock = ( BlockLink_t * ) pucAlignedHeap;
- pxFirstFreeBlock->xBlockSize = ( size_t ) ( uxAddress - ( portPOINTER_SIZE_TYPE ) pxFirstFreeBlock );
- pxFirstFreeBlock->pxNextFreeBlock = pxEnd;
+ pxFirstFreeBlock = ( BlockLink_t * ) uxStartAddress;
+ pxFirstFreeBlock->xBlockSize = ( size_t ) ( uxEndAddress - ( portPOINTER_SIZE_TYPE ) pxFirstFreeBlock );
+ pxFirstFreeBlock->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( pxEnd );
/* Only one block exists - and it covers the entire usable heap space. */
xMinimumEverFreeBytesRemaining = pxFirstFreeBlock->xBlockSize;
@@ -428,11 +496,16 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) /* PRIVI
/* Iterate through the list until a block is found that has a higher address
* than the block being inserted. */
- for( pxIterator = &xStart; pxIterator->pxNextFreeBlock < pxBlockToInsert; pxIterator = pxIterator->pxNextFreeBlock )
+ for( pxIterator = &xStart; heapPROTECT_BLOCK_POINTER( pxIterator->pxNextFreeBlock ) < pxBlockToInsert; pxIterator = heapPROTECT_BLOCK_POINTER( pxIterator->pxNextFreeBlock ) )
{
/* Nothing to do here, just iterate to the right position. */
}
+ if( pxIterator != &xStart )
+ {
+ heapVALIDATE_BLOCK_POINTER( pxIterator );
+ }
+
/* Do the block being inserted, and the block it is being inserted after
* make a contiguous block of memory? */
puc = ( uint8_t * ) pxIterator;
@@ -451,17 +524,17 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) /* PRIVI
* make a contiguous block of memory? */
puc = ( uint8_t * ) pxBlockToInsert;
- if( ( puc + pxBlockToInsert->xBlockSize ) == ( uint8_t * ) pxIterator->pxNextFreeBlock )
+ if( ( puc + pxBlockToInsert->xBlockSize ) == ( uint8_t * ) heapPROTECT_BLOCK_POINTER( pxIterator->pxNextFreeBlock ) )
{
- if( pxIterator->pxNextFreeBlock != pxEnd )
+ if( heapPROTECT_BLOCK_POINTER( pxIterator->pxNextFreeBlock ) != pxEnd )
{
/* Form one big block from the two blocks. */
- pxBlockToInsert->xBlockSize += pxIterator->pxNextFreeBlock->xBlockSize;
- pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock->pxNextFreeBlock;
+ pxBlockToInsert->xBlockSize += heapPROTECT_BLOCK_POINTER( pxIterator->pxNextFreeBlock )->xBlockSize;
+ pxBlockToInsert->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( pxIterator->pxNextFreeBlock )->pxNextFreeBlock;
}
else
{
- pxBlockToInsert->pxNextFreeBlock = pxEnd;
+ pxBlockToInsert->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( pxEnd );
}
}
else
@@ -475,7 +548,7 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) /* PRIVI
* to itself. */
if( pxIterator != pxBlockToInsert )
{
- pxIterator->pxNextFreeBlock = pxBlockToInsert;
+ pxIterator->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( pxBlockToInsert );
}
else
{
@@ -491,7 +564,7 @@ void vPortGetHeapStats( HeapStats_t * pxHeapStats )
vTaskSuspendAll();
{
- pxBlock = xStart.pxNextFreeBlock;
+ pxBlock = heapPROTECT_BLOCK_POINTER( xStart.pxNextFreeBlock );
/* pxBlock will be NULL if the heap has not been initialised. The heap
* is initialised automatically when the first allocation is made. */
@@ -515,7 +588,7 @@ void vPortGetHeapStats( HeapStats_t * pxHeapStats )
/* Move to the next block in the chain until the last block is
* reached. */
- pxBlock = pxBlock->pxNextFreeBlock;
+ pxBlock = heapPROTECT_BLOCK_POINTER( pxBlock->pxNextFreeBlock );
}
}
}
@@ -535,3 +608,19 @@ void vPortGetHeapStats( HeapStats_t * pxHeapStats )
taskEXIT_CRITICAL();
}
/*-----------------------------------------------------------*/
+
+/*
+ * Reset the state in this file. This state is normally initialized at start up.
+ * This function must be called by the application before restarting the
+ * scheduler.
+ */
+void vPortHeapResetState( void )
+{
+ pxEnd = NULL;
+
+ xFreeBytesRemaining = ( size_t ) 0U;
+ xMinimumEverFreeBytesRemaining = ( size_t ) 0U;
+ xNumberOfSuccessfulAllocations = ( size_t ) 0U;
+ xNumberOfSuccessfulFrees = ( size_t ) 0U;
+}
+/*-----------------------------------------------------------*/
diff --git a/third-party/freertos/portable/MemMang/heap_5.c b/third-party/freertos/portable/MemMang/heap_5.c
index 5c95925bf8485b8be61836d9128db0fa69714312..a88de10c1c6c250e95c295cd15a01ee46c8e88cc 100644
--- a/third-party/freertos/portable/MemMang/heap_5.c
+++ b/third-party/freertos/portable/MemMang/heap_5.c
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -28,7 +28,7 @@
/*
* A sample implementation of pvPortMalloc() that allows the heap to be defined
- * across multiple non-contigous blocks and combines (coalescences) adjacent
+ * across multiple non-contiguous blocks and combines (coalescences) adjacent
* memory blocks as they are freed.
*
* See heap_1.c, heap_2.c, heap_3.c and heap_4.c for alternative
@@ -99,10 +99,13 @@
#define heapSIZE_MAX ( ~( ( size_t ) 0 ) )
/* Check if multiplying a and b will result in overflow. */
-#define heapMULTIPLY_WILL_OVERFLOW( a, b ) ( ( ( a ) > 0 ) && ( ( b ) > ( heapSIZE_MAX / ( a ) ) ) )
+#define heapMULTIPLY_WILL_OVERFLOW( a, b ) ( ( ( a ) > 0 ) && ( ( b ) > ( heapSIZE_MAX / ( a ) ) ) )
/* Check if adding a and b will result in overflow. */
-#define heapADD_WILL_OVERFLOW( a, b ) ( ( a ) > ( heapSIZE_MAX - ( b ) ) )
+#define heapADD_WILL_OVERFLOW( a, b ) ( ( a ) > ( heapSIZE_MAX - ( b ) ) )
+
+/* Check if the subtraction operation ( a - b ) will result in underflow. */
+#define heapSUBTRACT_WILL_UNDERFLOW( a, b ) ( ( a ) < ( b ) )
/* MSB of the xBlockSize member of an BlockLink_t structure is used to track
* the allocation status of a block. When MSB of the xBlockSize member of
@@ -114,14 +117,41 @@
#define heapALLOCATE_BLOCK( pxBlock ) ( ( pxBlock->xBlockSize ) |= heapBLOCK_ALLOCATED_BITMASK )
#define heapFREE_BLOCK( pxBlock ) ( ( pxBlock->xBlockSize ) &= ~heapBLOCK_ALLOCATED_BITMASK )
+/* Setting configENABLE_HEAP_PROTECTOR to 1 enables heap block pointers
+ * protection using an application supplied canary value to catch heap
+ * corruption should a heap buffer overflow occur.
+ */
+#if ( configENABLE_HEAP_PROTECTOR == 1 )
+
+/* Macro to load/store BlockLink_t pointers to memory. By XORing the
+ * pointers with a random canary value, heap overflows will result
+ * in randomly unpredictable pointer values which will be caught by
+ * heapVALIDATE_BLOCK_POINTER assert. */
+ #define heapPROTECT_BLOCK_POINTER( pxBlock ) ( ( BlockLink_t * ) ( ( ( portPOINTER_SIZE_TYPE ) ( pxBlock ) ) ^ xHeapCanary ) )
+
+/* Assert that a heap block pointer is within the heap bounds. */
+ #define heapVALIDATE_BLOCK_POINTER( pxBlock ) \
+ configASSERT( ( pucHeapHighAddress != NULL ) && \
+ ( pucHeapLowAddress != NULL ) && \
+ ( ( uint8_t * ) ( pxBlock ) >= pucHeapLowAddress ) && \
+ ( ( uint8_t * ) ( pxBlock ) < pucHeapHighAddress ) )
+
+#else /* if ( configENABLE_HEAP_PROTECTOR == 1 ) */
+
+ #define heapPROTECT_BLOCK_POINTER( pxBlock ) ( pxBlock )
+
+ #define heapVALIDATE_BLOCK_POINTER( pxBlock )
+
+#endif /* configENABLE_HEAP_PROTECTOR */
+
/*-----------------------------------------------------------*/
/* Define the linked list structure. This is used to link free blocks in order
* of their memory address. */
typedef struct A_BLOCK_LINK
{
- struct A_BLOCK_LINK * pxNextFreeBlock; /*<< The next free block in the list. */
- size_t xBlockSize; /*<< The size of the free block. */
+ struct A_BLOCK_LINK * pxNextFreeBlock; /**< The next free block in the list. */
+ size_t xBlockSize; /**< The size of the free block. */
} BlockLink_t;
/*-----------------------------------------------------------*/
@@ -132,7 +162,18 @@ typedef struct A_BLOCK_LINK
* the block in front it and/or the block behind it if the memory blocks are
* adjacent to each other.
*/
-static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert );
+static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) PRIVILEGED_FUNCTION;
+void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEGED_FUNCTION;
+
+#if ( configENABLE_HEAP_PROTECTOR == 1 )
+
+/**
+ * @brief Application provided function to get a random value to be used as canary.
+ *
+ * @param pxHeapCanary [out] Output parameter to return the canary value.
+ */
+ extern void vApplicationGetRandomHeapCanary( portPOINTER_SIZE_TYPE * pxHeapCanary );
+#endif /* configENABLE_HEAP_PROTECTOR */
/*-----------------------------------------------------------*/
@@ -141,15 +182,26 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert );
static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( portBYTE_ALIGNMENT - 1 ) ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK );
/* Create a couple of list links to mark the start and end of the list. */
-static BlockLink_t xStart;
-static BlockLink_t * pxEnd = NULL;
+PRIVILEGED_DATA static BlockLink_t xStart;
+PRIVILEGED_DATA static BlockLink_t * pxEnd = NULL;
/* Keeps track of the number of calls to allocate and free memory as well as the
* number of free bytes remaining, but says nothing about fragmentation. */
-static size_t xFreeBytesRemaining = 0U;
-static size_t xMinimumEverFreeBytesRemaining = 0U;
-static size_t xNumberOfSuccessfulAllocations = 0;
-static size_t xNumberOfSuccessfulFrees = 0;
+PRIVILEGED_DATA static size_t xFreeBytesRemaining = ( size_t ) 0U;
+PRIVILEGED_DATA static size_t xMinimumEverFreeBytesRemaining = ( size_t ) 0U;
+PRIVILEGED_DATA static size_t xNumberOfSuccessfulAllocations = ( size_t ) 0U;
+PRIVILEGED_DATA static size_t xNumberOfSuccessfulFrees = ( size_t ) 0U;
+
+#if ( configENABLE_HEAP_PROTECTOR == 1 )
+
+/* Canary value for protecting internal heap pointers. */
+ PRIVILEGED_DATA static portPOINTER_SIZE_TYPE xHeapCanary;
+
+/* Highest and lowest heap addresses used for heap block bounds checking. */
+ PRIVILEGED_DATA static uint8_t * pucHeapHighAddress = NULL;
+ PRIVILEGED_DATA static uint8_t * pucHeapLowAddress = NULL;
+
+#endif /* configENABLE_HEAP_PROTECTOR */
/*-----------------------------------------------------------*/
@@ -162,32 +214,50 @@ void * pvPortMalloc( size_t xWantedSize )
size_t xAdditionalRequiredSize;
/* The heap must be initialised before the first call to
- * prvPortMalloc(). */
+ * pvPortMalloc(). */
configASSERT( pxEnd );
- vTaskSuspendAll();
+ if( xWantedSize > 0 )
{
- if( xWantedSize > 0 )
+ /* The wanted size must be increased so it can contain a BlockLink_t
+ * structure in addition to the requested amount of bytes. */
+ if( heapADD_WILL_OVERFLOW( xWantedSize, xHeapStructSize ) == 0 )
{
- /* The wanted size must be increased so it can contain a BlockLink_t
- * structure in addition to the requested amount of bytes. Some
- * additional increment may also be needed for alignment. */
- xAdditionalRequiredSize = xHeapStructSize + portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK );
+ xWantedSize += xHeapStructSize;
- if( heapADD_WILL_OVERFLOW( xWantedSize, xAdditionalRequiredSize ) == 0 )
+ /* Ensure that blocks are always aligned to the required number
+ * of bytes. */
+ if( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) != 0x00 )
{
- xWantedSize += xAdditionalRequiredSize;
+ /* Byte alignment required. */
+ xAdditionalRequiredSize = portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK );
+
+ if( heapADD_WILL_OVERFLOW( xWantedSize, xAdditionalRequiredSize ) == 0 )
+ {
+ xWantedSize += xAdditionalRequiredSize;
+ }
+ else
+ {
+ xWantedSize = 0;
+ }
}
else
{
- xWantedSize = 0;
+ mtCOVERAGE_TEST_MARKER();
}
}
else
{
- mtCOVERAGE_TEST_MARKER();
+ xWantedSize = 0;
}
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ vTaskSuspendAll();
+ {
/* Check the block size we are trying to allocate is not so large that the
* top bit is set. The top bit of the block size member of the BlockLink_t
* structure is used to determine who owns the block - the application or
@@ -199,12 +269,14 @@ void * pvPortMalloc( size_t xWantedSize )
/* Traverse the list from the start (lowest address) block until
* one of adequate size is found. */
pxPreviousBlock = &xStart;
- pxBlock = xStart.pxNextFreeBlock;
+ pxBlock = heapPROTECT_BLOCK_POINTER( xStart.pxNextFreeBlock );
+ heapVALIDATE_BLOCK_POINTER( pxBlock );
- while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != NULL ) )
+ while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != heapPROTECT_BLOCK_POINTER( NULL ) ) )
{
pxPreviousBlock = pxBlock;
- pxBlock = pxBlock->pxNextFreeBlock;
+ pxBlock = heapPROTECT_BLOCK_POINTER( pxBlock->pxNextFreeBlock );
+ heapVALIDATE_BLOCK_POINTER( pxBlock );
}
/* If the end marker was reached then a block of adequate size
@@ -213,7 +285,8 @@ void * pvPortMalloc( size_t xWantedSize )
{
/* Return the memory space pointed to - jumping over the
* BlockLink_t structure at its start. */
- pvReturn = ( void * ) ( ( ( uint8_t * ) pxPreviousBlock->pxNextFreeBlock ) + xHeapStructSize );
+ pvReturn = ( void * ) ( ( ( uint8_t * ) heapPROTECT_BLOCK_POINTER( pxPreviousBlock->pxNextFreeBlock ) ) + xHeapStructSize );
+ heapVALIDATE_BLOCK_POINTER( pvReturn );
/* This block is being returned for use so must be taken out
* of the list of free blocks. */
@@ -221,6 +294,8 @@ void * pvPortMalloc( size_t xWantedSize )
/* If the block is larger than required it can be split into
* two. */
+ configASSERT( heapSUBTRACT_WILL_UNDERFLOW( pxBlock->xBlockSize, xWantedSize ) == 0 );
+
if( ( pxBlock->xBlockSize - xWantedSize ) > heapMINIMUM_BLOCK_SIZE )
{
/* This block is to be split into two. Create a new
@@ -228,6 +303,7 @@ void * pvPortMalloc( size_t xWantedSize )
* cast is used to prevent byte alignment warnings from the
* compiler. */
pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize );
+ configASSERT( ( ( ( size_t ) pxNewBlockLink ) & portBYTE_ALIGNMENT_MASK ) == 0 );
/* Calculate the sizes of two blocks split from the
* single block. */
@@ -235,7 +311,8 @@ void * pvPortMalloc( size_t xWantedSize )
pxBlock->xBlockSize = xWantedSize;
/* Insert the new block into the list of free blocks. */
- prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );
+ pxNewBlockLink->pxNextFreeBlock = pxPreviousBlock->pxNextFreeBlock;
+ pxPreviousBlock->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( pxNewBlockLink );
}
else
{
@@ -291,6 +368,7 @@ void * pvPortMalloc( size_t xWantedSize )
}
#endif /* if ( configUSE_MALLOC_FAILED_HOOK == 1 ) */
+ configASSERT( ( ( ( size_t ) pvReturn ) & ( size_t ) portBYTE_ALIGNMENT_MASK ) == 0 );
return pvReturn;
}
/*-----------------------------------------------------------*/
@@ -309,6 +387,7 @@ void vPortFree( void * pv )
/* This casting is to keep the compiler from issuing warnings. */
pxLink = ( void * ) puc;
+ heapVALIDATE_BLOCK_POINTER( pxLink );
configASSERT( heapBLOCK_IS_ALLOCATED( pxLink ) != 0 );
configASSERT( pxLink->pxNextFreeBlock == NULL );
@@ -321,7 +400,12 @@ void vPortFree( void * pv )
heapFREE_BLOCK( pxLink );
#if ( configHEAP_CLEAR_MEMORY_ON_FREE == 1 )
{
- ( void ) memset( puc + xHeapStructSize, 0, pxLink->xBlockSize - xHeapStructSize );
+ /* Check for underflow as this can occur if xBlockSize is
+ * overwritten in a heap block. */
+ if( heapSUBTRACT_WILL_UNDERFLOW( pxLink->xBlockSize, xHeapStructSize ) == 0 )
+ {
+ ( void ) memset( puc + xHeapStructSize, 0, pxLink->xBlockSize - xHeapStructSize );
+ }
}
#endif
@@ -379,18 +463,23 @@ void * pvPortCalloc( size_t xNum,
}
/*-----------------------------------------------------------*/
-static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert )
+static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) /* PRIVILEGED_FUNCTION */
{
BlockLink_t * pxIterator;
uint8_t * puc;
/* Iterate through the list until a block is found that has a higher address
* than the block being inserted. */
- for( pxIterator = &xStart; pxIterator->pxNextFreeBlock < pxBlockToInsert; pxIterator = pxIterator->pxNextFreeBlock )
+ for( pxIterator = &xStart; heapPROTECT_BLOCK_POINTER( pxIterator->pxNextFreeBlock ) < pxBlockToInsert; pxIterator = heapPROTECT_BLOCK_POINTER( pxIterator->pxNextFreeBlock ) )
{
/* Nothing to do here, just iterate to the right position. */
}
+ if( pxIterator != &xStart )
+ {
+ heapVALIDATE_BLOCK_POINTER( pxIterator );
+ }
+
/* Do the block being inserted, and the block it is being inserted after
* make a contiguous block of memory? */
puc = ( uint8_t * ) pxIterator;
@@ -409,17 +498,17 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert )
* make a contiguous block of memory? */
puc = ( uint8_t * ) pxBlockToInsert;
- if( ( puc + pxBlockToInsert->xBlockSize ) == ( uint8_t * ) pxIterator->pxNextFreeBlock )
+ if( ( puc + pxBlockToInsert->xBlockSize ) == ( uint8_t * ) heapPROTECT_BLOCK_POINTER( pxIterator->pxNextFreeBlock ) )
{
- if( pxIterator->pxNextFreeBlock != pxEnd )
+ if( heapPROTECT_BLOCK_POINTER( pxIterator->pxNextFreeBlock ) != pxEnd )
{
/* Form one big block from the two blocks. */
- pxBlockToInsert->xBlockSize += pxIterator->pxNextFreeBlock->xBlockSize;
- pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock->pxNextFreeBlock;
+ pxBlockToInsert->xBlockSize += heapPROTECT_BLOCK_POINTER( pxIterator->pxNextFreeBlock )->xBlockSize;
+ pxBlockToInsert->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( pxIterator->pxNextFreeBlock )->pxNextFreeBlock;
}
else
{
- pxBlockToInsert->pxNextFreeBlock = pxEnd;
+ pxBlockToInsert->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( pxEnd );
}
}
else
@@ -427,13 +516,13 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert )
pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock;
}
- /* If the block being inserted plugged a gab, so was merged with the block
+ /* If the block being inserted plugged a gap, so was merged with the block
* before and the block after, then it's pxNextFreeBlock pointer will have
* already been set, and should not be set here as that would make it point
* to itself. */
if( pxIterator != pxBlockToInsert )
{
- pxIterator->pxNextFreeBlock = pxBlockToInsert;
+ pxIterator->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( pxBlockToInsert );
}
else
{
@@ -442,7 +531,7 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert )
}
/*-----------------------------------------------------------*/
-void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions )
+void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) /* PRIVILEGED_FUNCTION */
{
BlockLink_t * pxFirstFreeBlockInRegion = NULL;
BlockLink_t * pxPreviousFreeBlock;
@@ -455,6 +544,12 @@ void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions )
/* Can only call once! */
configASSERT( pxEnd == NULL );
+ #if ( configENABLE_HEAP_PROTECTOR == 1 )
+ {
+ vApplicationGetRandomHeapCanary( &( xHeapCanary ) );
+ }
+ #endif
+
pxHeapRegion = &( pxHeapRegions[ xDefinedRegions ] );
while( pxHeapRegion->xSizeInBytes > 0 )
@@ -467,7 +562,7 @@ void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions )
if( ( xAddress & portBYTE_ALIGNMENT_MASK ) != 0 )
{
xAddress += ( portBYTE_ALIGNMENT - 1 );
- xAddress &= ~portBYTE_ALIGNMENT_MASK;
+ xAddress &= ~( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK;
/* Adjust the size for the bytes lost to alignment. */
xTotalRegionSize -= ( size_t ) ( xAddress - ( portPOINTER_SIZE_TYPE ) pxHeapRegion->pucStartAddress );
@@ -480,18 +575,28 @@ void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions )
{
/* xStart is used to hold a pointer to the first item in the list of
* free blocks. The void cast is used to prevent compiler warnings. */
- xStart.pxNextFreeBlock = ( BlockLink_t * ) xAlignedHeap;
+ xStart.pxNextFreeBlock = ( BlockLink_t * ) heapPROTECT_BLOCK_POINTER( xAlignedHeap );
xStart.xBlockSize = ( size_t ) 0;
}
else
{
/* Should only get here if one region has already been added to the
* heap. */
- configASSERT( pxEnd != NULL );
+ configASSERT( pxEnd != heapPROTECT_BLOCK_POINTER( NULL ) );
/* Check blocks are passed in with increasing start addresses. */
- configASSERT( xAddress > ( size_t ) pxEnd );
+ configASSERT( ( size_t ) xAddress > ( size_t ) pxEnd );
+ }
+
+ #if ( configENABLE_HEAP_PROTECTOR == 1 )
+ {
+ if( ( pucHeapLowAddress == NULL ) ||
+ ( ( uint8_t * ) xAlignedHeap < pucHeapLowAddress ) )
+ {
+ pucHeapLowAddress = ( uint8_t * ) xAlignedHeap;
+ }
}
+ #endif /* configENABLE_HEAP_PROTECTOR */
/* Remember the location of the end marker in the previous region, if
* any. */
@@ -499,29 +604,39 @@ void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions )
/* pxEnd is used to mark the end of the list of free blocks and is
* inserted at the end of the region space. */
- xAddress = xAlignedHeap + xTotalRegionSize;
- xAddress -= xHeapStructSize;
- xAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );
+ xAddress = xAlignedHeap + ( portPOINTER_SIZE_TYPE ) xTotalRegionSize;
+ xAddress -= ( portPOINTER_SIZE_TYPE ) xHeapStructSize;
+ xAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
pxEnd = ( BlockLink_t * ) xAddress;
pxEnd->xBlockSize = 0;
- pxEnd->pxNextFreeBlock = NULL;
+ pxEnd->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( NULL );
/* To start with there is a single free block in this region that is
* sized to take up the entire heap region minus the space taken by the
* free block structure. */
pxFirstFreeBlockInRegion = ( BlockLink_t * ) xAlignedHeap;
pxFirstFreeBlockInRegion->xBlockSize = ( size_t ) ( xAddress - ( portPOINTER_SIZE_TYPE ) pxFirstFreeBlockInRegion );
- pxFirstFreeBlockInRegion->pxNextFreeBlock = pxEnd;
+ pxFirstFreeBlockInRegion->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( pxEnd );
/* If this is not the first region that makes up the entire heap space
* then link the previous region to this region. */
if( pxPreviousFreeBlock != NULL )
{
- pxPreviousFreeBlock->pxNextFreeBlock = pxFirstFreeBlockInRegion;
+ pxPreviousFreeBlock->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( pxFirstFreeBlockInRegion );
}
xTotalHeapSize += pxFirstFreeBlockInRegion->xBlockSize;
+ #if ( configENABLE_HEAP_PROTECTOR == 1 )
+ {
+ if( ( pucHeapHighAddress == NULL ) ||
+ ( ( ( ( uint8_t * ) pxFirstFreeBlockInRegion ) + pxFirstFreeBlockInRegion->xBlockSize ) > pucHeapHighAddress ) )
+ {
+ pucHeapHighAddress = ( ( uint8_t * ) pxFirstFreeBlockInRegion ) + pxFirstFreeBlockInRegion->xBlockSize;
+ }
+ }
+ #endif
+
/* Move onto the next HeapRegion_t structure. */
xDefinedRegions++;
pxHeapRegion = &( pxHeapRegions[ xDefinedRegions ] );
@@ -542,7 +657,7 @@ void vPortGetHeapStats( HeapStats_t * pxHeapStats )
vTaskSuspendAll();
{
- pxBlock = xStart.pxNextFreeBlock;
+ pxBlock = heapPROTECT_BLOCK_POINTER( xStart.pxNextFreeBlock );
/* pxBlock will be NULL if the heap has not been initialised. The heap
* is initialised automatically when the first allocation is made. */
@@ -572,7 +687,7 @@ void vPortGetHeapStats( HeapStats_t * pxHeapStats )
/* Move to the next block in the chain until the last block is
* reached. */
- pxBlock = pxBlock->pxNextFreeBlock;
+ pxBlock = heapPROTECT_BLOCK_POINTER( pxBlock->pxNextFreeBlock );
}
}
}
@@ -592,3 +707,24 @@ void vPortGetHeapStats( HeapStats_t * pxHeapStats )
taskEXIT_CRITICAL();
}
/*-----------------------------------------------------------*/
+
+/*
+ * Reset the state in this file. This state is normally initialized at start up.
+ * This function must be called by the application before restarting the
+ * scheduler.
+ */
+void vPortHeapResetState( void )
+{
+ pxEnd = NULL;
+
+ xFreeBytesRemaining = ( size_t ) 0U;
+ xMinimumEverFreeBytesRemaining = ( size_t ) 0U;
+ xNumberOfSuccessfulAllocations = ( size_t ) 0U;
+ xNumberOfSuccessfulFrees = ( size_t ) 0U;
+
+ #if ( configENABLE_HEAP_PROTECTOR == 1 )
+ pucHeapHighAddress = NULL;
+ pucHeapLowAddress = NULL;
+ #endif /* #if ( configENABLE_HEAP_PROTECTOR == 1 ) */
+}
+/*-----------------------------------------------------------*/
diff --git a/third-party/freertos/portable/freertos_configs.c b/third-party/freertos/portable/freertos_configs.c
index 6361ee2bccee7ea7a6b190504fa3e6b49bd2bf0e..df12110f5d7b1cea55c15ec7b7a181d252987977 100644
--- a/third-party/freertos/portable/freertos_configs.c
+++ b/third-party/freertos/portable/freertos_configs.c
@@ -65,13 +65,13 @@ void vApplicationMallocFailedHook(void)
}
-
-/*
-void vApplicationIdleHook(void)
+_WEAK void vApplicationTickHook(void)
{
+}
+_WEAK void vApplicationIdleHook(void)
+{
}
-*/
u32 PlatformGetGicDistBase(void)
{
diff --git a/third-party/freertos/portable/readme.txt b/third-party/freertos/portable/readme.txt
index 89f6b09cf5c9c29bce7ea50ac7eaf1c1629ffc19..ca8f71ed028e10b61e778f32e52a4e7502ecb594 100644
--- a/third-party/freertos/portable/readme.txt
+++ b/third-party/freertos/portable/readme.txt
@@ -17,4 +17,3 @@ microcontroller, then the port specific files are contained in
FreeRTOS/Source/Portable/[compiler]/[architecture] directory. If this is the
only port you are interested in then all the other directories can be
ignored.
-
diff --git a/third-party/freertos/queue.c b/third-party/freertos/queue.c
index e76e7ff25014d9ede37b5351c541b65052c682c1..f91841f964e3fc0f7d42f5c50237de102b6b9770 100644
--- a/third-party/freertos/queue.c
+++ b/third-party/freertos/queue.c
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -42,11 +42,10 @@
#include "croutine.h"
#endif
-/* Lint e9021, e961 and e750 are suppressed as a MISRA exception justified
- * because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
+/* The MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
* for the header files above, but not in this file, in order to generate the
* correct privileged Vs unprivileged linkage and placement. */
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/* Constants used with the cRxLock and cTxLock structure members. */
@@ -68,14 +67,14 @@
typedef struct QueuePointers
{
- int8_t * pcTail; /*< Points to the byte at the end of the queue storage area. Once more byte is allocated than necessary to store the queue items, this is used as a marker. */
- int8_t * pcReadFrom; /*< Points to the last place that a queued item was read from when the structure is used as a queue. */
+ int8_t * pcTail; /**< Points to the byte at the end of the queue storage area. Once more byte is allocated than necessary to store the queue items, this is used as a marker. */
+ int8_t * pcReadFrom; /**< Points to the last place that a queued item was read from when the structure is used as a queue. */
} QueuePointers_t;
typedef struct SemaphoreData
{
- TaskHandle_t xMutexHolder; /*< The handle of the task that holds the mutex. */
- UBaseType_t uxRecursiveCallCount; /*< Maintains a count of the number of times a recursive mutex has been recursively 'taken' when the structure is used as a mutex. */
+ TaskHandle_t xMutexHolder; /**< The handle of the task that holds the mutex. */
+ UBaseType_t uxRecursiveCallCount; /**< Maintains a count of the number of times a recursive mutex has been recursively 'taken' when the structure is used as a mutex. */
} SemaphoreData_t;
/* Semaphores do not actually store or copy data, so have an item size of
@@ -89,7 +88,11 @@ typedef struct SemaphoreData
* performed just because a higher priority task has been woken. */
#define queueYIELD_IF_USING_PREEMPTION()
#else
- #define queueYIELD_IF_USING_PREEMPTION() portYIELD_WITHIN_API()
+ #if ( configNUMBER_OF_CORES == 1 )
+ #define queueYIELD_IF_USING_PREEMPTION() portYIELD_WITHIN_API()
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
+ #define queueYIELD_IF_USING_PREEMPTION() vTaskYieldWithinAPI()
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
#endif
/*
@@ -99,27 +102,27 @@ typedef struct SemaphoreData
*/
typedef struct QueueDefinition /* The old naming convention is used to prevent breaking kernel aware debuggers. */
{
- int8_t * pcHead; /*< Points to the beginning of the queue storage area. */
- int8_t * pcWriteTo; /*< Points to the free next place in the storage area. */
+ int8_t * pcHead; /**< Points to the beginning of the queue storage area. */
+ int8_t * pcWriteTo; /**< Points to the free next place in the storage area. */
union
{
- QueuePointers_t xQueue; /*< Data required exclusively when this structure is used as a queue. */
- SemaphoreData_t xSemaphore; /*< Data required exclusively when this structure is used as a semaphore. */
+ QueuePointers_t xQueue; /**< Data required exclusively when this structure is used as a queue. */
+ SemaphoreData_t xSemaphore; /**< Data required exclusively when this structure is used as a semaphore. */
} u;
- List_t xTasksWaitingToSend; /*< List of tasks that are blocked waiting to post onto this queue. Stored in priority order. */
- List_t xTasksWaitingToReceive; /*< List of tasks that are blocked waiting to read from this queue. Stored in priority order. */
+ List_t xTasksWaitingToSend; /**< List of tasks that are blocked waiting to post onto this queue. Stored in priority order. */
+ List_t xTasksWaitingToReceive; /**< List of tasks that are blocked waiting to read from this queue. Stored in priority order. */
- volatile UBaseType_t uxMessagesWaiting; /*< The number of items currently in the queue. */
- UBaseType_t uxLength; /*< The length of the queue defined as the number of items it will hold, not the number of bytes. */
- UBaseType_t uxItemSize; /*< The size of each items that the queue will hold. */
+ volatile UBaseType_t uxMessagesWaiting; /**< The number of items currently in the queue. */
+ UBaseType_t uxLength; /**< The length of the queue defined as the number of items it will hold, not the number of bytes. */
+ UBaseType_t uxItemSize; /**< The size of each items that the queue will hold. */
- volatile int8_t cRxLock; /*< Stores the number of items received from the queue (removed from the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */
- volatile int8_t cTxLock; /*< Stores the number of items transmitted to the queue (added to the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */
+ volatile int8_t cRxLock; /**< Stores the number of items received from the queue (removed from the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */
+ volatile int8_t cTxLock; /**< Stores the number of items transmitted to the queue (added to the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */
#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
- uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the memory used by the queue was statically allocated to ensure no attempt is made to free the memory. */
+ uint8_t ucStaticallyAllocated; /**< Set to pdTRUE if the memory used by the queue was statically allocated to ensure no attempt is made to free the memory. */
#endif
#if ( configUSE_QUEUE_SETS == 1 )
@@ -149,7 +152,7 @@ typedef xQUEUE Queue_t;
* more user friendly. */
typedef struct QUEUE_REGISTRY_ITEM
{
- const char * pcQueueName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ const char * pcQueueName;
QueueHandle_t xHandle;
} xQueueRegistryItem;
@@ -161,6 +164,10 @@ typedef xQUEUE Queue_t;
/* The queue registry is simply an array of QueueRegistryItem_t structures.
* The pcQueueName member of a structure being NULL is indicative of the
* array position being vacant. */
+
+/* MISRA Ref 8.4.2 [Declaration shall be visible] */
+/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-84 */
+/* coverity[misra_c_2012_rule_8_4_violation] */
PRIVILEGED_DATA QueueRegistryItem_t xQueueRegistry[ configQUEUE_REGISTRY_SIZE ];
#endif /* configQUEUE_REGISTRY_SIZE */
@@ -268,14 +275,14 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
* tasks than the number of tasks in the system.
*/
#define prvIncrementQueueTxLock( pxQueue, cTxLock ) \
- { \
+ do { \
const UBaseType_t uxNumberOfTasks = uxTaskGetNumberOfTasks(); \
if( ( UBaseType_t ) ( cTxLock ) < uxNumberOfTasks ) \
{ \
configASSERT( ( cTxLock ) != queueINT8_MAX ); \
( pxQueue )->cTxLock = ( int8_t ) ( ( cTxLock ) + ( int8_t ) 1 ); \
} \
- }
+ } while( 0 )
/*
* Macro to increment cRxLock member of the queue data structure. It is
@@ -283,14 +290,14 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
* tasks than the number of tasks in the system.
*/
#define prvIncrementQueueRxLock( pxQueue, cRxLock ) \
- { \
+ do { \
const UBaseType_t uxNumberOfTasks = uxTaskGetNumberOfTasks(); \
if( ( UBaseType_t ) ( cRxLock ) < uxNumberOfTasks ) \
{ \
configASSERT( ( cRxLock ) != queueINT8_MAX ); \
( pxQueue )->cRxLock = ( int8_t ) ( ( cRxLock ) + ( int8_t ) 1 ); \
} \
- }
+ } while( 0 )
/*-----------------------------------------------------------*/
BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
@@ -299,6 +306,8 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
BaseType_t xReturn = pdPASS;
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueueGenericReset( xQueue, xNewQueue );
+
configASSERT( pxQueue );
if( ( pxQueue != NULL ) &&
@@ -308,10 +317,10 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
{
taskENTER_CRITICAL();
{
- pxQueue->u.xQueue.pcTail = pxQueue->pcHead + ( pxQueue->uxLength * pxQueue->uxItemSize ); /*lint !e9016 Pointer arithmetic allowed on char types, especially when it assists conveying intent. */
+ pxQueue->u.xQueue.pcTail = pxQueue->pcHead + ( pxQueue->uxLength * pxQueue->uxItemSize );
pxQueue->uxMessagesWaiting = ( UBaseType_t ) 0U;
pxQueue->pcWriteTo = pxQueue->pcHead;
- pxQueue->u.xQueue.pcReadFrom = pxQueue->pcHead + ( ( pxQueue->uxLength - 1U ) * pxQueue->uxItemSize ); /*lint !e9016 Pointer arithmetic allowed on char types, especially when it assists conveying intent. */
+ pxQueue->u.xQueue.pcReadFrom = pxQueue->pcHead + ( ( pxQueue->uxLength - 1U ) * pxQueue->uxItemSize );
pxQueue->cRxLock = queueUNLOCKED;
pxQueue->cTxLock = queueUNLOCKED;
@@ -356,6 +365,8 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
/* A value is returned for calling semantic consistency with previous
* versions. */
+ traceRETURN_xQueueGenericReset( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
@@ -370,6 +381,8 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
{
Queue_t * pxNewQueue = NULL;
+ traceENTER_xQueueGenericCreateStatic( uxQueueLength, uxItemSize, pucQueueStorage, pxStaticQueue, ucQueueType );
+
/* The StaticQueue_t structure and the queue storage area must be
* supplied. */
configASSERT( pxStaticQueue );
@@ -379,8 +392,8 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
/* A queue storage area should be provided if the item size is not 0, and
* should not be provided if the item size is 0. */
- ( !( ( pucQueueStorage != NULL ) && ( uxItemSize == 0 ) ) ) &&
- ( !( ( pucQueueStorage == NULL ) && ( uxItemSize != 0 ) ) ) )
+ ( !( ( pucQueueStorage != NULL ) && ( uxItemSize == 0U ) ) ) &&
+ ( !( ( pucQueueStorage == NULL ) && ( uxItemSize != 0U ) ) ) )
{
#if ( configASSERT_DEFINED == 1 )
{
@@ -391,14 +404,17 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
/* This assertion cannot be branch covered in unit tests */
configASSERT( xSize == sizeof( Queue_t ) ); /* LCOV_EXCL_BR_LINE */
- ( void ) xSize; /* Keeps lint quiet when configASSERT() is not defined. */
+ ( void ) xSize; /* Prevent unused variable warning when configASSERT() is not defined. */
}
#endif /* configASSERT_DEFINED */
/* The address of a statically allocated queue was passed in, use it.
* The address of a statically allocated storage area was also passed in
* but is already set. */
- pxNewQueue = ( Queue_t * ) pxStaticQueue; /*lint !e740 !e9087 Unusual cast is ok as the structures are designed to have the same alignment, and the size is checked by an assert. */
+ /* MISRA Ref 11.3.1 [Misaligned access] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
+ /* coverity[misra_c_2012_rule_11_3_violation] */
+ pxNewQueue = ( Queue_t * ) pxStaticQueue;
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{
@@ -417,12 +433,70 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
mtCOVERAGE_TEST_MARKER();
}
+ traceRETURN_xQueueGenericCreateStatic( pxNewQueue );
+
return pxNewQueue;
}
#endif /* configSUPPORT_STATIC_ALLOCATION */
/*-----------------------------------------------------------*/
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+
+ BaseType_t xQueueGenericGetStaticBuffers( QueueHandle_t xQueue,
+ uint8_t ** ppucQueueStorage,
+ StaticQueue_t ** ppxStaticQueue )
+ {
+ BaseType_t xReturn;
+ Queue_t * const pxQueue = xQueue;
+
+ traceENTER_xQueueGenericGetStaticBuffers( xQueue, ppucQueueStorage, ppxStaticQueue );
+
+ configASSERT( pxQueue );
+ configASSERT( ppxStaticQueue );
+
+ #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ {
+ /* Check if the queue was statically allocated. */
+ if( pxQueue->ucStaticallyAllocated == ( uint8_t ) pdTRUE )
+ {
+ if( ppucQueueStorage != NULL )
+ {
+ *ppucQueueStorage = ( uint8_t * ) pxQueue->pcHead;
+ }
+
+ /* MISRA Ref 11.3.1 [Misaligned access] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
+ /* coverity[misra_c_2012_rule_11_3_violation] */
+ *ppxStaticQueue = ( StaticQueue_t * ) pxQueue;
+ xReturn = pdTRUE;
+ }
+ else
+ {
+ xReturn = pdFALSE;
+ }
+ }
+ #else /* configSUPPORT_DYNAMIC_ALLOCATION */
+ {
+ /* Queue must have been statically allocated. */
+ if( ppucQueueStorage != NULL )
+ {
+ *ppucQueueStorage = ( uint8_t * ) pxQueue->pcHead;
+ }
+
+ *ppxStaticQueue = ( StaticQueue_t * ) pxQueue;
+ xReturn = pdTRUE;
+ }
+ #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
+
+ traceRETURN_xQueueGenericGetStaticBuffers( xReturn );
+
+ return xReturn;
+ }
+
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+/*-----------------------------------------------------------*/
+
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
QueueHandle_t xQueueGenericCreate( const UBaseType_t uxQueueLength,
@@ -433,34 +507,30 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
size_t xQueueSizeInBytes;
uint8_t * pucQueueStorage;
+ traceENTER_xQueueGenericCreate( uxQueueLength, uxItemSize, ucQueueType );
+
if( ( uxQueueLength > ( UBaseType_t ) 0 ) &&
/* Check for multiplication overflow. */
( ( SIZE_MAX / uxQueueLength ) >= uxItemSize ) &&
/* Check for addition overflow. */
- ( ( SIZE_MAX - sizeof( Queue_t ) ) >= ( uxQueueLength * uxItemSize ) ) )
+ ( ( UBaseType_t ) ( SIZE_MAX - sizeof( Queue_t ) ) >= ( uxQueueLength * uxItemSize ) ) )
{
/* Allocate enough space to hold the maximum number of items that
* can be in the queue at any time. It is valid for uxItemSize to be
* zero in the case the queue is used as a semaphore. */
- xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
-
- /* Allocate the queue and storage area. Justification for MISRA
- * deviation as follows: pvPortMalloc() always ensures returned memory
- * blocks are aligned per the requirements of the MCU stack. In this case
- * pvPortMalloc() must return a pointer that is guaranteed to meet the
- * alignment requirements of the Queue_t structure - which in this case
- * is an int8_t *. Therefore, whenever the stack alignment requirements
- * are greater than or equal to the pointer to char requirements the cast
- * is safe. In other cases alignment requirements are not strict (one or
- * two bytes). */
- pxNewQueue = ( Queue_t * ) pvPortMalloc( sizeof( Queue_t ) + xQueueSizeInBytes ); /*lint !e9087 !e9079 see comment above. */
+ xQueueSizeInBytes = ( size_t ) ( ( size_t ) uxQueueLength * ( size_t ) uxItemSize );
+
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxNewQueue = ( Queue_t * ) pvPortMalloc( sizeof( Queue_t ) + xQueueSizeInBytes );
if( pxNewQueue != NULL )
{
/* Jump past the queue structure to find the location of the queue
* storage area. */
pucQueueStorage = ( uint8_t * ) pxNewQueue;
- pucQueueStorage += sizeof( Queue_t ); /*lint !e9016 Pointer arithmetic allowed on char types, especially when it assists conveying intent. */
+ pucQueueStorage += sizeof( Queue_t );
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
{
@@ -485,6 +555,8 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
mtCOVERAGE_TEST_MARKER();
}
+ traceRETURN_xQueueGenericCreate( pxNewQueue );
+
return pxNewQueue;
}
@@ -574,9 +646,13 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
QueueHandle_t xNewQueue;
const UBaseType_t uxMutexLength = ( UBaseType_t ) 1, uxMutexSize = ( UBaseType_t ) 0;
+ traceENTER_xQueueCreateMutex( ucQueueType );
+
xNewQueue = xQueueGenericCreate( uxMutexLength, uxMutexSize, ucQueueType );
prvInitialiseMutex( ( Queue_t * ) xNewQueue );
+ traceRETURN_xQueueCreateMutex( xNewQueue );
+
return xNewQueue;
}
@@ -591,6 +667,8 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
QueueHandle_t xNewQueue;
const UBaseType_t uxMutexLength = ( UBaseType_t ) 1, uxMutexSize = ( UBaseType_t ) 0;
+ traceENTER_xQueueCreateMutexStatic( ucQueueType, pxStaticQueue );
+
/* Prevent compiler warnings about unused parameters if
* configUSE_TRACE_FACILITY does not equal 1. */
( void ) ucQueueType;
@@ -598,6 +676,8 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
xNewQueue = xQueueGenericCreateStatic( uxMutexLength, uxMutexSize, NULL, pxStaticQueue, ucQueueType );
prvInitialiseMutex( ( Queue_t * ) xNewQueue );
+ traceRETURN_xQueueCreateMutexStatic( xNewQueue );
+
return xNewQueue;
}
@@ -611,6 +691,8 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
TaskHandle_t pxReturn;
Queue_t * const pxSemaphore = ( Queue_t * ) xSemaphore;
+ traceENTER_xQueueGetMutexHolder( xSemaphore );
+
configASSERT( xSemaphore );
/* This function is called by xSemaphoreGetMutexHolder(), and should not
@@ -631,8 +713,10 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
}
taskEXIT_CRITICAL();
+ traceRETURN_xQueueGetMutexHolder( pxReturn );
+
return pxReturn;
- } /*lint !e818 xSemaphore cannot be a pointer to const because it is a typedef. */
+ }
#endif /* if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) ) */
/*-----------------------------------------------------------*/
@@ -643,6 +727,8 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
{
TaskHandle_t pxReturn;
+ traceENTER_xQueueGetMutexHolderFromISR( xSemaphore );
+
configASSERT( xSemaphore );
/* Mutexes cannot be used in interrupt service routines, so the mutex
@@ -657,8 +743,10 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
pxReturn = NULL;
}
+ traceRETURN_xQueueGetMutexHolderFromISR( pxReturn );
+
return pxReturn;
- } /*lint !e818 xSemaphore cannot be a pointer to const because it is a typedef. */
+ }
#endif /* if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) ) */
/*-----------------------------------------------------------*/
@@ -670,6 +758,8 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
BaseType_t xReturn;
Queue_t * const pxMutex = ( Queue_t * ) xMutex;
+ traceENTER_xQueueGiveMutexRecursive( xMutex );
+
configASSERT( pxMutex );
/* If this is the task that holds the mutex then xMutexHolder will not
@@ -712,6 +802,8 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex );
}
+ traceRETURN_xQueueGiveMutexRecursive( xReturn );
+
return xReturn;
}
@@ -726,6 +818,8 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
BaseType_t xReturn;
Queue_t * const pxMutex = ( Queue_t * ) xMutex;
+ traceENTER_xQueueTakeMutexRecursive( xMutex, xTicksToWait );
+
configASSERT( pxMutex );
/* Comments regarding mutual exclusion as per those within
@@ -755,6 +849,8 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
}
}
+ traceRETURN_xQueueTakeMutexRecursive( xReturn );
+
return xReturn;
}
@@ -769,7 +865,9 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
{
QueueHandle_t xHandle = NULL;
- if( ( uxMaxCount != 0 ) &&
+ traceENTER_xQueueCreateCountingSemaphoreStatic( uxMaxCount, uxInitialCount, pxStaticQueue );
+
+ if( ( uxMaxCount != 0U ) &&
( uxInitialCount <= uxMaxCount ) )
{
xHandle = xQueueGenericCreateStatic( uxMaxCount, queueSEMAPHORE_QUEUE_ITEM_LENGTH, NULL, pxStaticQueue, queueQUEUE_TYPE_COUNTING_SEMAPHORE );
@@ -791,6 +889,8 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
mtCOVERAGE_TEST_MARKER();
}
+ traceRETURN_xQueueCreateCountingSemaphoreStatic( xHandle );
+
return xHandle;
}
@@ -804,7 +904,9 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
{
QueueHandle_t xHandle = NULL;
- if( ( uxMaxCount != 0 ) &&
+ traceENTER_xQueueCreateCountingSemaphore( uxMaxCount, uxInitialCount );
+
+ if( ( uxMaxCount != 0U ) &&
( uxInitialCount <= uxMaxCount ) )
{
xHandle = xQueueGenericCreate( uxMaxCount, queueSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_COUNTING_SEMAPHORE );
@@ -826,6 +928,8 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
mtCOVERAGE_TEST_MARKER();
}
+ traceRETURN_xQueueCreateCountingSemaphore( xHandle );
+
return xHandle;
}
@@ -841,6 +945,8 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
TimeOut_t xTimeOut;
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueueGenericSend( xQueue, pvItemToQueue, xTicksToWait, xCopyPosition );
+
configASSERT( pxQueue );
configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );
configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) );
@@ -850,9 +956,6 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
}
#endif
- /*lint -save -e904 This function relaxes the coding standard somewhat to
- * allow return statements within the function itself. This is done in the
- * interest of execution time efficiency. */
for( ; ; )
{
taskENTER_CRITICAL();
@@ -962,6 +1065,9 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
#endif /* configUSE_QUEUE_SETS */
taskEXIT_CRITICAL();
+
+ traceRETURN_xQueueGenericSend( pdPASS );
+
return pdPASS;
}
else
@@ -975,6 +1081,8 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
/* Return to the original privilege level before exiting
* the function. */
traceQUEUE_SEND_FAILED( pxQueue );
+ traceRETURN_xQueueGenericSend( errQUEUE_FULL );
+
return errQUEUE_FULL;
}
else if( xEntryTimeSet == pdFALSE )
@@ -1021,7 +1129,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
* is also a higher priority task in the pending ready list. */
if( xTaskResumeAll() == pdFALSE )
{
- portYIELD_WITHIN_API();
+ taskYIELD_WITHIN_API();
}
}
else
@@ -1038,9 +1146,11 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
( void ) xTaskResumeAll();
traceQUEUE_SEND_FAILED( pxQueue );
+ traceRETURN_xQueueGenericSend( errQUEUE_FULL );
+
return errQUEUE_FULL;
}
- } /*lint -restore */
+ }
}
/*-----------------------------------------------------------*/
@@ -1053,6 +1163,8 @@ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
UBaseType_t uxSavedInterruptStatus;
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueueGenericSendFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken, xCopyPosition );
+
configASSERT( pxQueue );
configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );
configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) );
@@ -1078,7 +1190,10 @@ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
* read, instead return a flag to say whether a context switch is required or
* not (i.e. has a task with a higher priority than us been woken by this
* post). */
- uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = ( UBaseType_t ) taskENTER_CRITICAL_FROM_ISR();
{
if( ( pxQueue->uxMessagesWaiting < pxQueue->uxLength ) || ( xCopyPosition == queueOVERWRITE ) )
{
@@ -1203,7 +1318,9 @@ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
xReturn = errQUEUE_FULL;
}
}
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
+
+ traceRETURN_xQueueGenericSendFromISR( xReturn );
return xReturn;
}
@@ -1216,6 +1333,8 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
UBaseType_t uxSavedInterruptStatus;
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueueGiveFromISR( xQueue, pxHigherPriorityTaskWoken );
+
/* Similar to xQueueGenericSendFromISR() but used with semaphores where the
* item size is 0. Don't directly wake a task that was blocked on a queue
* read, instead return a flag to say whether a context switch is required or
@@ -1249,7 +1368,10 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
* link: https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
- uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = ( UBaseType_t ) taskENTER_CRITICAL_FROM_ISR();
{
const UBaseType_t uxMessagesWaiting = pxQueue->uxMessagesWaiting;
@@ -1268,7 +1390,7 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
* can be assumed there is no mutex holder and no need to determine if
* priority disinheritance is needed. Simply increase the count of
* messages (semaphores) available. */
- pxQueue->uxMessagesWaiting = uxMessagesWaiting + ( UBaseType_t ) 1;
+ pxQueue->uxMessagesWaiting = ( UBaseType_t ) ( uxMessagesWaiting + ( UBaseType_t ) 1 );
/* The event list is not altered if the queue is locked. This will
* be done when the queue is unlocked later. */
@@ -1369,7 +1491,9 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
xReturn = errQUEUE_FULL;
}
}
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
+
+ traceRETURN_xQueueGiveFromISR( xReturn );
return xReturn;
}
@@ -1383,6 +1507,8 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
TimeOut_t xTimeOut;
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueueReceive( xQueue, pvBuffer, xTicksToWait );
+
/* Check the pointer is not NULL. */
configASSERT( ( pxQueue ) );
@@ -1397,9 +1523,6 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
}
#endif
- /*lint -save -e904 This function relaxes the coding standard somewhat to
- * allow return statements within the function itself. This is done in the
- * interest of execution time efficiency. */
for( ; ; )
{
taskENTER_CRITICAL();
@@ -1413,7 +1536,7 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
/* Data available, remove one item. */
prvCopyDataFromQueue( pxQueue, pvBuffer );
traceQUEUE_RECEIVE( pxQueue );
- pxQueue->uxMessagesWaiting = uxMessagesWaiting - ( UBaseType_t ) 1;
+ pxQueue->uxMessagesWaiting = ( UBaseType_t ) ( uxMessagesWaiting - ( UBaseType_t ) 1 );
/* There is now space in the queue, were any tasks waiting to
* post to the queue? If so, unblock the highest priority waiting
@@ -1435,6 +1558,9 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
}
taskEXIT_CRITICAL();
+
+ traceRETURN_xQueueReceive( pdPASS );
+
return pdPASS;
}
else
@@ -1444,7 +1570,10 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
/* The queue was empty and no block time is specified (or
* the block time has expired) so leave now. */
taskEXIT_CRITICAL();
+
traceQUEUE_RECEIVE_FAILED( pxQueue );
+ traceRETURN_xQueueReceive( errQUEUE_EMPTY );
+
return errQUEUE_EMPTY;
}
else if( xEntryTimeSet == pdFALSE )
@@ -1482,7 +1611,7 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
if( xTaskResumeAll() == pdFALSE )
{
- portYIELD_WITHIN_API();
+ taskYIELD_WITHIN_API();
}
else
{
@@ -1507,6 +1636,8 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
if( prvIsQueueEmpty( pxQueue ) != pdFALSE )
{
traceQUEUE_RECEIVE_FAILED( pxQueue );
+ traceRETURN_xQueueReceive( errQUEUE_EMPTY );
+
return errQUEUE_EMPTY;
}
else
@@ -1514,7 +1645,7 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
mtCOVERAGE_TEST_MARKER();
}
}
- } /*lint -restore */
+ }
}
/*-----------------------------------------------------------*/
@@ -1529,6 +1660,8 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
BaseType_t xInheritanceOccurred = pdFALSE;
#endif
+ traceENTER_xQueueSemaphoreTake( xQueue, xTicksToWait );
+
/* Check the queue pointer is not NULL. */
configASSERT( ( pxQueue ) );
@@ -1543,9 +1676,6 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
}
#endif
- /*lint -save -e904 This function relaxes the coding standard somewhat to allow return
- * statements within the function itself. This is done in the interest
- * of execution time efficiency. */
for( ; ; )
{
taskENTER_CRITICAL();
@@ -1562,7 +1692,7 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
/* Semaphores are queues with a data size of zero and where the
* messages waiting is the semaphore's count. Reduce the count. */
- pxQueue->uxMessagesWaiting = uxSemaphoreCount - ( UBaseType_t ) 1;
+ pxQueue->uxMessagesWaiting = ( UBaseType_t ) ( uxSemaphoreCount - ( UBaseType_t ) 1 );
#if ( configUSE_MUTEXES == 1 )
{
@@ -1598,6 +1728,9 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
}
taskEXIT_CRITICAL();
+
+ traceRETURN_xQueueSemaphoreTake( pdPASS );
+
return pdPASS;
}
else
@@ -1607,7 +1740,10 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
/* The semaphore count was 0 and no block time is specified
* (or the block time has expired) so exit now. */
taskEXIT_CRITICAL();
+
traceQUEUE_RECEIVE_FAILED( pxQueue );
+ traceRETURN_xQueueSemaphoreTake( errQUEUE_EMPTY );
+
return errQUEUE_EMPTY;
}
else if( xEntryTimeSet == pdFALSE )
@@ -1665,7 +1801,7 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
if( xTaskResumeAll() == pdFALSE )
{
- portYIELD_WITHIN_API();
+ taskYIELD_WITHIN_API();
}
else
{
@@ -1709,6 +1845,14 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
* again, but only as low as the next highest priority
* task that is waiting for the same mutex. */
uxHighestWaitingPriority = prvGetDisinheritPriorityAfterTimeout( pxQueue );
+
+ /* vTaskPriorityDisinheritAfterTimeout uses the uxHighestWaitingPriority
+ * parameter to index pxReadyTasksLists when adding the task holding
+ * mutex to the ready list for its new priority. Coverity thinks that
+ * it can result in out-of-bounds access which is not true because
+ * uxHighestWaitingPriority, as returned by prvGetDisinheritPriorityAfterTimeout,
+ * is capped at ( configMAX_PRIORITIES - 1 ). */
+ /* coverity[overrun] */
vTaskPriorityDisinheritAfterTimeout( pxQueue->u.xSemaphore.xMutexHolder, uxHighestWaitingPriority );
}
taskEXIT_CRITICAL();
@@ -1717,6 +1861,8 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
#endif /* configUSE_MUTEXES */
traceQUEUE_RECEIVE_FAILED( pxQueue );
+ traceRETURN_xQueueSemaphoreTake( errQUEUE_EMPTY );
+
return errQUEUE_EMPTY;
}
else
@@ -1724,7 +1870,7 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
mtCOVERAGE_TEST_MARKER();
}
}
- } /*lint -restore */
+ }
}
/*-----------------------------------------------------------*/
@@ -1737,6 +1883,8 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
int8_t * pcOriginalReadPosition;
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueuePeek( xQueue, pvBuffer, xTicksToWait );
+
/* Check the pointer is not NULL. */
configASSERT( ( pxQueue ) );
@@ -1751,9 +1899,6 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
}
#endif
- /*lint -save -e904 This function relaxes the coding standard somewhat to
- * allow return statements within the function itself. This is done in the
- * interest of execution time efficiency. */
for( ; ; )
{
taskENTER_CRITICAL();
@@ -1795,6 +1940,9 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
}
taskEXIT_CRITICAL();
+
+ traceRETURN_xQueuePeek( pdPASS );
+
return pdPASS;
}
else
@@ -1804,7 +1952,10 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
/* The queue was empty and no block time is specified (or
* the block time has expired) so leave now. */
taskEXIT_CRITICAL();
+
traceQUEUE_PEEK_FAILED( pxQueue );
+ traceRETURN_xQueuePeek( errQUEUE_EMPTY );
+
return errQUEUE_EMPTY;
}
else if( xEntryTimeSet == pdFALSE )
@@ -1843,7 +1994,7 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
if( xTaskResumeAll() == pdFALSE )
{
- portYIELD_WITHIN_API();
+ taskYIELD_WITHIN_API();
}
else
{
@@ -1868,6 +2019,8 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
if( prvIsQueueEmpty( pxQueue ) != pdFALSE )
{
traceQUEUE_PEEK_FAILED( pxQueue );
+ traceRETURN_xQueuePeek( errQUEUE_EMPTY );
+
return errQUEUE_EMPTY;
}
else
@@ -1875,7 +2028,7 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
mtCOVERAGE_TEST_MARKER();
}
}
- } /*lint -restore */
+ }
}
/*-----------------------------------------------------------*/
@@ -1887,6 +2040,8 @@ BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue,
UBaseType_t uxSavedInterruptStatus;
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueueReceiveFromISR( xQueue, pvBuffer, pxHigherPriorityTaskWoken );
+
configASSERT( pxQueue );
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );
@@ -1906,7 +2061,10 @@ BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue,
* link: https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
- uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = ( UBaseType_t ) taskENTER_CRITICAL_FROM_ISR();
{
const UBaseType_t uxMessagesWaiting = pxQueue->uxMessagesWaiting;
@@ -1918,7 +2076,7 @@ BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue,
traceQUEUE_RECEIVE_FROM_ISR( pxQueue );
prvCopyDataFromQueue( pxQueue, pvBuffer );
- pxQueue->uxMessagesWaiting = uxMessagesWaiting - ( UBaseType_t ) 1;
+ pxQueue->uxMessagesWaiting = ( UBaseType_t ) ( uxMessagesWaiting - ( UBaseType_t ) 1 );
/* If the queue is locked the event list will not be modified.
* Instead update the lock count so the task that unlocks the queue
@@ -1966,7 +2124,9 @@ BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue,
traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue );
}
}
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
+
+ traceRETURN_xQueueReceiveFromISR( xReturn );
return xReturn;
}
@@ -1980,6 +2140,8 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
int8_t * pcOriginalReadPosition;
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueuePeekFromISR( xQueue, pvBuffer );
+
configASSERT( pxQueue );
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );
configASSERT( pxQueue->uxItemSize != 0 ); /* Can't peek a semaphore. */
@@ -2000,7 +2162,10 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
* link: https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
- uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = ( UBaseType_t ) taskENTER_CRITICAL_FROM_ISR();
{
/* Cannot block in an ISR, so check there is data available. */
if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 )
@@ -2021,7 +2186,9 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue );
}
}
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
+
+ traceRETURN_xQueuePeekFromISR( xReturn );
return xReturn;
}
@@ -2031,6 +2198,8 @@ UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue )
{
UBaseType_t uxReturn;
+ traceENTER_uxQueueMessagesWaiting( xQueue );
+
configASSERT( xQueue );
taskENTER_CRITICAL();
@@ -2039,8 +2208,10 @@ UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue )
}
taskEXIT_CRITICAL();
+ traceRETURN_uxQueueMessagesWaiting( uxReturn );
+
return uxReturn;
-} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */
+}
/*-----------------------------------------------------------*/
UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue )
@@ -2048,16 +2219,20 @@ UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue )
UBaseType_t uxReturn;
Queue_t * const pxQueue = xQueue;
+ traceENTER_uxQueueSpacesAvailable( xQueue );
+
configASSERT( pxQueue );
taskENTER_CRITICAL();
{
- uxReturn = pxQueue->uxLength - pxQueue->uxMessagesWaiting;
+ uxReturn = ( UBaseType_t ) ( pxQueue->uxLength - pxQueue->uxMessagesWaiting );
}
taskEXIT_CRITICAL();
+ traceRETURN_uxQueueSpacesAvailable( uxReturn );
+
return uxReturn;
-} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */
+}
/*-----------------------------------------------------------*/
UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue )
@@ -2065,17 +2240,23 @@ UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue )
UBaseType_t uxReturn;
Queue_t * const pxQueue = xQueue;
+ traceENTER_uxQueueMessagesWaitingFromISR( xQueue );
+
configASSERT( pxQueue );
uxReturn = pxQueue->uxMessagesWaiting;
+ traceRETURN_uxQueueMessagesWaitingFromISR( uxReturn );
+
return uxReturn;
-} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */
+}
/*-----------------------------------------------------------*/
void vQueueDelete( QueueHandle_t xQueue )
{
Queue_t * const pxQueue = xQueue;
+ traceENTER_vQueueDelete( xQueue );
+
configASSERT( pxQueue );
traceQUEUE_DELETE( pxQueue );
@@ -2111,6 +2292,8 @@ void vQueueDelete( QueueHandle_t xQueue )
( void ) pxQueue;
}
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
+
+ traceRETURN_vQueueDelete();
}
/*-----------------------------------------------------------*/
@@ -2118,6 +2301,10 @@ void vQueueDelete( QueueHandle_t xQueue )
UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue )
{
+ traceENTER_uxQueueGetQueueNumber( xQueue );
+
+ traceRETURN_uxQueueGetQueueNumber( ( ( Queue_t * ) xQueue )->uxQueueNumber );
+
return ( ( Queue_t * ) xQueue )->uxQueueNumber;
}
@@ -2129,7 +2316,11 @@ void vQueueDelete( QueueHandle_t xQueue )
void vQueueSetQueueNumber( QueueHandle_t xQueue,
UBaseType_t uxQueueNumber )
{
+ traceENTER_vQueueSetQueueNumber( xQueue, uxQueueNumber );
+
( ( Queue_t * ) xQueue )->uxQueueNumber = uxQueueNumber;
+
+ traceRETURN_vQueueSetQueueNumber();
}
#endif /* configUSE_TRACE_FACILITY */
@@ -2139,12 +2330,36 @@ void vQueueDelete( QueueHandle_t xQueue )
uint8_t ucQueueGetQueueType( QueueHandle_t xQueue )
{
+ traceENTER_ucQueueGetQueueType( xQueue );
+
+ traceRETURN_ucQueueGetQueueType( ( ( Queue_t * ) xQueue )->ucQueueType );
+
return ( ( Queue_t * ) xQueue )->ucQueueType;
}
#endif /* configUSE_TRACE_FACILITY */
/*-----------------------------------------------------------*/
+UBaseType_t uxQueueGetQueueItemSize( QueueHandle_t xQueue ) /* PRIVILEGED_FUNCTION */
+{
+ traceENTER_uxQueueGetQueueItemSize( xQueue );
+
+ traceRETURN_uxQueueGetQueueItemSize( ( ( Queue_t * ) xQueue )->uxItemSize );
+
+ return ( ( Queue_t * ) xQueue )->uxItemSize;
+}
+/*-----------------------------------------------------------*/
+
+UBaseType_t uxQueueGetQueueLength( QueueHandle_t xQueue ) /* PRIVILEGED_FUNCTION */
+{
+ traceENTER_uxQueueGetQueueLength( xQueue );
+
+ traceRETURN_uxQueueGetQueueLength( ( ( Queue_t * ) xQueue )->uxLength );
+
+ return ( ( Queue_t * ) xQueue )->uxLength;
+}
+/*-----------------------------------------------------------*/
+
#if ( configUSE_MUTEXES == 1 )
static UBaseType_t prvGetDisinheritPriorityAfterTimeout( const Queue_t * const pxQueue )
@@ -2159,7 +2374,7 @@ void vQueueDelete( QueueHandle_t xQueue )
* mutex. */
if( listCURRENT_LIST_LENGTH( &( pxQueue->xTasksWaitingToReceive ) ) > 0U )
{
- uxHighestPriorityOfWaitingTasks = ( UBaseType_t ) configMAX_PRIORITIES - ( UBaseType_t ) listGET_ITEM_VALUE_OF_HEAD_ENTRY( &( pxQueue->xTasksWaitingToReceive ) );
+ uxHighestPriorityOfWaitingTasks = ( UBaseType_t ) ( ( UBaseType_t ) configMAX_PRIORITIES - ( UBaseType_t ) listGET_ITEM_VALUE_OF_HEAD_ENTRY( &( pxQueue->xTasksWaitingToReceive ) ) );
}
else
{
@@ -2202,10 +2417,10 @@ static BaseType_t prvCopyDataToQueue( Queue_t * const pxQueue,
}
else if( xPosition == queueSEND_TO_BACK )
{
- ( void ) memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 !e418 !e9087 MISRA exception as the casts are only redundant for some ports, plus previous logic ensures a null pointer can only be passed to memcpy() if the copy size is 0. Cast to void required by function signature and safe as no alignment requirement and copy length specified in bytes. */
- pxQueue->pcWriteTo += pxQueue->uxItemSize; /*lint !e9016 Pointer arithmetic on char types ok, especially in this use case where it is the clearest way of conveying intent. */
+ ( void ) memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( size_t ) pxQueue->uxItemSize );
+ pxQueue->pcWriteTo += pxQueue->uxItemSize;
- if( pxQueue->pcWriteTo >= pxQueue->u.xQueue.pcTail ) /*lint !e946 MISRA exception justified as comparison of pointers is the cleanest solution. */
+ if( pxQueue->pcWriteTo >= pxQueue->u.xQueue.pcTail )
{
pxQueue->pcWriteTo = pxQueue->pcHead;
}
@@ -2216,10 +2431,10 @@ static BaseType_t prvCopyDataToQueue( Queue_t * const pxQueue,
}
else
{
- ( void ) memcpy( ( void * ) pxQueue->u.xQueue.pcReadFrom, pvItemToQueue, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 !e9087 !e418 MISRA exception as the casts are only redundant for some ports. Cast to void required by function signature and safe as no alignment requirement and copy length specified in bytes. Assert checks null pointer only used when length is 0. */
+ ( void ) memcpy( ( void * ) pxQueue->u.xQueue.pcReadFrom, pvItemToQueue, ( size_t ) pxQueue->uxItemSize );
pxQueue->u.xQueue.pcReadFrom -= pxQueue->uxItemSize;
- if( pxQueue->u.xQueue.pcReadFrom < pxQueue->pcHead ) /*lint !e946 MISRA exception justified as comparison of pointers is the cleanest solution. */
+ if( pxQueue->u.xQueue.pcReadFrom < pxQueue->pcHead )
{
pxQueue->u.xQueue.pcReadFrom = ( pxQueue->u.xQueue.pcTail - pxQueue->uxItemSize );
}
@@ -2249,7 +2464,7 @@ static BaseType_t prvCopyDataToQueue( Queue_t * const pxQueue,
}
}
- pxQueue->uxMessagesWaiting = uxMessagesWaiting + ( UBaseType_t ) 1;
+ pxQueue->uxMessagesWaiting = ( UBaseType_t ) ( uxMessagesWaiting + ( UBaseType_t ) 1 );
return xReturn;
}
@@ -2260,9 +2475,9 @@ static void prvCopyDataFromQueue( Queue_t * const pxQueue,
{
if( pxQueue->uxItemSize != ( UBaseType_t ) 0 )
{
- pxQueue->u.xQueue.pcReadFrom += pxQueue->uxItemSize; /*lint !e9016 Pointer arithmetic on char types ok, especially in this use case where it is the clearest way of conveying intent. */
+ pxQueue->u.xQueue.pcReadFrom += pxQueue->uxItemSize;
- if( pxQueue->u.xQueue.pcReadFrom >= pxQueue->u.xQueue.pcTail ) /*lint !e946 MISRA exception justified as use of the relational operator is the cleanest solutions. */
+ if( pxQueue->u.xQueue.pcReadFrom >= pxQueue->u.xQueue.pcTail )
{
pxQueue->u.xQueue.pcReadFrom = pxQueue->pcHead;
}
@@ -2271,7 +2486,7 @@ static void prvCopyDataFromQueue( Queue_t * const pxQueue,
mtCOVERAGE_TEST_MARKER();
}
- ( void ) memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.xQueue.pcReadFrom, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 !e418 !e9087 MISRA exception as the casts are only redundant for some ports. Also previous logic ensures a null pointer can only be passed to memcpy() when the count is 0. Cast to void required by function signature and safe as no alignment requirement and copy length specified in bytes. */
+ ( void ) memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.xQueue.pcReadFrom, ( size_t ) pxQueue->uxItemSize );
}
}
/*-----------------------------------------------------------*/
@@ -2422,6 +2637,8 @@ BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue )
BaseType_t xReturn;
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueueIsQueueEmptyFromISR( xQueue );
+
configASSERT( pxQueue );
if( pxQueue->uxMessagesWaiting == ( UBaseType_t ) 0 )
@@ -2433,8 +2650,10 @@ BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue )
xReturn = pdFALSE;
}
+ traceRETURN_xQueueIsQueueEmptyFromISR( xReturn );
+
return xReturn;
-} /*lint !e818 xQueue could not be pointer to const because it is a typedef. */
+}
/*-----------------------------------------------------------*/
static BaseType_t prvIsQueueFull( const Queue_t * pxQueue )
@@ -2463,6 +2682,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
BaseType_t xReturn;
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueueIsQueueFullFromISR( xQueue );
+
configASSERT( pxQueue );
if( pxQueue->uxMessagesWaiting == pxQueue->uxLength )
@@ -2474,8 +2695,10 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
xReturn = pdFALSE;
}
+ traceRETURN_xQueueIsQueueFullFromISR( xReturn );
+
return xReturn;
-} /*lint !e818 xQueue could not be pointer to const because it is a typedef. */
+}
/*-----------------------------------------------------------*/
#if ( configUSE_CO_ROUTINES == 1 )
@@ -2487,6 +2710,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
BaseType_t xReturn;
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueueCRSend( xQueue, pvItemToQueue, xTicksToWait );
+
/* If the queue is already full we may have to block. A critical section
* is required to prevent an interrupt removing something from the queue
* between the check to see if the queue is full and blocking on the queue. */
@@ -2551,6 +2776,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
}
portENABLE_INTERRUPTS();
+ traceRETURN_xQueueCRSend( xReturn );
+
return xReturn;
}
@@ -2566,6 +2793,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
BaseType_t xReturn;
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueueCRReceive( xQueue, pvBuffer, xTicksToWait );
+
/* If the queue is already empty we may have to block. A critical section
* is required to prevent an interrupt adding something to the queue
* between the check to see if the queue is empty and blocking on the queue. */
@@ -2645,6 +2874,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
}
portENABLE_INTERRUPTS();
+ traceRETURN_xQueueCRReceive( xReturn );
+
return xReturn;
}
@@ -2659,6 +2890,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
{
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueueCRSendFromISR( xQueue, pvItemToQueue, xCoRoutinePreviouslyWoken );
+
/* Cannot block within an ISR so if there is no space on the queue then
* exit without doing anything. */
if( pxQueue->uxMessagesWaiting < pxQueue->uxLength )
@@ -2695,6 +2928,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
mtCOVERAGE_TEST_MARKER();
}
+ traceRETURN_xQueueCRSendFromISR( xCoRoutinePreviouslyWoken );
+
return xCoRoutinePreviouslyWoken;
}
@@ -2710,6 +2945,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
BaseType_t xReturn;
Queue_t * const pxQueue = xQueue;
+ traceENTER_xQueueCRReceiveFromISR( xQueue, pvBuffer, pxCoRoutineWoken );
+
/* We cannot block from an ISR, so check there is data available. If
* not then just leave without doing anything. */
if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 )
@@ -2759,6 +2996,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
xReturn = pdFAIL;
}
+ traceRETURN_xQueueCRReceiveFromISR( xReturn );
+
return xReturn;
}
@@ -2768,11 +3007,13 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
#if ( configQUEUE_REGISTRY_SIZE > 0 )
void vQueueAddToRegistry( QueueHandle_t xQueue,
- const char * pcQueueName ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ const char * pcQueueName )
{
UBaseType_t ux;
QueueRegistryItem_t * pxEntryToWrite = NULL;
+ traceENTER_vQueueAddToRegistry( xQueue, pcQueueName );
+
configASSERT( xQueue );
if( pcQueueName != NULL )
@@ -2807,6 +3048,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
traceQUEUE_REGISTRY_ADD( xQueue, pcQueueName );
}
+
+ traceRETURN_vQueueAddToRegistry();
}
#endif /* configQUEUE_REGISTRY_SIZE */
@@ -2814,10 +3057,12 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
#if ( configQUEUE_REGISTRY_SIZE > 0 )
- const char * pcQueueGetName( QueueHandle_t xQueue ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ const char * pcQueueGetName( QueueHandle_t xQueue )
{
UBaseType_t ux;
- const char * pcReturn = NULL; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ const char * pcReturn = NULL;
+
+ traceENTER_pcQueueGetName( xQueue );
configASSERT( xQueue );
@@ -2837,8 +3082,10 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
}
}
+ traceRETURN_pcQueueGetName( pcReturn );
+
return pcReturn;
- } /*lint !e818 xQueue cannot be a pointer to const because it is a typedef. */
+ }
#endif /* configQUEUE_REGISTRY_SIZE */
/*-----------------------------------------------------------*/
@@ -2849,6 +3096,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
{
UBaseType_t ux;
+ traceENTER_vQueueUnregisterQueue( xQueue );
+
configASSERT( xQueue );
/* See if the handle of the queue being unregistered in actually in the
@@ -2871,7 +3120,9 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
mtCOVERAGE_TEST_MARKER();
}
}
- } /*lint !e818 xQueue could not be pointer to const because it is a typedef. */
+
+ traceRETURN_vQueueUnregisterQueue();
+ }
#endif /* configQUEUE_REGISTRY_SIZE */
/*-----------------------------------------------------------*/
@@ -2884,6 +3135,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
{
Queue_t * const pxQueue = xQueue;
+ traceENTER_vQueueWaitForMessageRestricted( xQueue, xTicksToWait, xWaitIndefinitely );
+
/* This function should not be called by application code hence the
* 'Restricted' in its name. It is not part of the public API. It is
* designed for use by kernel code, and has special calling requirements.
@@ -2911,6 +3164,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
}
prvUnlockQueue( pxQueue );
+
+ traceRETURN_vQueueWaitForMessageRestricted();
}
#endif /* configUSE_TIMERS */
@@ -2922,8 +3177,12 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
{
QueueSetHandle_t pxQueue;
+ traceENTER_xQueueCreateSet( uxEventQueueLength );
+
pxQueue = xQueueGenericCreate( uxEventQueueLength, ( UBaseType_t ) sizeof( Queue_t * ), queueQUEUE_TYPE_SET );
+ traceRETURN_xQueueCreateSet( pxQueue );
+
return pxQueue;
}
@@ -2937,6 +3196,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
{
BaseType_t xReturn;
+ traceENTER_xQueueAddToSet( xQueueOrSemaphore, xQueueSet );
+
taskENTER_CRITICAL();
{
if( ( ( Queue_t * ) xQueueOrSemaphore )->pxQueueSetContainer != NULL )
@@ -2958,6 +3219,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
}
taskEXIT_CRITICAL();
+ traceRETURN_xQueueAddToSet( xReturn );
+
return xReturn;
}
@@ -2972,6 +3235,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
BaseType_t xReturn;
Queue_t * const pxQueueOrSemaphore = ( Queue_t * ) xQueueOrSemaphore;
+ traceENTER_xQueueRemoveFromSet( xQueueOrSemaphore, xQueueSet );
+
if( pxQueueOrSemaphore->pxQueueSetContainer != xQueueSet )
{
/* The queue was not a member of the set. */
@@ -2995,8 +3260,10 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
xReturn = pdPASS;
}
+ traceRETURN_xQueueRemoveFromSet( xReturn );
+
return xReturn;
- } /*lint !e818 xQueueSet could not be declared as pointing to const as it is a typedef. */
+ }
#endif /* configUSE_QUEUE_SETS */
/*-----------------------------------------------------------*/
@@ -3008,7 +3275,12 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
{
QueueSetMemberHandle_t xReturn = NULL;
- ( void ) xQueueReceive( ( QueueHandle_t ) xQueueSet, &xReturn, xTicksToWait ); /*lint !e961 Casting from one typedef to another is not redundant. */
+ traceENTER_xQueueSelectFromSet( xQueueSet, xTicksToWait );
+
+ ( void ) xQueueReceive( ( QueueHandle_t ) xQueueSet, &xReturn, xTicksToWait );
+
+ traceRETURN_xQueueSelectFromSet( xReturn );
+
return xReturn;
}
@@ -3021,7 +3293,12 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
{
QueueSetMemberHandle_t xReturn = NULL;
- ( void ) xQueueReceiveFromISR( ( QueueHandle_t ) xQueueSet, &xReturn, NULL ); /*lint !e961 Casting from one typedef to another is not redundant. */
+ traceENTER_xQueueSelectFromSetFromISR( xQueueSet );
+
+ ( void ) xQueueReceiveFromISR( ( QueueHandle_t ) xQueueSet, &xReturn, NULL );
+
+ traceRETURN_xQueueSelectFromSetFromISR( xReturn );
+
return xReturn;
}
diff --git a/third-party/freertos/stream_buffer.c b/third-party/freertos/stream_buffer.c
index fed7eb8f956b5fd01e1879f2b4fded01d73c6558..6decfed6f962e4d6a8994130710ebec8a48fd873 100644
--- a/third-party/freertos/stream_buffer.c
+++ b/third-party/freertos/stream_buffer.c
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -27,7 +27,6 @@
*/
/* Standard includes. */
-#include
#include
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
@@ -48,37 +47,45 @@
#error INCLUDE_xTaskGetCurrentTaskHandle must be set to 1 to build stream_buffer.c
#endif
-/* Lint e961, e9021 and e750 are suppressed as a MISRA exception justified
- * because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
+/* The MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
* for the header files above, but not in this file, in order to generate the
* correct privileged Vs unprivileged linkage and placement. */
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
+
+/* This entire source file will be skipped if the application is not configured
+ * to include stream buffer functionality. This #if is closed at the very bottom
+ * of this file. If you want to include stream buffers then ensure
+ * configUSE_STREAM_BUFFERS is set to 1 in FreeRTOSConfig.h. */
+#if ( configUSE_STREAM_BUFFERS == 1 )
/* If the user has not provided application specific Rx notification macros,
* or #defined the notification macros away, then provide default implementations
* that uses task notifications. */
-/*lint -save -e9026 Function like macros allowed and needed here so they can be overridden. */
-#ifndef sbRECEIVE_COMPLETED
- #define sbRECEIVE_COMPLETED( pxStreamBuffer ) \
- vTaskSuspendAll(); \
- { \
- if( ( pxStreamBuffer )->xTaskWaitingToSend != NULL ) \
- { \
- ( void ) xTaskNotify( ( pxStreamBuffer )->xTaskWaitingToSend, \
- ( uint32_t ) 0, \
- eNoAction ); \
- ( pxStreamBuffer )->xTaskWaitingToSend = NULL; \
- } \
- } \
- ( void ) xTaskResumeAll();
-#endif /* sbRECEIVE_COMPLETED */
+ #ifndef sbRECEIVE_COMPLETED
+ #define sbRECEIVE_COMPLETED( pxStreamBuffer ) \
+ do \
+ { \
+ vTaskSuspendAll(); \
+ { \
+ if( ( pxStreamBuffer )->xTaskWaitingToSend != NULL ) \
+ { \
+ ( void ) xTaskNotifyIndexed( ( pxStreamBuffer )->xTaskWaitingToSend, \
+ ( pxStreamBuffer )->uxNotificationIndex, \
+ ( uint32_t ) 0, \
+ eNoAction ); \
+ ( pxStreamBuffer )->xTaskWaitingToSend = NULL; \
+ } \
+ } \
+ ( void ) xTaskResumeAll(); \
+ } while( 0 )
+ #endif /* sbRECEIVE_COMPLETED */
/* If user has provided a per-instance receive complete callback, then
* invoke the callback else use the receive complete macro which is provided by default for all instances.
*/
-#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
- #define prvRECEIVE_COMPLETED( pxStreamBuffer ) \
- { \
+ #if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
+ #define prvRECEIVE_COMPLETED( pxStreamBuffer ) \
+ do { \
if( ( pxStreamBuffer )->pxReceiveCompletedCallback != NULL ) \
{ \
( pxStreamBuffer )->pxReceiveCompletedCallback( ( pxStreamBuffer ), pdFALSE, NULL ); \
@@ -87,36 +94,37 @@
{ \
sbRECEIVE_COMPLETED( ( pxStreamBuffer ) ); \
} \
- }
-#else /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
- #define prvRECEIVE_COMPLETED( pxStreamBuffer ) sbRECEIVE_COMPLETED( ( pxStreamBuffer ) )
-#endif /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
-
-#ifndef sbRECEIVE_COMPLETED_FROM_ISR
- #define sbRECEIVE_COMPLETED_FROM_ISR( pxStreamBuffer, \
- pxHigherPriorityTaskWoken ) \
- { \
- UBaseType_t uxSavedInterruptStatus; \
- \
- uxSavedInterruptStatus = ( UBaseType_t ) portSET_INTERRUPT_MASK_FROM_ISR(); \
- { \
- if( ( pxStreamBuffer )->xTaskWaitingToSend != NULL ) \
- { \
- ( void ) xTaskNotifyFromISR( ( pxStreamBuffer )->xTaskWaitingToSend, \
- ( uint32_t ) 0, \
- eNoAction, \
- ( pxHigherPriorityTaskWoken ) ); \
- ( pxStreamBuffer )->xTaskWaitingToSend = NULL; \
- } \
- } \
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ); \
- }
-#endif /* sbRECEIVE_COMPLETED_FROM_ISR */
-
-#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
- #define prvRECEIVE_COMPLETED_FROM_ISR( pxStreamBuffer, \
- pxHigherPriorityTaskWoken ) \
- { \
+ } while( 0 )
+ #else /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
+ #define prvRECEIVE_COMPLETED( pxStreamBuffer ) sbRECEIVE_COMPLETED( ( pxStreamBuffer ) )
+ #endif /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
+
+ #ifndef sbRECEIVE_COMPLETED_FROM_ISR
+ #define sbRECEIVE_COMPLETED_FROM_ISR( pxStreamBuffer, \
+ pxHigherPriorityTaskWoken ) \
+ do { \
+ UBaseType_t uxSavedInterruptStatus; \
+ \
+ uxSavedInterruptStatus = taskENTER_CRITICAL_FROM_ISR(); \
+ { \
+ if( ( pxStreamBuffer )->xTaskWaitingToSend != NULL ) \
+ { \
+ ( void ) xTaskNotifyIndexedFromISR( ( pxStreamBuffer )->xTaskWaitingToSend, \
+ ( pxStreamBuffer )->uxNotificationIndex, \
+ ( uint32_t ) 0, \
+ eNoAction, \
+ ( pxHigherPriorityTaskWoken ) ); \
+ ( pxStreamBuffer )->xTaskWaitingToSend = NULL; \
+ } \
+ } \
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus ); \
+ } while( 0 )
+ #endif /* sbRECEIVE_COMPLETED_FROM_ISR */
+
+ #if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
+ #define prvRECEIVE_COMPLETED_FROM_ISR( pxStreamBuffer, \
+ pxHigherPriorityTaskWoken ) \
+ do { \
if( ( pxStreamBuffer )->pxReceiveCompletedCallback != NULL ) \
{ \
( pxStreamBuffer )->pxReceiveCompletedCallback( ( pxStreamBuffer ), pdTRUE, ( pxHigherPriorityTaskWoken ) ); \
@@ -125,75 +133,77 @@
{ \
sbRECEIVE_COMPLETED_FROM_ISR( ( pxStreamBuffer ), ( pxHigherPriorityTaskWoken ) ); \
} \
- }
-#else /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
- #define prvRECEIVE_COMPLETED_FROM_ISR( pxStreamBuffer, pxHigherPriorityTaskWoken ) \
+ } while( 0 )
+ #else /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
+ #define prvRECEIVE_COMPLETED_FROM_ISR( pxStreamBuffer, pxHigherPriorityTaskWoken ) \
sbRECEIVE_COMPLETED_FROM_ISR( ( pxStreamBuffer ), ( pxHigherPriorityTaskWoken ) )
-#endif /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
+ #endif /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
/* If the user has not provided an application specific Tx notification macro,
* or #defined the notification macro away, then provide a default
* implementation that uses task notifications.
*/
-#ifndef sbSEND_COMPLETED
- #define sbSEND_COMPLETED( pxStreamBuffer ) \
- vTaskSuspendAll(); \
- { \
- if( ( pxStreamBuffer )->xTaskWaitingToReceive != NULL ) \
- { \
- ( void ) xTaskNotify( ( pxStreamBuffer )->xTaskWaitingToReceive, \
- ( uint32_t ) 0, \
- eNoAction ); \
- ( pxStreamBuffer )->xTaskWaitingToReceive = NULL; \
- } \
- } \
- ( void ) xTaskResumeAll();
-#endif /* sbSEND_COMPLETED */
+ #ifndef sbSEND_COMPLETED
+ #define sbSEND_COMPLETED( pxStreamBuffer ) \
+ vTaskSuspendAll(); \
+ { \
+ if( ( pxStreamBuffer )->xTaskWaitingToReceive != NULL ) \
+ { \
+ ( void ) xTaskNotifyIndexed( ( pxStreamBuffer )->xTaskWaitingToReceive, \
+ ( pxStreamBuffer )->uxNotificationIndex, \
+ ( uint32_t ) 0, \
+ eNoAction ); \
+ ( pxStreamBuffer )->xTaskWaitingToReceive = NULL; \
+ } \
+ } \
+ ( void ) xTaskResumeAll()
+ #endif /* sbSEND_COMPLETED */
/* If user has provided a per-instance send completed callback, then
* invoke the callback else use the send complete macro which is provided by default for all instances.
*/
-#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
- #define prvSEND_COMPLETED( pxStreamBuffer ) \
- { \
- if( ( pxStreamBuffer )->pxSendCompletedCallback != NULL ) \
- { \
- pxStreamBuffer->pxSendCompletedCallback( ( pxStreamBuffer ), pdFALSE, NULL ); \
- } \
- else \
- { \
- sbSEND_COMPLETED( ( pxStreamBuffer ) ); \
- } \
- }
-#else /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
- #define prvSEND_COMPLETED( pxStreamBuffer ) sbSEND_COMPLETED( ( pxStreamBuffer ) )
-#endif /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
-
-
-#ifndef sbSEND_COMPLETE_FROM_ISR
- #define sbSEND_COMPLETE_FROM_ISR( pxStreamBuffer, pxHigherPriorityTaskWoken ) \
- { \
- UBaseType_t uxSavedInterruptStatus; \
- \
- uxSavedInterruptStatus = ( UBaseType_t ) portSET_INTERRUPT_MASK_FROM_ISR(); \
- { \
- if( ( pxStreamBuffer )->xTaskWaitingToReceive != NULL ) \
- { \
- ( void ) xTaskNotifyFromISR( ( pxStreamBuffer )->xTaskWaitingToReceive, \
- ( uint32_t ) 0, \
- eNoAction, \
- ( pxHigherPriorityTaskWoken ) ); \
- ( pxStreamBuffer )->xTaskWaitingToReceive = NULL; \
- } \
- } \
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ); \
- }
-#endif /* sbSEND_COMPLETE_FROM_ISR */
-
-
-#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
- #define prvSEND_COMPLETE_FROM_ISR( pxStreamBuffer, pxHigherPriorityTaskWoken ) \
- { \
+ #if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
+ #define prvSEND_COMPLETED( pxStreamBuffer ) \
+ do { \
+ if( ( pxStreamBuffer )->pxSendCompletedCallback != NULL ) \
+ { \
+ ( pxStreamBuffer )->pxSendCompletedCallback( ( pxStreamBuffer ), pdFALSE, NULL ); \
+ } \
+ else \
+ { \
+ sbSEND_COMPLETED( ( pxStreamBuffer ) ); \
+ } \
+ } while( 0 )
+ #else /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
+ #define prvSEND_COMPLETED( pxStreamBuffer ) sbSEND_COMPLETED( ( pxStreamBuffer ) )
+ #endif /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
+
+
+ #ifndef sbSEND_COMPLETE_FROM_ISR
+ #define sbSEND_COMPLETE_FROM_ISR( pxStreamBuffer, pxHigherPriorityTaskWoken ) \
+ do { \
+ UBaseType_t uxSavedInterruptStatus; \
+ \
+ uxSavedInterruptStatus = taskENTER_CRITICAL_FROM_ISR(); \
+ { \
+ if( ( pxStreamBuffer )->xTaskWaitingToReceive != NULL ) \
+ { \
+ ( void ) xTaskNotifyIndexedFromISR( ( pxStreamBuffer )->xTaskWaitingToReceive, \
+ ( pxStreamBuffer )->uxNotificationIndex, \
+ ( uint32_t ) 0, \
+ eNoAction, \
+ ( pxHigherPriorityTaskWoken ) ); \
+ ( pxStreamBuffer )->xTaskWaitingToReceive = NULL; \
+ } \
+ } \
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus ); \
+ } while( 0 )
+ #endif /* sbSEND_COMPLETE_FROM_ISR */
+
+
+ #if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
+ #define prvSEND_COMPLETE_FROM_ISR( pxStreamBuffer, pxHigherPriorityTaskWoken ) \
+ do { \
if( ( pxStreamBuffer )->pxSendCompletedCallback != NULL ) \
{ \
( pxStreamBuffer )->pxSendCompletedCallback( ( pxStreamBuffer ), pdTRUE, ( pxHigherPriorityTaskWoken ) ); \
@@ -202,25 +212,24 @@
{ \
sbSEND_COMPLETE_FROM_ISR( ( pxStreamBuffer ), ( pxHigherPriorityTaskWoken ) ); \
} \
- }
-#else /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
- #define prvSEND_COMPLETE_FROM_ISR( pxStreamBuffer, pxHigherPriorityTaskWoken ) \
+ } while( 0 )
+ #else /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
+ #define prvSEND_COMPLETE_FROM_ISR( pxStreamBuffer, pxHigherPriorityTaskWoken ) \
sbSEND_COMPLETE_FROM_ISR( ( pxStreamBuffer ), ( pxHigherPriorityTaskWoken ) )
-#endif /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
-
-/*lint -restore (9026) */
+ #endif /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
/* The number of bytes used to hold the length of a message in the buffer. */
-#define sbBYTES_TO_STORE_MESSAGE_LENGTH ( sizeof( configMESSAGE_BUFFER_LENGTH_TYPE ) )
+ #define sbBYTES_TO_STORE_MESSAGE_LENGTH ( sizeof( configMESSAGE_BUFFER_LENGTH_TYPE ) )
/* Bits stored in the ucFlags field of the stream buffer. */
-#define sbFLAGS_IS_MESSAGE_BUFFER ( ( uint8_t ) 1 ) /* Set if the stream buffer was created as a message buffer, in which case it holds discrete messages rather than a stream. */
-#define sbFLAGS_IS_STATICALLY_ALLOCATED ( ( uint8_t ) 2 ) /* Set if the stream buffer was created using statically allocated memory. */
+ #define sbFLAGS_IS_MESSAGE_BUFFER ( ( uint8_t ) 1 ) /* Set if the stream buffer was created as a message buffer, in which case it holds discrete messages rather than a stream. */
+ #define sbFLAGS_IS_STATICALLY_ALLOCATED ( ( uint8_t ) 2 ) /* Set if the stream buffer was created using statically allocated memory. */
+ #define sbFLAGS_IS_BATCHING_BUFFER ( ( uint8_t ) 4 ) /* Set if the stream buffer was created as a batching buffer, meaning the receiver task will only unblock when the trigger level exceededs. */
/*-----------------------------------------------------------*/
/* Structure that hold state information on the buffer. */
-typedef struct StreamBufferDef_t /*lint !e9058 Style convention uses tag. */
+typedef struct StreamBufferDef_t
{
volatile size_t xTail; /* Index to the next item to read within the buffer. */
volatile size_t xHead; /* Index to the next item to write within the buffer. */
@@ -239,6 +248,7 @@ typedef struct StreamBufferDef_t /*lint !e9058 Style convention
StreamBufferCallbackFunction_t pxSendCompletedCallback; /* Optional callback called on send complete. sbSEND_COMPLETED is called if this is NULL. */
StreamBufferCallbackFunction_t pxReceiveCompletedCallback; /* Optional callback called on receive complete. sbRECEIVE_COMPLETED is called if this is NULL. */
#endif
+ UBaseType_t uxNotificationIndex; /* The index we are using for notification, by default tskDEFAULT_INDEX_TO_NOTIFY. */
} StreamBuffer_t;
/*
@@ -317,26 +327,34 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION;
/*-----------------------------------------------------------*/
-#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
StreamBufferHandle_t xStreamBufferGenericCreate( size_t xBufferSizeBytes,
size_t xTriggerLevelBytes,
- BaseType_t xIsMessageBuffer,
+ BaseType_t xStreamBufferType,
StreamBufferCallbackFunction_t pxSendCompletedCallback,
StreamBufferCallbackFunction_t pxReceiveCompletedCallback )
{
- uint8_t * pucAllocatedMemory;
+ void * pvAllocatedMemory;
uint8_t ucFlags;
+ traceENTER_xStreamBufferGenericCreate( xBufferSizeBytes, xTriggerLevelBytes, xStreamBufferType, pxSendCompletedCallback, pxReceiveCompletedCallback );
+
/* In case the stream buffer is going to be used as a message buffer
* (that is, it will hold discrete messages with a little meta data that
* says how big the next message is) check the buffer will be large enough
* to hold at least one message. */
- if( xIsMessageBuffer == pdTRUE )
+ if( xStreamBufferType == sbTYPE_MESSAGE_BUFFER )
{
/* Is a message buffer but not statically allocated. */
ucFlags = sbFLAGS_IS_MESSAGE_BUFFER;
configASSERT( xBufferSizeBytes > sbBYTES_TO_STORE_MESSAGE_LENGTH );
}
+ else if( xStreamBufferType == sbTYPE_STREAM_BATCHING_BUFFER )
+ {
+ /* Is a batching buffer but not statically allocated. */
+ ucFlags = sbFLAGS_IS_BATCHING_BUFFER;
+ configASSERT( xBufferSizeBytes > 0 );
+ }
else
{
/* Not a message buffer and not statically allocated. */
@@ -361,52 +379,68 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
* this is a quirk of the implementation that means otherwise the free
* space would be reported as one byte smaller than would be logically
* expected. */
- if( xBufferSizeBytes < ( xBufferSizeBytes + 1 + sizeof( StreamBuffer_t ) ) )
+ if( xBufferSizeBytes < ( xBufferSizeBytes + 1U + sizeof( StreamBuffer_t ) ) )
{
xBufferSizeBytes++;
- pucAllocatedMemory = ( uint8_t * ) pvPortMalloc( xBufferSizeBytes + sizeof( StreamBuffer_t ) ); /*lint !e9079 malloc() only returns void*. */
+ pvAllocatedMemory = pvPortMalloc( xBufferSizeBytes + sizeof( StreamBuffer_t ) );
}
else
{
- pucAllocatedMemory = NULL;
+ pvAllocatedMemory = NULL;
}
- if( pucAllocatedMemory != NULL )
+ if( pvAllocatedMemory != NULL )
{
- prvInitialiseNewStreamBuffer( ( StreamBuffer_t * ) pucAllocatedMemory, /* Structure at the start of the allocated memory. */ /*lint !e9087 Safe cast as allocated memory is aligned. */ /*lint !e826 Area is not too small and alignment is guaranteed provided malloc() behaves as expected and returns aligned buffer. */
- pucAllocatedMemory + sizeof( StreamBuffer_t ), /* Storage area follows. */ /*lint !e9016 Indexing past structure valid for uint8_t pointer, also storage area has no alignment requirement. */
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ prvInitialiseNewStreamBuffer( ( StreamBuffer_t * ) pvAllocatedMemory, /* Structure at the start of the allocated memory. */
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ ( ( uint8_t * ) pvAllocatedMemory ) + sizeof( StreamBuffer_t ), /* Storage area follows. */
xBufferSizeBytes,
xTriggerLevelBytes,
ucFlags,
pxSendCompletedCallback,
pxReceiveCompletedCallback );
- traceSTREAM_BUFFER_CREATE( ( ( StreamBuffer_t * ) pucAllocatedMemory ), xIsMessageBuffer );
+ traceSTREAM_BUFFER_CREATE( ( ( StreamBuffer_t * ) pvAllocatedMemory ), xStreamBufferType );
}
else
{
- traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer );
+ traceSTREAM_BUFFER_CREATE_FAILED( xStreamBufferType );
}
- return ( StreamBufferHandle_t ) pucAllocatedMemory; /*lint !e9087 !e826 Safe cast as allocated memory is aligned. */
+ traceRETURN_xStreamBufferGenericCreate( pvAllocatedMemory );
+
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ return ( StreamBufferHandle_t ) pvAllocatedMemory;
}
-#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
+ #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
/*-----------------------------------------------------------*/
-#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
StreamBufferHandle_t xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
size_t xTriggerLevelBytes,
- BaseType_t xIsMessageBuffer,
+ BaseType_t xStreamBufferType,
uint8_t * const pucStreamBufferStorageArea,
StaticStreamBuffer_t * const pxStaticStreamBuffer,
StreamBufferCallbackFunction_t pxSendCompletedCallback,
StreamBufferCallbackFunction_t pxReceiveCompletedCallback )
{
- StreamBuffer_t * const pxStreamBuffer = ( StreamBuffer_t * ) pxStaticStreamBuffer; /*lint !e740 !e9087 Safe cast as StaticStreamBuffer_t is opaque Streambuffer_t. */
+ /* MISRA Ref 11.3.1 [Misaligned access] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
+ /* coverity[misra_c_2012_rule_11_3_violation] */
+ StreamBuffer_t * const pxStreamBuffer = ( StreamBuffer_t * ) pxStaticStreamBuffer;
StreamBufferHandle_t xReturn;
uint8_t ucFlags;
+ traceENTER_xStreamBufferGenericCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, xStreamBufferType, pucStreamBufferStorageArea, pxStaticStreamBuffer, pxSendCompletedCallback, pxReceiveCompletedCallback );
+
configASSERT( pucStreamBufferStorageArea );
configASSERT( pxStaticStreamBuffer );
configASSERT( xTriggerLevelBytes <= xBufferSizeBytes );
@@ -418,10 +452,22 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
xTriggerLevelBytes = ( size_t ) 1;
}
- if( xIsMessageBuffer != pdFALSE )
+ /* In case the stream buffer is going to be used as a message buffer
+ * (that is, it will hold discrete messages with a little meta data that
+ * says how big the next message is) check the buffer will be large enough
+ * to hold at least one message. */
+
+ if( xStreamBufferType == sbTYPE_MESSAGE_BUFFER )
{
/* Statically allocated message buffer. */
ucFlags = sbFLAGS_IS_MESSAGE_BUFFER | sbFLAGS_IS_STATICALLY_ALLOCATED;
+ configASSERT( xBufferSizeBytes > sbBYTES_TO_STORE_MESSAGE_LENGTH );
+ }
+ else if( xStreamBufferType == sbTYPE_STREAM_BATCHING_BUFFER )
+ {
+ /* Statically allocated batching buffer. */
+ ucFlags = sbFLAGS_IS_BATCHING_BUFFER | sbFLAGS_IS_STATICALLY_ALLOCATED;
+ configASSERT( xBufferSizeBytes > 0 );
}
else
{
@@ -429,12 +475,6 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
ucFlags = sbFLAGS_IS_STATICALLY_ALLOCATED;
}
- /* In case the stream buffer is going to be used as a message buffer
- * (that is, it will hold discrete messages with a little meta data that
- * says how big the next message is) check the buffer will be large enough
- * to hold at least one message. */
- configASSERT( xBufferSizeBytes > sbBYTES_TO_STORE_MESSAGE_LENGTH );
-
#if ( configASSERT_DEFINED == 1 )
{
/* Sanity check that the size of the structure used to declare a
@@ -442,7 +482,7 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
* message buffer structure. */
volatile size_t xSize = sizeof( StaticStreamBuffer_t );
configASSERT( xSize == sizeof( StreamBuffer_t ) );
- } /*lint !e529 xSize is referenced is configASSERT() is defined. */
+ }
#endif /* configASSERT_DEFINED */
if( ( pucStreamBufferStorageArea != NULL ) && ( pxStaticStreamBuffer != NULL ) )
@@ -459,25 +499,67 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
* again. */
pxStreamBuffer->ucFlags |= sbFLAGS_IS_STATICALLY_ALLOCATED;
- traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer );
+ traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xStreamBufferType );
- xReturn = ( StreamBufferHandle_t ) pxStaticStreamBuffer; /*lint !e9087 Data hiding requires cast to opaque type. */
+ /* MISRA Ref 11.3.1 [Misaligned access] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
+ /* coverity[misra_c_2012_rule_11_3_violation] */
+ xReturn = ( StreamBufferHandle_t ) pxStaticStreamBuffer;
}
else
{
xReturn = NULL;
- traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer );
+ traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xStreamBufferType );
+ }
+
+ traceRETURN_xStreamBufferGenericCreateStatic( xReturn );
+
+ return xReturn;
+ }
+ #endif /* ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
+/*-----------------------------------------------------------*/
+
+ #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ BaseType_t xStreamBufferGetStaticBuffers( StreamBufferHandle_t xStreamBuffer,
+ uint8_t ** ppucStreamBufferStorageArea,
+ StaticStreamBuffer_t ** ppxStaticStreamBuffer )
+ {
+ BaseType_t xReturn;
+ StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;
+
+ traceENTER_xStreamBufferGetStaticBuffers( xStreamBuffer, ppucStreamBufferStorageArea, ppxStaticStreamBuffer );
+
+ configASSERT( pxStreamBuffer );
+ configASSERT( ppucStreamBufferStorageArea );
+ configASSERT( ppxStaticStreamBuffer );
+
+ if( ( pxStreamBuffer->ucFlags & sbFLAGS_IS_STATICALLY_ALLOCATED ) != ( uint8_t ) 0 )
+ {
+ *ppucStreamBufferStorageArea = pxStreamBuffer->pucBuffer;
+ /* MISRA Ref 11.3.1 [Misaligned access] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
+ /* coverity[misra_c_2012_rule_11_3_violation] */
+ *ppxStaticStreamBuffer = ( StaticStreamBuffer_t * ) pxStreamBuffer;
+ xReturn = pdTRUE;
}
+ else
+ {
+ xReturn = pdFALSE;
+ }
+
+ traceRETURN_xStreamBufferGetStaticBuffers( xReturn );
return xReturn;
}
-#endif /* ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
+ #endif /* configSUPPORT_STATIC_ALLOCATION */
/*-----------------------------------------------------------*/
void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer )
{
StreamBuffer_t * pxStreamBuffer = xStreamBuffer;
+ traceENTER_vStreamBufferDelete( xStreamBuffer );
+
configASSERT( pxStreamBuffer );
traceSTREAM_BUFFER_DELETE( xStreamBuffer );
@@ -488,7 +570,7 @@ void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer )
{
/* Both the structure and the buffer were allocated using a single call
* to pvPortMalloc(), hence only one call to vPortFree() is required. */
- vPortFree( ( void * ) pxStreamBuffer ); /*lint !e9087 Standard free() semantics require void *, plus pxStreamBuffer was allocated by pvPortMalloc(). */
+ vPortFree( ( void * ) pxStreamBuffer );
}
#else
{
@@ -504,6 +586,8 @@ void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer )
* freed - just scrub the structure so future use will assert. */
( void ) memset( pxStreamBuffer, 0x00, sizeof( StreamBuffer_t ) );
}
+
+ traceRETURN_vStreamBufferDelete();
}
/*-----------------------------------------------------------*/
@@ -517,6 +601,8 @@ BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer )
UBaseType_t uxStreamBufferNumber;
#endif
+ traceENTER_xStreamBufferReset( xStreamBuffer );
+
configASSERT( pxStreamBuffer );
#if ( configUSE_TRACE_FACILITY == 1 )
@@ -560,6 +646,73 @@ BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer )
}
taskEXIT_CRITICAL();
+ traceRETURN_xStreamBufferReset( xReturn );
+
+ return xReturn;
+}
+/*-----------------------------------------------------------*/
+
+BaseType_t xStreamBufferResetFromISR( StreamBufferHandle_t xStreamBuffer )
+{
+ StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;
+ BaseType_t xReturn = pdFAIL;
+ StreamBufferCallbackFunction_t pxSendCallback = NULL, pxReceiveCallback = NULL;
+ UBaseType_t uxSavedInterruptStatus;
+
+ #if ( configUSE_TRACE_FACILITY == 1 )
+ UBaseType_t uxStreamBufferNumber;
+ #endif
+
+ traceENTER_xStreamBufferResetFromISR( xStreamBuffer );
+
+ configASSERT( pxStreamBuffer );
+
+ #if ( configUSE_TRACE_FACILITY == 1 )
+ {
+ /* Store the stream buffer number so it can be restored after the
+ * reset. */
+ uxStreamBufferNumber = pxStreamBuffer->uxStreamBufferNumber;
+ }
+ #endif
+
+ /* Can only reset a message buffer if there are no tasks blocked on it. */
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = taskENTER_CRITICAL_FROM_ISR();
+ {
+ if( ( pxStreamBuffer->xTaskWaitingToReceive == NULL ) && ( pxStreamBuffer->xTaskWaitingToSend == NULL ) )
+ {
+ #if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
+ {
+ pxSendCallback = pxStreamBuffer->pxSendCompletedCallback;
+ pxReceiveCallback = pxStreamBuffer->pxReceiveCompletedCallback;
+ }
+ #endif
+
+ prvInitialiseNewStreamBuffer( pxStreamBuffer,
+ pxStreamBuffer->pucBuffer,
+ pxStreamBuffer->xLength,
+ pxStreamBuffer->xTriggerLevelBytes,
+ pxStreamBuffer->ucFlags,
+ pxSendCallback,
+ pxReceiveCallback );
+
+ #if ( configUSE_TRACE_FACILITY == 1 )
+ {
+ pxStreamBuffer->uxStreamBufferNumber = uxStreamBufferNumber;
+ }
+ #endif
+
+ traceSTREAM_BUFFER_RESET_FROM_ISR( xStreamBuffer );
+
+ xReturn = pdPASS;
+ }
+ }
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
+
+ traceRETURN_xStreamBufferResetFromISR( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
@@ -570,6 +723,8 @@ BaseType_t xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;
BaseType_t xReturn;
+ traceENTER_xStreamBufferSetTriggerLevel( xStreamBuffer, xTriggerLevel );
+
configASSERT( pxStreamBuffer );
/* It is not valid for the trigger level to be 0. */
@@ -590,6 +745,8 @@ BaseType_t xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
xReturn = pdFALSE;
}
+ traceRETURN_xStreamBufferSetTriggerLevel( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
@@ -600,6 +757,8 @@ size_t xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer )
size_t xSpace;
size_t xOriginalTail;
+ traceENTER_xStreamBufferSpacesAvailable( xStreamBuffer );
+
configASSERT( pxStreamBuffer );
/* The code below reads xTail and then xHead. This is safe if the stream
@@ -623,6 +782,8 @@ size_t xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer )
mtCOVERAGE_TEST_MARKER();
}
+ traceRETURN_xStreamBufferSpacesAvailable( xSpace );
+
return xSpace;
}
/*-----------------------------------------------------------*/
@@ -632,9 +793,14 @@ size_t xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer )
const StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;
size_t xReturn;
+ traceENTER_xStreamBufferBytesAvailable( xStreamBuffer );
+
configASSERT( pxStreamBuffer );
xReturn = prvBytesInBuffer( pxStreamBuffer );
+
+ traceRETURN_xStreamBufferBytesAvailable( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
@@ -650,6 +816,8 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
TimeOut_t xTimeOut;
size_t xMaxReportedSpace = 0;
+ traceENTER_xStreamBufferSend( xStreamBuffer, pvTxData, xDataLengthBytes, xTicksToWait );
+
configASSERT( pvTxData );
configASSERT( pxStreamBuffer );
@@ -711,7 +879,7 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
if( xSpace < xRequiredSpace )
{
/* Clear notification state as going to wait for space. */
- ( void ) xTaskNotifyStateClear( NULL );
+ ( void ) xTaskNotifyStateClearIndexed( NULL, pxStreamBuffer->uxNotificationIndex );
/* Should only be one writer. */
configASSERT( pxStreamBuffer->xTaskWaitingToSend == NULL );
@@ -726,7 +894,7 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
taskEXIT_CRITICAL();
traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer );
- ( void ) xTaskNotifyWait( ( uint32_t ) 0, ( uint32_t ) 0, NULL, xTicksToWait );
+ ( void ) xTaskNotifyWaitIndexed( pxStreamBuffer->uxNotificationIndex, ( uint32_t ) 0, ( uint32_t ) 0, NULL, xTicksToWait );
pxStreamBuffer->xTaskWaitingToSend = NULL;
} while( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE );
}
@@ -766,6 +934,8 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer );
}
+ traceRETURN_xStreamBufferSend( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
@@ -779,6 +949,8 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
size_t xReturn, xSpace;
size_t xRequiredSpace = xDataLengthBytes;
+ traceENTER_xStreamBufferSendFromISR( xStreamBuffer, pvTxData, xDataLengthBytes, pxHigherPriorityTaskWoken );
+
configASSERT( pvTxData );
configASSERT( pxStreamBuffer );
@@ -803,6 +975,9 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
/* Was a task waiting for the data? */
if( prvBytesInBuffer( pxStreamBuffer ) >= pxStreamBuffer->xTriggerLevelBytes )
{
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
prvSEND_COMPLETE_FROM_ISR( pxStreamBuffer, pxHigherPriorityTaskWoken );
}
else
@@ -816,6 +991,7 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
}
traceSTREAM_BUFFER_SEND_FROM_ISR( xStreamBuffer, xReturn );
+ traceRETURN_xStreamBufferSendFromISR( xReturn );
return xReturn;
}
@@ -864,7 +1040,10 @@ static size_t prvWriteMessageToBuffer( StreamBuffer_t * const pxStreamBuffer,
if( xDataLengthBytes != ( size_t ) 0 )
{
/* Write the data to the buffer. */
- pxStreamBuffer->xHead = prvWriteBytesToBuffer( pxStreamBuffer, ( const uint8_t * ) pvTxData, xDataLengthBytes, xNextHead ); /*lint !e9079 Storage buffer is implemented as uint8_t for ease of sizing, alignment and access. */
+ /* MISRA Ref 11.5.5 [Void pointer assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxStreamBuffer->xHead = prvWriteBytesToBuffer( pxStreamBuffer, ( const uint8_t * ) pvTxData, xDataLengthBytes, xNextHead );
}
return xDataLengthBytes;
@@ -879,6 +1058,8 @@ size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;
size_t xReceivedLength = 0, xBytesAvailable, xBytesToStoreMessageLength;
+ traceENTER_xStreamBufferReceive( xStreamBuffer, pvRxData, xBufferLengthBytes, xTicksToWait );
+
configASSERT( pvRxData );
configASSERT( pxStreamBuffer );
@@ -891,6 +1072,12 @@ size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
{
xBytesToStoreMessageLength = sbBYTES_TO_STORE_MESSAGE_LENGTH;
}
+ else if( ( pxStreamBuffer->ucFlags & sbFLAGS_IS_BATCHING_BUFFER ) != ( uint8_t ) 0 )
+ {
+ /* Force task to block if the batching buffer contains less bytes than
+ * the trigger level. */
+ xBytesToStoreMessageLength = pxStreamBuffer->xTriggerLevelBytes;
+ }
else
{
xBytesToStoreMessageLength = 0;
@@ -908,11 +1095,13 @@ size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
* xBytesToStoreMessageLength holds the number of bytes used to hold
* the length of the next discrete message. If this function was
* invoked by a stream buffer read then xBytesToStoreMessageLength will
- * be 0. */
+ * be 0. If this function was invoked by a stream batch buffer read
+ * then xBytesToStoreMessageLength will be xTriggerLevelBytes value
+ * for the buffer.*/
if( xBytesAvailable <= xBytesToStoreMessageLength )
{
/* Clear notification state as going to wait for data. */
- ( void ) xTaskNotifyStateClear( NULL );
+ ( void ) xTaskNotifyStateClearIndexed( NULL, pxStreamBuffer->uxNotificationIndex );
/* Should only be one reader. */
configASSERT( pxStreamBuffer->xTaskWaitingToReceive == NULL );
@@ -929,7 +1118,7 @@ size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
{
/* Wait for data to be available. */
traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer );
- ( void ) xTaskNotifyWait( ( uint32_t ) 0, ( uint32_t ) 0, NULL, xTicksToWait );
+ ( void ) xTaskNotifyWaitIndexed( pxStreamBuffer->uxNotificationIndex, ( uint32_t ) 0, ( uint32_t ) 0, NULL, xTicksToWait );
pxStreamBuffer->xTaskWaitingToReceive = NULL;
/* Recheck the data available after blocking. */
@@ -971,6 +1160,8 @@ size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
mtCOVERAGE_TEST_MARKER();
}
+ traceRETURN_xStreamBufferReceive( xReceivedLength );
+
return xReceivedLength;
}
/*-----------------------------------------------------------*/
@@ -981,6 +1172,8 @@ size_t xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer )
size_t xReturn, xBytesAvailable;
configMESSAGE_BUFFER_LENGTH_TYPE xTempReturn;
+ traceENTER_xStreamBufferNextMessageLengthBytes( xStreamBuffer );
+
configASSERT( pxStreamBuffer );
/* Ensure the stream buffer is being used as a message buffer. */
@@ -1011,6 +1204,8 @@ size_t xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer )
xReturn = 0;
}
+ traceRETURN_xStreamBufferNextMessageLengthBytes( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
@@ -1023,6 +1218,8 @@ size_t xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;
size_t xReceivedLength = 0, xBytesAvailable, xBytesToStoreMessageLength;
+ traceENTER_xStreamBufferReceiveFromISR( xStreamBuffer, pvRxData, xBufferLengthBytes, pxHigherPriorityTaskWoken );
+
configASSERT( pvRxData );
configASSERT( pxStreamBuffer );
@@ -1054,6 +1251,9 @@ size_t xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
/* Was a task waiting for space in the buffer? */
if( xReceivedLength != ( size_t ) 0 )
{
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
prvRECEIVE_COMPLETED_FROM_ISR( pxStreamBuffer, pxHigherPriorityTaskWoken );
}
else
@@ -1067,6 +1267,7 @@ size_t xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
}
traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength );
+ traceRETURN_xStreamBufferReceiveFromISR( xReceivedLength );
return xReceivedLength;
}
@@ -1117,7 +1318,10 @@ static size_t prvReadMessageFromBuffer( StreamBuffer_t * pxStreamBuffer,
if( xCount != ( size_t ) 0 )
{
/* Read the actual data and update the tail to mark the data as officially consumed. */
- pxStreamBuffer->xTail = prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) pvRxData, xCount, xNextTail ); /*lint !e9079 Data storage area is implemented as uint8_t array for ease of sizing, indexing and alignment. */
+ /* MISRA Ref 11.5.5 [Void pointer assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxStreamBuffer->xTail = prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) pvRxData, xCount, xNextTail );
}
return xCount;
@@ -1130,6 +1334,8 @@ BaseType_t xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer )
BaseType_t xReturn;
size_t xTail;
+ traceENTER_xStreamBufferIsEmpty( xStreamBuffer );
+
configASSERT( pxStreamBuffer );
/* True if no bytes are available. */
@@ -1144,6 +1350,8 @@ BaseType_t xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer )
xReturn = pdFALSE;
}
+ traceRETURN_xStreamBufferIsEmpty( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
@@ -1154,6 +1362,8 @@ BaseType_t xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer )
size_t xBytesToStoreMessageLength;
const StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;
+ traceENTER_xStreamBufferIsFull( xStreamBuffer );
+
configASSERT( pxStreamBuffer );
/* This generic version of the receive function is used by both message
@@ -1179,6 +1389,8 @@ BaseType_t xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer )
xReturn = pdFALSE;
}
+ traceRETURN_xStreamBufferIsFull( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
@@ -1190,16 +1402,22 @@ BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer
BaseType_t xReturn;
UBaseType_t uxSavedInterruptStatus;
+ traceENTER_xStreamBufferSendCompletedFromISR( xStreamBuffer, pxHigherPriorityTaskWoken );
+
configASSERT( pxStreamBuffer );
- uxSavedInterruptStatus = ( UBaseType_t ) portSET_INTERRUPT_MASK_FROM_ISR();
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = taskENTER_CRITICAL_FROM_ISR();
{
if( ( pxStreamBuffer )->xTaskWaitingToReceive != NULL )
{
- ( void ) xTaskNotifyFromISR( ( pxStreamBuffer )->xTaskWaitingToReceive,
- ( uint32_t ) 0,
- eNoAction,
- pxHigherPriorityTaskWoken );
+ ( void ) xTaskNotifyIndexedFromISR( ( pxStreamBuffer )->xTaskWaitingToReceive,
+ ( pxStreamBuffer )->uxNotificationIndex,
+ ( uint32_t ) 0,
+ eNoAction,
+ pxHigherPriorityTaskWoken );
( pxStreamBuffer )->xTaskWaitingToReceive = NULL;
xReturn = pdTRUE;
}
@@ -1208,7 +1426,9 @@ BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer
xReturn = pdFALSE;
}
}
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
+
+ traceRETURN_xStreamBufferSendCompletedFromISR( xReturn );
return xReturn;
}
@@ -1221,16 +1441,22 @@ BaseType_t xStreamBufferReceiveCompletedFromISR( StreamBufferHandle_t xStreamBuf
BaseType_t xReturn;
UBaseType_t uxSavedInterruptStatus;
+ traceENTER_xStreamBufferReceiveCompletedFromISR( xStreamBuffer, pxHigherPriorityTaskWoken );
+
configASSERT( pxStreamBuffer );
- uxSavedInterruptStatus = ( UBaseType_t ) portSET_INTERRUPT_MASK_FROM_ISR();
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = taskENTER_CRITICAL_FROM_ISR();
{
if( ( pxStreamBuffer )->xTaskWaitingToSend != NULL )
{
- ( void ) xTaskNotifyFromISR( ( pxStreamBuffer )->xTaskWaitingToSend,
- ( uint32_t ) 0,
- eNoAction,
- pxHigherPriorityTaskWoken );
+ ( void ) xTaskNotifyIndexedFromISR( ( pxStreamBuffer )->xTaskWaitingToSend,
+ ( pxStreamBuffer )->uxNotificationIndex,
+ ( uint32_t ) 0,
+ eNoAction,
+ pxHigherPriorityTaskWoken );
( pxStreamBuffer )->xTaskWaitingToSend = NULL;
xReturn = pdTRUE;
}
@@ -1239,7 +1465,9 @@ BaseType_t xStreamBufferReceiveCompletedFromISR( StreamBufferHandle_t xStreamBuf
xReturn = pdFALSE;
}
}
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
+
+ traceRETURN_xStreamBufferReceiveCompletedFromISR( xReturn );
return xReturn;
}
@@ -1261,7 +1489,7 @@ static size_t prvWriteBytesToBuffer( StreamBuffer_t * const pxStreamBuffer,
/* Write as many bytes as can be written in the first write. */
configASSERT( ( xHead + xFirstLength ) <= pxStreamBuffer->xLength );
- ( void ) memcpy( ( void * ) ( &( pxStreamBuffer->pucBuffer[ xHead ] ) ), ( const void * ) pucData, xFirstLength ); /*lint !e9087 memcpy() requires void *. */
+ ( void ) memcpy( ( void * ) ( &( pxStreamBuffer->pucBuffer[ xHead ] ) ), ( const void * ) pucData, xFirstLength );
/* If the number of bytes written was less than the number that could be
* written in the first write... */
@@ -1269,7 +1497,7 @@ static size_t prvWriteBytesToBuffer( StreamBuffer_t * const pxStreamBuffer,
{
/* ...then write the remaining bytes to the start of the buffer. */
configASSERT( ( xCount - xFirstLength ) <= pxStreamBuffer->xLength );
- ( void ) memcpy( ( void * ) pxStreamBuffer->pucBuffer, ( const void * ) &( pucData[ xFirstLength ] ), xCount - xFirstLength ); /*lint !e9087 memcpy() requires void *. */
+ ( void ) memcpy( ( void * ) pxStreamBuffer->pucBuffer, ( const void * ) &( pucData[ xFirstLength ] ), xCount - xFirstLength );
}
else
{
@@ -1309,14 +1537,14 @@ static size_t prvReadBytesFromBuffer( StreamBuffer_t * pxStreamBuffer,
* read. Asserts check bounds of read and write. */
configASSERT( xFirstLength <= xCount );
configASSERT( ( xTail + xFirstLength ) <= pxStreamBuffer->xLength );
- ( void ) memcpy( ( void * ) pucData, ( const void * ) &( pxStreamBuffer->pucBuffer[ xTail ] ), xFirstLength ); /*lint !e9087 memcpy() requires void *. */
+ ( void ) memcpy( ( void * ) pucData, ( const void * ) &( pxStreamBuffer->pucBuffer[ xTail ] ), xFirstLength );
/* If the total number of wanted bytes is greater than the number
* that could be read in the first read... */
if( xCount > xFirstLength )
{
/* ...then read the remaining bytes from the start of the buffer. */
- ( void ) memcpy( ( void * ) &( pucData[ xFirstLength ] ), ( void * ) ( pxStreamBuffer->pucBuffer ), xCount - xFirstLength ); /*lint !e9087 memcpy() requires void *. */
+ ( void ) memcpy( ( void * ) &( pucData[ xFirstLength ] ), ( void * ) ( pxStreamBuffer->pucBuffer ), xCount - xFirstLength );
}
else
{
@@ -1337,7 +1565,7 @@ static size_t prvReadBytesFromBuffer( StreamBuffer_t * pxStreamBuffer,
static size_t prvBytesInBuffer( const StreamBuffer_t * const pxStreamBuffer )
{
-/* Returns the distance between xTail and xHead. */
+ /* Returns the distance between xTail and xHead. */
size_t xCount;
xCount = pxStreamBuffer->xLength + pxStreamBuffer->xHead;
@@ -1372,16 +1600,17 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
/* The value written just has to be identifiable when looking at the
* memory. Don't use 0xA5 as that is the stack fill value and could
* result in confusion as to what is actually being observed. */
- const BaseType_t xWriteValue = 0x55;
- configASSERT( memset( pucBuffer, ( int ) xWriteValue, xBufferSizeBytes ) == pucBuffer );
- } /*lint !e529 !e438 xWriteValue is only used if configASSERT() is defined. */
+ #define STREAM_BUFFER_BUFFER_WRITE_VALUE ( 0x55 )
+ configASSERT( memset( pucBuffer, ( int ) STREAM_BUFFER_BUFFER_WRITE_VALUE, xBufferSizeBytes ) == pucBuffer );
+ }
#endif
- ( void ) memset( ( void * ) pxStreamBuffer, 0x00, sizeof( StreamBuffer_t ) ); /*lint !e9087 memset() requires void *. */
+ ( void ) memset( ( void * ) pxStreamBuffer, 0x00, sizeof( StreamBuffer_t ) );
pxStreamBuffer->pucBuffer = pucBuffer;
pxStreamBuffer->xLength = xBufferSizeBytes;
pxStreamBuffer->xTriggerLevelBytes = xTriggerLevelBytes;
pxStreamBuffer->ucFlags = ucFlags;
+ pxStreamBuffer->uxNotificationIndex = tskDEFAULT_INDEX_TO_NOTIFY;
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
{
pxStreamBuffer->pxSendCompletedCallback = pxSendCompletedCallback;
@@ -1389,39 +1618,101 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
}
#else
{
+ /* MISRA Ref 11.1.1 [Object type casting] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-111 */
+ /* coverity[misra_c_2012_rule_11_1_violation] */
( void ) pxSendCompletedCallback;
+
+ /* MISRA Ref 11.1.1 [Object type casting] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-111 */
+ /* coverity[misra_c_2012_rule_11_1_violation] */
( void ) pxReceiveCompletedCallback;
}
- #endif
+ #endif /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
}
+/*-----------------------------------------------------------*/
-#if ( configUSE_TRACE_FACILITY == 1 )
+UBaseType_t uxStreamBufferGetStreamBufferNotificationIndex( StreamBufferHandle_t xStreamBuffer )
+{
+ StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;
+
+ traceENTER_uxStreamBufferGetStreamBufferNotificationIndex( xStreamBuffer );
+
+ configASSERT( pxStreamBuffer );
+
+ traceRETURN_uxStreamBufferGetStreamBufferNotificationIndex( pxStreamBuffer->uxNotificationIndex );
+
+ return pxStreamBuffer->uxNotificationIndex;
+}
+/*-----------------------------------------------------------*/
+
+void vStreamBufferSetStreamBufferNotificationIndex( StreamBufferHandle_t xStreamBuffer,
+ UBaseType_t uxNotificationIndex )
+{
+ StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;
+
+ traceENTER_vStreamBufferSetStreamBufferNotificationIndex( xStreamBuffer, uxNotificationIndex );
+
+ configASSERT( pxStreamBuffer );
+
+ /* There should be no task waiting otherwise we'd never resume them. */
+ configASSERT( pxStreamBuffer->xTaskWaitingToReceive == NULL );
+ configASSERT( pxStreamBuffer->xTaskWaitingToSend == NULL );
+
+ /* Check that the task notification index is valid. */
+ configASSERT( uxNotificationIndex < configTASK_NOTIFICATION_ARRAY_ENTRIES );
+
+ pxStreamBuffer->uxNotificationIndex = uxNotificationIndex;
+
+ traceRETURN_vStreamBufferSetStreamBufferNotificationIndex();
+}
+/*-----------------------------------------------------------*/
+
+ #if ( configUSE_TRACE_FACILITY == 1 )
UBaseType_t uxStreamBufferGetStreamBufferNumber( StreamBufferHandle_t xStreamBuffer )
{
+ traceENTER_uxStreamBufferGetStreamBufferNumber( xStreamBuffer );
+
+ traceRETURN_uxStreamBufferGetStreamBufferNumber( xStreamBuffer->uxStreamBufferNumber );
+
return xStreamBuffer->uxStreamBufferNumber;
}
-#endif /* configUSE_TRACE_FACILITY */
+ #endif /* configUSE_TRACE_FACILITY */
/*-----------------------------------------------------------*/
-#if ( configUSE_TRACE_FACILITY == 1 )
+ #if ( configUSE_TRACE_FACILITY == 1 )
void vStreamBufferSetStreamBufferNumber( StreamBufferHandle_t xStreamBuffer,
UBaseType_t uxStreamBufferNumber )
{
+ traceENTER_vStreamBufferSetStreamBufferNumber( xStreamBuffer, uxStreamBufferNumber );
+
xStreamBuffer->uxStreamBufferNumber = uxStreamBufferNumber;
+
+ traceRETURN_vStreamBufferSetStreamBufferNumber();
}
-#endif /* configUSE_TRACE_FACILITY */
+ #endif /* configUSE_TRACE_FACILITY */
/*-----------------------------------------------------------*/
-#if ( configUSE_TRACE_FACILITY == 1 )
+ #if ( configUSE_TRACE_FACILITY == 1 )
uint8_t ucStreamBufferGetStreamBufferType( StreamBufferHandle_t xStreamBuffer )
{
- return( xStreamBuffer->ucFlags & sbFLAGS_IS_MESSAGE_BUFFER );
+ traceENTER_ucStreamBufferGetStreamBufferType( xStreamBuffer );
+
+ traceRETURN_ucStreamBufferGetStreamBufferType( ( uint8_t ) ( xStreamBuffer->ucFlags & sbFLAGS_IS_MESSAGE_BUFFER ) );
+
+ return( ( uint8_t ) ( xStreamBuffer->ucFlags & sbFLAGS_IS_MESSAGE_BUFFER ) );
}
-#endif /* configUSE_TRACE_FACILITY */
+ #endif /* configUSE_TRACE_FACILITY */
/*-----------------------------------------------------------*/
+
+/* This entire source file will be skipped if the application is not configured
+ * to include stream buffer functionality. This #if is closed at the very bottom
+ * of this file. If you want to include stream buffers then ensure
+ * configUSE_STREAM_BUFFERS is set to 1 in FreeRTOSConfig.h. */
+#endif /* configUSE_STREAM_BUFFERS == 1 */
diff --git a/third-party/freertos/tasks.c b/third-party/freertos/tasks.c
index 0cc948fcce3dff5c3cfaca6275f35396a0f3e360..fd3bc638d6574293e9ad9cd9fbca2305fa2108b7 100644
--- a/third-party/freertos/tasks.c
+++ b/third-party/freertos/tasks.c
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -41,11 +41,17 @@
#include "timers.h"
#include "stack_macros.h"
-/* Lint e9021, e961 and e750 are suppressed as a MISRA exception justified
- * because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
+/* The default definitions are only available for non-MPU ports. The
+ * reason is that the stack alignment requirements vary for different
+ * architectures.*/
+#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configKERNEL_PROVIDED_STATIC_MEMORY == 1 ) && ( portUSING_MPU_WRAPPERS != 0 ) )
+ #error configKERNEL_PROVIDED_STATIC_MEMORY cannot be set to 1 when using an MPU port. The vApplicationGet*TaskMemory() functions must be provided manually.
+#endif
+
+/* The MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
* for the header files above, but not in this file, in order to generate the
* correct privileged Vs unprivileged linkage and placement. */
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/* Set configUSE_STATS_FORMATTING_FUNCTIONS to 2 to include the stats formatting
* functions but without including stdio.h here. */
@@ -62,10 +68,45 @@
/* If the cooperative scheduler is being used then a yield should not be
* performed just because a higher priority task has been woken. */
- #define taskYIELD_IF_USING_PREEMPTION()
+ #define taskYIELD_TASK_CORE_IF_USING_PREEMPTION( pxTCB )
+ #define taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxTCB )
#else
- #define taskYIELD_IF_USING_PREEMPTION() portYIELD_WITHIN_API()
-#endif
+
+ #if ( configNUMBER_OF_CORES == 1 )
+
+/* This macro requests the running task pxTCB to yield. In single core
+ * scheduler, a running task always runs on core 0 and portYIELD_WITHIN_API()
+ * can be used to request the task running on core 0 to yield. Therefore, pxTCB
+ * is not used in this macro. */
+ #define taskYIELD_TASK_CORE_IF_USING_PREEMPTION( pxTCB ) \
+ do { \
+ ( void ) ( pxTCB ); \
+ portYIELD_WITHIN_API(); \
+ } while( 0 )
+
+ #define taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxTCB ) \
+ do { \
+ if( pxCurrentTCB->uxPriority < ( pxTCB )->uxPriority ) \
+ { \
+ portYIELD_WITHIN_API(); \
+ } \
+ else \
+ { \
+ mtCOVERAGE_TEST_MARKER(); \
+ } \
+ } while( 0 )
+
+ #else /* if ( configNUMBER_OF_CORES == 1 ) */
+
+/* Yield the core on which this task is running. */
+ #define taskYIELD_TASK_CORE_IF_USING_PREEMPTION( pxTCB ) prvYieldCore( ( pxTCB )->xTaskRunState )
+
+/* Yield for the task if a running task has priority lower than this task. */
+ #define taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxTCB ) prvYieldForTask( pxTCB )
+
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+
+#endif /* if ( configUSE_PREEMPTION == 0 ) */
/* Values that can be assigned to the ucNotifyState member of the TCB. */
#define taskNOT_WAITING_NOTIFICATION ( ( uint8_t ) 0 ) /* Must be zero as it is the initialised value. */
@@ -102,8 +143,8 @@
#define tskSUSPENDED_CHAR ( 'S' )
/*
- * Some kernel aware debuggers require the data the debugger needs access to to
- * be global, rather than file scope.
+ * Some kernel aware debuggers require the data the debugger needs access to be
+ * global, rather than file scope.
*/
#ifdef portREMOVE_STATIC_QUALIFIER
#define static
@@ -124,31 +165,37 @@
/* uxTopReadyPriority holds the priority of the highest priority ready
* state task. */
#define taskRECORD_READY_PRIORITY( uxPriority ) \
- { \
+ do { \
if( ( uxPriority ) > uxTopReadyPriority ) \
{ \
uxTopReadyPriority = ( uxPriority ); \
} \
- } /* taskRECORD_READY_PRIORITY */
+ } while( 0 ) /* taskRECORD_READY_PRIORITY */
/*-----------------------------------------------------------*/
- #define taskSELECT_HIGHEST_PRIORITY_TASK() \
- { \
- UBaseType_t uxTopPriority = uxTopReadyPriority; \
- \
- /* Find the highest priority queue that contains ready tasks. */ \
- while( listLIST_IS_EMPTY( &( pxReadyTasksLists[ uxTopPriority ] ) ) ) \
- { \
- configASSERT( uxTopPriority ); \
- --uxTopPriority; \
- } \
- \
+ #if ( configNUMBER_OF_CORES == 1 )
+ #define taskSELECT_HIGHEST_PRIORITY_TASK() \
+ do { \
+ UBaseType_t uxTopPriority = uxTopReadyPriority; \
+ \
+ /* Find the highest priority queue that contains ready tasks. */ \
+ while( listLIST_IS_EMPTY( &( pxReadyTasksLists[ uxTopPriority ] ) ) != pdFALSE ) \
+ { \
+ configASSERT( uxTopPriority ); \
+ --uxTopPriority; \
+ } \
+ \
/* listGET_OWNER_OF_NEXT_ENTRY indexes through the list, so the tasks of \
* the same priority get an equal share of the processor time. */ \
listGET_OWNER_OF_NEXT_ENTRY( pxCurrentTCB, &( pxReadyTasksLists[ uxTopPriority ] ) ); \
uxTopReadyPriority = uxTopPriority; \
- } /* taskSELECT_HIGHEST_PRIORITY_TASK */
+ } while( 0 ) /* taskSELECT_HIGHEST_PRIORITY_TASK */
+ #else /* if ( configNUMBER_OF_CORES == 1 ) */
+
+ #define taskSELECT_HIGHEST_PRIORITY_TASK( xCoreID ) prvSelectHighestPriorityTask( xCoreID )
+
+ #endif /* if ( configNUMBER_OF_CORES == 1 ) */
/*-----------------------------------------------------------*/
@@ -170,14 +217,14 @@
/*-----------------------------------------------------------*/
#define taskSELECT_HIGHEST_PRIORITY_TASK() \
- { \
+ do { \
UBaseType_t uxTopPriority; \
\
/* Find the highest priority list that contains ready tasks. */ \
portGET_HIGHEST_PRIORITY( uxTopPriority, uxTopReadyPriority ); \
configASSERT( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ uxTopPriority ] ) ) > 0 ); \
listGET_OWNER_OF_NEXT_ENTRY( pxCurrentTCB, &( pxReadyTasksLists[ uxTopPriority ] ) ); \
- } /* taskSELECT_HIGHEST_PRIORITY_TASK() */
+ } while( 0 )
/*-----------------------------------------------------------*/
@@ -185,12 +232,12 @@
* is being referenced from a ready list. If it is referenced from a delayed
* or suspended list then it won't be in a ready list. */
#define taskRESET_READY_PRIORITY( uxPriority ) \
- { \
+ do { \
if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ ( uxPriority ) ] ) ) == ( UBaseType_t ) 0 ) \
{ \
portRESET_READY_PRIORITY( ( uxPriority ), ( uxTopReadyPriority ) ); \
} \
- }
+ } while( 0 )
#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
@@ -199,7 +246,7 @@
/* pxDelayedTaskList and pxOverflowDelayedTaskList are switched when the tick
* count overflows. */
#define taskSWITCH_DELAYED_LISTS() \
- { \
+ do { \
List_t * pxTemp; \
\
/* The delayed tasks list should be empty when the lists are switched. */ \
@@ -208,9 +255,9 @@
pxTemp = pxDelayedTaskList; \
pxDelayedTaskList = pxOverflowDelayedTaskList; \
pxOverflowDelayedTaskList = pxTemp; \
- xNumOfOverflows++; \
+ xNumOfOverflows = ( BaseType_t ) ( xNumOfOverflows + 1 ); \
prvResetNextTaskUnblockTime(); \
- }
+ } while( 0 )
/*-----------------------------------------------------------*/
@@ -218,11 +265,13 @@
* Place the task represented by pxTCB into the appropriate ready list for
* the task. It is inserted at the end of the list.
*/
-#define prvAddTaskToReadyList( pxTCB ) \
- traceMOVED_TASK_TO_READY_STATE( pxTCB ); \
- taskRECORD_READY_PRIORITY( ( pxTCB )->uxPriority ); \
- listINSERT_END( &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xStateListItem ) ); \
- tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )
+#define prvAddTaskToReadyList( pxTCB ) \
+ do { \
+ traceMOVED_TASK_TO_READY_STATE( pxTCB ); \
+ taskRECORD_READY_PRIORITY( ( pxTCB )->uxPriority ); \
+ listINSERT_END( &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xStateListItem ) ); \
+ tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB ); \
+ } while( 0 )
/*-----------------------------------------------------------*/
/*
@@ -241,12 +290,66 @@
* the scheduler that the value should not be changed - in which case it is the
* responsibility of whichever module is using the value to ensure it gets set back
* to its original value when it is released. */
-#if ( configUSE_16_BIT_TICKS == 1 )
- #define taskEVENT_LIST_ITEM_VALUE_IN_USE 0x8000U
+#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
+ #define taskEVENT_LIST_ITEM_VALUE_IN_USE ( ( uint16_t ) 0x8000U )
+#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
+ #define taskEVENT_LIST_ITEM_VALUE_IN_USE ( ( uint32_t ) 0x80000000U )
+#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
+ #define taskEVENT_LIST_ITEM_VALUE_IN_USE ( ( uint64_t ) 0x8000000000000000U )
+#endif
+
+/* Indicates that the task is not actively running on any core. */
+#define taskTASK_NOT_RUNNING ( ( BaseType_t ) ( -1 ) )
+
+/* Indicates that the task is actively running but scheduled to yield. */
+#define taskTASK_SCHEDULED_TO_YIELD ( ( BaseType_t ) ( -2 ) )
+
+/* Returns pdTRUE if the task is actively running and not scheduled to yield. */
+#if ( configNUMBER_OF_CORES == 1 )
+ #define taskTASK_IS_RUNNING( pxTCB ) ( ( ( pxTCB ) == pxCurrentTCB ) ? ( pdTRUE ) : ( pdFALSE ) )
+ #define taskTASK_IS_RUNNING_OR_SCHEDULED_TO_YIELD( pxTCB ) ( ( ( pxTCB ) == pxCurrentTCB ) ? ( pdTRUE ) : ( pdFALSE ) )
#else
- #define taskEVENT_LIST_ITEM_VALUE_IN_USE 0x80000000UL
+ #define taskTASK_IS_RUNNING( pxTCB ) ( ( ( ( pxTCB )->xTaskRunState >= ( BaseType_t ) 0 ) && ( ( pxTCB )->xTaskRunState < ( BaseType_t ) configNUMBER_OF_CORES ) ) ? ( pdTRUE ) : ( pdFALSE ) )
+ #define taskTASK_IS_RUNNING_OR_SCHEDULED_TO_YIELD( pxTCB ) ( ( ( pxTCB )->xTaskRunState != taskTASK_NOT_RUNNING ) ? ( pdTRUE ) : ( pdFALSE ) )
#endif
+/* Indicates that the task is an Idle task. */
+#define taskATTRIBUTE_IS_IDLE ( UBaseType_t ) ( 1U << 0U )
+
+#if ( ( configNUMBER_OF_CORES > 1 ) && ( portCRITICAL_NESTING_IN_TCB == 1 ) )
+ #define portGET_CRITICAL_NESTING_COUNT() ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxCriticalNesting )
+ #define portSET_CRITICAL_NESTING_COUNT( x ) ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxCriticalNesting = ( x ) )
+ #define portINCREMENT_CRITICAL_NESTING_COUNT() ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxCriticalNesting++ )
+ #define portDECREMENT_CRITICAL_NESTING_COUNT() ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxCriticalNesting-- )
+#endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( portCRITICAL_NESTING_IN_TCB == 1 ) ) */
+
+#define taskBITS_PER_BYTE ( ( size_t ) 8 )
+
+#if ( configNUMBER_OF_CORES > 1 )
+
+/* Yields the given core. This must be called from a critical section and xCoreID
+ * must be valid. This macro is not required in single core since there is only
+ * one core to yield. */
+ #define prvYieldCore( xCoreID ) \
+ do { \
+ if( ( xCoreID ) == ( BaseType_t ) portGET_CORE_ID() ) \
+ { \
+ /* Pending a yield for this core since it is in the critical section. */ \
+ xYieldPendings[ ( xCoreID ) ] = pdTRUE; \
+ } \
+ else \
+ { \
+ /* Request other core to yield if it is not requested before. */ \
+ if( pxCurrentTCBs[ ( xCoreID ) ]->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD ) \
+ { \
+ portYIELD_CORE( xCoreID ); \
+ pxCurrentTCBs[ ( xCoreID ) ]->xTaskRunState = taskTASK_SCHEDULED_TO_YIELD; \
+ } \
+ } \
+ } while( 0 )
+#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
+/*-----------------------------------------------------------*/
+
/*
* Task control block. A task control block (TCB) is allocated for each task,
* and stores task state information, including a pointer to the task's context
@@ -254,33 +357,45 @@
*/
typedef struct tskTaskControlBlock /* The old naming convention is used to prevent breaking kernel aware debuggers. */
{
- volatile StackType_t * pxTopOfStack; /*< Points to the location of the last item placed on the tasks stack. THIS MUST BE THE FIRST MEMBER OF THE TCB STRUCT. */
+ volatile StackType_t * pxTopOfStack; /**< Points to the location of the last item placed on the tasks stack. THIS MUST BE THE FIRST MEMBER OF THE TCB STRUCT. */
#if ( portUSING_MPU_WRAPPERS == 1 )
- xMPU_SETTINGS xMPUSettings; /*< The MPU settings are defined as part of the port layer. THIS MUST BE THE SECOND MEMBER OF THE TCB STRUCT. */
+ xMPU_SETTINGS xMPUSettings; /**< The MPU settings are defined as part of the port layer. THIS MUST BE THE SECOND MEMBER OF THE TCB STRUCT. */
+ #endif
+
+ #if ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 )
+ UBaseType_t uxCoreAffinityMask; /**< Used to link the task to certain cores. UBaseType_t must have greater than or equal to the number of bits as configNUMBER_OF_CORES. */
+ #endif
+
+ ListItem_t xStateListItem; /**< The list that the state list item of a task is reference from denotes the state of that task (Ready, Blocked, Suspended ). */
+ ListItem_t xEventListItem; /**< Used to reference a task from an event list. */
+ UBaseType_t uxPriority; /**< The priority of the task. 0 is the lowest priority. */
+ StackType_t * pxStack; /**< Points to the start of the stack. */
+ #if ( configNUMBER_OF_CORES > 1 )
+ volatile BaseType_t xTaskRunState; /**< Used to identify the core the task is running on, if the task is running. Otherwise, identifies the task's state - not running or yielding. */
+ UBaseType_t uxTaskAttributes; /**< Task's attributes - currently used to identify the idle tasks. */
#endif
+ char pcTaskName[ configMAX_TASK_NAME_LEN ]; /**< Descriptive name given to the task when created. Facilitates debugging only. */
- ListItem_t xStateListItem; /*< The list that the state list item of a task is reference from denotes the state of that task (Ready, Blocked, Suspended ). */
- ListItem_t xEventListItem; /*< Used to reference a task from an event list. */
- UBaseType_t uxPriority; /*< The priority of the task. 0 is the lowest priority. */
- StackType_t * pxStack; /*< Points to the start of the stack. */
- char pcTaskName[ configMAX_TASK_NAME_LEN ]; /*< Descriptive name given to the task when created. Facilitates debugging only. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
+ BaseType_t xPreemptionDisable; /**< Used to prevent the task from being preempted. */
+ #endif
#if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
- StackType_t * pxEndOfStack; /*< Points to the highest valid address for the stack. */
+ StackType_t * pxEndOfStack; /**< Points to the highest valid address for the stack. */
#endif
#if ( portCRITICAL_NESTING_IN_TCB == 1 )
- UBaseType_t uxCriticalNesting; /*< Holds the critical section nesting depth for ports that do not maintain their own count in the port layer. */
+ UBaseType_t uxCriticalNesting; /**< Holds the critical section nesting depth for ports that do not maintain their own count in the port layer. */
#endif
#if ( configUSE_TRACE_FACILITY == 1 )
- UBaseType_t uxTCBNumber; /*< Stores a number that increments each time a TCB is created. It allows debuggers to determine when a task has been deleted and then recreated. */
- UBaseType_t uxTaskNumber; /*< Stores a number specifically for use by third party trace code. */
+ UBaseType_t uxTCBNumber; /**< Stores a number that increments each time a TCB is created. It allows debuggers to determine when a task has been deleted and then recreated. */
+ UBaseType_t uxTaskNumber; /**< Stores a number specifically for use by third party trace code. */
#endif
#if ( configUSE_MUTEXES == 1 )
- UBaseType_t uxBasePriority; /*< The priority last assigned to the task - used by the priority inheritance mechanism. */
+ UBaseType_t uxBasePriority; /**< The priority last assigned to the task - used by the priority inheritance mechanism. */
UBaseType_t uxMutexesHeld;
#endif
@@ -293,11 +408,11 @@ typedef struct tskTaskControlBlock /* The old naming convention is used to
#endif
#if ( configGENERATE_RUN_TIME_STATS == 1 )
- configRUN_TIME_COUNTER_TYPE ulRunTimeCounter; /*< Stores the amount of time the task has spent in the Running state. */
+ configRUN_TIME_COUNTER_TYPE ulRunTimeCounter; /**< Stores the amount of time the task has spent in the Running state. */
#endif
- #if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
- configTLS_BLOCK_TYPE xTLSBlock; /*< Memory block used as Thread Local Storage (TLS) Block for the task. */
+ #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
+ configTLS_BLOCK_TYPE xTLSBlock; /**< Memory block used as Thread Local Storage (TLS) Block for the task. */
#endif
#if ( configUSE_TASK_NOTIFICATIONS == 1 )
@@ -307,8 +422,8 @@ typedef struct tskTaskControlBlock /* The old naming convention is used to
/* See the comments in FreeRTOS.h with the definition of
* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE. */
- #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
- uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the task is a statically allocated to ensure no attempt is made to free the memory. */
+ #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
+ uint8_t ucStaticallyAllocated; /**< Set to pdTRUE if the task is a statically allocated to ensure no attempt is made to free the memory. */
#endif
#if ( INCLUDE_xTaskAbortDelay == 1 )
@@ -324,31 +439,40 @@ typedef struct tskTaskControlBlock /* The old naming convention is used to
* below to enable the use of older kernel aware debuggers. */
typedef tskTCB TCB_t;
-/*lint -save -e956 A manual analysis and inspection has been used to determine
- * which static variables must be declared volatile. */
-portDONT_DISCARD PRIVILEGED_DATA TCB_t * volatile pxCurrentTCB = NULL;
+#if ( configNUMBER_OF_CORES == 1 )
+ /* MISRA Ref 8.4.1 [Declaration shall be visible] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-84 */
+ /* coverity[misra_c_2012_rule_8_4_violation] */
+ portDONT_DISCARD PRIVILEGED_DATA TCB_t * volatile pxCurrentTCB = NULL;
+#else
+ /* MISRA Ref 8.4.1 [Declaration shall be visible] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-84 */
+ /* coverity[misra_c_2012_rule_8_4_violation] */
+ portDONT_DISCARD PRIVILEGED_DATA TCB_t * volatile pxCurrentTCBs[ configNUMBER_OF_CORES ];
+ #define pxCurrentTCB xTaskGetCurrentTaskHandle()
+#endif
/* Lists for ready and blocked tasks. --------------------
* xDelayedTaskList1 and xDelayedTaskList2 could be moved to function scope but
* doing so breaks some kernel aware debuggers and debuggers that rely on removing
* the static qualifier. */
-PRIVILEGED_DATA static List_t pxReadyTasksLists[ configMAX_PRIORITIES ]; /*< Prioritised ready tasks. */
-PRIVILEGED_DATA static List_t xDelayedTaskList1; /*< Delayed tasks. */
-PRIVILEGED_DATA static List_t xDelayedTaskList2; /*< Delayed tasks (two lists are used - one for delays that have overflowed the current tick count. */
-PRIVILEGED_DATA static List_t * volatile pxDelayedTaskList; /*< Points to the delayed task list currently being used. */
-PRIVILEGED_DATA static List_t * volatile pxOverflowDelayedTaskList; /*< Points to the delayed task list currently being used to hold tasks that have overflowed the current tick count. */
-PRIVILEGED_DATA static List_t xPendingReadyList; /*< Tasks that have been readied while the scheduler was suspended. They will be moved to the ready list when the scheduler is resumed. */
+PRIVILEGED_DATA static List_t pxReadyTasksLists[ configMAX_PRIORITIES ]; /**< Prioritised ready tasks. */
+PRIVILEGED_DATA static List_t xDelayedTaskList1; /**< Delayed tasks. */
+PRIVILEGED_DATA static List_t xDelayedTaskList2; /**< Delayed tasks (two lists are used - one for delays that have overflowed the current tick count. */
+PRIVILEGED_DATA static List_t * volatile pxDelayedTaskList; /**< Points to the delayed task list currently being used. */
+PRIVILEGED_DATA static List_t * volatile pxOverflowDelayedTaskList; /**< Points to the delayed task list currently being used to hold tasks that have overflowed the current tick count. */
+PRIVILEGED_DATA static List_t xPendingReadyList; /**< Tasks that have been readied while the scheduler was suspended. They will be moved to the ready list when the scheduler is resumed. */
#if ( INCLUDE_vTaskDelete == 1 )
- PRIVILEGED_DATA static List_t xTasksWaitingTermination; /*< Tasks that have been deleted - but their memory not yet freed. */
+ PRIVILEGED_DATA static List_t xTasksWaitingTermination; /**< Tasks that have been deleted - but their memory not yet freed. */
PRIVILEGED_DATA static volatile UBaseType_t uxDeletedTasksWaitingCleanUp = ( UBaseType_t ) 0U;
#endif
#if ( INCLUDE_vTaskSuspend == 1 )
- PRIVILEGED_DATA static List_t xSuspendedTaskList; /*< Tasks that are currently suspended. */
+ PRIVILEGED_DATA static List_t xSuspendedTaskList; /**< Tasks that are currently suspended. */
#endif
@@ -364,16 +488,16 @@ PRIVILEGED_DATA static volatile TickType_t xTickCount = ( TickType_t ) configINI
PRIVILEGED_DATA static volatile UBaseType_t uxTopReadyPriority = tskIDLE_PRIORITY;
PRIVILEGED_DATA static volatile BaseType_t xSchedulerRunning = pdFALSE;
PRIVILEGED_DATA static volatile TickType_t xPendedTicks = ( TickType_t ) 0U;
-PRIVILEGED_DATA static volatile BaseType_t xYieldPending = pdFALSE;
+PRIVILEGED_DATA static volatile BaseType_t xYieldPendings[ configNUMBER_OF_CORES ] = { pdFALSE };
PRIVILEGED_DATA static volatile BaseType_t xNumOfOverflows = ( BaseType_t ) 0;
PRIVILEGED_DATA static UBaseType_t uxTaskNumber = ( UBaseType_t ) 0U;
PRIVILEGED_DATA static volatile TickType_t xNextTaskUnblockTime = ( TickType_t ) 0U; /* Initialised to portMAX_DELAY before the scheduler starts. */
-PRIVILEGED_DATA static TaskHandle_t xIdleTaskHandle = NULL; /*< Holds the handle of the idle task. The idle task is created automatically when the scheduler is started. */
+PRIVILEGED_DATA static TaskHandle_t xIdleTaskHandles[ configNUMBER_OF_CORES ]; /**< Holds the handles of the idle tasks. The idle tasks are created automatically when the scheduler is started. */
/* Improve support for OpenOCD. The kernel tracks Ready tasks via priority lists.
* For tracking the state of remote threads, OpenOCD uses uxTopUsedPriority
* to determine the number of priority lists to read back from the remote target. */
-const volatile UBaseType_t uxTopUsedPriority = configMAX_PRIORITIES - 1U;
+static const volatile UBaseType_t uxTopUsedPriority = configMAX_PRIORITIES - 1U;
/* Context switches are held pending while the scheduler is suspended. Also,
* interrupts must not manipulate the xStateListItem of a TCB, or any of the
@@ -382,24 +506,57 @@ const volatile UBaseType_t uxTopUsedPriority = configMAX_PRIORITIES - 1U;
* moves the task's event list item into the xPendingReadyList, ready for the
* kernel to move the task from the pending ready list into the real ready list
* when the scheduler is unsuspended. The pending ready list itself can only be
- * accessed from a critical section. */
-PRIVILEGED_DATA static volatile UBaseType_t uxSchedulerSuspended = ( UBaseType_t ) pdFALSE;
+ * accessed from a critical section.
+ *
+ * Updates to uxSchedulerSuspended must be protected by both the task lock and the ISR lock
+ * and must not be done from an ISR. Reads must be protected by either lock and may be done
+ * from either an ISR or a task. */
+PRIVILEGED_DATA static volatile UBaseType_t uxSchedulerSuspended = ( UBaseType_t ) 0U;
#if ( configGENERATE_RUN_TIME_STATS == 1 )
/* Do not move these variables to function scope as doing so prevents the
* code working with debuggers that need to remove the static qualifier. */
- PRIVILEGED_DATA static configRUN_TIME_COUNTER_TYPE ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */
- PRIVILEGED_DATA static volatile configRUN_TIME_COUNTER_TYPE ulTotalRunTime = 0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */
+PRIVILEGED_DATA static configRUN_TIME_COUNTER_TYPE ulTaskSwitchedInTime[ configNUMBER_OF_CORES ] = { 0U }; /**< Holds the value of a timer/counter the last time a task was switched in. */
+PRIVILEGED_DATA static volatile configRUN_TIME_COUNTER_TYPE ulTotalRunTime[ configNUMBER_OF_CORES ] = { 0U }; /**< Holds the total amount of execution time as defined by the run time counter clock. */
#endif
-/*lint -restore */
-
/*-----------------------------------------------------------*/
/* File private functions. --------------------------------*/
+/*
+ * Creates the idle tasks during scheduler start.
+ */
+static BaseType_t prvCreateIdleTasks( void );
+
+#if ( configNUMBER_OF_CORES > 1 )
+
+/*
+ * Checks to see if another task moved the current task out of the ready
+ * list while it was waiting to enter a critical section and yields, if so.
+ */
+ static void prvCheckForRunStateChange( void );
+#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
+
+#if ( configNUMBER_OF_CORES > 1 )
+
+/*
+ * Yields a core, or cores if multiple priorities are not allowed to run
+ * simultaneously, to allow the task pxTCB to run.
+ */
+ static void prvYieldForTask( const TCB_t * pxTCB );
+#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
+
+#if ( configNUMBER_OF_CORES > 1 )
+
+/*
+ * Selects the highest priority available task for the given core.
+ */
+ static void prvSelectHighestPriorityTask( BaseType_t xCoreID );
+#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
+
/**
* Utility task that simply returns pdTRUE if the task referenced by xTask is
* currently in the Suspended state, or pdFALSE if the task referenced by xTask
@@ -422,13 +579,21 @@ static void prvInitialiseTaskLists( void ) PRIVILEGED_FUNCTION;
* The idle task is automatically created and added to the ready lists upon
* creation of the first user task.
*
+ * In the FreeRTOS SMP, configNUMBER_OF_CORES - 1 passive idle tasks are also
+ * created to ensure that each core has an idle task to run when no other
+ * task is available to run.
+ *
* The portTASK_FUNCTION_PROTO() macro is used to allow port/compiler specific
- * language extensions. The equivalent prototype for this function is:
+ * language extensions. The equivalent prototype for these functions are:
*
* void prvIdleTask( void *pvParameters );
+ * void prvPassiveIdleTask( void *pvParameters );
*
*/
static portTASK_FUNCTION_PROTO( prvIdleTask, pvParameters ) PRIVILEGED_FUNCTION;
+#if ( configNUMBER_OF_CORES > 1 )
+ static portTASK_FUNCTION_PROTO( prvPassiveIdleTask, pvParameters ) PRIVILEGED_FUNCTION;
+#endif
/*
* Utility to free all memory allocated by the scheduler to hold a TCB,
@@ -532,8 +697,8 @@ static void prvResetNextTaskUnblockTime( void ) PRIVILEGED_FUNCTION;
* dynamically to fill in the structure's members.
*/
static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
- const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
- const uint32_t ulStackDepth,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
void * const pvParameters,
UBaseType_t uxPriority,
TaskHandle_t * const pxCreatedTask,
@@ -546,6 +711,53 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
*/
static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
+/*
+ * Create a task with static buffer for both TCB and stack. Returns a handle to
+ * the task if it is created successfully. Otherwise, returns NULL.
+ */
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ static TCB_t * prvCreateStaticTask( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ StackType_t * const puxStackBuffer,
+ StaticTask_t * const pxTaskBuffer,
+ TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;
+#endif /* #if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
+
+/*
+ * Create a restricted task with static buffer for both TCB and stack. Returns
+ * a handle to the task if it is created successfully. Otherwise, returns NULL.
+ */
+#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
+ static TCB_t * prvCreateRestrictedStaticTask( const TaskParameters_t * const pxTaskDefinition,
+ TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;
+#endif /* #if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) */
+
+/*
+ * Create a restricted task with static buffer for task stack and allocated buffer
+ * for TCB. Returns a handle to the task if it is created successfully. Otherwise,
+ * returns NULL.
+ */
+#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
+ static TCB_t * prvCreateRestrictedTask( const TaskParameters_t * const pxTaskDefinition,
+ TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;
+#endif /* #if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) */
+
+/*
+ * Create a task with allocated buffer for both TCB and stack. Returns a handle to
+ * the task if it is created successfully. Otherwise, returns NULL.
+ */
+#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ static TCB_t * prvCreateTask( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;
+#endif /* #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */
+
/*
* freertos_tasks_c_additions_init() should only be called if the user definable
* macro FREERTOS_TASKS_C_ADDITIONS_INIT() is defined, as that is the only macro
@@ -557,219 +769,917 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
#endif
-/*-----------------------------------------------------------*/
+#if ( configUSE_PASSIVE_IDLE_HOOK == 1 )
+ extern void vApplicationPassiveIdleHook( void );
+#endif /* #if ( configUSE_PASSIVE_IDLE_HOOK == 1 ) */
-#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )
- TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,
- const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
- const uint32_t ulStackDepth,
- void * const pvParameters,
- UBaseType_t uxPriority,
- StackType_t * const puxStackBuffer,
- StaticTask_t * const pxTaskBuffer )
+/*
+ * Convert the snprintf return value to the number of characters
+ * written. The following are the possible cases:
+ *
+ * 1. The buffer supplied to snprintf is large enough to hold the
+ * generated string. The return value in this case is the number
+ * of characters actually written, not counting the terminating
+ * null character.
+ * 2. The buffer supplied to snprintf is NOT large enough to hold
+ * the generated string. The return value in this case is the
+ * number of characters that would have been written if the
+ * buffer had been sufficiently large, not counting the
+ * terminating null character.
+ * 3. Encoding error. The return value in this case is a negative
+ * number.
+ *
+ * From 1 and 2 above ==> Only when the return value is non-negative
+ * and less than the supplied buffer length, the string has been
+ * completely written.
+ */
+ static size_t prvSnprintfReturnValueToCharsWritten( int iSnprintfReturnValue,
+ size_t n );
+
+#endif /* #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) ) */
+/*-----------------------------------------------------------*/
+
+#if ( configNUMBER_OF_CORES > 1 )
+ static void prvCheckForRunStateChange( void )
{
- TCB_t * pxNewTCB;
- TaskHandle_t xReturn;
+ UBaseType_t uxPrevCriticalNesting;
+ const TCB_t * pxThisTCB;
- configASSERT( puxStackBuffer != NULL );
- configASSERT( pxTaskBuffer != NULL );
+ /* This must only be called from within a task. */
+ portASSERT_IF_IN_ISR();
- #if ( configASSERT_DEFINED == 1 )
- {
- /* Sanity check that the size of the structure used to declare a
- * variable of type StaticTask_t equals the size of the real task
- * structure. */
- volatile size_t xSize = sizeof( StaticTask_t );
- configASSERT( xSize == sizeof( TCB_t ) );
- ( void ) xSize; /* Prevent lint warning when configASSERT() is not used. */
- }
- #endif /* configASSERT_DEFINED */
+ /* This function is always called with interrupts disabled
+ * so this is safe. */
+ pxThisTCB = pxCurrentTCBs[ portGET_CORE_ID() ];
- if( ( pxTaskBuffer != NULL ) && ( puxStackBuffer != NULL ) )
+ while( pxThisTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YIELD )
{
- /* The memory used for the task's TCB and stack are passed into this
- * function - use them. */
- pxNewTCB = ( TCB_t * ) pxTaskBuffer; /*lint !e740 !e9087 Unusual cast is ok as the structures are designed to have the same alignment, and the size is checked by an assert. */
- memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
- pxNewTCB->pxStack = ( StackType_t * ) puxStackBuffer;
+ /* We are only here if we just entered a critical section
+ * or if we just suspended the scheduler, and another task
+ * has requested that we yield.
+ *
+ * This is slightly complicated since we need to save and restore
+ * the suspension and critical nesting counts, as well as release
+ * and reacquire the correct locks. And then, do it all over again
+ * if our state changed again during the reacquisition. */
+ uxPrevCriticalNesting = portGET_CRITICAL_NESTING_COUNT();
- #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
+ if( uxPrevCriticalNesting > 0U )
{
- /* Tasks can be created statically or dynamically, so note this
- * task was created statically in case the task is later deleted. */
- pxNewTCB->ucStaticallyAllocated = tskSTATICALLY_ALLOCATED_STACK_AND_TCB;
+ portSET_CRITICAL_NESTING_COUNT( 0U );
+ portRELEASE_ISR_LOCK();
+ }
+ else
+ {
+ /* The scheduler is suspended. uxSchedulerSuspended is updated
+ * only when the task is not requested to yield. */
+ mtCOVERAGE_TEST_MARKER();
}
- #endif /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE */
-
- prvInitialiseNewTask( pxTaskCode, pcName, ulStackDepth, pvParameters, uxPriority, &xReturn, pxNewTCB, NULL );
- prvAddNewTaskToReadyList( pxNewTCB );
- }
- else
- {
- xReturn = NULL;
- }
-
- return xReturn;
- }
-
-#endif /* SUPPORT_STATIC_ALLOCATION */
-/*-----------------------------------------------------------*/
-#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
+ portRELEASE_TASK_LOCK();
+ portMEMORY_BARRIER();
+ configASSERT( pxThisTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YIELD );
- BaseType_t xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition,
- TaskHandle_t * pxCreatedTask )
- {
- TCB_t * pxNewTCB;
- BaseType_t xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
+ portENABLE_INTERRUPTS();
- configASSERT( pxTaskDefinition->puxStackBuffer != NULL );
- configASSERT( pxTaskDefinition->pxTaskBuffer != NULL );
+ /* Enabling interrupts should cause this core to immediately
+ * service the pending interrupt and yield. If the run state is still
+ * yielding here then that is a problem. */
+ configASSERT( pxThisTCB->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD );
- if( ( pxTaskDefinition->puxStackBuffer != NULL ) && ( pxTaskDefinition->pxTaskBuffer != NULL ) )
- {
- /* Allocate space for the TCB. Where the memory comes from depends
- * on the implementation of the port malloc function and whether or
- * not static allocation is being used. */
- pxNewTCB = ( TCB_t * ) pxTaskDefinition->pxTaskBuffer;
- memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
+ portDISABLE_INTERRUPTS();
+ portGET_TASK_LOCK();
+ portGET_ISR_LOCK();
- /* Store the stack location in the TCB. */
- pxNewTCB->pxStack = pxTaskDefinition->puxStackBuffer;
+ portSET_CRITICAL_NESTING_COUNT( uxPrevCriticalNesting );
- #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
+ if( uxPrevCriticalNesting == 0U )
{
- /* Tasks can be created statically or dynamically, so note this
- * task was created statically in case the task is later deleted. */
- pxNewTCB->ucStaticallyAllocated = tskSTATICALLY_ALLOCATED_STACK_AND_TCB;
+ portRELEASE_ISR_LOCK();
}
- #endif /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE */
-
- prvInitialiseNewTask( pxTaskDefinition->pvTaskCode,
- pxTaskDefinition->pcName,
- ( uint32_t ) pxTaskDefinition->usStackDepth,
- pxTaskDefinition->pvParameters,
- pxTaskDefinition->uxPriority,
- pxCreatedTask, pxNewTCB,
- pxTaskDefinition->xRegions );
-
- prvAddNewTaskToReadyList( pxNewTCB );
- xReturn = pdPASS;
}
-
- return xReturn;
}
+#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
-#endif /* ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/*-----------------------------------------------------------*/
-#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
-
- BaseType_t xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition,
- TaskHandle_t * pxCreatedTask )
+#if ( configNUMBER_OF_CORES > 1 )
+ static void prvYieldForTask( const TCB_t * pxTCB )
{
- TCB_t * pxNewTCB;
- BaseType_t xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
+ BaseType_t xLowestPriorityToPreempt;
+ BaseType_t xCurrentCoreTaskPriority;
+ BaseType_t xLowestPriorityCore = ( BaseType_t ) -1;
+ BaseType_t xCoreID;
- configASSERT( pxTaskDefinition->puxStackBuffer );
+ #if ( configRUN_MULTIPLE_PRIORITIES == 0 )
+ BaseType_t xYieldCount = 0;
+ #endif /* #if ( configRUN_MULTIPLE_PRIORITIES == 0 ) */
- if( pxTaskDefinition->puxStackBuffer != NULL )
+ /* This must be called from a critical section. */
+ configASSERT( portGET_CRITICAL_NESTING_COUNT() > 0U );
+
+ #if ( configRUN_MULTIPLE_PRIORITIES == 0 )
+
+ /* No task should yield for this one if it is a lower priority
+ * than priority level of currently ready tasks. */
+ if( pxTCB->uxPriority >= uxTopReadyPriority )
+ #else
+ /* Yield is not required for a task which is already running. */
+ if( taskTASK_IS_RUNNING( pxTCB ) == pdFALSE )
+ #endif
{
- /* Allocate space for the TCB. Where the memory comes from depends
- * on the implementation of the port malloc function and whether or
- * not static allocation is being used. */
- pxNewTCB = ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) );
+ xLowestPriorityToPreempt = ( BaseType_t ) pxTCB->uxPriority;
- if( pxNewTCB != NULL )
- {
- memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
+ /* xLowestPriorityToPreempt will be decremented to -1 if the priority of pxTCB
+ * is 0. This is ok as we will give system idle tasks a priority of -1 below. */
+ --xLowestPriorityToPreempt;
- /* Store the stack location in the TCB. */
- pxNewTCB->pxStack = pxTaskDefinition->puxStackBuffer;
+ for( xCoreID = ( BaseType_t ) 0; xCoreID < ( BaseType_t ) configNUMBER_OF_CORES; xCoreID++ )
+ {
+ xCurrentCoreTaskPriority = ( BaseType_t ) pxCurrentTCBs[ xCoreID ]->uxPriority;
- #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
+ /* System idle tasks are being assigned a priority of tskIDLE_PRIORITY - 1 here. */
+ if( ( pxCurrentTCBs[ xCoreID ]->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) != 0U )
{
- /* Tasks can be created statically or dynamically, so note
- * this task had a statically allocated stack in case it is
- * later deleted. The TCB was allocated dynamically. */
- pxNewTCB->ucStaticallyAllocated = tskSTATICALLY_ALLOCATED_STACK_ONLY;
+ xCurrentCoreTaskPriority = ( BaseType_t ) ( xCurrentCoreTaskPriority - 1 );
}
- #endif /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE */
- prvInitialiseNewTask( pxTaskDefinition->pvTaskCode,
- pxTaskDefinition->pcName,
- ( uint32_t ) pxTaskDefinition->usStackDepth,
- pxTaskDefinition->pvParameters,
- pxTaskDefinition->uxPriority,
- pxCreatedTask, pxNewTCB,
- pxTaskDefinition->xRegions );
+ if( ( taskTASK_IS_RUNNING( pxCurrentTCBs[ xCoreID ] ) != pdFALSE ) && ( xYieldPendings[ xCoreID ] == pdFALSE ) )
+ {
+ #if ( configRUN_MULTIPLE_PRIORITIES == 0 )
+ if( taskTASK_IS_RUNNING( pxTCB ) == pdFALSE )
+ #endif
+ {
+ if( xCurrentCoreTaskPriority <= xLowestPriorityToPreempt )
+ {
+ #if ( configUSE_CORE_AFFINITY == 1 )
+ if( ( pxTCB->uxCoreAffinityMask & ( ( UBaseType_t ) 1U << ( UBaseType_t ) xCoreID ) ) != 0U )
+ #endif
+ {
+ #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
+ if( pxCurrentTCBs[ xCoreID ]->xPreemptionDisable == pdFALSE )
+ #endif
+ {
+ xLowestPriorityToPreempt = xCurrentCoreTaskPriority;
+ xLowestPriorityCore = xCoreID;
+ }
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
- prvAddNewTaskToReadyList( pxNewTCB );
- xReturn = pdPASS;
+ #if ( configRUN_MULTIPLE_PRIORITIES == 0 )
+ {
+ /* Yield all currently running non-idle tasks with a priority lower than
+ * the task that needs to run. */
+ if( ( xCurrentCoreTaskPriority > ( ( BaseType_t ) tskIDLE_PRIORITY - 1 ) ) &&
+ ( xCurrentCoreTaskPriority < ( BaseType_t ) pxTCB->uxPriority ) )
+ {
+ prvYieldCore( xCoreID );
+ xYieldCount++;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ #endif /* #if ( configRUN_MULTIPLE_PRIORITIES == 0 ) */
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
- }
- return xReturn;
- }
+ #if ( configRUN_MULTIPLE_PRIORITIES == 0 )
+ if( ( xYieldCount == 0 ) && ( xLowestPriorityCore >= 0 ) )
+ #else /* #if ( configRUN_MULTIPLE_PRIORITIES == 0 ) */
+ if( xLowestPriorityCore >= 0 )
+ #endif /* #if ( configRUN_MULTIPLE_PRIORITIES == 0 ) */
+ {
+ prvYieldCore( xLowestPriorityCore );
+ }
-#endif /* portUSING_MPU_WRAPPERS */
+ #if ( configRUN_MULTIPLE_PRIORITIES == 0 )
+ /* Verify that the calling core always yields to higher priority tasks. */
+ if( ( ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) == 0U ) &&
+ ( pxTCB->uxPriority > pxCurrentTCBs[ portGET_CORE_ID() ]->uxPriority ) )
+ {
+ configASSERT( ( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE ) ||
+ ( taskTASK_IS_RUNNING( pxCurrentTCBs[ portGET_CORE_ID() ] ) == pdFALSE ) );
+ }
+ #endif
+ }
+ }
+#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
/*-----------------------------------------------------------*/
-#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
-
- BaseType_t xTaskCreate( TaskFunction_t pxTaskCode,
- const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
- const configSTACK_DEPTH_TYPE usStackDepth,
- void * const pvParameters,
- UBaseType_t uxPriority,
- TaskHandle_t * const pxCreatedTask )
+#if ( configNUMBER_OF_CORES > 1 )
+ static void prvSelectHighestPriorityTask( BaseType_t xCoreID )
{
- TCB_t * pxNewTCB;
- BaseType_t xReturn;
+ UBaseType_t uxCurrentPriority = uxTopReadyPriority;
+ BaseType_t xTaskScheduled = pdFALSE;
+ BaseType_t xDecrementTopPriority = pdTRUE;
+ TCB_t * pxTCB = NULL;
- /* If the stack grows down then allocate the stack then the TCB so the stack
- * does not grow into the TCB. Likewise if the stack grows up then allocate
- * the TCB then the stack. */
- #if ( portSTACK_GROWTH > 0 )
- {
- /* Allocate space for the TCB. Where the memory comes from depends on
- * the implementation of the port malloc function and whether or not static
- * allocation is being used. */
- pxNewTCB = ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) );
+ #if ( configUSE_CORE_AFFINITY == 1 )
+ const TCB_t * pxPreviousTCB = NULL;
+ #endif
+ #if ( configRUN_MULTIPLE_PRIORITIES == 0 )
+ BaseType_t xPriorityDropped = pdFALSE;
+ #endif
- if( pxNewTCB != NULL )
- {
- memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
+ /* This function should be called when scheduler is running. */
+ configASSERT( xSchedulerRunning == pdTRUE );
- /* Allocate space for the stack used by the task being created.
- * The base of the stack memory stored in the TCB so the task can
- * be deleted later if required. */
- pxNewTCB->pxStack = ( StackType_t * ) pvPortMallocStack( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
+ /* A new task is created and a running task with the same priority yields
+ * itself to run the new task. When a running task yields itself, it is still
+ * in the ready list. This running task will be selected before the new task
+ * since the new task is always added to the end of the ready list.
+ * The other problem is that the running task still in the same position of
+ * the ready list when it yields itself. It is possible that it will be selected
+ * earlier then other tasks which waits longer than this task.
+ *
+ * To fix these problems, the running task should be put to the end of the
+ * ready list before searching for the ready task in the ready list. */
+ if( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ pxCurrentTCBs[ xCoreID ]->uxPriority ] ),
+ &pxCurrentTCBs[ xCoreID ]->xStateListItem ) == pdTRUE )
+ {
+ ( void ) uxListRemove( &pxCurrentTCBs[ xCoreID ]->xStateListItem );
+ vListInsertEnd( &( pxReadyTasksLists[ pxCurrentTCBs[ xCoreID ]->uxPriority ] ),
+ &pxCurrentTCBs[ xCoreID ]->xStateListItem );
+ }
- if( pxNewTCB->pxStack == NULL )
+ while( xTaskScheduled == pdFALSE )
+ {
+ #if ( configRUN_MULTIPLE_PRIORITIES == 0 )
+ {
+ if( uxCurrentPriority < uxTopReadyPriority )
{
- /* Could not allocate the stack. Delete the allocated TCB. */
- vPortFree( pxNewTCB );
- pxNewTCB = NULL;
+ /* We can't schedule any tasks, other than idle, that have a
+ * priority lower than the priority of a task currently running
+ * on another core. */
+ uxCurrentPriority = tskIDLE_PRIORITY;
}
}
- }
+ #endif
+
+ if( listLIST_IS_EMPTY( &( pxReadyTasksLists[ uxCurrentPriority ] ) ) == pdFALSE )
+ {
+ const List_t * const pxReadyList = &( pxReadyTasksLists[ uxCurrentPriority ] );
+ const ListItem_t * pxEndMarker = listGET_END_MARKER( pxReadyList );
+ ListItem_t * pxIterator;
+
+ /* The ready task list for uxCurrentPriority is not empty, so uxTopReadyPriority
+ * must not be decremented any further. */
+ xDecrementTopPriority = pdFALSE;
+
+ for( pxIterator = listGET_HEAD_ENTRY( pxReadyList ); pxIterator != pxEndMarker; pxIterator = listGET_NEXT( pxIterator ) )
+ {
+ /* MISRA Ref 11.5.3 [Void pointer assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxTCB = ( TCB_t * ) listGET_LIST_ITEM_OWNER( pxIterator );
+
+ #if ( configRUN_MULTIPLE_PRIORITIES == 0 )
+ {
+ /* When falling back to the idle priority because only one priority
+ * level is allowed to run at a time, we should ONLY schedule the true
+ * idle tasks, not user tasks at the idle priority. */
+ if( uxCurrentPriority < uxTopReadyPriority )
+ {
+ if( ( pxTCB->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) == 0U )
+ {
+ continue;
+ }
+ }
+ }
+ #endif /* #if ( configRUN_MULTIPLE_PRIORITIES == 0 ) */
+
+ if( pxTCB->xTaskRunState == taskTASK_NOT_RUNNING )
+ {
+ #if ( configUSE_CORE_AFFINITY == 1 )
+ if( ( pxTCB->uxCoreAffinityMask & ( ( UBaseType_t ) 1U << ( UBaseType_t ) xCoreID ) ) != 0U )
+ #endif
+ {
+ /* If the task is not being executed by any core swap it in. */
+ pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_NOT_RUNNING;
+ #if ( configUSE_CORE_AFFINITY == 1 )
+ pxPreviousTCB = pxCurrentTCBs[ xCoreID ];
+ #endif
+ pxTCB->xTaskRunState = xCoreID;
+ pxCurrentTCBs[ xCoreID ] = pxTCB;
+ xTaskScheduled = pdTRUE;
+ }
+ }
+ else if( pxTCB == pxCurrentTCBs[ xCoreID ] )
+ {
+ configASSERT( ( pxTCB->xTaskRunState == xCoreID ) || ( pxTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YIELD ) );
+
+ #if ( configUSE_CORE_AFFINITY == 1 )
+ if( ( pxTCB->uxCoreAffinityMask & ( ( UBaseType_t ) 1U << ( UBaseType_t ) xCoreID ) ) != 0U )
+ #endif
+ {
+ /* The task is already running on this core, mark it as scheduled. */
+ pxTCB->xTaskRunState = xCoreID;
+ xTaskScheduled = pdTRUE;
+ }
+ }
+ else
+ {
+ /* This task is running on the core other than xCoreID. */
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ if( xTaskScheduled != pdFALSE )
+ {
+ /* A task has been selected to run on this core. */
+ break;
+ }
+ }
+ }
+ else
+ {
+ if( xDecrementTopPriority != pdFALSE )
+ {
+ uxTopReadyPriority--;
+ #if ( configRUN_MULTIPLE_PRIORITIES == 0 )
+ {
+ xPriorityDropped = pdTRUE;
+ }
+ #endif
+ }
+ }
+
+ /* There are configNUMBER_OF_CORES Idle tasks created when scheduler started.
+ * The scheduler should be able to select a task to run when uxCurrentPriority
+ * is tskIDLE_PRIORITY. uxCurrentPriority is never decreased to value blow
+ * tskIDLE_PRIORITY. */
+ if( uxCurrentPriority > tskIDLE_PRIORITY )
+ {
+ uxCurrentPriority--;
+ }
+ else
+ {
+ /* This function is called when idle task is not created. Break the
+ * loop to prevent uxCurrentPriority overrun. */
+ break;
+ }
+ }
+
+ #if ( configRUN_MULTIPLE_PRIORITIES == 0 )
+ {
+ if( xTaskScheduled == pdTRUE )
+ {
+ if( xPriorityDropped != pdFALSE )
+ {
+ /* There may be several ready tasks that were being prevented from running because there was
+ * a higher priority task running. Now that the last of the higher priority tasks is no longer
+ * running, make sure all the other idle tasks yield. */
+ BaseType_t x;
+
+ for( x = ( BaseType_t ) 0; x < ( BaseType_t ) configNUMBER_OF_CORES; x++ )
+ {
+ if( ( pxCurrentTCBs[ x ]->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) != 0U )
+ {
+ prvYieldCore( x );
+ }
+ }
+ }
+ }
+ }
+ #endif /* #if ( configRUN_MULTIPLE_PRIORITIES == 0 ) */
+
+ #if ( configUSE_CORE_AFFINITY == 1 )
+ {
+ if( xTaskScheduled == pdTRUE )
+ {
+ if( ( pxPreviousTCB != NULL ) && ( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ pxPreviousTCB->uxPriority ] ), &( pxPreviousTCB->xStateListItem ) ) != pdFALSE ) )
+ {
+ /* A ready task was just evicted from this core. See if it can be
+ * scheduled on any other core. */
+ UBaseType_t uxCoreMap = pxPreviousTCB->uxCoreAffinityMask;
+ BaseType_t xLowestPriority = ( BaseType_t ) pxPreviousTCB->uxPriority;
+ BaseType_t xLowestPriorityCore = -1;
+ BaseType_t x;
+
+ if( ( pxPreviousTCB->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) != 0U )
+ {
+ xLowestPriority = xLowestPriority - 1;
+ }
+
+ if( ( uxCoreMap & ( ( UBaseType_t ) 1U << ( UBaseType_t ) xCoreID ) ) != 0U )
+ {
+ /* pxPreviousTCB was removed from this core and this core is not excluded
+ * from it's core affinity mask.
+ *
+ * pxPreviousTCB is preempted by the new higher priority task
+ * pxCurrentTCBs[ xCoreID ]. When searching a new core for pxPreviousTCB,
+ * we do not need to look at the cores on which pxCurrentTCBs[ xCoreID ]
+ * is allowed to run. The reason is - when more than one cores are
+ * eligible for an incoming task, we preempt the core with the minimum
+ * priority task. Because this core (i.e. xCoreID) was preempted for
+ * pxCurrentTCBs[ xCoreID ], this means that all the others cores
+ * where pxCurrentTCBs[ xCoreID ] can run, are running tasks with priority
+ * no lower than pxPreviousTCB's priority. Therefore, the only cores where
+ * which can be preempted for pxPreviousTCB are the ones where
+ * pxCurrentTCBs[ xCoreID ] is not allowed to run (and obviously,
+ * pxPreviousTCB is allowed to run).
+ *
+ * This is an optimization which reduces the number of cores needed to be
+ * searched for pxPreviousTCB to run. */
+ uxCoreMap &= ~( pxCurrentTCBs[ xCoreID ]->uxCoreAffinityMask );
+ }
+ else
+ {
+ /* pxPreviousTCB's core affinity mask is changed and it is no longer
+ * allowed to run on this core. Searching all the cores in pxPreviousTCB's
+ * new core affinity mask to find a core on which it can run. */
+ }
+
+ uxCoreMap &= ( ( 1U << configNUMBER_OF_CORES ) - 1U );
+
+ for( x = ( ( BaseType_t ) configNUMBER_OF_CORES - 1 ); x >= ( BaseType_t ) 0; x-- )
+ {
+ UBaseType_t uxCore = ( UBaseType_t ) x;
+ BaseType_t xTaskPriority;
+
+ if( ( uxCoreMap & ( ( UBaseType_t ) 1U << uxCore ) ) != 0U )
+ {
+ xTaskPriority = ( BaseType_t ) pxCurrentTCBs[ uxCore ]->uxPriority;
+
+ if( ( pxCurrentTCBs[ uxCore ]->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) != 0U )
+ {
+ xTaskPriority = xTaskPriority - ( BaseType_t ) 1;
+ }
+
+ uxCoreMap &= ~( ( UBaseType_t ) 1U << uxCore );
+
+ if( ( xTaskPriority < xLowestPriority ) &&
+ ( taskTASK_IS_RUNNING( pxCurrentTCBs[ uxCore ] ) != pdFALSE ) &&
+ ( xYieldPendings[ uxCore ] == pdFALSE ) )
+ {
+ #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
+ if( pxCurrentTCBs[ uxCore ]->xPreemptionDisable == pdFALSE )
+ #endif
+ {
+ xLowestPriority = xTaskPriority;
+ xLowestPriorityCore = ( BaseType_t ) uxCore;
+ }
+ }
+ }
+ }
+
+ if( xLowestPriorityCore >= 0 )
+ {
+ prvYieldCore( xLowestPriorityCore );
+ }
+ }
+ }
+ }
+ #endif /* #if ( configUSE_CORE_AFFINITY == 1 ) */
+ }
+
+#endif /* ( configNUMBER_OF_CORES > 1 ) */
+
+/*-----------------------------------------------------------*/
+
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+
+ static TCB_t * prvCreateStaticTask( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ StackType_t * const puxStackBuffer,
+ StaticTask_t * const pxTaskBuffer,
+ TaskHandle_t * const pxCreatedTask )
+ {
+ TCB_t * pxNewTCB;
+
+ configASSERT( puxStackBuffer != NULL );
+ configASSERT( pxTaskBuffer != NULL );
+
+ #if ( configASSERT_DEFINED == 1 )
+ {
+ /* Sanity check that the size of the structure used to declare a
+ * variable of type StaticTask_t equals the size of the real task
+ * structure. */
+ volatile size_t xSize = sizeof( StaticTask_t );
+ configASSERT( xSize == sizeof( TCB_t ) );
+ ( void ) xSize; /* Prevent unused variable warning when configASSERT() is not used. */
+ }
+ #endif /* configASSERT_DEFINED */
+
+ if( ( pxTaskBuffer != NULL ) && ( puxStackBuffer != NULL ) )
+ {
+ /* The memory used for the task's TCB and stack are passed into this
+ * function - use them. */
+ /* MISRA Ref 11.3.1 [Misaligned access] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
+ /* coverity[misra_c_2012_rule_11_3_violation] */
+ pxNewTCB = ( TCB_t * ) pxTaskBuffer;
+ ( void ) memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
+ pxNewTCB->pxStack = ( StackType_t * ) puxStackBuffer;
+
+ #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
+ {
+ /* Tasks can be created statically or dynamically, so note this
+ * task was created statically in case the task is later deleted. */
+ pxNewTCB->ucStaticallyAllocated = tskSTATICALLY_ALLOCATED_STACK_AND_TCB;
+ }
+ #endif /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE */
+
+ prvInitialiseNewTask( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, pxCreatedTask, pxNewTCB, NULL );
+ }
+ else
+ {
+ pxNewTCB = NULL;
+ }
+
+ return pxNewTCB;
+ }
+/*-----------------------------------------------------------*/
+
+ TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ StackType_t * const puxStackBuffer,
+ StaticTask_t * const pxTaskBuffer )
+ {
+ TaskHandle_t xReturn = NULL;
+ TCB_t * pxNewTCB;
+
+ traceENTER_xTaskCreateStatic( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, puxStackBuffer, pxTaskBuffer );
+
+ pxNewTCB = prvCreateStaticTask( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, puxStackBuffer, pxTaskBuffer, &xReturn );
+
+ if( pxNewTCB != NULL )
+ {
+ #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ {
+ /* Set the task's affinity before scheduling it. */
+ pxNewTCB->uxCoreAffinityMask = configTASK_DEFAULT_CORE_AFFINITY;
+ }
+ #endif
+
+ prvAddNewTaskToReadyList( pxNewTCB );
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ traceRETURN_xTaskCreateStatic( xReturn );
+
+ return xReturn;
+ }
+/*-----------------------------------------------------------*/
+
+ #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ TaskHandle_t xTaskCreateStaticAffinitySet( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ StackType_t * const puxStackBuffer,
+ StaticTask_t * const pxTaskBuffer,
+ UBaseType_t uxCoreAffinityMask )
+ {
+ TaskHandle_t xReturn = NULL;
+ TCB_t * pxNewTCB;
+
+ traceENTER_xTaskCreateStaticAffinitySet( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, puxStackBuffer, pxTaskBuffer, uxCoreAffinityMask );
+
+ pxNewTCB = prvCreateStaticTask( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, puxStackBuffer, pxTaskBuffer, &xReturn );
+
+ if( pxNewTCB != NULL )
+ {
+ /* Set the task's affinity before scheduling it. */
+ pxNewTCB->uxCoreAffinityMask = uxCoreAffinityMask;
+
+ prvAddNewTaskToReadyList( pxNewTCB );
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ traceRETURN_xTaskCreateStaticAffinitySet( xReturn );
+
+ return xReturn;
+ }
+ #endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) */
+
+#endif /* SUPPORT_STATIC_ALLOCATION */
+/*-----------------------------------------------------------*/
+
+#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
+ static TCB_t * prvCreateRestrictedStaticTask( const TaskParameters_t * const pxTaskDefinition,
+ TaskHandle_t * const pxCreatedTask )
+ {
+ TCB_t * pxNewTCB;
+
+ configASSERT( pxTaskDefinition->puxStackBuffer != NULL );
+ configASSERT( pxTaskDefinition->pxTaskBuffer != NULL );
+
+ if( ( pxTaskDefinition->puxStackBuffer != NULL ) && ( pxTaskDefinition->pxTaskBuffer != NULL ) )
+ {
+ /* Allocate space for the TCB. Where the memory comes from depends
+ * on the implementation of the port malloc function and whether or
+ * not static allocation is being used. */
+ pxNewTCB = ( TCB_t * ) pxTaskDefinition->pxTaskBuffer;
+ ( void ) memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
+
+ /* Store the stack location in the TCB. */
+ pxNewTCB->pxStack = pxTaskDefinition->puxStackBuffer;
+
+ #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
+ {
+ /* Tasks can be created statically or dynamically, so note this
+ * task was created statically in case the task is later deleted. */
+ pxNewTCB->ucStaticallyAllocated = tskSTATICALLY_ALLOCATED_STACK_AND_TCB;
+ }
+ #endif /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE */
+
+ prvInitialiseNewTask( pxTaskDefinition->pvTaskCode,
+ pxTaskDefinition->pcName,
+ pxTaskDefinition->usStackDepth,
+ pxTaskDefinition->pvParameters,
+ pxTaskDefinition->uxPriority,
+ pxCreatedTask, pxNewTCB,
+ pxTaskDefinition->xRegions );
+ }
+ else
+ {
+ pxNewTCB = NULL;
+ }
+
+ return pxNewTCB;
+ }
+/*-----------------------------------------------------------*/
+
+ BaseType_t xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition,
+ TaskHandle_t * pxCreatedTask )
+ {
+ TCB_t * pxNewTCB;
+ BaseType_t xReturn;
+
+ traceENTER_xTaskCreateRestrictedStatic( pxTaskDefinition, pxCreatedTask );
+
+ configASSERT( pxTaskDefinition != NULL );
+
+ pxNewTCB = prvCreateRestrictedStaticTask( pxTaskDefinition, pxCreatedTask );
+
+ if( pxNewTCB != NULL )
+ {
+ #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ {
+ /* Set the task's affinity before scheduling it. */
+ pxNewTCB->uxCoreAffinityMask = configTASK_DEFAULT_CORE_AFFINITY;
+ }
+ #endif
+
+ prvAddNewTaskToReadyList( pxNewTCB );
+ xReturn = pdPASS;
+ }
+ else
+ {
+ xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
+ }
+
+ traceRETURN_xTaskCreateRestrictedStatic( xReturn );
+
+ return xReturn;
+ }
+/*-----------------------------------------------------------*/
+
+ #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ BaseType_t xTaskCreateRestrictedStaticAffinitySet( const TaskParameters_t * const pxTaskDefinition,
+ UBaseType_t uxCoreAffinityMask,
+ TaskHandle_t * pxCreatedTask )
+ {
+ TCB_t * pxNewTCB;
+ BaseType_t xReturn;
+
+ traceENTER_xTaskCreateRestrictedStaticAffinitySet( pxTaskDefinition, uxCoreAffinityMask, pxCreatedTask );
+
+ configASSERT( pxTaskDefinition != NULL );
+
+ pxNewTCB = prvCreateRestrictedStaticTask( pxTaskDefinition, pxCreatedTask );
+
+ if( pxNewTCB != NULL )
+ {
+ /* Set the task's affinity before scheduling it. */
+ pxNewTCB->uxCoreAffinityMask = uxCoreAffinityMask;
+
+ prvAddNewTaskToReadyList( pxNewTCB );
+ xReturn = pdPASS;
+ }
+ else
+ {
+ xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
+ }
+
+ traceRETURN_xTaskCreateRestrictedStaticAffinitySet( xReturn );
+
+ return xReturn;
+ }
+ #endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) */
+
+#endif /* ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
+/*-----------------------------------------------------------*/
+
+#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
+ static TCB_t * prvCreateRestrictedTask( const TaskParameters_t * const pxTaskDefinition,
+ TaskHandle_t * const pxCreatedTask )
+ {
+ TCB_t * pxNewTCB;
+
+ configASSERT( pxTaskDefinition->puxStackBuffer );
+
+ if( pxTaskDefinition->puxStackBuffer != NULL )
+ {
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxNewTCB = ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) );
+
+ if( pxNewTCB != NULL )
+ {
+ ( void ) memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
+
+ /* Store the stack location in the TCB. */
+ pxNewTCB->pxStack = pxTaskDefinition->puxStackBuffer;
+
+ #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
+ {
+ /* Tasks can be created statically or dynamically, so note
+ * this task had a statically allocated stack in case it is
+ * later deleted. The TCB was allocated dynamically. */
+ pxNewTCB->ucStaticallyAllocated = tskSTATICALLY_ALLOCATED_STACK_ONLY;
+ }
+ #endif /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE */
+
+ prvInitialiseNewTask( pxTaskDefinition->pvTaskCode,
+ pxTaskDefinition->pcName,
+ pxTaskDefinition->usStackDepth,
+ pxTaskDefinition->pvParameters,
+ pxTaskDefinition->uxPriority,
+ pxCreatedTask, pxNewTCB,
+ pxTaskDefinition->xRegions );
+ }
+ }
+ else
+ {
+ pxNewTCB = NULL;
+ }
+
+ return pxNewTCB;
+ }
+/*-----------------------------------------------------------*/
+
+ BaseType_t xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition,
+ TaskHandle_t * pxCreatedTask )
+ {
+ TCB_t * pxNewTCB;
+ BaseType_t xReturn;
+
+ traceENTER_xTaskCreateRestricted( pxTaskDefinition, pxCreatedTask );
+
+ pxNewTCB = prvCreateRestrictedTask( pxTaskDefinition, pxCreatedTask );
+
+ if( pxNewTCB != NULL )
+ {
+ #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ {
+ /* Set the task's affinity before scheduling it. */
+ pxNewTCB->uxCoreAffinityMask = configTASK_DEFAULT_CORE_AFFINITY;
+ }
+ #endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) */
+
+ prvAddNewTaskToReadyList( pxNewTCB );
+
+ xReturn = pdPASS;
+ }
+ else
+ {
+ xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
+ }
+
+ traceRETURN_xTaskCreateRestricted( xReturn );
+
+ return xReturn;
+ }
+/*-----------------------------------------------------------*/
+
+ #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ BaseType_t xTaskCreateRestrictedAffinitySet( const TaskParameters_t * const pxTaskDefinition,
+ UBaseType_t uxCoreAffinityMask,
+ TaskHandle_t * pxCreatedTask )
+ {
+ TCB_t * pxNewTCB;
+ BaseType_t xReturn;
+
+ traceENTER_xTaskCreateRestrictedAffinitySet( pxTaskDefinition, uxCoreAffinityMask, pxCreatedTask );
+
+ pxNewTCB = prvCreateRestrictedTask( pxTaskDefinition, pxCreatedTask );
+
+ if( pxNewTCB != NULL )
+ {
+ /* Set the task's affinity before scheduling it. */
+ pxNewTCB->uxCoreAffinityMask = uxCoreAffinityMask;
+
+ prvAddNewTaskToReadyList( pxNewTCB );
+
+ xReturn = pdPASS;
+ }
+ else
+ {
+ xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
+ }
+
+ traceRETURN_xTaskCreateRestrictedAffinitySet( xReturn );
+
+ return xReturn;
+ }
+ #endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) */
+
+
+#endif /* portUSING_MPU_WRAPPERS */
+/*-----------------------------------------------------------*/
+
+#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
+ static TCB_t * prvCreateTask( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ TaskHandle_t * const pxCreatedTask )
+ {
+ TCB_t * pxNewTCB;
+
+ /* If the stack grows down then allocate the stack then the TCB so the stack
+ * does not grow into the TCB. Likewise if the stack grows up then allocate
+ * the TCB then the stack. */
+ #if ( portSTACK_GROWTH > 0 )
+ {
+ /* Allocate space for the TCB. Where the memory comes from depends on
+ * the implementation of the port malloc function and whether or not static
+ * allocation is being used. */
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxNewTCB = ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) );
+
+ if( pxNewTCB != NULL )
+ {
+ ( void ) memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
+
+ /* Allocate space for the stack used by the task being created.
+ * The base of the stack memory stored in the TCB so the task can
+ * be deleted later if required. */
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxNewTCB->pxStack = ( StackType_t * ) pvPortMallocStack( ( ( ( size_t ) uxStackDepth ) * sizeof( StackType_t ) ) );
+
+ if( pxNewTCB->pxStack == NULL )
+ {
+ /* Could not allocate the stack. Delete the allocated TCB. */
+ vPortFree( pxNewTCB );
+ pxNewTCB = NULL;
+ }
+ }
+ }
#else /* portSTACK_GROWTH */
{
StackType_t * pxStack;
/* Allocate space for the stack used by the task being created. */
- pxStack = pvPortMallocStack( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation is the stack. */
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxStack = pvPortMallocStack( ( ( ( size_t ) uxStackDepth ) * sizeof( StackType_t ) ) );
if( pxStack != NULL )
{
/* Allocate space for the TCB. */
- pxNewTCB = ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) ); /*lint !e9087 !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack, and the first member of TCB_t is always a pointer to the task's stack. */
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxNewTCB = ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) );
if( pxNewTCB != NULL )
{
- memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
+ ( void ) memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) );
/* Store the stack location in the TCB. */
pxNewTCB->pxStack = pxStack;
@@ -790,7 +1700,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
if( pxNewTCB != NULL )
{
- #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e9029 !e731 Macro has been consolidated for readability reasons. */
+ #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
{
/* Tasks can be created statically or dynamically, so note this
* task was created dynamically in case it is later deleted. */
@@ -798,7 +1708,36 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
}
#endif /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE */
- prvInitialiseNewTask( pxTaskCode, pcName, ( uint32_t ) usStackDepth, pvParameters, uxPriority, pxCreatedTask, pxNewTCB, NULL );
+ prvInitialiseNewTask( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, pxCreatedTask, pxNewTCB, NULL );
+ }
+
+ return pxNewTCB;
+ }
+/*-----------------------------------------------------------*/
+
+ BaseType_t xTaskCreate( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ TaskHandle_t * const pxCreatedTask )
+ {
+ TCB_t * pxNewTCB;
+ BaseType_t xReturn;
+
+ traceENTER_xTaskCreate( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, pxCreatedTask );
+
+ pxNewTCB = prvCreateTask( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, pxCreatedTask );
+
+ if( pxNewTCB != NULL )
+ {
+ #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ {
+ /* Set the task's affinity before scheduling it. */
+ pxNewTCB->uxCoreAffinityMask = configTASK_DEFAULT_CORE_AFFINITY;
+ }
+ #endif
+
prvAddNewTaskToReadyList( pxNewTCB );
xReturn = pdPASS;
}
@@ -807,15 +1746,53 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
}
+ traceRETURN_xTaskCreate( xReturn );
+
return xReturn;
}
+/*-----------------------------------------------------------*/
+
+ #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ BaseType_t xTaskCreateAffinitySet( TaskFunction_t pxTaskCode,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
+ void * const pvParameters,
+ UBaseType_t uxPriority,
+ UBaseType_t uxCoreAffinityMask,
+ TaskHandle_t * const pxCreatedTask )
+ {
+ TCB_t * pxNewTCB;
+ BaseType_t xReturn;
+
+ traceENTER_xTaskCreateAffinitySet( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, uxCoreAffinityMask, pxCreatedTask );
+
+ pxNewTCB = prvCreateTask( pxTaskCode, pcName, uxStackDepth, pvParameters, uxPriority, pxCreatedTask );
+
+ if( pxNewTCB != NULL )
+ {
+ /* Set the task's affinity before scheduling it. */
+ pxNewTCB->uxCoreAffinityMask = uxCoreAffinityMask;
+
+ prvAddNewTaskToReadyList( pxNewTCB );
+ xReturn = pdPASS;
+ }
+ else
+ {
+ xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
+ }
+
+ traceRETURN_xTaskCreateAffinitySet( xReturn );
+
+ return xReturn;
+ }
+ #endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) */
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
/*-----------------------------------------------------------*/
static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
- const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
- const uint32_t ulStackDepth,
+ const char * const pcName,
+ const configSTACK_DEPTH_TYPE uxStackDepth,
void * const pvParameters,
UBaseType_t uxPriority,
TaskHandle_t * const pxCreatedTask,
@@ -844,7 +1821,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
#if ( tskSET_NEW_STACKS_TO_KNOWN_VALUE == 1 )
{
/* Fill the stack with a known value to assist debugging. */
- ( void ) memset( pxNewTCB->pxStack, ( int ) tskSTACK_FILL_BYTE, ( size_t ) ulStackDepth * sizeof( StackType_t ) );
+ ( void ) memset( pxNewTCB->pxStack, ( int ) tskSTACK_FILL_BYTE, ( size_t ) uxStackDepth * sizeof( StackType_t ) );
}
#endif /* tskSET_NEW_STACKS_TO_KNOWN_VALUE */
@@ -854,11 +1831,11 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
* by the port. */
#if ( portSTACK_GROWTH < 0 )
{
- pxTopOfStack = &( pxNewTCB->pxStack[ ulStackDepth - ( uint32_t ) 1 ] );
- pxTopOfStack = ( StackType_t * ) ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) ); /*lint !e923 !e9033 !e9078 MISRA exception. Avoiding casts between pointers and integers is not practical. Size differences accounted for using portPOINTER_SIZE_TYPE type. Checked by assert(). */
+ pxTopOfStack = &( pxNewTCB->pxStack[ uxStackDepth - ( configSTACK_DEPTH_TYPE ) 1 ] );
+ pxTopOfStack = ( StackType_t * ) ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) );
/* Check the alignment of the calculated top of stack is correct. */
- configASSERT( ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack & ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) == 0UL ) );
+ configASSERT( ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack & ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) == 0U ) );
#if ( configRECORD_STACK_HIGH_ADDRESS == 1 )
{
@@ -871,13 +1848,14 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
#else /* portSTACK_GROWTH */
{
pxTopOfStack = pxNewTCB->pxStack;
+ pxTopOfStack = ( StackType_t * ) ( ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack ) + portBYTE_ALIGNMENT_MASK ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) );
- /* Check the alignment of the stack buffer is correct. */
- configASSERT( ( ( ( portPOINTER_SIZE_TYPE ) pxNewTCB->pxStack & ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) == 0UL ) );
+ /* Check the alignment of the calculated top of stack is correct. */
+ configASSERT( ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack & ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) == 0U ) );
/* The other extreme of the stack space is required if stack checking is
* performed. */
- pxNewTCB->pxEndOfStack = pxNewTCB->pxStack + ( ulStackDepth - ( uint32_t ) 1 );
+ pxNewTCB->pxEndOfStack = pxNewTCB->pxStack + ( uxStackDepth - ( configSTACK_DEPTH_TYPE ) 1 );
}
#endif /* portSTACK_GROWTH */
@@ -903,7 +1881,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
/* Ensure the name string is terminated in the case that the string length
* was greater or equal to configMAX_TASK_NAME_LEN. */
- pxNewTCB->pcTaskName[ configMAX_TASK_NAME_LEN - 1 ] = '\0';
+ pxNewTCB->pcTaskName[ configMAX_TASK_NAME_LEN - 1U ] = '\0';
}
else
{
@@ -937,12 +1915,12 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
listSET_LIST_ITEM_OWNER( &( pxNewTCB->xStateListItem ), pxNewTCB );
/* Event lists are always in priority order. */
- listSET_LIST_ITEM_VALUE( &( pxNewTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) uxPriority ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
+ listSET_LIST_ITEM_VALUE( &( pxNewTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) uxPriority );
listSET_LIST_ITEM_OWNER( &( pxNewTCB->xEventListItem ), pxNewTCB );
#if ( portUSING_MPU_WRAPPERS == 1 )
{
- vPortStoreTaskMPUSettings( &( pxNewTCB->xMPUSettings ), xRegions, pxNewTCB->pxStack, ulStackDepth );
+ vPortStoreTaskMPUSettings( &( pxNewTCB->xMPUSettings ), xRegions, pxNewTCB->pxStack, uxStackDepth );
}
#else
{
@@ -951,10 +1929,10 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
}
#endif
- #if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
+ #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
{
/* Allocate and initialize memory for the task's TLS Block. */
- configINIT_TLS_BLOCK( pxNewTCB->xTLSBlock );
+ configINIT_TLS_BLOCK( pxNewTCB->xTLSBlock, pxTopOfStack );
}
#endif
@@ -971,17 +1949,17 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
{
#if ( portSTACK_GROWTH < 0 )
{
- pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxNewTCB->pxStack, pxTaskCode, pvParameters, xRunPrivileged );
+ pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxNewTCB->pxStack, pxTaskCode, pvParameters, xRunPrivileged, &( pxNewTCB->xMPUSettings ) );
}
#else /* portSTACK_GROWTH */
{
- pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxNewTCB->pxEndOfStack, pxTaskCode, pvParameters, xRunPrivileged );
+ pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxNewTCB->pxEndOfStack, pxTaskCode, pvParameters, xRunPrivileged, &( pxNewTCB->xMPUSettings ) );
}
#endif /* portSTACK_GROWTH */
}
#else /* portHAS_STACK_OVERFLOW_CHECKING */
{
- pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxTaskCode, pvParameters, xRunPrivileged );
+ pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxTaskCode, pvParameters, xRunPrivileged, &( pxNewTCB->xMPUSettings ) );
}
#endif /* portHAS_STACK_OVERFLOW_CHECKING */
}
@@ -1002,109 +1980,210 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
}
#endif /* portSTACK_GROWTH */
}
- #else /* portHAS_STACK_OVERFLOW_CHECKING */
+ #else /* portHAS_STACK_OVERFLOW_CHECKING */
+ {
+ pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxTaskCode, pvParameters );
+ }
+ #endif /* portHAS_STACK_OVERFLOW_CHECKING */
+ }
+ #endif /* portUSING_MPU_WRAPPERS */
+
+ /* Initialize task state and task attributes. */
+ #if ( configNUMBER_OF_CORES > 1 )
+ {
+ pxNewTCB->xTaskRunState = taskTASK_NOT_RUNNING;
+
+ /* Is this an idle task? */
+ if( ( ( TaskFunction_t ) pxTaskCode == ( TaskFunction_t ) prvIdleTask ) || ( ( TaskFunction_t ) pxTaskCode == ( TaskFunction_t ) prvPassiveIdleTask ) )
+ {
+ pxNewTCB->uxTaskAttributes |= taskATTRIBUTE_IS_IDLE;
+ }
+ }
+ #endif /* #if ( configNUMBER_OF_CORES > 1 ) */
+
+ if( pxCreatedTask != NULL )
+ {
+ /* Pass the handle out in an anonymous way. The handle can be used to
+ * change the created task's priority, delete the created task, etc.*/
+ *pxCreatedTask = ( TaskHandle_t ) pxNewTCB;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+}
+/*-----------------------------------------------------------*/
+
+#if ( configNUMBER_OF_CORES == 1 )
+
+ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
+ {
+ /* Ensure interrupts don't access the task lists while the lists are being
+ * updated. */
+ taskENTER_CRITICAL();
+ {
+ uxCurrentNumberOfTasks = ( UBaseType_t ) ( uxCurrentNumberOfTasks + 1U );
+
+ if( pxCurrentTCB == NULL )
+ {
+ /* There are no other tasks, or all the other tasks are in
+ * the suspended state - make this the current task. */
+ pxCurrentTCB = pxNewTCB;
+
+ if( uxCurrentNumberOfTasks == ( UBaseType_t ) 1 )
+ {
+ /* This is the first task to be created so do the preliminary
+ * initialisation required. We will not recover if this call
+ * fails, but we will report the failure. */
+ prvInitialiseTaskLists();
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ /* If the scheduler is not already running, make this task the
+ * current task if it is the highest priority task to be created
+ * so far. */
+ if( xSchedulerRunning == pdFALSE )
+ {
+ if( pxCurrentTCB->uxPriority <= pxNewTCB->uxPriority )
+ {
+ pxCurrentTCB = pxNewTCB;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+
+ uxTaskNumber++;
+
+ #if ( configUSE_TRACE_FACILITY == 1 )
+ {
+ /* Add a counter into the TCB for tracing only. */
+ pxNewTCB->uxTCBNumber = uxTaskNumber;
+ }
+ #endif /* configUSE_TRACE_FACILITY */
+ traceTASK_CREATE( pxNewTCB );
+
+ prvAddTaskToReadyList( pxNewTCB );
+
+ portSETUP_TCB( pxNewTCB );
+ }
+ taskEXIT_CRITICAL();
+
+ if( xSchedulerRunning != pdFALSE )
+ {
+ /* If the created task is of a higher priority than the current task
+ * then it should run now. */
+ taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxNewTCB );
+ }
+ else
{
- pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxTaskCode, pvParameters );
+ mtCOVERAGE_TEST_MARKER();
}
- #endif /* portHAS_STACK_OVERFLOW_CHECKING */
}
- #endif /* portUSING_MPU_WRAPPERS */
- if( pxCreatedTask != NULL )
- {
- /* Pass the handle out in an anonymous way. The handle can be used to
- * change the created task's priority, delete the created task, etc.*/
- *pxCreatedTask = ( TaskHandle_t ) pxNewTCB;
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
- }
-}
-/*-----------------------------------------------------------*/
+#else /* #if ( configNUMBER_OF_CORES == 1 ) */
-static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
-{
- /* Ensure interrupts don't access the task lists while the lists are being
- * updated. */
- taskENTER_CRITICAL();
+ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
{
- uxCurrentNumberOfTasks++;
-
- if( pxCurrentTCB == NULL )
+ /* Ensure interrupts don't access the task lists while the lists are being
+ * updated. */
+ taskENTER_CRITICAL();
{
- /* There are no other tasks, or all the other tasks are in
- * the suspended state - make this the current task. */
- pxCurrentTCB = pxNewTCB;
+ uxCurrentNumberOfTasks++;
- if( uxCurrentNumberOfTasks == ( UBaseType_t ) 1 )
- {
- /* This is the first task to be created so do the preliminary
- * initialisation required. We will not recover if this call
- * fails, but we will report the failure. */
- prvInitialiseTaskLists();
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
- }
- }
- else
- {
- /* If the scheduler is not already running, make this task the
- * current task if it is the highest priority task to be created
- * so far. */
if( xSchedulerRunning == pdFALSE )
{
- if( pxCurrentTCB->uxPriority <= pxNewTCB->uxPriority )
+ if( uxCurrentNumberOfTasks == ( UBaseType_t ) 1 )
{
- pxCurrentTCB = pxNewTCB;
+ /* This is the first task to be created so do the preliminary
+ * initialisation required. We will not recover if this call
+ * fails, but we will report the failure. */
+ prvInitialiseTaskLists();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
+
+ /* All the cores start with idle tasks before the SMP scheduler
+ * is running. Idle tasks are assigned to cores when they are
+ * created in prvCreateIdleTasks(). */
}
- else
+
+ uxTaskNumber++;
+
+ #if ( configUSE_TRACE_FACILITY == 1 )
{
- mtCOVERAGE_TEST_MARKER();
+ /* Add a counter into the TCB for tracing only. */
+ pxNewTCB->uxTCBNumber = uxTaskNumber;
}
- }
+ #endif /* configUSE_TRACE_FACILITY */
+ traceTASK_CREATE( pxNewTCB );
- uxTaskNumber++;
+ prvAddTaskToReadyList( pxNewTCB );
- #if ( configUSE_TRACE_FACILITY == 1 )
- {
- /* Add a counter into the TCB for tracing only. */
- pxNewTCB->uxTCBNumber = uxTaskNumber;
+ portSETUP_TCB( pxNewTCB );
+
+ if( xSchedulerRunning != pdFALSE )
+ {
+ /* If the created task is of a higher priority than another
+ * currently running task and preemption is on then it should
+ * run now. */
+ taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxNewTCB );
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
- #endif /* configUSE_TRACE_FACILITY */
- traceTASK_CREATE( pxNewTCB );
+ taskEXIT_CRITICAL();
+ }
- prvAddTaskToReadyList( pxNewTCB );
+#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+/*-----------------------------------------------------------*/
- portSETUP_TCB( pxNewTCB );
- }
- taskEXIT_CRITICAL();
+#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )
- if( xSchedulerRunning != pdFALSE )
+ static size_t prvSnprintfReturnValueToCharsWritten( int iSnprintfReturnValue,
+ size_t n )
{
- /* If the created task is of a higher priority than the current task
- * then it should run now. */
- if( pxCurrentTCB->uxPriority < pxNewTCB->uxPriority )
+ size_t uxCharsWritten;
+
+ if( iSnprintfReturnValue < 0 )
+ {
+ /* Encoding error - Return 0 to indicate that nothing
+ * was written to the buffer. */
+ uxCharsWritten = 0;
+ }
+ else if( iSnprintfReturnValue >= ( int ) n )
{
- taskYIELD_IF_USING_PREEMPTION();
+ /* This is the case when the supplied buffer is not
+ * large to hold the generated string. Return the
+ * number of characters actually written without
+ * counting the terminating NULL character. */
+ uxCharsWritten = n - 1U;
}
else
{
- mtCOVERAGE_TEST_MARKER();
+ /* Complete string was written to the buffer. */
+ uxCharsWritten = ( size_t ) iSnprintfReturnValue;
}
+
+ return uxCharsWritten;
}
- else
- {
- mtCOVERAGE_TEST_MARKER();
- }
-}
+
+#endif /* #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) ) */
/*-----------------------------------------------------------*/
#if ( INCLUDE_vTaskDelete == 1 )
@@ -1112,6 +2191,10 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
void vTaskDelete( TaskHandle_t xTaskToDelete )
{
TCB_t * pxTCB;
+ BaseType_t xDeleteTCBInIdleTask = pdFALSE;
+ BaseType_t xTaskIsRunningOrYielding;
+
+ traceENTER_vTaskDelete( xTaskToDelete );
taskENTER_CRITICAL();
{
@@ -1145,13 +2228,22 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
* not return. */
uxTaskNumber++;
- if( pxTCB == pxCurrentTCB )
+ /* Use temp variable as distinct sequence points for reading volatile
+ * variables prior to a logical operator to ensure compliance with
+ * MISRA C 2012 Rule 13.5. */
+ xTaskIsRunningOrYielding = taskTASK_IS_RUNNING_OR_SCHEDULED_TO_YIELD( pxTCB );
+
+ /* If the task is running (or yielding), we must add it to the
+ * termination list so that an idle task can delete it when it is
+ * no longer running. */
+ if( ( xSchedulerRunning != pdFALSE ) && ( xTaskIsRunningOrYielding != pdFALSE ) )
{
- /* A task is deleting itself. This cannot complete within the
- * task itself, as a context switch to another task is required.
- * Place the task in the termination list. The idle task will
- * check the termination list and free up any memory allocated by
- * the scheduler for the TCB and stack of the deleted task. */
+ /* A running task or a task which is scheduled to yield is being
+ * deleted. This cannot complete when the task is still running
+ * on a core, as a context switch to another task is required.
+ * Place the task in the termination list. The idle task will check
+ * the termination list and free up any memory allocated by the
+ * scheduler for the TCB and stack of the deleted task. */
vListInsertEnd( &xTasksWaitingTermination, &( pxTCB->xStateListItem ) );
/* Increment the ucTasksDeleted variable so the idle task knows
@@ -1163,12 +2255,43 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
* portPRE_TASK_DELETE_HOOK() does not return in the Win32 port. */
traceTASK_DELETE( pxTCB );
+ /* Delete the task TCB in idle task. */
+ xDeleteTCBInIdleTask = pdTRUE;
+
/* The pre-delete hook is primarily for the Windows simulator,
* in which Windows specific clean up operations are performed,
* after which it is not possible to yield away from this task -
* hence xYieldPending is used to latch that a context switch is
* required. */
- portPRE_TASK_DELETE_HOOK( pxTCB, &xYieldPending );
+ #if ( configNUMBER_OF_CORES == 1 )
+ portPRE_TASK_DELETE_HOOK( pxTCB, &( xYieldPendings[ 0 ] ) );
+ #else
+ portPRE_TASK_DELETE_HOOK( pxTCB, &( xYieldPendings[ pxTCB->xTaskRunState ] ) );
+ #endif
+
+ /* In the case of SMP, it is possible that the task being deleted
+ * is running on another core. We must evict the task before
+ * exiting the critical section to ensure that the task cannot
+ * take an action which puts it back on ready/state/event list,
+ * thereby nullifying the delete operation. Once evicted, the
+ * task won't be scheduled ever as it will no longer be on the
+ * ready list. */
+ #if ( configNUMBER_OF_CORES > 1 )
+ {
+ if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE )
+ {
+ if( pxTCB->xTaskRunState == ( BaseType_t ) portGET_CORE_ID() )
+ {
+ configASSERT( uxSchedulerSuspended == 0 );
+ taskYIELD_WITHIN_API();
+ }
+ else
+ {
+ prvYieldCore( pxTCB->xTaskRunState );
+ }
+ }
+ }
+ #endif /* #if ( configNUMBER_OF_CORES > 1 ) */
}
else
{
@@ -1185,25 +2308,31 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
/* If the task is not deleting itself, call prvDeleteTCB from outside of
* critical section. If a task deletes itself, prvDeleteTCB is called
* from prvCheckTasksWaitingTermination which is called from Idle task. */
- if( pxTCB != pxCurrentTCB )
+ if( xDeleteTCBInIdleTask != pdTRUE )
{
prvDeleteTCB( pxTCB );
}
/* Force a reschedule if it is the currently running task that has just
* been deleted. */
- if( xSchedulerRunning != pdFALSE )
+ #if ( configNUMBER_OF_CORES == 1 )
{
- if( pxTCB == pxCurrentTCB )
- {
- configASSERT( uxSchedulerSuspended == 0 );
- portYIELD_WITHIN_API();
- }
- else
+ if( xSchedulerRunning != pdFALSE )
{
- mtCOVERAGE_TEST_MARKER();
+ if( pxTCB == pxCurrentTCB )
+ {
+ configASSERT( uxSchedulerSuspended == 0 );
+ taskYIELD_WITHIN_API();
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
}
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+
+ traceRETURN_vTaskDelete();
}
#endif /* INCLUDE_vTaskDelete */
@@ -1217,9 +2346,10 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
TickType_t xTimeToWake;
BaseType_t xAlreadyYielded, xShouldDelay = pdFALSE;
+ traceENTER_xTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement );
+
configASSERT( pxPreviousWakeTime );
configASSERT( ( xTimeIncrement > 0U ) );
- configASSERT( uxSchedulerSuspended == 0 );
vTaskSuspendAll();
{
@@ -1227,6 +2357,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
* block. */
const TickType_t xConstTickCount = xTickCount;
+ configASSERT( uxSchedulerSuspended == 1U );
+
/* Generate the tick time at which the task wants to wake. */
xTimeToWake = *pxPreviousWakeTime + xTimeIncrement;
@@ -1283,13 +2415,15 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
* have put ourselves to sleep. */
if( xAlreadyYielded == pdFALSE )
{
- portYIELD_WITHIN_API();
+ taskYIELD_WITHIN_API();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
+ traceRETURN_xTaskDelayUntil( xShouldDelay );
+
return xShouldDelay;
}
@@ -1302,12 +2436,15 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
{
BaseType_t xAlreadyYielded = pdFALSE;
+ traceENTER_vTaskDelay( xTicksToDelay );
+
/* A delay time of zero just forces a reschedule. */
if( xTicksToDelay > ( TickType_t ) 0U )
{
- configASSERT( uxSchedulerSuspended == 0 );
vTaskSuspendAll();
{
+ configASSERT( uxSchedulerSuspended == 1U );
+
traceTASK_DELAY();
/* A task that is removed from the event list while the
@@ -1330,12 +2467,14 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
* have put ourselves to sleep. */
if( xAlreadyYielded == pdFALSE )
{
- portYIELD_WITHIN_API();
+ taskYIELD_WITHIN_API();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
+
+ traceRETURN_vTaskDelay();
}
#endif /* INCLUDE_vTaskDelay */
@@ -1347,28 +2486,41 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
{
eTaskState eReturn;
List_t const * pxStateList;
+ List_t const * pxEventList;
List_t const * pxDelayedList;
List_t const * pxOverflowedDelayedList;
const TCB_t * const pxTCB = xTask;
+ traceENTER_eTaskGetState( xTask );
+
configASSERT( pxTCB );
- if( pxTCB == pxCurrentTCB )
- {
- /* The task calling this function is querying its own state. */
- eReturn = eRunning;
- }
- else
+ #if ( configNUMBER_OF_CORES == 1 )
+ if( pxTCB == pxCurrentTCB )
+ {
+ /* The task calling this function is querying its own state. */
+ eReturn = eRunning;
+ }
+ else
+ #endif
{
taskENTER_CRITICAL();
{
pxStateList = listLIST_ITEM_CONTAINER( &( pxTCB->xStateListItem ) );
+ pxEventList = listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) );
pxDelayedList = pxDelayedTaskList;
pxOverflowedDelayedList = pxOverflowDelayedTaskList;
}
taskEXIT_CRITICAL();
- if( ( pxStateList == pxDelayedList ) || ( pxStateList == pxOverflowedDelayedList ) )
+ if( pxEventList == &xPendingReadyList )
+ {
+ /* The task has been placed on the pending ready list, so its
+ * state is eReady regardless of what list the task's state list
+ * item is currently placed on. */
+ eReturn = eReady;
+ }
+ else if( ( pxStateList == pxDelayedList ) || ( pxStateList == pxOverflowedDelayedList ) )
{
/* The task being queried is referenced from one of the Blocked
* lists. */
@@ -1394,7 +2546,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
* suspended. */
eReturn = eSuspended;
- for( x = 0; x < configTASK_NOTIFICATION_ARRAY_ENTRIES; x++ )
+ for( x = ( BaseType_t ) 0; x < ( BaseType_t ) configTASK_NOTIFICATION_ARRAY_ENTRIES; x++ )
{
if( pxTCB->ucNotifyState[ x ] == taskWAITING_NOTIFICATION )
{
@@ -1426,16 +2578,36 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
}
#endif
- else /*lint !e525 Negative indentation is intended to make use of pre-processor clearer. */
+ else
{
- /* If the task is not in any other state, it must be in the
- * Ready (including pending ready) state. */
- eReturn = eReady;
+ #if ( configNUMBER_OF_CORES == 1 )
+ {
+ /* If the task is not in any other state, it must be in the
+ * Ready (including pending ready) state. */
+ eReturn = eReady;
+ }
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
+ {
+ if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE )
+ {
+ /* Is it actively running on a core? */
+ eReturn = eRunning;
+ }
+ else
+ {
+ /* If the task is not in any other state, it must be in the
+ * Ready (including pending ready) state. */
+ eReturn = eReady;
+ }
+ }
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
}
}
+ traceRETURN_eTaskGetState( eReturn );
+
return eReturn;
- } /*lint !e818 xTask cannot be a pointer to const because it is a typedef. */
+ }
#endif /* INCLUDE_eTaskGetState */
/*-----------------------------------------------------------*/
@@ -1447,6 +2619,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
TCB_t const * pxTCB;
UBaseType_t uxReturn;
+ traceENTER_uxTaskPriorityGet( xTask );
+
taskENTER_CRITICAL();
{
/* If null is passed in here then it is the priority of the task
@@ -1456,6 +2630,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
}
taskEXIT_CRITICAL();
+ traceRETURN_uxTaskPriorityGet( uxReturn );
+
return uxReturn;
}
@@ -1467,7 +2643,10 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
UBaseType_t uxTaskPriorityGetFromISR( const TaskHandle_t xTask )
{
TCB_t const * pxTCB;
- UBaseType_t uxReturn, uxSavedInterruptState;
+ UBaseType_t uxReturn;
+ UBaseType_t uxSavedInterruptStatus;
+
+ traceENTER_uxTaskPriorityGetFromISR( xTask );
/* RTOS ports that support interrupt nesting have the concept of a
* maximum system call (or maximum API call) interrupt priority.
@@ -1487,14 +2666,19 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
* https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
- uxSavedInterruptState = portSET_INTERRUPT_MASK_FROM_ISR();
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = ( UBaseType_t ) taskENTER_CRITICAL_FROM_ISR();
{
/* If null is passed in here then it is the priority of the calling
* task that is being queried. */
pxTCB = prvGetTCBFromHandle( xTask );
uxReturn = pxTCB->uxPriority;
}
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptState );
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
+
+ traceRETURN_uxTaskPriorityGetFromISR( uxReturn );
return uxReturn;
}
@@ -1502,6 +2686,80 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
#endif /* INCLUDE_uxTaskPriorityGet */
/*-----------------------------------------------------------*/
+#if ( ( INCLUDE_uxTaskPriorityGet == 1 ) && ( configUSE_MUTEXES == 1 ) )
+
+ UBaseType_t uxTaskBasePriorityGet( const TaskHandle_t xTask )
+ {
+ TCB_t const * pxTCB;
+ UBaseType_t uxReturn;
+
+ traceENTER_uxTaskBasePriorityGet( xTask );
+
+ taskENTER_CRITICAL();
+ {
+ /* If null is passed in here then it is the base priority of the task
+ * that called uxTaskBasePriorityGet() that is being queried. */
+ pxTCB = prvGetTCBFromHandle( xTask );
+ uxReturn = pxTCB->uxBasePriority;
+ }
+ taskEXIT_CRITICAL();
+
+ traceRETURN_uxTaskBasePriorityGet( uxReturn );
+
+ return uxReturn;
+ }
+
+#endif /* #if ( ( INCLUDE_uxTaskPriorityGet == 1 ) && ( configUSE_MUTEXES == 1 ) ) */
+/*-----------------------------------------------------------*/
+
+#if ( ( INCLUDE_uxTaskPriorityGet == 1 ) && ( configUSE_MUTEXES == 1 ) )
+
+ UBaseType_t uxTaskBasePriorityGetFromISR( const TaskHandle_t xTask )
+ {
+ TCB_t const * pxTCB;
+ UBaseType_t uxReturn;
+ UBaseType_t uxSavedInterruptStatus;
+
+ traceENTER_uxTaskBasePriorityGetFromISR( xTask );
+
+ /* RTOS ports that support interrupt nesting have the concept of a
+ * maximum system call (or maximum API call) interrupt priority.
+ * Interrupts that are above the maximum system call priority are keep
+ * permanently enabled, even when the RTOS kernel is in a critical section,
+ * but cannot make any calls to FreeRTOS API functions. If configASSERT()
+ * is defined in FreeRTOSConfig.h then
+ * portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion
+ * failure if a FreeRTOS API function is called from an interrupt that has
+ * been assigned a priority above the configured maximum system call
+ * priority. Only FreeRTOS functions that end in FromISR can be called
+ * from interrupts that have been assigned a priority at or (logically)
+ * below the maximum system call interrupt priority. FreeRTOS maintains a
+ * separate interrupt safe API to ensure interrupt entry is as fast and as
+ * simple as possible. More information (albeit Cortex-M specific) is
+ * provided on the following link:
+ * https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
+ portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
+
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = ( UBaseType_t ) taskENTER_CRITICAL_FROM_ISR();
+ {
+ /* If null is passed in here then it is the base priority of the calling
+ * task that is being queried. */
+ pxTCB = prvGetTCBFromHandle( xTask );
+ uxReturn = pxTCB->uxBasePriority;
+ }
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
+
+ traceRETURN_uxTaskBasePriorityGetFromISR( uxReturn );
+
+ return uxReturn;
+ }
+
+#endif /* #if ( ( INCLUDE_uxTaskPriorityGet == 1 ) && ( configUSE_MUTEXES == 1 ) ) */
+/*-----------------------------------------------------------*/
+
#if ( INCLUDE_vTaskPrioritySet == 1 )
void vTaskPrioritySet( TaskHandle_t xTask,
@@ -1511,6 +2769,12 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
UBaseType_t uxCurrentBasePriority, uxPriorityUsedOnEntry;
BaseType_t xYieldRequired = pdFALSE;
+ #if ( configNUMBER_OF_CORES > 1 )
+ BaseType_t xYieldForTask = pdFALSE;
+ #endif
+
+ traceENTER_vTaskPrioritySet( xTask, uxNewPriority );
+
configASSERT( uxNewPriority < configMAX_PRIORITIES );
/* Ensure the new priority is valid. */
@@ -1544,36 +2808,51 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
if( uxCurrentBasePriority != uxNewPriority )
{
/* The priority change may have readied a task of higher
- * priority than the calling task. */
+ * priority than a running task. */
if( uxNewPriority > uxCurrentBasePriority )
{
- if( pxTCB != pxCurrentTCB )
+ #if ( configNUMBER_OF_CORES == 1 )
{
- /* The priority of a task other than the currently
- * running task is being raised. Is the priority being
- * raised above that of the running task? */
- if( uxNewPriority >= pxCurrentTCB->uxPriority )
+ if( pxTCB != pxCurrentTCB )
{
- xYieldRequired = pdTRUE;
+ /* The priority of a task other than the currently
+ * running task is being raised. Is the priority being
+ * raised above that of the running task? */
+ if( uxNewPriority > pxCurrentTCB->uxPriority )
+ {
+ xYieldRequired = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
else
{
- mtCOVERAGE_TEST_MARKER();
+ /* The priority of the running task is being raised,
+ * but the running task must already be the highest
+ * priority task able to run so no yield is required. */
}
}
- else
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
{
- /* The priority of the running task is being raised,
- * but the running task must already be the highest
- * priority task able to run so no yield is required. */
+ /* The priority of a task is being raised so
+ * perform a yield for this task later. */
+ xYieldForTask = pdTRUE;
}
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
}
- else if( pxTCB == pxCurrentTCB )
+ else if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE )
{
- /* Setting the priority of the running task down means
+ /* Setting the priority of a running task down means
* there may now be another task of higher priority that
* is ready to execute. */
- xYieldRequired = pdTRUE;
+ #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
+ if( pxTCB->xPreemptionDisable == pdFALSE )
+ #endif
+ {
+ xYieldRequired = pdTRUE;
+ }
}
else
{
@@ -1590,8 +2869,9 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
#if ( configUSE_MUTEXES == 1 )
{
/* Only change the priority being used if the task is not
- * currently using an inherited priority. */
- if( pxTCB->uxBasePriority == pxTCB->uxPriority )
+ * currently using an inherited priority or the new priority
+ * is bigger than the inherited priority. */
+ if( ( pxTCB->uxBasePriority == pxTCB->uxPriority ) || ( uxNewPriority > pxTCB->uxPriority ) )
{
pxTCB->uxPriority = uxNewPriority;
}
@@ -1611,9 +2891,9 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
/* Only reset the event list item value if the value is not
* being used for anything else. */
- if( ( listGET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) == 0UL )
+ if( ( listGET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) == ( ( TickType_t ) 0U ) )
{
- listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) uxNewPriority ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
+ listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) uxNewPriority ) );
}
else
{
@@ -1638,34 +2918,202 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
}
else
{
- mtCOVERAGE_TEST_MARKER();
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ prvAddTaskToReadyList( pxTCB );
+ }
+ else
+ {
+ #if ( configNUMBER_OF_CORES == 1 )
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ #else
+ {
+ /* It's possible that xYieldForTask was already set to pdTRUE because
+ * its priority is being raised. However, since it is not in a ready list
+ * we don't actually need to yield for it. */
+ xYieldForTask = pdFALSE;
+ }
+ #endif
+ }
+
+ if( xYieldRequired != pdFALSE )
+ {
+ /* The running task priority is set down. Request the task to yield. */
+ taskYIELD_TASK_CORE_IF_USING_PREEMPTION( pxTCB );
+ }
+ else
+ {
+ #if ( configNUMBER_OF_CORES > 1 )
+ if( xYieldForTask != pdFALSE )
+ {
+ /* The priority of the task is being raised. If a running
+ * task has priority lower than this task, it should yield
+ * for this task. */
+ taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxTCB );
+ }
+ else
+ #endif /* if ( configNUMBER_OF_CORES > 1 ) */
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+
+ /* Remove compiler warning about unused variables when the port
+ * optimised task selection is not being used. */
+ ( void ) uxPriorityUsedOnEntry;
+ }
+ }
+ taskEXIT_CRITICAL();
+
+ traceRETURN_vTaskPrioritySet();
+ }
+
+#endif /* INCLUDE_vTaskPrioritySet */
+/*-----------------------------------------------------------*/
+
+#if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ void vTaskCoreAffinitySet( const TaskHandle_t xTask,
+ UBaseType_t uxCoreAffinityMask )
+ {
+ TCB_t * pxTCB;
+ BaseType_t xCoreID;
+ UBaseType_t uxPrevCoreAffinityMask;
+
+ #if ( configUSE_PREEMPTION == 1 )
+ UBaseType_t uxPrevNotAllowedCores;
+ #endif
+
+ traceENTER_vTaskCoreAffinitySet( xTask, uxCoreAffinityMask );
+
+ taskENTER_CRITICAL();
+ {
+ pxTCB = prvGetTCBFromHandle( xTask );
+
+ uxPrevCoreAffinityMask = pxTCB->uxCoreAffinityMask;
+ pxTCB->uxCoreAffinityMask = uxCoreAffinityMask;
+
+ if( xSchedulerRunning != pdFALSE )
+ {
+ if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE )
+ {
+ xCoreID = ( BaseType_t ) pxTCB->xTaskRunState;
+
+ /* If the task can no longer run on the core it was running,
+ * request the core to yield. */
+ if( ( uxCoreAffinityMask & ( ( UBaseType_t ) 1U << ( UBaseType_t ) xCoreID ) ) == 0U )
+ {
+ prvYieldCore( xCoreID );
}
-
- prvAddTaskToReadyList( pxTCB );
}
else
{
- mtCOVERAGE_TEST_MARKER();
+ #if ( configUSE_PREEMPTION == 1 )
+ {
+ /* Calculate the cores on which this task was not allowed to
+ * run previously. */
+ uxPrevNotAllowedCores = ( ~uxPrevCoreAffinityMask ) & ( ( 1U << configNUMBER_OF_CORES ) - 1U );
+
+ /* Does the new core mask enables this task to run on any of the
+ * previously not allowed cores? If yes, check if this task can be
+ * scheduled on any of those cores. */
+ if( ( uxPrevNotAllowedCores & uxCoreAffinityMask ) != 0U )
+ {
+ prvYieldForTask( pxTCB );
+ }
+ }
+ #else /* #if( configUSE_PREEMPTION == 1 ) */
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ #endif /* #if( configUSE_PREEMPTION == 1 ) */
}
+ }
+ }
+ taskEXIT_CRITICAL();
- if( xYieldRequired != pdFALSE )
- {
- taskYIELD_IF_USING_PREEMPTION();
- }
- else
+ traceRETURN_vTaskCoreAffinitySet();
+ }
+#endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) */
+/*-----------------------------------------------------------*/
+
+#if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+ UBaseType_t vTaskCoreAffinityGet( ConstTaskHandle_t xTask )
+ {
+ const TCB_t * pxTCB;
+ UBaseType_t uxCoreAffinityMask;
+
+ traceENTER_vTaskCoreAffinityGet( xTask );
+
+ taskENTER_CRITICAL();
+ {
+ pxTCB = prvGetTCBFromHandle( xTask );
+ uxCoreAffinityMask = pxTCB->uxCoreAffinityMask;
+ }
+ taskEXIT_CRITICAL();
+
+ traceRETURN_vTaskCoreAffinityGet( uxCoreAffinityMask );
+
+ return uxCoreAffinityMask;
+ }
+#endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) */
+
+/*-----------------------------------------------------------*/
+
+#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
+
+ void vTaskPreemptionDisable( const TaskHandle_t xTask )
+ {
+ TCB_t * pxTCB;
+
+ traceENTER_vTaskPreemptionDisable( xTask );
+
+ taskENTER_CRITICAL();
+ {
+ pxTCB = prvGetTCBFromHandle( xTask );
+
+ pxTCB->xPreemptionDisable = pdTRUE;
+ }
+ taskEXIT_CRITICAL();
+
+ traceRETURN_vTaskPreemptionDisable();
+ }
+
+#endif /* #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 ) */
+/*-----------------------------------------------------------*/
+
+#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
+
+ void vTaskPreemptionEnable( const TaskHandle_t xTask )
+ {
+ TCB_t * pxTCB;
+ BaseType_t xCoreID;
+
+ traceENTER_vTaskPreemptionEnable( xTask );
+
+ taskENTER_CRITICAL();
+ {
+ pxTCB = prvGetTCBFromHandle( xTask );
+
+ pxTCB->xPreemptionDisable = pdFALSE;
+
+ if( xSchedulerRunning != pdFALSE )
+ {
+ if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE )
{
- mtCOVERAGE_TEST_MARKER();
+ xCoreID = ( BaseType_t ) pxTCB->xTaskRunState;
+ prvYieldCore( xCoreID );
}
-
- /* Remove compiler warning about unused variables when the port
- * optimised task selection is not being used. */
- ( void ) uxPriorityUsedOnEntry;
}
}
taskEXIT_CRITICAL();
+
+ traceRETURN_vTaskPreemptionEnable();
}
-#endif /* INCLUDE_vTaskPrioritySet */
+#endif /* #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 ) */
/*-----------------------------------------------------------*/
#if ( INCLUDE_vTaskSuspend == 1 )
@@ -1674,6 +3122,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
{
TCB_t * pxTCB;
+ traceENTER_vTaskSuspend( xTaskToSuspend );
+
taskENTER_CRITICAL();
{
/* If null is passed in here then it is the running task that is
@@ -1709,7 +3159,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
{
BaseType_t x;
- for( x = 0; x < configTASK_NOTIFICATION_ARRAY_ENTRIES; x++ )
+ for( x = ( BaseType_t ) 0; x < ( BaseType_t ) configTASK_NOTIFICATION_ARRAY_ENTRIES; x++ )
{
if( pxTCB->ucNotifyState[ x ] == taskWAITING_NOTIFICATION )
{
@@ -1720,55 +3170,109 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
}
}
#endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
- }
- taskEXIT_CRITICAL();
- if( xSchedulerRunning != pdFALSE )
- {
- /* Reset the next expected unblock time in case it referred to the
- * task that is now in the Suspended state. */
- taskENTER_CRITICAL();
+ /* In the case of SMP, it is possible that the task being suspended
+ * is running on another core. We must evict the task before
+ * exiting the critical section to ensure that the task cannot
+ * take an action which puts it back on ready/state/event list,
+ * thereby nullifying the suspend operation. Once evicted, the
+ * task won't be scheduled before it is resumed as it will no longer
+ * be on the ready list. */
+ #if ( configNUMBER_OF_CORES > 1 )
{
- prvResetNextTaskUnblockTime();
+ if( xSchedulerRunning != pdFALSE )
+ {
+ /* Reset the next expected unblock time in case it referred to the
+ * task that is now in the Suspended state. */
+ prvResetNextTaskUnblockTime();
+
+ if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE )
+ {
+ if( pxTCB->xTaskRunState == ( BaseType_t ) portGET_CORE_ID() )
+ {
+ /* The current task has just been suspended. */
+ configASSERT( uxSchedulerSuspended == 0 );
+ vTaskYieldWithinAPI();
+ }
+ else
+ {
+ prvYieldCore( pxTCB->xTaskRunState );
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
- taskEXIT_CRITICAL();
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
+ #endif /* #if ( configNUMBER_OF_CORES > 1 ) */
}
+ taskEXIT_CRITICAL();
- if( pxTCB == pxCurrentTCB )
+ #if ( configNUMBER_OF_CORES == 1 )
{
+ UBaseType_t uxCurrentListLength;
+
if( xSchedulerRunning != pdFALSE )
{
- /* The current task has just been suspended. */
- configASSERT( uxSchedulerSuspended == 0 );
- portYIELD_WITHIN_API();
+ /* Reset the next expected unblock time in case it referred to the
+ * task that is now in the Suspended state. */
+ taskENTER_CRITICAL();
+ {
+ prvResetNextTaskUnblockTime();
+ }
+ taskEXIT_CRITICAL();
}
else
{
- /* The scheduler is not running, but the task that was pointed
- * to by pxCurrentTCB has just been suspended and pxCurrentTCB
- * must be adjusted to point to a different task. */
- if( listCURRENT_LIST_LENGTH( &xSuspendedTaskList ) == uxCurrentNumberOfTasks ) /*lint !e931 Right has no side effect, just volatile. */
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ if( pxTCB == pxCurrentTCB )
+ {
+ if( xSchedulerRunning != pdFALSE )
{
- /* No other tasks are ready, so set pxCurrentTCB back to
- * NULL so when the next task is created pxCurrentTCB will
- * be set to point to it no matter what its relative priority
- * is. */
- pxCurrentTCB = NULL;
+ /* The current task has just been suspended. */
+ configASSERT( uxSchedulerSuspended == 0 );
+ portYIELD_WITHIN_API();
}
else
{
- vTaskSwitchContext();
+ /* The scheduler is not running, but the task that was pointed
+ * to by pxCurrentTCB has just been suspended and pxCurrentTCB
+ * must be adjusted to point to a different task. */
+
+ /* Use a temp variable as a distinct sequence point for reading
+ * volatile variables prior to a comparison to ensure compliance
+ * with MISRA C 2012 Rule 13.2. */
+ uxCurrentListLength = listCURRENT_LIST_LENGTH( &xSuspendedTaskList );
+
+ if( uxCurrentListLength == uxCurrentNumberOfTasks )
+ {
+ /* No other tasks are ready, so set pxCurrentTCB back to
+ * NULL so when the next task is created pxCurrentTCB will
+ * be set to point to it no matter what its relative priority
+ * is. */
+ pxCurrentTCB = NULL;
+ }
+ else
+ {
+ vTaskSwitchContext();
+ }
}
}
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
- else
- {
- mtCOVERAGE_TEST_MARKER();
- }
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+
+ traceRETURN_vTaskSuspend();
}
#endif /* INCLUDE_vTaskSuspend */
@@ -1794,10 +3298,34 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
if( listIS_CONTAINED_WITHIN( &xPendingReadyList, &( pxTCB->xEventListItem ) ) == pdFALSE )
{
/* Is it in the suspended list because it is in the Suspended
- * state, or because is is blocked with no timeout? */
- if( listIS_CONTAINED_WITHIN( NULL, &( pxTCB->xEventListItem ) ) != pdFALSE ) /*lint !e961. The cast is only redundant when NULL is used. */
+ * state, or because it is blocked with no timeout? */
+ if( listIS_CONTAINED_WITHIN( NULL, &( pxTCB->xEventListItem ) ) != pdFALSE )
{
- xReturn = pdTRUE;
+ #if ( configUSE_TASK_NOTIFICATIONS == 1 )
+ {
+ BaseType_t x;
+
+ /* The task does not appear on the event list item of
+ * and of the RTOS objects, but could still be in the
+ * blocked state if it is waiting on its notification
+ * rather than waiting on an object. If not, is
+ * suspended. */
+ xReturn = pdTRUE;
+
+ for( x = ( BaseType_t ) 0; x < ( BaseType_t ) configTASK_NOTIFICATION_ARRAY_ENTRIES; x++ )
+ {
+ if( pxTCB->ucNotifyState[ x ] == taskWAITING_NOTIFICATION )
+ {
+ xReturn = pdFALSE;
+ break;
+ }
+ }
+ }
+ #else /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
+ {
+ xReturn = pdTRUE;
+ }
+ #endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
}
else
{
@@ -1815,7 +3343,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
}
return xReturn;
- } /*lint !e818 xTask cannot be a pointer to const because it is a typedef. */
+ }
#endif /* INCLUDE_vTaskSuspend */
/*-----------------------------------------------------------*/
@@ -1826,12 +3354,25 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
{
TCB_t * const pxTCB = xTaskToResume;
+ traceENTER_vTaskResume( xTaskToResume );
+
/* It does not make sense to resume the calling task. */
configASSERT( xTaskToResume );
- /* The parameter cannot be NULL as it is impossible to resume the
- * currently executing task. */
- if( ( pxTCB != pxCurrentTCB ) && ( pxTCB != NULL ) )
+ #if ( configNUMBER_OF_CORES == 1 )
+
+ /* The parameter cannot be NULL as it is impossible to resume the
+ * currently executing task. */
+ if( ( pxTCB != pxCurrentTCB ) && ( pxTCB != NULL ) )
+ #else
+
+ /* The parameter cannot be NULL as it is impossible to resume the
+ * currently executing task. It is also impossible to resume a task
+ * that is actively running on another core but it is not safe
+ * to check their run state here. Therefore, we get into a critical
+ * section and check if the task is actually suspended or not. */
+ if( pxTCB != NULL )
+ #endif
{
taskENTER_CRITICAL();
{
@@ -1844,18 +3385,10 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
( void ) uxListRemove( &( pxTCB->xStateListItem ) );
prvAddTaskToReadyList( pxTCB );
- /* A higher priority task may have just been resumed. */
- if( pxTCB->uxPriority >= pxCurrentTCB->uxPriority )
- {
- /* This yield may not cause the task just resumed to run,
- * but will leave the lists in the correct state for the
- * next yield. */
- taskYIELD_IF_USING_PREEMPTION();
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
- }
+ /* This yield may not cause the task just resumed to run,
+ * but will leave the lists in the correct state for the
+ * next yield. */
+ taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxTCB );
}
else
{
@@ -1868,6 +3401,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
{
mtCOVERAGE_TEST_MARKER();
}
+
+ traceRETURN_vTaskResume();
}
#endif /* INCLUDE_vTaskSuspend */
@@ -1882,6 +3417,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
TCB_t * const pxTCB = xTaskToResume;
UBaseType_t uxSavedInterruptStatus;
+ traceENTER_xTaskResumeFromISR( xTaskToResume );
+
configASSERT( xTaskToResume );
/* RTOS ports that support interrupt nesting have the concept of a
@@ -1902,30 +3439,37 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
* https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
- uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = taskENTER_CRITICAL_FROM_ISR();
{
if( prvTaskIsTaskSuspended( pxTCB ) != pdFALSE )
{
traceTASK_RESUME_FROM_ISR( pxTCB );
/* Check the ready lists can be accessed. */
- if( uxSchedulerSuspended == ( UBaseType_t ) pdFALSE )
+ if( uxSchedulerSuspended == ( UBaseType_t ) 0U )
{
- /* Ready lists can be accessed so move the task from the
- * suspended list to the ready list directly. */
- if( pxTCB->uxPriority >= pxCurrentTCB->uxPriority )
+ #if ( configNUMBER_OF_CORES == 1 )
{
- xYieldRequired = pdTRUE;
+ /* Ready lists can be accessed so move the task from the
+ * suspended list to the ready list directly. */
+ if( pxTCB->uxPriority > pxCurrentTCB->uxPriority )
+ {
+ xYieldRequired = pdTRUE;
- /* Mark that a yield is pending in case the user is not
- * using the return value to initiate a context switch
- * from the ISR using portYIELD_FROM_ISR. */
- xYieldPending = pdTRUE;
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
+ /* Mark that a yield is pending in case the user is not
+ * using the return value to initiate a context switch
+ * from the ISR using the port specific portYIELD_FROM_ISR(). */
+ xYieldPendings[ 0 ] = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
( void ) uxListRemove( &( pxTCB->xStateListItem ) );
prvAddTaskToReadyList( pxTCB );
@@ -1937,62 +3481,202 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
* unsuspended. */
vListInsertEnd( &( xPendingReadyList ), &( pxTCB->xEventListItem ) );
}
+
+ #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_PREEMPTION == 1 ) )
+ {
+ prvYieldForTask( pxTCB );
+
+ if( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE )
+ {
+ xYieldRequired = pdTRUE;
+ }
+ }
+ #endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_PREEMPTION == 1 ) ) */
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
+
+ traceRETURN_xTaskResumeFromISR( xYieldRequired );
+
+ return xYieldRequired;
+ }
+
+#endif /* ( ( INCLUDE_xTaskResumeFromISR == 1 ) && ( INCLUDE_vTaskSuspend == 1 ) ) */
+/*-----------------------------------------------------------*/
+
+static BaseType_t prvCreateIdleTasks( void )
+{
+ BaseType_t xReturn = pdPASS;
+ BaseType_t xCoreID;
+ char cIdleName[ configMAX_TASK_NAME_LEN ];
+ TaskFunction_t pxIdleTaskFunction = NULL;
+ BaseType_t xIdleTaskNameIndex;
+
+ for( xIdleTaskNameIndex = ( BaseType_t ) 0; xIdleTaskNameIndex < ( BaseType_t ) configMAX_TASK_NAME_LEN; xIdleTaskNameIndex++ )
+ {
+ cIdleName[ xIdleTaskNameIndex ] = configIDLE_TASK_NAME[ xIdleTaskNameIndex ];
+
+ /* Don't copy all configMAX_TASK_NAME_LEN if the string is shorter than
+ * configMAX_TASK_NAME_LEN characters just in case the memory after the
+ * string is not accessible (extremely unlikely). */
+ if( cIdleName[ xIdleTaskNameIndex ] == ( char ) 0x00 )
+ {
+ break;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+
+ /* Add each idle task at the lowest priority. */
+ for( xCoreID = ( BaseType_t ) 0; xCoreID < ( BaseType_t ) configNUMBER_OF_CORES; xCoreID++ )
+ {
+ #if ( configNUMBER_OF_CORES == 1 )
+ {
+ pxIdleTaskFunction = prvIdleTask;
+ }
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
+ {
+ /* In the FreeRTOS SMP, configNUMBER_OF_CORES - 1 passive idle tasks
+ * are also created to ensure that each core has an idle task to
+ * run when no other task is available to run. */
+ if( xCoreID == 0 )
+ {
+ pxIdleTaskFunction = prvIdleTask;
+ }
+ else
+ {
+ pxIdleTaskFunction = prvPassiveIdleTask;
+ }
+ }
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+
+ /* Update the idle task name with suffix to differentiate the idle tasks.
+ * This function is not required in single core FreeRTOS since there is
+ * only one idle task. */
+ #if ( configNUMBER_OF_CORES > 1 )
+ {
+ /* Append the idle task number to the end of the name if there is space. */
+ if( xIdleTaskNameIndex < ( BaseType_t ) configMAX_TASK_NAME_LEN )
+ {
+ cIdleName[ xIdleTaskNameIndex ] = ( char ) ( xCoreID + '0' );
+
+ /* And append a null character if there is space. */
+ if( ( xIdleTaskNameIndex + 1 ) < ( BaseType_t ) configMAX_TASK_NAME_LEN )
+ {
+ cIdleName[ xIdleTaskNameIndex + 1 ] = '\0';
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ #endif /* if ( configNUMBER_OF_CORES > 1 ) */
+
+ #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ {
+ StaticTask_t * pxIdleTaskTCBBuffer = NULL;
+ StackType_t * pxIdleTaskStackBuffer = NULL;
+ configSTACK_DEPTH_TYPE uxIdleTaskStackSize;
+
+ /* The Idle task is created using user provided RAM - obtain the
+ * address of the RAM then create the idle task. */
+ #if ( configNUMBER_OF_CORES == 1 )
+ {
+ vApplicationGetIdleTaskMemory( &pxIdleTaskTCBBuffer, &pxIdleTaskStackBuffer, &uxIdleTaskStackSize );
+ }
+ #else
+ {
+ if( xCoreID == 0 )
+ {
+ vApplicationGetIdleTaskMemory( &pxIdleTaskTCBBuffer, &pxIdleTaskStackBuffer, &uxIdleTaskStackSize );
+ }
+ else
+ {
+ vApplicationGetPassiveIdleTaskMemory( &pxIdleTaskTCBBuffer, &pxIdleTaskStackBuffer, &uxIdleTaskStackSize, ( BaseType_t ) ( xCoreID - 1 ) );
+ }
+ }
+ #endif /* if ( configNUMBER_OF_CORES == 1 ) */
+ xIdleTaskHandles[ xCoreID ] = xTaskCreateStatic( pxIdleTaskFunction,
+ cIdleName,
+ uxIdleTaskStackSize,
+ ( void * ) NULL,
+ portPRIVILEGE_BIT, /* In effect ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), but tskIDLE_PRIORITY is zero. */
+ pxIdleTaskStackBuffer,
+ pxIdleTaskTCBBuffer );
+
+ if( xIdleTaskHandles[ xCoreID ] != NULL )
+ {
+ xReturn = pdPASS;
}
else
+ {
+ xReturn = pdFAIL;
+ }
+ }
+ #else /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
+ {
+ /* The Idle task is being created using dynamically allocated RAM. */
+ xReturn = xTaskCreate( pxIdleTaskFunction,
+ cIdleName,
+ configMINIMAL_STACK_SIZE,
+ ( void * ) NULL,
+ portPRIVILEGE_BIT, /* In effect ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), but tskIDLE_PRIORITY is zero. */
+ &xIdleTaskHandles[ xCoreID ] );
+ }
+ #endif /* configSUPPORT_STATIC_ALLOCATION */
+
+ /* Break the loop if any of the idle task is failed to be created. */
+ if( xReturn == pdFAIL )
+ {
+ break;
+ }
+ else
+ {
+ #if ( configNUMBER_OF_CORES == 1 )
{
mtCOVERAGE_TEST_MARKER();
}
+ #else
+ {
+ /* Assign idle task to each core before SMP scheduler is running. */
+ xIdleTaskHandles[ xCoreID ]->xTaskRunState = xCoreID;
+ pxCurrentTCBs[ xCoreID ] = xIdleTaskHandles[ xCoreID ];
+ }
+ #endif
}
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
-
- return xYieldRequired;
}
-#endif /* ( ( INCLUDE_xTaskResumeFromISR == 1 ) && ( INCLUDE_vTaskSuspend == 1 ) ) */
+ return xReturn;
+}
+
/*-----------------------------------------------------------*/
void vTaskStartScheduler( void )
{
BaseType_t xReturn;
- /* Add the idle task at the lowest priority. */
- #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
- {
- StaticTask_t * pxIdleTaskTCBBuffer = NULL;
- StackType_t * pxIdleTaskStackBuffer = NULL;
- uint32_t ulIdleTaskStackSize;
-
- /* The Idle task is created using user provided RAM - obtain the
- * address of the RAM then create the idle task. */
- vApplicationGetIdleTaskMemory( &pxIdleTaskTCBBuffer, &pxIdleTaskStackBuffer, &ulIdleTaskStackSize );
- xIdleTaskHandle = xTaskCreateStatic( prvIdleTask,
- configIDLE_TASK_NAME,
- ulIdleTaskStackSize,
- ( void * ) NULL, /*lint !e961. The cast is not redundant for all compilers. */
- portPRIVILEGE_BIT, /* In effect ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), but tskIDLE_PRIORITY is zero. */
- pxIdleTaskStackBuffer,
- pxIdleTaskTCBBuffer ); /*lint !e961 MISRA exception, justified as it is not a redundant explicit cast to all supported compilers. */
+ traceENTER_vTaskStartScheduler();
- if( xIdleTaskHandle != NULL )
- {
- xReturn = pdPASS;
- }
- else
- {
- xReturn = pdFAIL;
- }
- }
- #else /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
+ #if ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 )
{
- /* The Idle task is being created using dynamically allocated RAM. */
- xReturn = xTaskCreate( prvIdleTask,
- configIDLE_TASK_NAME,
- configMINIMAL_STACK_SIZE,
- ( void * ) NULL,
- portPRIVILEGE_BIT, /* In effect ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), but tskIDLE_PRIORITY is zero. */
- &xIdleTaskHandle ); /*lint !e961 MISRA exception, justified as it is not a redundant explicit cast to all supported compilers. */
+ /* Sanity check that the UBaseType_t must have greater than or equal to
+ * the number of bits as confNUMBER_OF_CORES. */
+ configASSERT( ( sizeof( UBaseType_t ) * taskBITS_PER_BYTE ) >= configNUMBER_OF_CORES );
}
- #endif /* configSUPPORT_STATIC_ALLOCATION */
+ #endif /* #if ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) */
+
+ xReturn = prvCreateIdleTasks();
#if ( configUSE_TIMERS == 1 )
{
@@ -2025,7 +3709,7 @@ void vTaskStartScheduler( void )
* starts to run. */
portDISABLE_INTERRUPTS();
- #if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
+ #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
{
/* Switch C-Runtime's TLS Block to point to the TLS
* block specific to the task that will run first. */
@@ -2049,7 +3733,10 @@ void vTaskStartScheduler( void )
/* Setting up the timer tick is hardware specific and thus in the
* portable interface. */
- xPortStartScheduler();
+
+ /* The return value for xPortStartScheduler is not required
+ * hence using a void datatype. */
+ ( void ) xPortStartScheduler();
/* In most cases, xPortStartScheduler() will not return. If it
* returns pdTRUE then there was not enough heap memory available
@@ -2067,45 +3754,139 @@ void vTaskStartScheduler( void )
}
/* Prevent compiler warnings if INCLUDE_xTaskGetIdleTaskHandle is set to 0,
- * meaning xIdleTaskHandle is not used anywhere else. */
- ( void ) xIdleTaskHandle;
+ * meaning xIdleTaskHandles are not used anywhere else. */
+ ( void ) xIdleTaskHandles;
/* OpenOCD makes use of uxTopUsedPriority for thread debugging. Prevent uxTopUsedPriority
* from getting optimized out as it is no longer used by the kernel. */
( void ) uxTopUsedPriority;
+
+ traceRETURN_vTaskStartScheduler();
}
/*-----------------------------------------------------------*/
void vTaskEndScheduler( void )
{
+ traceENTER_vTaskEndScheduler();
+
+ #if ( INCLUDE_vTaskDelete == 1 )
+ {
+ BaseType_t xCoreID;
+
+ #if ( configUSE_TIMERS == 1 )
+ {
+ /* Delete the timer task created by the kernel. */
+ vTaskDelete( xTimerGetTimerDaemonTaskHandle() );
+ }
+ #endif /* #if ( configUSE_TIMERS == 1 ) */
+
+ /* Delete Idle tasks created by the kernel.*/
+ for( xCoreID = 0; xCoreID < ( BaseType_t ) configNUMBER_OF_CORES; xCoreID++ )
+ {
+ vTaskDelete( xIdleTaskHandles[ xCoreID ] );
+ }
+
+ /* Idle task is responsible for reclaiming the resources of the tasks in
+ * xTasksWaitingTermination list. Since the idle task is now deleted and
+ * no longer going to run, we need to reclaim resources of all the tasks
+ * in the xTasksWaitingTermination list. */
+ prvCheckTasksWaitingTermination();
+ }
+ #endif /* #if ( INCLUDE_vTaskDelete == 1 ) */
+
/* Stop the scheduler interrupts and call the portable scheduler end
* routine so the original ISRs can be restored if necessary. The port
* layer must ensure interrupts enable bit is left in the correct state. */
portDISABLE_INTERRUPTS();
xSchedulerRunning = pdFALSE;
+
+ /* This function must be called from a task and the application is
+ * responsible for deleting that task after the scheduler is stopped. */
vPortEndScheduler();
+
+ traceRETURN_vTaskEndScheduler();
}
/*----------------------------------------------------------*/
void vTaskSuspendAll( void )
{
- /* A critical section is not required as the variable is of type
- * BaseType_t. Please read Richard Barry's reply in the following link to a
- * post in the FreeRTOS support forum before reporting this as a bug! -
- * https://goo.gl/wu4acr */
-
- /* portSOFTWARE_BARRIER() is only implemented for emulated/simulated ports that
- * do not otherwise exhibit real time behaviour. */
- portSOFTWARE_BARRIER();
-
- /* The scheduler is suspended if uxSchedulerSuspended is non-zero. An increment
- * is used to allow calls to vTaskSuspendAll() to nest. */
- ++uxSchedulerSuspended;
-
- /* Enforces ordering for ports and optimised compilers that may otherwise place
- * the above increment elsewhere. */
- portMEMORY_BARRIER();
+ traceENTER_vTaskSuspendAll();
+
+ #if ( configNUMBER_OF_CORES == 1 )
+ {
+ /* A critical section is not required as the variable is of type
+ * BaseType_t. Please read Richard Barry's reply in the following link to a
+ * post in the FreeRTOS support forum before reporting this as a bug! -
+ * https://goo.gl/wu4acr */
+
+ /* portSOFTWARE_BARRIER() is only implemented for emulated/simulated ports that
+ * do not otherwise exhibit real time behaviour. */
+ portSOFTWARE_BARRIER();
+
+ /* The scheduler is suspended if uxSchedulerSuspended is non-zero. An increment
+ * is used to allow calls to vTaskSuspendAll() to nest. */
+ uxSchedulerSuspended = ( UBaseType_t ) ( uxSchedulerSuspended + 1U );
+
+ /* Enforces ordering for ports and optimised compilers that may otherwise place
+ * the above increment elsewhere. */
+ portMEMORY_BARRIER();
+ }
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
+ {
+ UBaseType_t ulState;
+
+ /* This must only be called from within a task. */
+ portASSERT_IF_IN_ISR();
+
+ if( xSchedulerRunning != pdFALSE )
+ {
+ /* Writes to uxSchedulerSuspended must be protected by both the task AND ISR locks.
+ * We must disable interrupts before we grab the locks in the event that this task is
+ * interrupted and switches context before incrementing uxSchedulerSuspended.
+ * It is safe to re-enable interrupts after releasing the ISR lock and incrementing
+ * uxSchedulerSuspended since that will prevent context switches. */
+ ulState = portSET_INTERRUPT_MASK();
+
+ /* This must never be called from inside a critical section. */
+ configASSERT( portGET_CRITICAL_NESTING_COUNT() == 0 );
+
+ /* portSOFRWARE_BARRIER() is only implemented for emulated/simulated ports that
+ * do not otherwise exhibit real time behaviour. */
+ portSOFTWARE_BARRIER();
+
+ portGET_TASK_LOCK();
+
+ /* uxSchedulerSuspended is increased after prvCheckForRunStateChange. The
+ * purpose is to prevent altering the variable when fromISR APIs are readying
+ * it. */
+ if( uxSchedulerSuspended == 0U )
+ {
+ prvCheckForRunStateChange();
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ portGET_ISR_LOCK();
+
+ /* The scheduler is suspended if uxSchedulerSuspended is non-zero. An increment
+ * is used to allow calls to vTaskSuspendAll() to nest. */
+ ++uxSchedulerSuspended;
+ portRELEASE_ISR_LOCK();
+
+ portCLEAR_INTERRUPT_MASK( ulState );
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+
+ traceRETURN_vTaskSuspendAll();
}
+
/*----------------------------------------------------------*/
#if ( configUSE_TICKLESS_IDLE != 0 )
@@ -2146,7 +3927,7 @@ void vTaskSuspendAll( void )
{
xReturn = 0;
}
- else if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) > 1 )
+ else if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) > 1U )
{
/* There are other idle priority tasks in the ready state. If
* time slicing is used then the very next tick interrupt must be
@@ -2162,7 +3943,8 @@ void vTaskSuspendAll( void )
}
else
{
- xReturn = xNextTaskUnblockTime - xTickCount;
+ xReturn = xNextTaskUnblockTime;
+ xReturn -= xTickCount;
}
return xReturn;
@@ -2176,108 +3958,146 @@ BaseType_t xTaskResumeAll( void )
TCB_t * pxTCB = NULL;
BaseType_t xAlreadyYielded = pdFALSE;
- /* If uxSchedulerSuspended is zero then this function does not match a
- * previous call to vTaskSuspendAll(). */
- configASSERT( uxSchedulerSuspended );
+ traceENTER_xTaskResumeAll();
- /* It is possible that an ISR caused a task to be removed from an event
- * list while the scheduler was suspended. If this was the case then the
- * removed task will have been added to the xPendingReadyList. Once the
- * scheduler has been resumed it is safe to move all the pending ready
- * tasks from this list into their appropriate ready list. */
- taskENTER_CRITICAL();
+ #if ( configNUMBER_OF_CORES > 1 )
+ if( xSchedulerRunning != pdFALSE )
+ #endif
{
- --uxSchedulerSuspended;
-
- if( uxSchedulerSuspended == ( UBaseType_t ) pdFALSE )
+ /* It is possible that an ISR caused a task to be removed from an event
+ * list while the scheduler was suspended. If this was the case then the
+ * removed task will have been added to the xPendingReadyList. Once the
+ * scheduler has been resumed it is safe to move all the pending ready
+ * tasks from this list into their appropriate ready list. */
+ taskENTER_CRITICAL();
{
- if( uxCurrentNumberOfTasks > ( UBaseType_t ) 0U )
- {
- /* Move any readied tasks from the pending list into the
- * appropriate ready list. */
- while( listLIST_IS_EMPTY( &xPendingReadyList ) == pdFALSE )
- {
- pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyList ) ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
- listREMOVE_ITEM( &( pxTCB->xEventListItem ) );
- portMEMORY_BARRIER();
- listREMOVE_ITEM( &( pxTCB->xStateListItem ) );
- prvAddTaskToReadyList( pxTCB );
+ BaseType_t xCoreID;
+ xCoreID = ( BaseType_t ) portGET_CORE_ID();
- /* If the moved task has a priority higher than or equal to
- * the current task then a yield must be performed. */
- if( pxTCB->uxPriority >= pxCurrentTCB->uxPriority )
- {
- xYieldPending = pdTRUE;
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
- }
- }
+ /* If uxSchedulerSuspended is zero then this function does not match a
+ * previous call to vTaskSuspendAll(). */
+ configASSERT( uxSchedulerSuspended != 0U );
- if( pxTCB != NULL )
- {
- /* A task was unblocked while the scheduler was suspended,
- * which may have prevented the next unblock time from being
- * re-calculated, in which case re-calculate it now. Mainly
- * important for low power tickless implementations, where
- * this can prevent an unnecessary exit from low power
- * state. */
- prvResetNextTaskUnblockTime();
- }
+ uxSchedulerSuspended = ( UBaseType_t ) ( uxSchedulerSuspended - 1U );
+ portRELEASE_TASK_LOCK();
- /* If any ticks occurred while the scheduler was suspended then
- * they should be processed now. This ensures the tick count does
- * not slip, and that any delayed tasks are resumed at the correct
- * time. */
+ if( uxSchedulerSuspended == ( UBaseType_t ) 0U )
+ {
+ if( uxCurrentNumberOfTasks > ( UBaseType_t ) 0U )
{
- TickType_t xPendedCounts = xPendedTicks; /* Non-volatile copy. */
-
- if( xPendedCounts > ( TickType_t ) 0U )
+ /* Move any readied tasks from the pending list into the
+ * appropriate ready list. */
+ while( listLIST_IS_EMPTY( &xPendingReadyList ) == pdFALSE )
{
- do
+ /* MISRA Ref 11.5.3 [Void pointer assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyList ) );
+ listREMOVE_ITEM( &( pxTCB->xEventListItem ) );
+ portMEMORY_BARRIER();
+ listREMOVE_ITEM( &( pxTCB->xStateListItem ) );
+ prvAddTaskToReadyList( pxTCB );
+
+ #if ( configNUMBER_OF_CORES == 1 )
{
- if( xTaskIncrementTick() != pdFALSE )
+ /* If the moved task has a priority higher than the current
+ * task then a yield must be performed. */
+ if( pxTCB->uxPriority > pxCurrentTCB->uxPriority )
{
- xYieldPending = pdTRUE;
+ xYieldPendings[ xCoreID ] = pdTRUE;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
+ }
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
+ {
+ /* All appropriate tasks yield at the moment a task is added to xPendingReadyList.
+ * If the current core yielded then vTaskSwitchContext() has already been called
+ * which sets xYieldPendings for the current core to pdTRUE. */
+ }
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+ }
- --xPendedCounts;
- } while( xPendedCounts > ( TickType_t ) 0U );
-
- xPendedTicks = 0;
+ if( pxTCB != NULL )
+ {
+ /* A task was unblocked while the scheduler was suspended,
+ * which may have prevented the next unblock time from being
+ * re-calculated, in which case re-calculate it now. Mainly
+ * important for low power tickless implementations, where
+ * this can prevent an unnecessary exit from low power
+ * state. */
+ prvResetNextTaskUnblockTime();
}
- else
+
+ /* If any ticks occurred while the scheduler was suspended then
+ * they should be processed now. This ensures the tick count does
+ * not slip, and that any delayed tasks are resumed at the correct
+ * time.
+ *
+ * It should be safe to call xTaskIncrementTick here from any core
+ * since we are in a critical section and xTaskIncrementTick itself
+ * protects itself within a critical section. Suspending the scheduler
+ * from any core causes xTaskIncrementTick to increment uxPendedCounts. */
{
- mtCOVERAGE_TEST_MARKER();
+ TickType_t xPendedCounts = xPendedTicks; /* Non-volatile copy. */
+
+ if( xPendedCounts > ( TickType_t ) 0U )
+ {
+ do
+ {
+ if( xTaskIncrementTick() != pdFALSE )
+ {
+ /* Other cores are interrupted from
+ * within xTaskIncrementTick(). */
+ xYieldPendings[ xCoreID ] = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ --xPendedCounts;
+ } while( xPendedCounts > ( TickType_t ) 0U );
+
+ xPendedTicks = 0;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
- }
- if( xYieldPending != pdFALSE )
- {
- #if ( configUSE_PREEMPTION != 0 )
+ if( xYieldPendings[ xCoreID ] != pdFALSE )
{
- xAlreadyYielded = pdTRUE;
+ #if ( configUSE_PREEMPTION != 0 )
+ {
+ xAlreadyYielded = pdTRUE;
+ }
+ #endif /* #if ( configUSE_PREEMPTION != 0 ) */
+
+ #if ( configNUMBER_OF_CORES == 1 )
+ {
+ taskYIELD_TASK_CORE_IF_USING_PREEMPTION( pxCurrentTCB );
+ }
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
}
- #endif
- taskYIELD_IF_USING_PREEMPTION();
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
}
}
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
- else
- {
- mtCOVERAGE_TEST_MARKER();
- }
+ taskEXIT_CRITICAL();
}
- taskEXIT_CRITICAL();
+
+ traceRETURN_xTaskResumeAll( xAlreadyYielded );
return xAlreadyYielded;
}
@@ -2287,6 +4107,8 @@ TickType_t xTaskGetTickCount( void )
{
TickType_t xTicks;
+ traceENTER_xTaskGetTickCount();
+
/* Critical section required if running on a 16 bit processor. */
portTICK_TYPE_ENTER_CRITICAL();
{
@@ -2294,6 +4116,8 @@ TickType_t xTaskGetTickCount( void )
}
portTICK_TYPE_EXIT_CRITICAL();
+ traceRETURN_xTaskGetTickCount( xTicks );
+
return xTicks;
}
/*-----------------------------------------------------------*/
@@ -2303,6 +4127,8 @@ TickType_t xTaskGetTickCountFromISR( void )
TickType_t xReturn;
UBaseType_t uxSavedInterruptStatus;
+ traceENTER_xTaskGetTickCountFromISR();
+
/* RTOS ports that support interrupt nesting have the concept of a maximum
* system call (or maximum API call) interrupt priority. Interrupts that are
* above the maximum system call priority are kept permanently enabled, even
@@ -2325,51 +4151,63 @@ TickType_t xTaskGetTickCountFromISR( void )
}
portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+ traceRETURN_xTaskGetTickCountFromISR( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
UBaseType_t uxTaskGetNumberOfTasks( void )
{
+ traceENTER_uxTaskGetNumberOfTasks();
+
/* A critical section is not required because the variables are of type
* BaseType_t. */
+ traceRETURN_uxTaskGetNumberOfTasks( uxCurrentNumberOfTasks );
+
return uxCurrentNumberOfTasks;
}
/*-----------------------------------------------------------*/
-char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+char * pcTaskGetName( TaskHandle_t xTaskToQuery )
{
TCB_t * pxTCB;
+ traceENTER_pcTaskGetName( xTaskToQuery );
+
/* If null is passed in here then the name of the calling task is being
* queried. */
pxTCB = prvGetTCBFromHandle( xTaskToQuery );
configASSERT( pxTCB );
+
+ traceRETURN_pcTaskGetName( &( pxTCB->pcTaskName[ 0 ] ) );
+
return &( pxTCB->pcTaskName[ 0 ] );
}
/*-----------------------------------------------------------*/
#if ( INCLUDE_xTaskGetHandle == 1 )
-
static TCB_t * prvSearchForNameWithinSingleList( List_t * pxList,
const char pcNameToQuery[] )
{
- TCB_t * pxNextTCB;
- TCB_t * pxFirstTCB;
TCB_t * pxReturn = NULL;
+ TCB_t * pxTCB = NULL;
UBaseType_t x;
char cNextChar;
BaseType_t xBreakLoop;
+ const ListItem_t * pxEndMarker = listGET_END_MARKER( pxList );
+ ListItem_t * pxIterator;
/* This function is called with the scheduler suspended. */
if( listCURRENT_LIST_LENGTH( pxList ) > ( UBaseType_t ) 0 )
{
- listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
-
- do
+ for( pxIterator = listGET_HEAD_ENTRY( pxList ); pxIterator != pxEndMarker; pxIterator = listGET_NEXT( pxIterator ) )
{
- listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
+ /* MISRA Ref 11.5.3 [Void pointer assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxTCB = listGET_LIST_ITEM_OWNER( pxIterator );
/* Check each character in the name looking for a match or
* mismatch. */
@@ -2377,7 +4215,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
for( x = ( UBaseType_t ) 0; x < ( UBaseType_t ) configMAX_TASK_NAME_LEN; x++ )
{
- cNextChar = pxNextTCB->pcTaskName[ x ];
+ cNextChar = pxTCB->pcTaskName[ x ];
if( cNextChar != pcNameToQuery[ x ] )
{
@@ -2388,7 +4226,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
{
/* Both strings terminated, a match must have been
* found. */
- pxReturn = pxNextTCB;
+ pxReturn = pxTCB;
xBreakLoop = pdTRUE;
}
else
@@ -2407,7 +4245,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
/* The handle has been found. */
break;
}
- } while( pxNextTCB != pxFirstTCB );
+ }
}
else
{
@@ -2422,11 +4260,13 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
#if ( INCLUDE_xTaskGetHandle == 1 )
- TaskHandle_t xTaskGetHandle( const char * pcNameToQuery ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ TaskHandle_t xTaskGetHandle( const char * pcNameToQuery )
{
UBaseType_t uxQueue = configMAX_PRIORITIES;
TCB_t * pxTCB;
+ traceENTER_xTaskGetHandle( pcNameToQuery );
+
/* Task names will be truncated to configMAX_TASK_NAME_LEN - 1 bytes. */
configASSERT( strlen( pcNameToQuery ) < configMAX_TASK_NAME_LEN );
@@ -2443,7 +4283,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
/* Found the handle. */
break;
}
- } while( uxQueue > ( UBaseType_t ) tskIDLE_PRIORITY ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
+ } while( uxQueue > ( UBaseType_t ) tskIDLE_PRIORITY );
/* Search the delayed lists. */
if( pxTCB == NULL )
@@ -2478,12 +4318,68 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
}
( void ) xTaskResumeAll();
+ traceRETURN_xTaskGetHandle( pxTCB );
+
return pxTCB;
}
#endif /* INCLUDE_xTaskGetHandle */
/*-----------------------------------------------------------*/
+#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+
+ BaseType_t xTaskGetStaticBuffers( TaskHandle_t xTask,
+ StackType_t ** ppuxStackBuffer,
+ StaticTask_t ** ppxTaskBuffer )
+ {
+ BaseType_t xReturn;
+ TCB_t * pxTCB;
+
+ traceENTER_xTaskGetStaticBuffers( xTask, ppuxStackBuffer, ppxTaskBuffer );
+
+ configASSERT( ppuxStackBuffer != NULL );
+ configASSERT( ppxTaskBuffer != NULL );
+
+ pxTCB = prvGetTCBFromHandle( xTask );
+
+ #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 )
+ {
+ if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB )
+ {
+ *ppuxStackBuffer = pxTCB->pxStack;
+ /* MISRA Ref 11.3.1 [Misaligned access] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
+ /* coverity[misra_c_2012_rule_11_3_violation] */
+ *ppxTaskBuffer = ( StaticTask_t * ) pxTCB;
+ xReturn = pdTRUE;
+ }
+ else if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_ONLY )
+ {
+ *ppuxStackBuffer = pxTCB->pxStack;
+ *ppxTaskBuffer = NULL;
+ xReturn = pdTRUE;
+ }
+ else
+ {
+ xReturn = pdFALSE;
+ }
+ }
+ #else /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 */
+ {
+ *ppuxStackBuffer = pxTCB->pxStack;
+ *ppxTaskBuffer = ( StaticTask_t * ) pxTCB;
+ xReturn = pdTRUE;
+ }
+ #endif /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 */
+
+ traceRETURN_xTaskGetStaticBuffers( xReturn );
+
+ return xReturn;
+ }
+
+#endif /* configSUPPORT_STATIC_ALLOCATION */
+/*-----------------------------------------------------------*/
+
#if ( configUSE_TRACE_FACILITY == 1 )
UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
@@ -2492,6 +4388,8 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
{
UBaseType_t uxTask = 0, uxQueue = configMAX_PRIORITIES;
+ traceENTER_uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, pulTotalRunTime );
+
vTaskSuspendAll();
{
/* Is there a space in the array for each task in the system? */
@@ -2502,19 +4400,19 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
do
{
uxQueue--;
- uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &( pxReadyTasksLists[ uxQueue ] ), eReady );
- } while( uxQueue > ( UBaseType_t ) tskIDLE_PRIORITY ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
+ uxTask = ( UBaseType_t ) ( uxTask + prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &( pxReadyTasksLists[ uxQueue ] ), eReady ) );
+ } while( uxQueue > ( UBaseType_t ) tskIDLE_PRIORITY );
/* Fill in an TaskStatus_t structure with information on each
* task in the Blocked state. */
- uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), ( List_t * ) pxDelayedTaskList, eBlocked );
- uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), ( List_t * ) pxOverflowDelayedTaskList, eBlocked );
+ uxTask = ( UBaseType_t ) ( uxTask + prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), ( List_t * ) pxDelayedTaskList, eBlocked ) );
+ uxTask = ( UBaseType_t ) ( uxTask + prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), ( List_t * ) pxOverflowDelayedTaskList, eBlocked ) );
#if ( INCLUDE_vTaskDelete == 1 )
{
/* Fill in an TaskStatus_t structure with information on
* each task that has been deleted but not yet cleaned up. */
- uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &xTasksWaitingTermination, eDeleted );
+ uxTask = ( UBaseType_t ) ( uxTask + prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &xTasksWaitingTermination, eDeleted ) );
}
#endif
@@ -2522,7 +4420,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
{
/* Fill in an TaskStatus_t structure with information on
* each task in the Suspended state. */
- uxTask += prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &xSuspendedTaskList, eSuspended );
+ uxTask = ( UBaseType_t ) ( uxTask + prvListTasksWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &xSuspendedTaskList, eSuspended ) );
}
#endif
@@ -2533,7 +4431,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
#ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
portALT_GET_RUN_TIME_COUNTER_VALUE( ( *pulTotalRunTime ) );
#else
- *pulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();
+ *pulTotalRunTime = ( configRUN_TIME_COUNTER_TYPE ) portGET_RUN_TIME_COUNTER_VALUE();
#endif
}
}
@@ -2553,6 +4451,8 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
}
( void ) xTaskResumeAll();
+ traceRETURN_uxTaskGetSystemState( uxTask );
+
return uxTask;
}
@@ -2561,12 +4461,35 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 )
- TaskHandle_t xTaskGetIdleTaskHandle( void )
+ #if ( configNUMBER_OF_CORES == 1 )
+ TaskHandle_t xTaskGetIdleTaskHandle( void )
+ {
+ traceENTER_xTaskGetIdleTaskHandle();
+
+ /* If xTaskGetIdleTaskHandle() is called before the scheduler has been
+ * started, then xIdleTaskHandles will be NULL. */
+ configASSERT( ( xIdleTaskHandles[ 0 ] != NULL ) );
+
+ traceRETURN_xTaskGetIdleTaskHandle( xIdleTaskHandles[ 0 ] );
+
+ return xIdleTaskHandles[ 0 ];
+ }
+ #endif /* if ( configNUMBER_OF_CORES == 1 ) */
+
+ TaskHandle_t xTaskGetIdleTaskHandleForCore( BaseType_t xCoreID )
{
+ traceENTER_xTaskGetIdleTaskHandleForCore( xCoreID );
+
+ /* Ensure the core ID is valid. */
+ configASSERT( taskVALID_CORE_ID( xCoreID ) == pdTRUE );
+
/* If xTaskGetIdleTaskHandle() is called before the scheduler has been
- * started, then xIdleTaskHandle will be NULL. */
- configASSERT( ( xIdleTaskHandle != NULL ) );
- return xIdleTaskHandle;
+ * started, then xIdleTaskHandles will be NULL. */
+ configASSERT( ( xIdleTaskHandles[ xCoreID ] != NULL ) );
+
+ traceRETURN_xTaskGetIdleTaskHandleForCore( xIdleTaskHandles[ xCoreID ] );
+
+ return xIdleTaskHandles[ xCoreID ];
}
#endif /* INCLUDE_xTaskGetIdleTaskHandle */
@@ -2580,17 +4503,22 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
void vTaskStepTick( TickType_t xTicksToJump )
{
+ TickType_t xUpdatedTickCount;
+
+ traceENTER_vTaskStepTick( xTicksToJump );
+
/* Correct the tick count value after a period during which the tick
* was suppressed. Note this does *not* call the tick hook function for
* each stepped tick. */
- configASSERT( ( xTickCount + xTicksToJump ) <= xNextTaskUnblockTime );
+ xUpdatedTickCount = xTickCount + xTicksToJump;
+ configASSERT( xUpdatedTickCount <= xNextTaskUnblockTime );
- if( ( xTickCount + xTicksToJump ) == xNextTaskUnblockTime )
+ if( xUpdatedTickCount == xNextTaskUnblockTime )
{
/* Arrange for xTickCount to reach xNextTaskUnblockTime in
* xTaskIncrementTick() when the scheduler resumes. This ensures
* that any delayed tasks are resumed at the correct time. */
- configASSERT( uxSchedulerSuspended );
+ configASSERT( uxSchedulerSuspended != ( UBaseType_t ) 0U );
configASSERT( xTicksToJump != ( TickType_t ) 0 );
/* Prevent the tick interrupt modifying xPendedTicks simultaneously. */
@@ -2607,7 +4535,9 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
}
xTickCount += xTicksToJump;
+
traceINCREASE_TICK_COUNT( xTicksToJump );
+ traceRETURN_vTaskStepTick();
}
#endif /* configUSE_TICKLESS_IDLE */
@@ -2617,9 +4547,11 @@ BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp )
{
BaseType_t xYieldOccurred;
+ traceENTER_xTaskCatchUpTicks( xTicksToCatchUp );
+
/* Must not be called with the scheduler suspended as the implementation
* relies on xPendedTicks being wound down to 0 in xTaskResumeAll(). */
- configASSERT( uxSchedulerSuspended == 0 );
+ configASSERT( uxSchedulerSuspended == ( UBaseType_t ) 0U );
/* Use xPendedTicks to mimic xTicksToCatchUp number of ticks occurring when
* the scheduler is suspended so the ticks are executed in xTaskResumeAll(). */
@@ -2633,6 +4565,8 @@ BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp )
taskEXIT_CRITICAL();
xYieldOccurred = xTaskResumeAll();
+ traceRETURN_xTaskCatchUpTicks( xYieldOccurred );
+
return xYieldOccurred;
}
/*----------------------------------------------------------*/
@@ -2644,6 +4578,8 @@ BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp )
TCB_t * pxTCB = xTask;
BaseType_t xReturn;
+ traceENTER_xTaskAbortDelay( xTask );
+
configASSERT( pxTCB );
vTaskSuspendAll();
@@ -2672,7 +4608,7 @@ BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp )
/* This lets the task know it was forcibly removed from the
* blocked state so it should not re-evaluate its block time and
* then block again. */
- pxTCB->ucDelayAborted = pdTRUE;
+ pxTCB->ucDelayAborted = ( uint8_t ) pdTRUE;
}
else
{
@@ -2688,21 +4624,33 @@ BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp )
* switch if preemption is turned off. */
#if ( configUSE_PREEMPTION == 1 )
{
- /* Preemption is on, but a context switch should only be
- * performed if the unblocked task has a priority that is
- * higher than the currently executing task. */
- if( pxTCB->uxPriority > pxCurrentTCB->uxPriority )
+ #if ( configNUMBER_OF_CORES == 1 )
{
- /* Pend the yield to be performed when the scheduler
- * is unsuspended. */
- xYieldPending = pdTRUE;
+ /* Preemption is on, but a context switch should only be
+ * performed if the unblocked task has a priority that is
+ * higher than the currently executing task. */
+ if( pxTCB->uxPriority > pxCurrentTCB->uxPriority )
+ {
+ /* Pend the yield to be performed when the scheduler
+ * is unsuspended. */
+ xYieldPendings[ 0 ] = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
- else
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
{
- mtCOVERAGE_TEST_MARKER();
+ taskENTER_CRITICAL();
+ {
+ prvYieldForTask( pxTCB );
+ }
+ taskEXIT_CRITICAL();
}
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
}
- #endif /* configUSE_PREEMPTION */
+ #endif /* #if ( configUSE_PREEMPTION == 1 ) */
}
else
{
@@ -2711,6 +4659,8 @@ BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp )
}
( void ) xTaskResumeAll();
+ traceRETURN_xTaskAbortDelay( xReturn );
+
return xReturn;
}
@@ -2723,12 +4673,22 @@ BaseType_t xTaskIncrementTick( void )
TickType_t xItemValue;
BaseType_t xSwitchRequired = pdFALSE;
+ #if ( configUSE_PREEMPTION == 1 ) && ( configNUMBER_OF_CORES > 1 )
+ BaseType_t xYieldRequiredForCore[ configNUMBER_OF_CORES ] = { pdFALSE };
+ #endif /* #if ( configUSE_PREEMPTION == 1 ) && ( configNUMBER_OF_CORES > 1 ) */
+
+ traceENTER_xTaskIncrementTick();
+
/* Called by the portable layer each time a tick interrupt occurs.
* Increments the tick then checks to see if the new tick value will cause any
* tasks to be unblocked. */
traceTASK_INCREMENT_TICK( xTickCount );
- if( uxSchedulerSuspended == ( UBaseType_t ) pdFALSE )
+ /* Tick increment should occur on every kernel timer event. Core 0 has the
+ * responsibility to increment the tick, or increment the pended ticks if the
+ * scheduler is suspended. If pended ticks is greater than zero, the core that
+ * calls xTaskResumeAll has the responsibility to increment the tick. */
+ if( uxSchedulerSuspended == ( UBaseType_t ) 0U )
{
/* Minor optimisation. The tick count cannot change in this
* block. */
@@ -2738,7 +4698,7 @@ BaseType_t xTaskIncrementTick( void )
* delayed lists if it wraps to 0. */
xTickCount = xConstTickCount;
- if( xConstTickCount == ( TickType_t ) 0U ) /*lint !e774 'if' does not always evaluate to false as it is looking for an overflow. */
+ if( xConstTickCount == ( TickType_t ) 0U )
{
taskSWITCH_DELAYED_LISTS();
}
@@ -2762,7 +4722,7 @@ BaseType_t xTaskIncrementTick( void )
* unlikely that the
* if( xTickCount >= xNextTaskUnblockTime ) test will pass
* next time through. */
- xNextTaskUnblockTime = portMAX_DELAY; /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
+ xNextTaskUnblockTime = portMAX_DELAY;
break;
}
else
@@ -2771,7 +4731,10 @@ BaseType_t xTaskIncrementTick( void )
* item at the head of the delayed list. This is the time
* at which the task at the head of the delayed list must
* be removed from the Blocked state. */
- pxTCB = listGET_OWNER_OF_HEAD_ENTRY( pxDelayedTaskList ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
+ /* MISRA Ref 11.5.3 [Void pointer assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxTCB = listGET_OWNER_OF_HEAD_ENTRY( pxDelayedTaskList );
xItemValue = listGET_LIST_ITEM_VALUE( &( pxTCB->xStateListItem ) );
if( xConstTickCount < xItemValue )
@@ -2782,7 +4745,7 @@ BaseType_t xTaskIncrementTick( void )
* state - so record the item value in
* xNextTaskUnblockTime. */
xNextTaskUnblockTime = xItemValue;
- break; /*lint !e9011 Code structure here is deemed easier to understand with multiple breaks. */
+ break;
}
else
{
@@ -2811,24 +4774,32 @@ BaseType_t xTaskIncrementTick( void )
* context switch if preemption is turned off. */
#if ( configUSE_PREEMPTION == 1 )
{
- /* Preemption is on, but a context switch should
- * only be performed if the unblocked task's
- * priority is higher than the currently executing
- * task.
- * The case of equal priority tasks sharing
- * processing time (which happens when both
- * preemption and time slicing are on) is
- * handled below.*/
- if( pxTCB->uxPriority > pxCurrentTCB->uxPriority )
+ #if ( configNUMBER_OF_CORES == 1 )
{
- xSwitchRequired = pdTRUE;
+ /* Preemption is on, but a context switch should
+ * only be performed if the unblocked task's
+ * priority is higher than the currently executing
+ * task.
+ * The case of equal priority tasks sharing
+ * processing time (which happens when both
+ * preemption and time slicing are on) is
+ * handled below.*/
+ if( pxTCB->uxPriority > pxCurrentTCB->uxPriority )
+ {
+ xSwitchRequired = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
- else
+ #else /* #if( configNUMBER_OF_CORES == 1 ) */
{
- mtCOVERAGE_TEST_MARKER();
+ prvYieldForTask( pxTCB );
}
+ #endif /* #if( configNUMBER_OF_CORES == 1 ) */
}
- #endif /* configUSE_PREEMPTION */
+ #endif /* #if ( configUSE_PREEMPTION == 1 ) */
}
}
}
@@ -2838,16 +4809,36 @@ BaseType_t xTaskIncrementTick( void )
* writer has not explicitly turned time slicing off. */
#if ( ( configUSE_PREEMPTION == 1 ) && ( configUSE_TIME_SLICING == 1 ) )
{
- if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ pxCurrentTCB->uxPriority ] ) ) > ( UBaseType_t ) 1 )
+ #if ( configNUMBER_OF_CORES == 1 )
{
- xSwitchRequired = pdTRUE;
+ if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ pxCurrentTCB->uxPriority ] ) ) > 1U )
+ {
+ xSwitchRequired = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
- else
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
{
- mtCOVERAGE_TEST_MARKER();
+ BaseType_t xCoreID;
+
+ for( xCoreID = 0; xCoreID < ( ( BaseType_t ) configNUMBER_OF_CORES ); xCoreID++ )
+ {
+ if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ pxCurrentTCBs[ xCoreID ]->uxPriority ] ) ) > 1U )
+ {
+ xYieldRequiredForCore[ xCoreID ] = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
}
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
}
- #endif /* ( ( configUSE_PREEMPTION == 1 ) && ( configUSE_TIME_SLICING == 1 ) ) */
+ #endif /* #if ( ( configUSE_PREEMPTION == 1 ) && ( configUSE_TIME_SLICING == 1 ) ) */
#if ( configUSE_TICK_HOOK == 1 )
{
@@ -2866,20 +4857,54 @@ BaseType_t xTaskIncrementTick( void )
#if ( configUSE_PREEMPTION == 1 )
{
- if( xYieldPending != pdFALSE )
+ #if ( configNUMBER_OF_CORES == 1 )
{
- xSwitchRequired = pdTRUE;
+ /* For single core the core ID is always 0. */
+ if( xYieldPendings[ 0 ] != pdFALSE )
+ {
+ xSwitchRequired = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
- else
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
{
- mtCOVERAGE_TEST_MARKER();
+ BaseType_t xCoreID, xCurrentCoreID;
+ xCurrentCoreID = ( BaseType_t ) portGET_CORE_ID();
+
+ for( xCoreID = 0; xCoreID < ( BaseType_t ) configNUMBER_OF_CORES; xCoreID++ )
+ {
+ #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
+ if( pxCurrentTCBs[ xCoreID ]->xPreemptionDisable == pdFALSE )
+ #endif
+ {
+ if( ( xYieldRequiredForCore[ xCoreID ] != pdFALSE ) || ( xYieldPendings[ xCoreID ] != pdFALSE ) )
+ {
+ if( xCoreID == xCurrentCoreID )
+ {
+ xSwitchRequired = pdTRUE;
+ }
+ else
+ {
+ prvYieldCore( xCoreID );
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ }
}
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
}
- #endif /* configUSE_PREEMPTION */
+ #endif /* #if ( configUSE_PREEMPTION == 1 ) */
}
else
{
- ++xPendedTicks;
+ xPendedTicks += 1U;
/* The tick hook gets called at regular intervals, even if the
* scheduler is locked. */
@@ -2890,6 +4915,8 @@ BaseType_t xTaskIncrementTick( void )
#endif
}
+ traceRETURN_xTaskIncrementTick( xSwitchRequired );
+
return xSwitchRequired;
}
/*-----------------------------------------------------------*/
@@ -2901,6 +4928,8 @@ BaseType_t xTaskIncrementTick( void )
{
TCB_t * xTCB;
+ traceENTER_vTaskSetApplicationTaskTag( xTask, pxHookFunction );
+
/* If xTask is NULL then it is the task hook of the calling task that is
* getting set. */
if( xTask == NULL )
@@ -2919,6 +4948,8 @@ BaseType_t xTaskIncrementTick( void )
xTCB->pxTaskTag = pxHookFunction;
}
taskEXIT_CRITICAL();
+
+ traceRETURN_vTaskSetApplicationTaskTag();
}
#endif /* configUSE_APPLICATION_TASK_TAG */
@@ -2931,6 +4962,8 @@ BaseType_t xTaskIncrementTick( void )
TCB_t * pxTCB;
TaskHookFunction_t xReturn;
+ traceENTER_xTaskGetApplicationTaskTag( xTask );
+
/* If xTask is NULL then set the calling task's hook. */
pxTCB = prvGetTCBFromHandle( xTask );
@@ -2942,6 +4975,8 @@ BaseType_t xTaskIncrementTick( void )
}
taskEXIT_CRITICAL();
+ traceRETURN_xTaskGetApplicationTaskTag( xReturn );
+
return xReturn;
}
@@ -2956,16 +4991,23 @@ BaseType_t xTaskIncrementTick( void )
TaskHookFunction_t xReturn;
UBaseType_t uxSavedInterruptStatus;
+ traceENTER_xTaskGetApplicationTaskTagFromISR( xTask );
+
/* If xTask is NULL then set the calling task's hook. */
pxTCB = prvGetTCBFromHandle( xTask );
/* Save the hook function in the TCB. A critical section is required as
* the value can be accessed from an interrupt. */
- uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = taskENTER_CRITICAL_FROM_ISR();
{
xReturn = pxTCB->pxTaskTag;
}
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
+
+ traceRETURN_xTaskGetApplicationTaskTagFromISR( xReturn );
return xReturn;
}
@@ -2981,6 +5023,8 @@ BaseType_t xTaskIncrementTick( void )
TCB_t * xTCB;
BaseType_t xReturn;
+ traceENTER_xTaskCallApplicationTaskHook( xTask, pvParameter );
+
/* If xTask is NULL then we are calling our own task hook. */
if( xTask == NULL )
{
@@ -3000,92 +5044,210 @@ BaseType_t xTaskIncrementTick( void )
xReturn = pdFAIL;
}
+ traceRETURN_xTaskCallApplicationTaskHook( xReturn );
+
return xReturn;
}
#endif /* configUSE_APPLICATION_TASK_TAG */
/*-----------------------------------------------------------*/
-void vTaskSwitchContext( void )
-{
- if( uxSchedulerSuspended != ( UBaseType_t ) pdFALSE )
+#if ( configNUMBER_OF_CORES == 1 )
+ void vTaskSwitchContext( void )
{
- /* The scheduler is currently suspended - do not allow a context
- * switch. */
- xYieldPending = pdTRUE;
- }
- else
- {
- xYieldPending = pdFALSE;
- traceTASK_SWITCHED_OUT();
+ traceENTER_vTaskSwitchContext();
- #if ( configGENERATE_RUN_TIME_STATS == 1 )
+ if( uxSchedulerSuspended != ( UBaseType_t ) 0U )
{
- #ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
- portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime );
- #else
- ulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();
- #endif
+ /* The scheduler is currently suspended - do not allow a context
+ * switch. */
+ xYieldPendings[ 0 ] = pdTRUE;
+ }
+ else
+ {
+ xYieldPendings[ 0 ] = pdFALSE;
+ traceTASK_SWITCHED_OUT();
+
+ #if ( configGENERATE_RUN_TIME_STATS == 1 )
+ {
+ #ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
+ portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime[ 0 ] );
+ #else
+ ulTotalRunTime[ 0 ] = portGET_RUN_TIME_COUNTER_VALUE();
+ #endif
+
+ /* Add the amount of time the task has been running to the
+ * accumulated time so far. The time the task started running was
+ * stored in ulTaskSwitchedInTime. Note that there is no overflow
+ * protection here so count values are only valid until the timer
+ * overflows. The guard against negative values is to protect
+ * against suspect run time stat counter implementations - which
+ * are provided by the application, not the kernel. */
+ if( ulTotalRunTime[ 0 ] > ulTaskSwitchedInTime[ 0 ] )
+ {
+ pxCurrentTCB->ulRunTimeCounter += ( ulTotalRunTime[ 0 ] - ulTaskSwitchedInTime[ 0 ] );
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ ulTaskSwitchedInTime[ 0 ] = ulTotalRunTime[ 0 ];
+ }
+ #endif /* configGENERATE_RUN_TIME_STATS */
+
+ /* Check for stack overflow, if configured. */
+ taskCHECK_FOR_STACK_OVERFLOW();
- /* Add the amount of time the task has been running to the
- * accumulated time so far. The time the task started running was
- * stored in ulTaskSwitchedInTime. Note that there is no overflow
- * protection here so count values are only valid until the timer
- * overflows. The guard against negative values is to protect
- * against suspect run time stat counter implementations - which
- * are provided by the application, not the kernel. */
- if( ulTotalRunTime > ulTaskSwitchedInTime )
+ /* Before the currently running task is switched out, save its errno. */
+ #if ( configUSE_POSIX_ERRNO == 1 )
{
- pxCurrentTCB->ulRunTimeCounter += ( ulTotalRunTime - ulTaskSwitchedInTime );
+ pxCurrentTCB->iTaskErrno = FreeRTOS_errno;
}
- else
+ #endif
+
+ /* Select a new task to run using either the generic C or port
+ * optimised asm code. */
+ /* MISRA Ref 11.5.3 [Void pointer assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ taskSELECT_HIGHEST_PRIORITY_TASK();
+ traceTASK_SWITCHED_IN();
+
+ /* Macro to inject port specific behaviour immediately after
+ * switching tasks, such as setting an end of stack watchpoint
+ * or reconfiguring the MPU. */
+ portTASK_SWITCH_HOOK( pxCurrentTCB );
+
+ /* After the new task is switched in, update the global errno. */
+ #if ( configUSE_POSIX_ERRNO == 1 )
{
- mtCOVERAGE_TEST_MARKER();
+ FreeRTOS_errno = pxCurrentTCB->iTaskErrno;
}
+ #endif
- ulTaskSwitchedInTime = ulTotalRunTime;
+ #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
+ {
+ /* Switch C-Runtime's TLS Block to point to the TLS
+ * Block specific to this task. */
+ configSET_TLS_BLOCK( pxCurrentTCB->xTLSBlock );
+ }
+ #endif
}
- #endif /* configGENERATE_RUN_TIME_STATS */
- /* Check for stack overflow, if configured. */
- taskCHECK_FOR_STACK_OVERFLOW();
+ traceRETURN_vTaskSwitchContext();
+ }
+#else /* if ( configNUMBER_OF_CORES == 1 ) */
+ void vTaskSwitchContext( BaseType_t xCoreID )
+ {
+ traceENTER_vTaskSwitchContext();
+
+ /* Acquire both locks:
+ * - The ISR lock protects the ready list from simultaneous access by
+ * both other ISRs and tasks.
+ * - We also take the task lock to pause here in case another core has
+ * suspended the scheduler. We don't want to simply set xYieldPending
+ * and move on if another core suspended the scheduler. We should only
+ * do that if the current core has suspended the scheduler. */
- /* Before the currently running task is switched out, save its errno. */
- #if ( configUSE_POSIX_ERRNO == 1 )
+ portGET_TASK_LOCK(); /* Must always acquire the task lock first. */
+ portGET_ISR_LOCK();
{
- pxCurrentTCB->iTaskErrno = FreeRTOS_errno;
- }
- #endif
+ /* vTaskSwitchContext() must never be called from within a critical section.
+ * This is not necessarily true for single core FreeRTOS, but it is for this
+ * SMP port. */
+ configASSERT( portGET_CRITICAL_NESTING_COUNT() == 0 );
- /* Select a new task to run using either the generic C or port
- * optimised asm code. */
- taskSELECT_HIGHEST_PRIORITY_TASK(); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
- traceTASK_SWITCHED_IN();
+ if( uxSchedulerSuspended != ( UBaseType_t ) 0U )
+ {
+ /* The scheduler is currently suspended - do not allow a context
+ * switch. */
+ xYieldPendings[ xCoreID ] = pdTRUE;
+ }
+ else
+ {
+ xYieldPendings[ xCoreID ] = pdFALSE;
+ traceTASK_SWITCHED_OUT();
- /* After the new task is switched in, update the global errno. */
- #if ( configUSE_POSIX_ERRNO == 1 )
- {
- FreeRTOS_errno = pxCurrentTCB->iTaskErrno;
- }
- #endif
+ #if ( configGENERATE_RUN_TIME_STATS == 1 )
+ {
+ #ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
+ portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime[ xCoreID ] );
+ #else
+ ulTotalRunTime[ xCoreID ] = portGET_RUN_TIME_COUNTER_VALUE();
+ #endif
- #if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
- {
- /* Switch C-Runtime's TLS Block to point to the TLS
- * Block specific to this task. */
- configSET_TLS_BLOCK( pxCurrentTCB->xTLSBlock );
+ /* Add the amount of time the task has been running to the
+ * accumulated time so far. The time the task started running was
+ * stored in ulTaskSwitchedInTime. Note that there is no overflow
+ * protection here so count values are only valid until the timer
+ * overflows. The guard against negative values is to protect
+ * against suspect run time stat counter implementations - which
+ * are provided by the application, not the kernel. */
+ if( ulTotalRunTime[ xCoreID ] > ulTaskSwitchedInTime[ xCoreID ] )
+ {
+ pxCurrentTCBs[ xCoreID ]->ulRunTimeCounter += ( ulTotalRunTime[ xCoreID ] - ulTaskSwitchedInTime[ xCoreID ] );
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ ulTaskSwitchedInTime[ xCoreID ] = ulTotalRunTime[ xCoreID ];
+ }
+ #endif /* configGENERATE_RUN_TIME_STATS */
+
+ /* Check for stack overflow, if configured. */
+ taskCHECK_FOR_STACK_OVERFLOW();
+
+ /* Before the currently running task is switched out, save its errno. */
+ #if ( configUSE_POSIX_ERRNO == 1 )
+ {
+ pxCurrentTCBs[ xCoreID ]->iTaskErrno = FreeRTOS_errno;
+ }
+ #endif
+
+ /* Select a new task to run. */
+ taskSELECT_HIGHEST_PRIORITY_TASK( xCoreID );
+ traceTASK_SWITCHED_IN();
+
+ /* Macro to inject port specific behaviour immediately after
+ * switching tasks, such as setting an end of stack watchpoint
+ * or reconfiguring the MPU. */
+ portTASK_SWITCH_HOOK( pxCurrentTCBs[ portGET_CORE_ID() ] );
+
+ /* After the new task is switched in, update the global errno. */
+ #if ( configUSE_POSIX_ERRNO == 1 )
+ {
+ FreeRTOS_errno = pxCurrentTCBs[ xCoreID ]->iTaskErrno;
+ }
+ #endif
+
+ #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
+ {
+ /* Switch C-Runtime's TLS Block to point to the TLS
+ * Block specific to this task. */
+ configSET_TLS_BLOCK( pxCurrentTCBs[ xCoreID ]->xTLSBlock );
+ }
+ #endif
+ }
}
- #endif
+ portRELEASE_ISR_LOCK();
+ portRELEASE_TASK_LOCK();
+
+ traceRETURN_vTaskSwitchContext();
}
-}
+#endif /* if ( configNUMBER_OF_CORES > 1 ) */
/*-----------------------------------------------------------*/
void vTaskPlaceOnEventList( List_t * const pxEventList,
const TickType_t xTicksToWait )
{
+ traceENTER_vTaskPlaceOnEventList( pxEventList, xTicksToWait );
+
configASSERT( pxEventList );
- /* THIS FUNCTION MUST BE CALLED WITH EITHER INTERRUPTS DISABLED OR THE
+ /* THIS FUNCTION MUST BE CALLED WITH THE
* SCHEDULER SUSPENDED AND THE QUEUE BEING ACCESSED LOCKED. */
/* Place the event list item of the TCB in the appropriate event list.
@@ -3102,6 +5264,8 @@ void vTaskPlaceOnEventList( List_t * const pxEventList,
vListInsert( pxEventList, &( pxCurrentTCB->xEventListItem ) );
prvAddCurrentTaskToDelayedList( xTicksToWait, pdTRUE );
+
+ traceRETURN_vTaskPlaceOnEventList();
}
/*-----------------------------------------------------------*/
@@ -3109,11 +5273,13 @@ void vTaskPlaceOnUnorderedEventList( List_t * pxEventList,
const TickType_t xItemValue,
const TickType_t xTicksToWait )
{
+ traceENTER_vTaskPlaceOnUnorderedEventList( pxEventList, xItemValue, xTicksToWait );
+
configASSERT( pxEventList );
/* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. It is used by
* the event groups implementation. */
- configASSERT( uxSchedulerSuspended != 0 );
+ configASSERT( uxSchedulerSuspended != ( UBaseType_t ) 0U );
/* Store the item value in the event list item. It is safe to access the
* event list item here as interrupts won't access the event list item of a
@@ -3128,6 +5294,8 @@ void vTaskPlaceOnUnorderedEventList( List_t * pxEventList,
listINSERT_END( pxEventList, &( pxCurrentTCB->xEventListItem ) );
prvAddCurrentTaskToDelayedList( xTicksToWait, pdTRUE );
+
+ traceRETURN_vTaskPlaceOnUnorderedEventList();
}
/*-----------------------------------------------------------*/
@@ -3137,6 +5305,8 @@ void vTaskPlaceOnUnorderedEventList( List_t * pxEventList,
TickType_t xTicksToWait,
const BaseType_t xWaitIndefinitely )
{
+ traceENTER_vTaskPlaceOnEventListRestricted( pxEventList, xTicksToWait, xWaitIndefinitely );
+
configASSERT( pxEventList );
/* This function should not be called by application code hence the
@@ -3161,6 +5331,8 @@ void vTaskPlaceOnUnorderedEventList( List_t * pxEventList,
traceTASK_DELAY_UNTIL( ( xTickCount + xTicksToWait ) );
prvAddCurrentTaskToDelayedList( xTicksToWait, xWaitIndefinitely );
+
+ traceRETURN_vTaskPlaceOnEventListRestricted();
}
#endif /* configUSE_TIMERS */
@@ -3171,6 +5343,8 @@ BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList )
TCB_t * pxUnblockedTCB;
BaseType_t xReturn;
+ traceENTER_xTaskRemoveFromEventList( pxEventList );
+
/* THIS FUNCTION MUST BE CALLED FROM A CRITICAL SECTION. It can also be
* called from a critical section within an ISR. */
@@ -3184,11 +5358,14 @@ BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList )
*
* This function assumes that a check has already been made to ensure that
* pxEventList is not empty. */
- pxUnblockedTCB = listGET_OWNER_OF_HEAD_ENTRY( pxEventList ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
+ /* MISRA Ref 11.5.3 [Void pointer assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxUnblockedTCB = listGET_OWNER_OF_HEAD_ENTRY( pxEventList );
configASSERT( pxUnblockedTCB );
listREMOVE_ITEM( &( pxUnblockedTCB->xEventListItem ) );
- if( uxSchedulerSuspended == ( UBaseType_t ) pdFALSE )
+ if( uxSchedulerSuspended == ( UBaseType_t ) 0U )
{
listREMOVE_ITEM( &( pxUnblockedTCB->xStateListItem ) );
prvAddTaskToReadyList( pxUnblockedTCB );
@@ -3214,22 +5391,42 @@ BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList )
listINSERT_END( &( xPendingReadyList ), &( pxUnblockedTCB->xEventListItem ) );
}
- if( pxUnblockedTCB->uxPriority > pxCurrentTCB->uxPriority )
+ #if ( configNUMBER_OF_CORES == 1 )
{
- /* Return true if the task removed from the event list has a higher
- * priority than the calling task. This allows the calling task to know if
- * it should force a context switch now. */
- xReturn = pdTRUE;
+ if( pxUnblockedTCB->uxPriority > pxCurrentTCB->uxPriority )
+ {
+ /* Return true if the task removed from the event list has a higher
+ * priority than the calling task. This allows the calling task to know if
+ * it should force a context switch now. */
+ xReturn = pdTRUE;
- /* Mark that a yield is pending in case the user is not using the
- * "xHigherPriorityTaskWoken" parameter to an ISR safe FreeRTOS function. */
- xYieldPending = pdTRUE;
+ /* Mark that a yield is pending in case the user is not using the
+ * "xHigherPriorityTaskWoken" parameter to an ISR safe FreeRTOS function. */
+ xYieldPendings[ 0 ] = pdTRUE;
+ }
+ else
+ {
+ xReturn = pdFALSE;
+ }
}
- else
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
{
xReturn = pdFALSE;
+
+ #if ( configUSE_PREEMPTION == 1 )
+ {
+ prvYieldForTask( pxUnblockedTCB );
+
+ if( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE )
+ {
+ xReturn = pdTRUE;
+ }
+ }
+ #endif /* #if ( configUSE_PREEMPTION == 1 ) */
}
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+ traceRETURN_xTaskRemoveFromEventList( xReturn );
return xReturn;
}
/*-----------------------------------------------------------*/
@@ -3239,16 +5436,21 @@ void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
{
TCB_t * pxUnblockedTCB;
+ traceENTER_vTaskRemoveFromUnorderedEventList( pxEventListItem, xItemValue );
+
/* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. It is used by
* the event flags implementation. */
- configASSERT( uxSchedulerSuspended != pdFALSE );
+ configASSERT( uxSchedulerSuspended != ( UBaseType_t ) 0U );
/* Store the new item value in the event list. */
listSET_LIST_ITEM_VALUE( pxEventListItem, xItemValue | taskEVENT_LIST_ITEM_VALUE_IN_USE );
/* Remove the event list form the event flag. Interrupts do not access
* event flags. */
- pxUnblockedTCB = listGET_LIST_ITEM_OWNER( pxEventListItem ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
+ /* MISRA Ref 11.5.3 [Void pointer assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxUnblockedTCB = listGET_LIST_ITEM_OWNER( pxEventListItem );
configASSERT( pxUnblockedTCB );
listREMOVE_ITEM( pxEventListItem );
@@ -3272,19 +5474,39 @@ void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
listREMOVE_ITEM( &( pxUnblockedTCB->xStateListItem ) );
prvAddTaskToReadyList( pxUnblockedTCB );
- if( pxUnblockedTCB->uxPriority > pxCurrentTCB->uxPriority )
+ #if ( configNUMBER_OF_CORES == 1 )
+ {
+ if( pxUnblockedTCB->uxPriority > pxCurrentTCB->uxPriority )
+ {
+ /* The unblocked task has a priority above that of the calling task, so
+ * a context switch is required. This function is called with the
+ * scheduler suspended so xYieldPending is set so the context switch
+ * occurs immediately that the scheduler is resumed (unsuspended). */
+ xYieldPendings[ 0 ] = pdTRUE;
+ }
+ }
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
{
- /* The unblocked task has a priority above that of the calling task, so
- * a context switch is required. This function is called with the
- * scheduler suspended so xYieldPending is set so the context switch
- * occurs immediately that the scheduler is resumed (unsuspended). */
- xYieldPending = pdTRUE;
+ #if ( configUSE_PREEMPTION == 1 )
+ {
+ taskENTER_CRITICAL();
+ {
+ prvYieldForTask( pxUnblockedTCB );
+ }
+ taskEXIT_CRITICAL();
+ }
+ #endif
}
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+
+ traceRETURN_vTaskRemoveFromUnorderedEventList();
}
/*-----------------------------------------------------------*/
void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut )
{
+ traceENTER_vTaskSetTimeOutState( pxTimeOut );
+
configASSERT( pxTimeOut );
taskENTER_CRITICAL();
{
@@ -3292,14 +5514,20 @@ void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut )
pxTimeOut->xTimeOnEntering = xTickCount;
}
taskEXIT_CRITICAL();
+
+ traceRETURN_vTaskSetTimeOutState();
}
/*-----------------------------------------------------------*/
void vTaskInternalSetTimeOutState( TimeOut_t * const pxTimeOut )
{
+ traceENTER_vTaskInternalSetTimeOutState( pxTimeOut );
+
/* For internal use only as it does not use a critical section. */
pxTimeOut->xOverflowCount = xNumOfOverflows;
pxTimeOut->xTimeOnEntering = xTickCount;
+
+ traceRETURN_vTaskInternalSetTimeOutState();
}
/*-----------------------------------------------------------*/
@@ -3308,6 +5536,8 @@ BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
{
BaseType_t xReturn;
+ traceENTER_xTaskCheckForTimeOut( pxTimeOut, pxTicksToWait );
+
configASSERT( pxTimeOut );
configASSERT( pxTicksToWait );
@@ -3322,7 +5552,7 @@ BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
{
/* The delay was aborted, which is not the same as a time out,
* but has the same result. */
- pxCurrentTCB->ucDelayAborted = pdFALSE;
+ pxCurrentTCB->ucDelayAborted = ( uint8_t ) pdFALSE;
xReturn = pdTRUE;
}
else
@@ -3339,7 +5569,7 @@ BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
else
#endif
- if( ( xNumOfOverflows != pxTimeOut->xOverflowCount ) && ( xConstTickCount >= pxTimeOut->xTimeOnEntering ) ) /*lint !e525 Indentation preferred as is to make code within pre-processor directives clearer. */
+ if( ( xNumOfOverflows != pxTimeOut->xOverflowCount ) && ( xConstTickCount >= pxTimeOut->xTimeOnEntering ) )
{
/* The tick count is greater than the time at which
* vTaskSetTimeout() was called, but has also overflowed since
@@ -3349,7 +5579,7 @@ BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
xReturn = pdTRUE;
*pxTicksToWait = ( TickType_t ) 0;
}
- else if( xElapsedTime < *pxTicksToWait ) /*lint !e961 Explicit casting is only redundant with some compilers, whereas others require it to prevent integer conversion errors. */
+ else if( xElapsedTime < *pxTicksToWait )
{
/* Not a genuine timeout. Adjust parameters for time remaining. */
*pxTicksToWait -= xElapsedTime;
@@ -3364,13 +5594,20 @@ BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
}
taskEXIT_CRITICAL();
+ traceRETURN_xTaskCheckForTimeOut( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
void vTaskMissedYield( void )
{
- xYieldPending = pdTRUE;
+ traceENTER_vTaskMissedYield();
+
+ /* Must be called from within a critical section. */
+ xYieldPendings[ portGET_CORE_ID() ] = pdTRUE;
+
+ traceRETURN_vTaskMissedYield();
}
/*-----------------------------------------------------------*/
@@ -3381,6 +5618,8 @@ void vTaskMissedYield( void )
UBaseType_t uxReturn;
TCB_t const * pxTCB;
+ traceENTER_uxTaskGetTaskNumber( xTask );
+
if( xTask != NULL )
{
pxTCB = xTask;
@@ -3391,6 +5630,8 @@ void vTaskMissedYield( void )
uxReturn = 0U;
}
+ traceRETURN_uxTaskGetTaskNumber( uxReturn );
+
return uxReturn;
}
@@ -3404,18 +5645,97 @@ void vTaskMissedYield( void )
{
TCB_t * pxTCB;
+ traceENTER_vTaskSetTaskNumber( xTask, uxHandle );
+
if( xTask != NULL )
{
pxTCB = xTask;
pxTCB->uxTaskNumber = uxHandle;
}
+
+ traceRETURN_vTaskSetTaskNumber();
}
#endif /* configUSE_TRACE_FACILITY */
+/*-----------------------------------------------------------*/
+
+/*
+ * -----------------------------------------------------------
+ * The passive idle task.
+ * ----------------------------------------------------------
+ *
+ * The passive idle task is used for all the additional cores in a SMP
+ * system. There must be only 1 active idle task and the rest are passive
+ * idle tasks.
+ *
+ * The portTASK_FUNCTION() macro is used to allow port/compiler specific
+ * language extensions. The equivalent prototype for this function is:
+ *
+ * void prvPassiveIdleTask( void *pvParameters );
+ */
+
+#if ( configNUMBER_OF_CORES > 1 )
+ static portTASK_FUNCTION( prvPassiveIdleTask, pvParameters )
+ {
+ ( void ) pvParameters;
+
+ taskYIELD();
+
+ for( ; configCONTROL_INFINITE_LOOP(); )
+ {
+ #if ( configUSE_PREEMPTION == 0 )
+ {
+ /* If we are not using preemption we keep forcing a task switch to
+ * see if any other task has become available. If we are using
+ * preemption we don't need to do this as any task becoming available
+ * will automatically get the processor anyway. */
+ taskYIELD();
+ }
+ #endif /* configUSE_PREEMPTION */
+
+ #if ( ( configUSE_PREEMPTION == 1 ) && ( configIDLE_SHOULD_YIELD == 1 ) )
+ {
+ /* When using preemption tasks of equal priority will be
+ * timesliced. If a task that is sharing the idle priority is ready
+ * to run then the idle task should yield before the end of the
+ * timeslice.
+ *
+ * A critical region is not required here as we are just reading from
+ * the list, and an occasional incorrect value will not matter. If
+ * the ready list at the idle priority contains one more task than the
+ * number of idle tasks, which is equal to the configured numbers of cores
+ * then a task other than the idle task is ready to execute. */
+ if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) > ( UBaseType_t ) configNUMBER_OF_CORES )
+ {
+ taskYIELD();
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ #endif /* ( ( configUSE_PREEMPTION == 1 ) && ( configIDLE_SHOULD_YIELD == 1 ) ) */
+
+ #if ( configUSE_PASSIVE_IDLE_HOOK == 1 )
+ {
+ /* Call the user defined function from within the idle task. This
+ * allows the application designer to add background functionality
+ * without the overhead of a separate task.
+ *
+ * This hook is intended to manage core activity such as disabling cores that go idle.
+ *
+ * NOTE: vApplicationPassiveIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES,
+ * CALL A FUNCTION THAT MIGHT BLOCK. */
+ vApplicationPassiveIdleHook();
+ }
+ #endif /* configUSE_PASSIVE_IDLE_HOOK */
+ }
+ }
+#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
/*
* -----------------------------------------------------------
- * The Idle task.
+ * The idle task.
* ----------------------------------------------------------
*
* The portTASK_FUNCTION() macro is used to allow port/compiler specific
@@ -3424,6 +5744,7 @@ void vTaskMissedYield( void )
* void prvIdleTask( void *pvParameters );
*
*/
+
static portTASK_FUNCTION( prvIdleTask, pvParameters )
{
/* Stop warnings. */
@@ -3437,7 +5758,15 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
* any. */
portALLOCATE_SECURE_CONTEXT( configMINIMAL_SECURE_STACK_SIZE );
- for( ; ; )
+ #if ( configNUMBER_OF_CORES > 1 )
+ {
+ /* SMP all cores start up in the idle task. This initial yield gets the application
+ * tasks started. */
+ taskYIELD();
+ }
+ #endif /* #if ( configNUMBER_OF_CORES > 1 ) */
+
+ for( ; configCONTROL_INFINITE_LOOP(); )
{
/* See if any tasks have deleted themselves - if so then the idle task
* is responsible for freeing the deleted task's TCB and stack. */
@@ -3462,9 +5791,10 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
*
* A critical region is not required here as we are just reading from
* the list, and an occasional incorrect value will not matter. If
- * the ready list at the idle priority contains more than one task
+ * the ready list at the idle priority contains one more task than the
+ * number of idle tasks, which is equal to the configured numbers of cores
* then a task other than the idle task is ready to execute. */
- if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) > ( UBaseType_t ) 1 )
+ if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) > ( UBaseType_t ) configNUMBER_OF_CORES )
{
taskYIELD();
}
@@ -3477,13 +5807,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
#if ( configUSE_IDLE_HOOK == 1 )
{
- extern void vApplicationIdleHook( void );
-
- /* Call the user defined function from within the idle task. This
- * allows the application designer to add background functionality
- * without the overhead of a separate task.
- * NOTE: vApplicationIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES,
- * CALL A FUNCTION THAT MIGHT BLOCK. */
+ /* Call the user defined function from within the idle task. */
vApplicationIdleHook();
}
#endif /* configUSE_IDLE_HOOK */
@@ -3503,7 +5827,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
* valid. */
xExpectedIdleTime = prvGetExpectedIdleTime();
- if( xExpectedIdleTime >= configEXPECTED_IDLE_TIME_BEFORE_SLEEP )
+ if( xExpectedIdleTime >= ( TickType_t ) configEXPECTED_IDLE_TIME_BEFORE_SLEEP )
{
vTaskSuspendAll();
{
@@ -3518,7 +5842,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
* portSUPPRESS_TICKS_AND_SLEEP() to be called. */
configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( xExpectedIdleTime );
- if( xExpectedIdleTime >= configEXPECTED_IDLE_TIME_BEFORE_SLEEP )
+ if( xExpectedIdleTime >= ( TickType_t ) configEXPECTED_IDLE_TIME_BEFORE_SLEEP )
{
traceLOW_POWER_IDLE_BEGIN();
portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime );
@@ -3537,6 +5861,20 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
}
}
#endif /* configUSE_TICKLESS_IDLE */
+
+ #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_PASSIVE_IDLE_HOOK == 1 ) )
+ {
+ /* Call the user defined function from within the idle task. This
+ * allows the application designer to add background functionality
+ * without the overhead of a separate task.
+ *
+ * This hook is intended to manage core activity such as disabling cores that go idle.
+ *
+ * NOTE: vApplicationPassiveIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES,
+ * CALL A FUNCTION THAT MIGHT BLOCK. */
+ vApplicationPassiveIdleHook();
+ }
+ #endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_PASSIVE_IDLE_HOOK == 1 ) ) */
}
}
/*-----------------------------------------------------------*/
@@ -3547,24 +5885,26 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
{
#if ( INCLUDE_vTaskSuspend == 1 )
/* The idle task exists in addition to the application tasks. */
- const UBaseType_t uxNonApplicationTasks = 1;
+ const UBaseType_t uxNonApplicationTasks = configNUMBER_OF_CORES;
#endif /* INCLUDE_vTaskSuspend */
eSleepModeStatus eReturn = eStandardSleep;
+ traceENTER_eTaskConfirmSleepModeStatus();
+
/* This function must be called from a critical section. */
- if( listCURRENT_LIST_LENGTH( &xPendingReadyList ) != 0 )
+ if( listCURRENT_LIST_LENGTH( &xPendingReadyList ) != 0U )
{
/* A task was made ready while the scheduler was suspended. */
eReturn = eAbortSleep;
}
- else if( xYieldPending != pdFALSE )
+ else if( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE )
{
/* A yield was pended while the scheduler was suspended. */
eReturn = eAbortSleep;
}
- else if( xPendedTicks != 0 )
+ else if( xPendedTicks != 0U )
{
/* A tick interrupt has already occurred but was held pending
* because the scheduler is suspended. */
@@ -3586,6 +5926,8 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
mtCOVERAGE_TEST_MARKER();
}
+ traceRETURN_eTaskConfirmSleepModeStatus( eReturn );
+
return eReturn;
}
@@ -3600,13 +5942,17 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
{
TCB_t * pxTCB;
+ traceENTER_vTaskSetThreadLocalStoragePointer( xTaskToSet, xIndex, pvValue );
+
if( ( xIndex >= 0 ) &&
- ( xIndex < configNUM_THREAD_LOCAL_STORAGE_POINTERS ) )
+ ( xIndex < ( BaseType_t ) configNUM_THREAD_LOCAL_STORAGE_POINTERS ) )
{
pxTCB = prvGetTCBFromHandle( xTaskToSet );
configASSERT( pxTCB != NULL );
pxTCB->pvThreadLocalStoragePointers[ xIndex ] = pvValue;
}
+
+ traceRETURN_vTaskSetThreadLocalStoragePointer();
}
#endif /* configNUM_THREAD_LOCAL_STORAGE_POINTERS */
@@ -3620,8 +5966,10 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
void * pvReturn = NULL;
TCB_t * pxTCB;
+ traceENTER_pvTaskGetThreadLocalStoragePointer( xTaskToQuery, xIndex );
+
if( ( xIndex >= 0 ) &&
- ( xIndex < configNUM_THREAD_LOCAL_STORAGE_POINTERS ) )
+ ( xIndex < ( BaseType_t ) configNUM_THREAD_LOCAL_STORAGE_POINTERS ) )
{
pxTCB = prvGetTCBFromHandle( xTaskToQuery );
pvReturn = pxTCB->pvThreadLocalStoragePointers[ xIndex ];
@@ -3631,6 +5979,8 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
pvReturn = NULL;
}
+ traceRETURN_pvTaskGetThreadLocalStoragePointer( pvReturn );
+
return pvReturn;
}
@@ -3640,15 +5990,19 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
#if ( portUSING_MPU_WRAPPERS == 1 )
void vTaskAllocateMPURegions( TaskHandle_t xTaskToModify,
- const MemoryRegion_t * const xRegions )
+ const MemoryRegion_t * const pxRegions )
{
TCB_t * pxTCB;
+ traceENTER_vTaskAllocateMPURegions( xTaskToModify, pxRegions );
+
/* If null is passed in here then we are modifying the MPU settings of
* the calling task. */
pxTCB = prvGetTCBFromHandle( xTaskToModify );
- vPortStoreTaskMPUSettings( &( pxTCB->xMPUSettings ), xRegions, NULL, 0 );
+ vPortStoreTaskMPUSettings( &( pxTCB->xMPUSettings ), pxRegions, NULL, 0 );
+
+ traceRETURN_vTaskAllocateMPURegions();
}
#endif /* portUSING_MPU_WRAPPERS */
@@ -3698,16 +6052,64 @@ static void prvCheckTasksWaitingTermination( void )
* being called too often in the idle task. */
while( uxDeletedTasksWaitingCleanUp > ( UBaseType_t ) 0U )
{
- taskENTER_CRITICAL();
+ #if ( configNUMBER_OF_CORES == 1 )
{
- pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
- ( void ) uxListRemove( &( pxTCB->xStateListItem ) );
- --uxCurrentNumberOfTasks;
- --uxDeletedTasksWaitingCleanUp;
+ taskENTER_CRITICAL();
+ {
+ {
+ /* MISRA Ref 11.5.3 [Void pointer assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) );
+ ( void ) uxListRemove( &( pxTCB->xStateListItem ) );
+ --uxCurrentNumberOfTasks;
+ --uxDeletedTasksWaitingCleanUp;
+ }
+ }
+ taskEXIT_CRITICAL();
+
+ prvDeleteTCB( pxTCB );
}
- taskEXIT_CRITICAL();
+ #else /* #if( configNUMBER_OF_CORES == 1 ) */
+ {
+ pxTCB = NULL;
- prvDeleteTCB( pxTCB );
+ taskENTER_CRITICAL();
+ {
+ /* For SMP, multiple idles can be running simultaneously
+ * and we need to check that other idles did not cleanup while we were
+ * waiting to enter the critical section. */
+ if( uxDeletedTasksWaitingCleanUp > ( UBaseType_t ) 0U )
+ {
+ /* MISRA Ref 11.5.3 [Void pointer assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) );
+
+ if( pxTCB->xTaskRunState == taskTASK_NOT_RUNNING )
+ {
+ ( void ) uxListRemove( &( pxTCB->xStateListItem ) );
+ --uxCurrentNumberOfTasks;
+ --uxDeletedTasksWaitingCleanUp;
+ }
+ else
+ {
+ /* The TCB to be deleted still has not yet been switched out
+ * by the scheduler, so we will just exit this loop early and
+ * try again next time. */
+ taskEXIT_CRITICAL();
+ break;
+ }
+ }
+ }
+ taskEXIT_CRITICAL();
+
+ if( pxTCB != NULL )
+ {
+ prvDeleteTCB( pxTCB );
+ }
+ }
+ #endif /* #if( configNUMBER_OF_CORES == 1 ) */
}
}
#endif /* INCLUDE_vTaskDelete */
@@ -3723,19 +6125,27 @@ static void prvCheckTasksWaitingTermination( void )
{
TCB_t * pxTCB;
+ traceENTER_vTaskGetInfo( xTask, pxTaskStatus, xGetFreeStackSpace, eState );
+
/* xTask is NULL then get the state of the calling task. */
pxTCB = prvGetTCBFromHandle( xTask );
- pxTaskStatus->xHandle = ( TaskHandle_t ) pxTCB;
+ pxTaskStatus->xHandle = pxTCB;
pxTaskStatus->pcTaskName = ( const char * ) &( pxTCB->pcTaskName[ 0 ] );
pxTaskStatus->uxCurrentPriority = pxTCB->uxPriority;
pxTaskStatus->pxStackBase = pxTCB->pxStack;
- #if ( ( portSTACK_GROWTH > 0 ) && ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
- pxTaskStatus->pxTopOfStack = pxTCB->pxTopOfStack;
+ #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
+ pxTaskStatus->pxTopOfStack = ( StackType_t * ) pxTCB->pxTopOfStack;
pxTaskStatus->pxEndOfStack = pxTCB->pxEndOfStack;
#endif
pxTaskStatus->xTaskNumber = pxTCB->uxTCBNumber;
+ #if ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
+ {
+ pxTaskStatus->uxCoreAffinityMask = pxTCB->uxCoreAffinityMask;
+ }
+ #endif
+
#if ( configUSE_MUTEXES == 1 )
{
pxTaskStatus->uxBasePriority = pxTCB->uxBasePriority;
@@ -3761,7 +6171,7 @@ static void prvCheckTasksWaitingTermination( void )
* state is just set to whatever is passed in. */
if( eState != eInvalid )
{
- if( pxTCB == pxCurrentTCB )
+ if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE )
{
pxTaskStatus->eCurrentState = eRunning;
}
@@ -3782,11 +6192,45 @@ static void prvCheckTasksWaitingTermination( void )
{
pxTaskStatus->eCurrentState = eBlocked;
}
+ else
+ {
+ #if ( configUSE_TASK_NOTIFICATIONS == 1 )
+ {
+ BaseType_t x;
+
+ /* The task does not appear on the event list item of
+ * and of the RTOS objects, but could still be in the
+ * blocked state if it is waiting on its notification
+ * rather than waiting on an object. If not, is
+ * suspended. */
+ for( x = ( BaseType_t ) 0; x < ( BaseType_t ) configTASK_NOTIFICATION_ARRAY_ENTRIES; x++ )
+ {
+ if( pxTCB->ucNotifyState[ x ] == taskWAITING_NOTIFICATION )
+ {
+ pxTaskStatus->eCurrentState = eBlocked;
+ break;
+ }
+ }
+ }
+ #endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
+ }
}
( void ) xTaskResumeAll();
}
}
#endif /* INCLUDE_vTaskSuspend */
+
+ /* Tasks can be in pending ready list and other state list at the
+ * same time. These tasks are in ready state no matter what state
+ * list the task is in. */
+ taskENTER_CRITICAL();
+ {
+ if( listIS_CONTAINED_WITHIN( &xPendingReadyList, &( pxTCB->xEventListItem ) ) != pdFALSE )
+ {
+ pxTaskStatus->eCurrentState = eReady;
+ }
+ }
+ taskEXIT_CRITICAL();
}
}
else
@@ -3812,6 +6256,8 @@ static void prvCheckTasksWaitingTermination( void )
{
pxTaskStatus->usStackHighWaterMark = 0;
}
+
+ traceRETURN_vTaskGetInfo();
}
#endif /* configUSE_TRACE_FACILITY */
@@ -3823,24 +6269,27 @@ static void prvCheckTasksWaitingTermination( void )
List_t * pxList,
eTaskState eState )
{
- configLIST_VOLATILE TCB_t * pxNextTCB;
- configLIST_VOLATILE TCB_t * pxFirstTCB;
UBaseType_t uxTask = 0;
+ const ListItem_t * pxEndMarker = listGET_END_MARKER( pxList );
+ ListItem_t * pxIterator;
+ TCB_t * pxTCB = NULL;
if( listCURRENT_LIST_LENGTH( pxList ) > ( UBaseType_t ) 0 )
{
- listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
-
/* Populate an TaskStatus_t structure within the
* pxTaskStatusArray array for each task that is referenced from
* pxList. See the definition of TaskStatus_t in task.h for the
* meaning of each TaskStatus_t structure member. */
- do
+ for( pxIterator = listGET_HEAD_ENTRY( pxList ); pxIterator != pxEndMarker; pxIterator = listGET_NEXT( pxIterator ) )
{
- listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
- vTaskGetInfo( ( TaskHandle_t ) pxNextTCB, &( pxTaskStatusArray[ uxTask ] ), pdTRUE, eState );
+ /* MISRA Ref 11.5.3 [Void pointer assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxTCB = listGET_LIST_ITEM_OWNER( pxIterator );
+
+ vTaskGetInfo( ( TaskHandle_t ) pxTCB, &( pxTaskStatusArray[ uxTask ] ), pdTRUE, eState );
uxTask++;
- } while( pxNextTCB != pxFirstTCB );
+ }
}
else
{
@@ -3857,17 +6306,17 @@ static void prvCheckTasksWaitingTermination( void )
static configSTACK_DEPTH_TYPE prvTaskCheckFreeStackSpace( const uint8_t * pucStackByte )
{
- uint32_t ulCount = 0U;
+ configSTACK_DEPTH_TYPE uxCount = 0U;
while( *pucStackByte == ( uint8_t ) tskSTACK_FILL_BYTE )
{
pucStackByte -= portSTACK_GROWTH;
- ulCount++;
+ uxCount++;
}
- ulCount /= ( uint32_t ) sizeof( StackType_t ); /*lint !e961 Casting is not redundant on smaller architectures. */
+ uxCount /= ( configSTACK_DEPTH_TYPE ) sizeof( StackType_t );
- return ( configSTACK_DEPTH_TYPE ) ulCount;
+ return uxCount;
}
#endif /* ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 ) ) */
@@ -3886,6 +6335,8 @@ static void prvCheckTasksWaitingTermination( void )
uint8_t * pucEndOfStack;
configSTACK_DEPTH_TYPE uxReturn;
+ traceENTER_uxTaskGetStackHighWaterMark2( xTask );
+
/* uxTaskGetStackHighWaterMark() and uxTaskGetStackHighWaterMark2() are
* the same except for their return type. Using configSTACK_DEPTH_TYPE
* allows the user to determine the return type. It gets around the
@@ -3907,6 +6358,8 @@ static void prvCheckTasksWaitingTermination( void )
uxReturn = prvTaskCheckFreeStackSpace( pucEndOfStack );
+ traceRETURN_uxTaskGetStackHighWaterMark2( uxReturn );
+
return uxReturn;
}
@@ -3921,6 +6374,8 @@ static void prvCheckTasksWaitingTermination( void )
uint8_t * pucEndOfStack;
UBaseType_t uxReturn;
+ traceENTER_uxTaskGetStackHighWaterMark( xTask );
+
pxTCB = prvGetTCBFromHandle( xTask );
#if portSTACK_GROWTH < 0
@@ -3935,6 +6390,8 @@ static void prvCheckTasksWaitingTermination( void )
uxReturn = ( UBaseType_t ) prvTaskCheckFreeStackSpace( pucEndOfStack );
+ traceRETURN_uxTaskGetStackHighWaterMark( uxReturn );
+
return uxReturn;
}
@@ -3950,10 +6407,10 @@ static void prvCheckTasksWaitingTermination( void )
* want to allocate and clean RAM statically. */
portCLEAN_UP_TCB( pxTCB );
- #if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
+ #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
{
/* Free up the memory allocated for the task's TLS Block. */
- configDEINIT_TLS_BLOCK( pxCurrentTCB->xTLSBlock );
+ configDEINIT_TLS_BLOCK( pxTCB->xTLSBlock );
}
#endif
@@ -3964,7 +6421,7 @@ static void prvCheckTasksWaitingTermination( void )
vPortFreeStack( pxTCB->pxStack );
vPortFree( pxTCB );
}
- #elif ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
+ #elif ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
{
/* The task could have been allocated statically or dynamically, so
* check what was statically allocated before trying to free the
@@ -4017,16 +6474,60 @@ static void prvResetNextTaskUnblockTime( void )
}
/*-----------------------------------------------------------*/
-#if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) )
+#if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) ) || ( configNUMBER_OF_CORES > 1 )
+
+ #if ( configNUMBER_OF_CORES == 1 )
+ TaskHandle_t xTaskGetCurrentTaskHandle( void )
+ {
+ TaskHandle_t xReturn;
+
+ traceENTER_xTaskGetCurrentTaskHandle();
+
+ /* A critical section is not required as this is not called from
+ * an interrupt and the current TCB will always be the same for any
+ * individual execution thread. */
+ xReturn = pxCurrentTCB;
+
+ traceRETURN_xTaskGetCurrentTaskHandle( xReturn );
+
+ return xReturn;
+ }
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
+ TaskHandle_t xTaskGetCurrentTaskHandle( void )
+ {
+ TaskHandle_t xReturn;
+ UBaseType_t uxSavedInterruptStatus;
+
+ traceENTER_xTaskGetCurrentTaskHandle();
+
+ uxSavedInterruptStatus = portSET_INTERRUPT_MASK();
+ {
+ xReturn = pxCurrentTCBs[ portGET_CORE_ID() ];
+ }
+ portCLEAR_INTERRUPT_MASK( uxSavedInterruptStatus );
+
+ traceRETURN_xTaskGetCurrentTaskHandle( xReturn );
+
+ return xReturn;
+ }
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
- TaskHandle_t xTaskGetCurrentTaskHandle( void )
+ TaskHandle_t xTaskGetCurrentTaskHandleForCore( BaseType_t xCoreID )
{
- TaskHandle_t xReturn;
+ TaskHandle_t xReturn = NULL;
+
+ traceENTER_xTaskGetCurrentTaskHandleForCore( xCoreID );
+
+ if( taskVALID_CORE_ID( xCoreID ) != pdFALSE )
+ {
+ #if ( configNUMBER_OF_CORES == 1 )
+ xReturn = pxCurrentTCB;
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
+ xReturn = pxCurrentTCBs[ xCoreID ];
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+ }
- /* A critical section is not required as this is not called from
- * an interrupt and the current TCB will always be the same for any
- * individual execution thread. */
- xReturn = pxCurrentTCB;
+ traceRETURN_xTaskGetCurrentTaskHandleForCore( xReturn );
return xReturn;
}
@@ -4040,22 +6541,34 @@ static void prvResetNextTaskUnblockTime( void )
{
BaseType_t xReturn;
+ traceENTER_xTaskGetSchedulerState();
+
if( xSchedulerRunning == pdFALSE )
{
xReturn = taskSCHEDULER_NOT_STARTED;
}
else
{
- if( uxSchedulerSuspended == ( UBaseType_t ) pdFALSE )
- {
- xReturn = taskSCHEDULER_RUNNING;
- }
- else
+ #if ( configNUMBER_OF_CORES > 1 )
+ taskENTER_CRITICAL();
+ #endif
{
- xReturn = taskSCHEDULER_SUSPENDED;
+ if( uxSchedulerSuspended == ( UBaseType_t ) 0U )
+ {
+ xReturn = taskSCHEDULER_RUNNING;
+ }
+ else
+ {
+ xReturn = taskSCHEDULER_SUSPENDED;
+ }
}
+ #if ( configNUMBER_OF_CORES > 1 )
+ taskEXIT_CRITICAL();
+ #endif
}
+ traceRETURN_xTaskGetSchedulerState( xReturn );
+
return xReturn;
}
@@ -4069,9 +6582,10 @@ static void prvResetNextTaskUnblockTime( void )
TCB_t * const pxMutexHolderTCB = pxMutexHolder;
BaseType_t xReturn = pdFALSE;
- /* If the mutex was given back by an interrupt while the queue was
- * locked then the mutex holder might now be NULL. _RB_ Is this still
- * needed as interrupts can no longer use mutexes? */
+ traceENTER_xTaskPriorityInherit( pxMutexHolder );
+
+ /* If the mutex is taken by an interrupt, the mutex holder is NULL. Priority
+ * inheritance is not applied in this scenario. */
if( pxMutexHolder != NULL )
{
/* If the holder of the mutex has a priority below the priority of
@@ -4082,9 +6596,9 @@ static void prvResetNextTaskUnblockTime( void )
/* Adjust the mutex holder state to account for its new
* priority. Only reset the event list item value if the value is
* not being used for anything else. */
- if( ( listGET_LIST_ITEM_VALUE( &( pxMutexHolderTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) == 0UL )
+ if( ( listGET_LIST_ITEM_VALUE( &( pxMutexHolderTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) == ( ( TickType_t ) 0U ) )
{
- listSET_LIST_ITEM_VALUE( &( pxMutexHolderTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) pxCurrentTCB->uxPriority ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
+ listSET_LIST_ITEM_VALUE( &( pxMutexHolderTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) pxCurrentTCB->uxPriority );
}
else
{
@@ -4110,6 +6624,16 @@ static void prvResetNextTaskUnblockTime( void )
/* Inherit the priority before being moved into the new list. */
pxMutexHolderTCB->uxPriority = pxCurrentTCB->uxPriority;
prvAddTaskToReadyList( pxMutexHolderTCB );
+ #if ( configNUMBER_OF_CORES > 1 )
+ {
+ /* The priority of the task is raised. Yield for this task
+ * if it is not running. */
+ if( taskTASK_IS_RUNNING( pxMutexHolderTCB ) != pdTRUE )
+ {
+ prvYieldForTask( pxMutexHolderTCB );
+ }
+ }
+ #endif /* if ( configNUMBER_OF_CORES > 1 ) */
}
else
{
@@ -4146,6 +6670,8 @@ static void prvResetNextTaskUnblockTime( void )
mtCOVERAGE_TEST_MARKER();
}
+ traceRETURN_xTaskPriorityInherit( xReturn );
+
return xReturn;
}
@@ -4159,6 +6685,8 @@ static void prvResetNextTaskUnblockTime( void )
TCB_t * const pxTCB = pxMutexHolder;
BaseType_t xReturn = pdFALSE;
+ traceENTER_xTaskPriorityDisinherit( pxMutexHolder );
+
if( pxMutexHolder != NULL )
{
/* A task can only have an inherited priority if it holds the mutex.
@@ -4198,8 +6726,18 @@ static void prvResetNextTaskUnblockTime( void )
/* Reset the event list item value. It cannot be in use for
* any other purpose if this task is running, and it must be
* running to give back the mutex. */
- listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) pxTCB->uxPriority ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
+ listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) pxTCB->uxPriority );
prvAddTaskToReadyList( pxTCB );
+ #if ( configNUMBER_OF_CORES > 1 )
+ {
+ /* The priority of the task is dropped. Yield the core on
+ * which the task is running. */
+ if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE )
+ {
+ prvYieldCore( pxTCB->xTaskRunState );
+ }
+ }
+ #endif /* if ( configNUMBER_OF_CORES > 1 ) */
/* Return true to indicate that a context switch is required.
* This is only actually required in the corner case whereby
@@ -4226,6 +6764,8 @@ static void prvResetNextTaskUnblockTime( void )
mtCOVERAGE_TEST_MARKER();
}
+ traceRETURN_xTaskPriorityDisinherit( xReturn );
+
return xReturn;
}
@@ -4241,6 +6781,8 @@ static void prvResetNextTaskUnblockTime( void )
UBaseType_t uxPriorityUsedOnEntry, uxPriorityToUse;
const UBaseType_t uxOnlyOneMutexHeld = ( UBaseType_t ) 1;
+ traceENTER_vTaskPriorityDisinheritAfterTimeout( pxMutexHolder, uxHighestPriorityWaitingTask );
+
if( pxMutexHolder != NULL )
{
/* If pxMutexHolder is not NULL then the holder must hold at least
@@ -4283,9 +6825,9 @@ static void prvResetNextTaskUnblockTime( void )
/* Only reset the event list item value if the value is not
* being used for anything else. */
- if( ( listGET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) == 0UL )
+ if( ( listGET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ) ) & taskEVENT_LIST_ITEM_VALUE_IN_USE ) == ( ( TickType_t ) 0U ) )
{
- listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) uxPriorityToUse ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
+ listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) uxPriorityToUse );
}
else
{
@@ -4313,6 +6855,16 @@ static void prvResetNextTaskUnblockTime( void )
}
prvAddTaskToReadyList( pxTCB );
+ #if ( configNUMBER_OF_CORES > 1 )
+ {
+ /* The priority of the task is dropped. Yield the core on
+ * which the task is running. */
+ if( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE )
+ {
+ prvYieldCore( pxTCB->xTaskRunState );
+ }
+ }
+ #endif /* if ( configNUMBER_OF_CORES > 1 ) */
}
else
{
@@ -4333,15 +6885,44 @@ static void prvResetNextTaskUnblockTime( void )
{
mtCOVERAGE_TEST_MARKER();
}
+
+ traceRETURN_vTaskPriorityDisinheritAfterTimeout();
}
#endif /* configUSE_MUTEXES */
/*-----------------------------------------------------------*/
-#if ( portCRITICAL_NESTING_IN_TCB == 1 )
+#if ( configNUMBER_OF_CORES > 1 )
+
+/* If not in a critical section then yield immediately.
+ * Otherwise set xYieldPendings to true to wait to
+ * yield until exiting the critical section.
+ */
+ void vTaskYieldWithinAPI( void )
+ {
+ traceENTER_vTaskYieldWithinAPI();
+
+ if( portGET_CRITICAL_NESTING_COUNT() == 0U )
+ {
+ portYIELD();
+ }
+ else
+ {
+ xYieldPendings[ portGET_CORE_ID() ] = pdTRUE;
+ }
+
+ traceRETURN_vTaskYieldWithinAPI();
+ }
+#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
+
+/*-----------------------------------------------------------*/
+
+#if ( ( portCRITICAL_NESTING_IN_TCB == 1 ) && ( configNUMBER_OF_CORES == 1 ) )
void vTaskEnterCritical( void )
{
+ traceENTER_vTaskEnterCritical();
+
portDISABLE_INTERRUPTS();
if( xSchedulerRunning != pdFALSE )
@@ -4354,26 +6935,120 @@ static void prvResetNextTaskUnblockTime( void )
* interrupt. Only assert if the critical nesting count is 1 to
* protect against recursive calls if the assert function also uses a
* critical section. */
- if( pxCurrentTCB->uxCriticalNesting == 1 )
+ if( pxCurrentTCB->uxCriticalNesting == 1U )
+ {
+ portASSERT_IF_IN_ISR();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ traceRETURN_vTaskEnterCritical();
+ }
+
+#endif /* #if ( ( portCRITICAL_NESTING_IN_TCB == 1 ) && ( configNUMBER_OF_CORES == 1 ) ) */
+/*-----------------------------------------------------------*/
+
+#if ( configNUMBER_OF_CORES > 1 )
+
+ void vTaskEnterCritical( void )
+ {
+ traceENTER_vTaskEnterCritical();
+
+ portDISABLE_INTERRUPTS();
+
+ if( xSchedulerRunning != pdFALSE )
+ {
+ if( portGET_CRITICAL_NESTING_COUNT() == 0U )
+ {
+ portGET_TASK_LOCK();
+ portGET_ISR_LOCK();
+ }
+
+ portINCREMENT_CRITICAL_NESTING_COUNT();
+
+ /* This is not the interrupt safe version of the enter critical
+ * function so assert() if it is being called from an interrupt
+ * context. Only API functions that end in "FromISR" can be used in an
+ * interrupt. Only assert if the critical nesting count is 1 to
+ * protect against recursive calls if the assert function also uses a
+ * critical section. */
+ if( portGET_CRITICAL_NESTING_COUNT() == 1U )
{
portASSERT_IF_IN_ISR();
+
+ if( uxSchedulerSuspended == 0U )
+ {
+ /* The only time there would be a problem is if this is called
+ * before a context switch and vTaskExitCritical() is called
+ * after pxCurrentTCB changes. Therefore this should not be
+ * used within vTaskSwitchContext(). */
+ prvCheckForRunStateChange();
+ }
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ traceRETURN_vTaskEnterCritical();
+ }
+
+#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
+
+/*-----------------------------------------------------------*/
+
+#if ( configNUMBER_OF_CORES > 1 )
+
+ UBaseType_t vTaskEnterCriticalFromISR( void )
+ {
+ UBaseType_t uxSavedInterruptStatus = 0;
+
+ traceENTER_vTaskEnterCriticalFromISR();
+
+ if( xSchedulerRunning != pdFALSE )
+ {
+ uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
+
+ if( portGET_CRITICAL_NESTING_COUNT() == 0U )
+ {
+ portGET_ISR_LOCK();
}
+
+ portINCREMENT_CRITICAL_NESTING_COUNT();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
+
+ traceRETURN_vTaskEnterCriticalFromISR( uxSavedInterruptStatus );
+
+ return uxSavedInterruptStatus;
}
-#endif /* portCRITICAL_NESTING_IN_TCB */
+#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
/*-----------------------------------------------------------*/
-#if ( portCRITICAL_NESTING_IN_TCB == 1 )
+#if ( ( portCRITICAL_NESTING_IN_TCB == 1 ) && ( configNUMBER_OF_CORES == 1 ) )
void vTaskExitCritical( void )
{
+ traceENTER_vTaskExitCritical();
+
if( xSchedulerRunning != pdFALSE )
{
+ /* If pxCurrentTCB->uxCriticalNesting is zero then this function
+ * does not match a previous call to vTaskEnterCritical(). */
+ configASSERT( pxCurrentTCB->uxCriticalNesting > 0U );
+
+ /* This function should not be called in ISR. Use vTaskExitCriticalFromISR
+ * to exit critical section from ISR. */
+ portASSERT_IF_IN_ISR();
+
if( pxCurrentTCB->uxCriticalNesting > 0U )
{
( pxCurrentTCB->uxCriticalNesting )--;
@@ -4396,9 +7071,114 @@ static void prvResetNextTaskUnblockTime( void )
{
mtCOVERAGE_TEST_MARKER();
}
+
+ traceRETURN_vTaskExitCritical();
+ }
+
+#endif /* #if ( ( portCRITICAL_NESTING_IN_TCB == 1 ) && ( configNUMBER_OF_CORES == 1 ) ) */
+/*-----------------------------------------------------------*/
+
+#if ( configNUMBER_OF_CORES > 1 )
+
+ void vTaskExitCritical( void )
+ {
+ traceENTER_vTaskExitCritical();
+
+ if( xSchedulerRunning != pdFALSE )
+ {
+ /* If critical nesting count is zero then this function
+ * does not match a previous call to vTaskEnterCritical(). */
+ configASSERT( portGET_CRITICAL_NESTING_COUNT() > 0U );
+
+ /* This function should not be called in ISR. Use vTaskExitCriticalFromISR
+ * to exit critical section from ISR. */
+ portASSERT_IF_IN_ISR();
+
+ if( portGET_CRITICAL_NESTING_COUNT() > 0U )
+ {
+ portDECREMENT_CRITICAL_NESTING_COUNT();
+
+ if( portGET_CRITICAL_NESTING_COUNT() == 0U )
+ {
+ BaseType_t xYieldCurrentTask;
+
+ /* Get the xYieldPending stats inside the critical section. */
+ xYieldCurrentTask = xYieldPendings[ portGET_CORE_ID() ];
+
+ portRELEASE_ISR_LOCK();
+ portRELEASE_TASK_LOCK();
+ portENABLE_INTERRUPTS();
+
+ /* When a task yields in a critical section it just sets
+ * xYieldPending to true. So now that we have exited the
+ * critical section check if xYieldPending is true, and
+ * if so yield. */
+ if( xYieldCurrentTask != pdFALSE )
+ {
+ portYIELD();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ traceRETURN_vTaskExitCritical();
+ }
+
+#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
+/*-----------------------------------------------------------*/
+
+#if ( configNUMBER_OF_CORES > 1 )
+
+ void vTaskExitCriticalFromISR( UBaseType_t uxSavedInterruptStatus )
+ {
+ traceENTER_vTaskExitCriticalFromISR( uxSavedInterruptStatus );
+
+ if( xSchedulerRunning != pdFALSE )
+ {
+ /* If critical nesting count is zero then this function
+ * does not match a previous call to vTaskEnterCritical(). */
+ configASSERT( portGET_CRITICAL_NESTING_COUNT() > 0U );
+
+ if( portGET_CRITICAL_NESTING_COUNT() > 0U )
+ {
+ portDECREMENT_CRITICAL_NESTING_COUNT();
+
+ if( portGET_CRITICAL_NESTING_COUNT() == 0U )
+ {
+ portRELEASE_ISR_LOCK();
+ portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ traceRETURN_vTaskExitCriticalFromISR();
}
-#endif /* portCRITICAL_NESTING_IN_TCB */
+#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
/*-----------------------------------------------------------*/
#if ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 )
@@ -4409,11 +7189,11 @@ static void prvResetNextTaskUnblockTime( void )
size_t x;
/* Start by copying the entire string. */
- strcpy( pcBuffer, pcTaskName );
+ ( void ) strcpy( pcBuffer, pcTaskName );
/* Pad the end of the string with spaces to ensure columns line up when
* printed out. */
- for( x = strlen( pcBuffer ); x < ( size_t ) ( configMAX_TASK_NAME_LEN - 1 ); x++ )
+ for( x = strlen( pcBuffer ); x < ( size_t ) ( ( size_t ) configMAX_TASK_NAME_LEN - 1U ); x++ )
{
pcBuffer[ x ] = ' ';
}
@@ -4430,12 +7210,19 @@ static void prvResetNextTaskUnblockTime( void )
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )
- void vTaskList( char * pcWriteBuffer )
+ void vTaskListTasks( char * pcWriteBuffer,
+ size_t uxBufferLength )
{
TaskStatus_t * pxTaskStatusArray;
+ size_t uxConsumedBufferLength = 0;
+ size_t uxCharsWrittenBySnprintf;
+ int iSnprintfReturnValue;
+ BaseType_t xOutputBufferFull = pdFALSE;
UBaseType_t uxArraySize, x;
char cStatus;
+ traceENTER_vTaskListTasks( pcWriteBuffer, uxBufferLength );
+
/*
* PLEASE NOTE:
*
@@ -4443,23 +7230,23 @@ static void prvResetNextTaskUnblockTime( void )
* of the demo applications. Do not consider it to be part of the
* scheduler.
*
- * vTaskList() calls uxTaskGetSystemState(), then formats part of the
+ * vTaskListTasks() calls uxTaskGetSystemState(), then formats part of the
* uxTaskGetSystemState() output into a human readable table that
* displays task: names, states, priority, stack usage and task number.
* Stack usage specified as the number of unused StackType_t words stack can hold
* on top of stack - not the number of bytes.
*
- * vTaskList() has a dependency on the sprintf() C library function that
+ * vTaskListTasks() has a dependency on the snprintf() C library function that
* might bloat the code size, use a lot of stack, and provide different
* results on different platforms. An alternative, tiny, third party,
- * and limited functionality implementation of sprintf() is provided in
+ * and limited functionality implementation of snprintf() is provided in
* many of the FreeRTOS/Demo sub-directories in a file called
* printf-stdarg.c (note printf-stdarg.c does not provide a full
* snprintf() implementation!).
*
* It is recommended that production systems call uxTaskGetSystemState()
* directly to get access to raw stats data, rather than indirectly
- * through a call to vTaskList().
+ * through a call to vTaskListTasks().
*/
@@ -4473,7 +7260,10 @@ static void prvResetNextTaskUnblockTime( void )
/* Allocate an array index for each task. NOTE! if
* configSUPPORT_DYNAMIC_ALLOCATION is set to 0 then pvPortMalloc() will
* equate to NULL. */
- pxTaskStatusArray = pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation allocates a struct that has the alignment requirements of a pointer. */
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxTaskStatusArray = pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) );
if( pxTaskStatusArray != NULL )
{
@@ -4512,13 +7302,65 @@ static void prvResetNextTaskUnblockTime( void )
break;
}
- /* Write the task name to the string, padding with spaces so it
- * can be printed in tabular form more easily. */
- pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
+ /* Is there enough space in the buffer to hold task name? */
+ if( ( uxConsumedBufferLength + configMAX_TASK_NAME_LEN ) <= uxBufferLength )
+ {
+ /* Write the task name to the string, padding with spaces so it
+ * can be printed in tabular form more easily. */
+ pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
+ /* Do not count the terminating null character. */
+ uxConsumedBufferLength = uxConsumedBufferLength + ( configMAX_TASK_NAME_LEN - 1U );
+
+ /* Is there space left in the buffer? -1 is done because snprintf
+ * writes a terminating null character. So we are essentially
+ * checking if the buffer has space to write at least one non-null
+ * character. */
+ if( uxConsumedBufferLength < ( uxBufferLength - 1U ) )
+ {
+ /* Write the rest of the string. */
+ #if ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
+ /* MISRA Ref 21.6.1 [snprintf for utility] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-216 */
+ /* coverity[misra_c_2012_rule_21_6_violation] */
+ iSnprintfReturnValue = snprintf( pcWriteBuffer,
+ uxBufferLength - uxConsumedBufferLength,
+ "\t%c\t%u\t%u\t%u\t0x%x\r\n",
+ cStatus,
+ ( unsigned int ) pxTaskStatusArray[ x ].uxCurrentPriority,
+ ( unsigned int ) pxTaskStatusArray[ x ].usStackHighWaterMark,
+ ( unsigned int ) pxTaskStatusArray[ x ].xTaskNumber,
+ ( unsigned int ) pxTaskStatusArray[ x ].uxCoreAffinityMask );
+ #else /* ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
+ /* MISRA Ref 21.6.1 [snprintf for utility] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-216 */
+ /* coverity[misra_c_2012_rule_21_6_violation] */
+ iSnprintfReturnValue = snprintf( pcWriteBuffer,
+ uxBufferLength - uxConsumedBufferLength,
+ "\t%c\t%u\t%u\t%u\r\n",
+ cStatus,
+ ( unsigned int ) pxTaskStatusArray[ x ].uxCurrentPriority,
+ ( unsigned int ) pxTaskStatusArray[ x ].usStackHighWaterMark,
+ ( unsigned int ) pxTaskStatusArray[ x ].xTaskNumber );
+ #endif /* ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
+ uxCharsWrittenBySnprintf = prvSnprintfReturnValueToCharsWritten( iSnprintfReturnValue, uxBufferLength - uxConsumedBufferLength );
+
+ uxConsumedBufferLength += uxCharsWrittenBySnprintf;
+ pcWriteBuffer += uxCharsWrittenBySnprintf;
+ }
+ else
+ {
+ xOutputBufferFull = pdTRUE;
+ }
+ }
+ else
+ {
+ xOutputBufferFull = pdTRUE;
+ }
- /* Write the rest of the string. */
- sprintf( pcWriteBuffer, "\t%c\t%u\t%u\t%u\r\n", cStatus, ( unsigned int ) pxTaskStatusArray[ x ].uxCurrentPriority, ( unsigned int ) pxTaskStatusArray[ x ].usStackHighWaterMark, ( unsigned int ) pxTaskStatusArray[ x ].xTaskNumber ); /*lint !e586 sprintf() allowed as this is compiled with many compilers and this is a utility function only - not part of the core kernel implementation. */
- pcWriteBuffer += strlen( pcWriteBuffer ); /*lint !e9016 Pointer arithmetic ok on char pointers especially as in this case where it best denotes the intent of the code. */
+ if( xOutputBufferFull == pdTRUE )
+ {
+ break;
+ }
}
/* Free the array again. NOTE! If configSUPPORT_DYNAMIC_ALLOCATION
@@ -4529,6 +7371,8 @@ static void prvResetNextTaskUnblockTime( void )
{
mtCOVERAGE_TEST_MARKER();
}
+
+ traceRETURN_vTaskListTasks();
}
#endif /* ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) ) */
@@ -4536,11 +7380,19 @@ static void prvResetNextTaskUnblockTime( void )
#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configUSE_TRACE_FACILITY == 1 ) )
- void vTaskGetRunTimeStats( char * pcWriteBuffer )
+ void vTaskGetRunTimeStatistics( char * pcWriteBuffer,
+ size_t uxBufferLength )
{
TaskStatus_t * pxTaskStatusArray;
+ size_t uxConsumedBufferLength = 0;
+ size_t uxCharsWrittenBySnprintf;
+ int iSnprintfReturnValue;
+ BaseType_t xOutputBufferFull = pdFALSE;
UBaseType_t uxArraySize, x;
- configRUN_TIME_COUNTER_TYPE ulTotalTime, ulStatsAsPercentage;
+ configRUN_TIME_COUNTER_TYPE ulTotalTime = 0;
+ configRUN_TIME_COUNTER_TYPE ulStatsAsPercentage;
+
+ traceENTER_vTaskGetRunTimeStatistics( pcWriteBuffer, uxBufferLength );
/*
* PLEASE NOTE:
@@ -4549,22 +7401,22 @@ static void prvResetNextTaskUnblockTime( void )
* of the demo applications. Do not consider it to be part of the
* scheduler.
*
- * vTaskGetRunTimeStats() calls uxTaskGetSystemState(), then formats part
+ * vTaskGetRunTimeStatistics() calls uxTaskGetSystemState(), then formats part
* of the uxTaskGetSystemState() output into a human readable table that
* displays the amount of time each task has spent in the Running state
* in both absolute and percentage terms.
*
- * vTaskGetRunTimeStats() has a dependency on the sprintf() C library
+ * vTaskGetRunTimeStatistics() has a dependency on the snprintf() C library
* function that might bloat the code size, use a lot of stack, and
* provide different results on different platforms. An alternative,
* tiny, third party, and limited functionality implementation of
- * sprintf() is provided in many of the FreeRTOS/Demo sub-directories in
+ * snprintf() is provided in many of the FreeRTOS/Demo sub-directories in
* a file called printf-stdarg.c (note printf-stdarg.c does not provide
* a full snprintf() implementation!).
*
* It is recommended that production systems call uxTaskGetSystemState()
* directly to get access to raw stats data, rather than indirectly
- * through a call to vTaskGetRunTimeStats().
+ * through a call to vTaskGetRunTimeStatistics().
*/
/* Make sure the write buffer does not contain a string. */
@@ -4577,7 +7429,10 @@ static void prvResetNextTaskUnblockTime( void )
/* Allocate an array index for each task. NOTE! If
* configSUPPORT_DYNAMIC_ALLOCATION is set to 0 then pvPortMalloc() will
* equate to NULL. */
- pxTaskStatusArray = pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation allocates a struct that has the alignment requirements of a pointer. */
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxTaskStatusArray = pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) );
if( pxTaskStatusArray != NULL )
{
@@ -4585,10 +7440,10 @@ static void prvResetNextTaskUnblockTime( void )
uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalTime );
/* For percentage calculations. */
- ulTotalTime /= 100UL;
+ ulTotalTime /= ( ( configRUN_TIME_COUNTER_TYPE ) 100U );
/* Avoid divide by zero errors. */
- if( ulTotalTime > 0UL )
+ if( ulTotalTime > 0U )
{
/* Create a human readable table from the binary data. */
for( x = 0; x < uxArraySize; x++ )
@@ -4598,43 +7453,97 @@ static void prvResetNextTaskUnblockTime( void )
* ulTotalRunTime has already been divided by 100. */
ulStatsAsPercentage = pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalTime;
- /* Write the task name to the string, padding with
- * spaces so it can be printed in tabular form more
- * easily. */
- pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
-
- if( ulStatsAsPercentage > 0UL )
- {
- #ifdef portLU_PRINTF_SPECIFIER_REQUIRED
- {
- sprintf( pcWriteBuffer, "\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].ulRunTimeCounter, ulStatsAsPercentage );
- }
- #else
- {
- /* sizeof( int ) == sizeof( long ) so a smaller
- * printf() library can be used. */
- sprintf( pcWriteBuffer, "\t%u\t\t%u%%\r\n", ( unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter, ( unsigned int ) ulStatsAsPercentage ); /*lint !e586 sprintf() allowed as this is compiled with many compilers and this is a utility function only - not part of the core kernel implementation. */
- }
- #endif
- }
- else
+ /* Is there enough space in the buffer to hold task name? */
+ if( ( uxConsumedBufferLength + configMAX_TASK_NAME_LEN ) <= uxBufferLength )
{
- /* If the percentage is zero here then the task has
- * consumed less than 1% of the total run time. */
- #ifdef portLU_PRINTF_SPECIFIER_REQUIRED
+ /* Write the task name to the string, padding with
+ * spaces so it can be printed in tabular form more
+ * easily. */
+ pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );
+ /* Do not count the terminating null character. */
+ uxConsumedBufferLength = uxConsumedBufferLength + ( configMAX_TASK_NAME_LEN - 1U );
+
+ /* Is there space left in the buffer? -1 is done because snprintf
+ * writes a terminating null character. So we are essentially
+ * checking if the buffer has space to write at least one non-null
+ * character. */
+ if( uxConsumedBufferLength < ( uxBufferLength - 1U ) )
{
- sprintf( pcWriteBuffer, "\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].ulRunTimeCounter );
+ if( ulStatsAsPercentage > 0U )
+ {
+ #ifdef portLU_PRINTF_SPECIFIER_REQUIRED
+ {
+ /* MISRA Ref 21.6.1 [snprintf for utility] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-216 */
+ /* coverity[misra_c_2012_rule_21_6_violation] */
+ iSnprintfReturnValue = snprintf( pcWriteBuffer,
+ uxBufferLength - uxConsumedBufferLength,
+ "\t%lu\t\t%lu%%\r\n",
+ pxTaskStatusArray[ x ].ulRunTimeCounter,
+ ulStatsAsPercentage );
+ }
+ #else /* ifdef portLU_PRINTF_SPECIFIER_REQUIRED */
+ {
+ /* sizeof( int ) == sizeof( long ) so a smaller
+ * printf() library can be used. */
+ /* MISRA Ref 21.6.1 [snprintf for utility] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-216 */
+ /* coverity[misra_c_2012_rule_21_6_violation] */
+ iSnprintfReturnValue = snprintf( pcWriteBuffer,
+ uxBufferLength - uxConsumedBufferLength,
+ "\t%u\t\t%u%%\r\n",
+ ( unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter,
+ ( unsigned int ) ulStatsAsPercentage );
+ }
+ #endif /* ifdef portLU_PRINTF_SPECIFIER_REQUIRED */
+ }
+ else
+ {
+ /* If the percentage is zero here then the task has
+ * consumed less than 1% of the total run time. */
+ #ifdef portLU_PRINTF_SPECIFIER_REQUIRED
+ {
+ /* MISRA Ref 21.6.1 [snprintf for utility] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-216 */
+ /* coverity[misra_c_2012_rule_21_6_violation] */
+ iSnprintfReturnValue = snprintf( pcWriteBuffer,
+ uxBufferLength - uxConsumedBufferLength,
+ "\t%lu\t\t<1%%\r\n",
+ pxTaskStatusArray[ x ].ulRunTimeCounter );
+ }
+ #else
+ {
+ /* sizeof( int ) == sizeof( long ) so a smaller
+ * printf() library can be used. */
+ /* MISRA Ref 21.6.1 [snprintf for utility] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-216 */
+ /* coverity[misra_c_2012_rule_21_6_violation] */
+ iSnprintfReturnValue = snprintf( pcWriteBuffer,
+ uxBufferLength - uxConsumedBufferLength,
+ "\t%u\t\t<1%%\r\n",
+ ( unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter );
+ }
+ #endif /* ifdef portLU_PRINTF_SPECIFIER_REQUIRED */
+ }
+
+ uxCharsWrittenBySnprintf = prvSnprintfReturnValueToCharsWritten( iSnprintfReturnValue, uxBufferLength - uxConsumedBufferLength );
+ uxConsumedBufferLength += uxCharsWrittenBySnprintf;
+ pcWriteBuffer += uxCharsWrittenBySnprintf;
}
- #else
+ else
{
- /* sizeof( int ) == sizeof( long ) so a smaller
- * printf() library can be used. */
- sprintf( pcWriteBuffer, "\t%u\t\t<1%%\r\n", ( unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter ); /*lint !e586 sprintf() allowed as this is compiled with many compilers and this is a utility function only - not part of the core kernel implementation. */
+ xOutputBufferFull = pdTRUE;
}
- #endif
+ }
+ else
+ {
+ xOutputBufferFull = pdTRUE;
}
- pcWriteBuffer += strlen( pcWriteBuffer ); /*lint !e9016 Pointer arithmetic ok on char pointers especially as in this case where it best denotes the intent of the code. */
+ if( xOutputBufferFull == pdTRUE )
+ {
+ break;
+ }
}
}
else
@@ -4650,6 +7559,8 @@ static void prvResetNextTaskUnblockTime( void )
{
mtCOVERAGE_TEST_MARKER();
}
+
+ traceRETURN_vTaskGetRunTimeStatistics();
}
#endif /* ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) ) */
@@ -4659,11 +7570,15 @@ TickType_t uxTaskResetEventItemValue( void )
{
TickType_t uxReturn;
+ traceENTER_uxTaskResetEventItemValue();
+
uxReturn = listGET_LIST_ITEM_VALUE( &( pxCurrentTCB->xEventListItem ) );
/* Reset the event list item to its normal value - so it can be used with
* queues and semaphores. */
- listSET_LIST_ITEM_VALUE( &( pxCurrentTCB->xEventListItem ), ( ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) pxCurrentTCB->uxPriority ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
+ listSET_LIST_ITEM_VALUE( &( pxCurrentTCB->xEventListItem ), ( ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) pxCurrentTCB->uxPriority ) );
+
+ traceRETURN_uxTaskResetEventItemValue( uxReturn );
return uxReturn;
}
@@ -4673,14 +7588,22 @@ TickType_t uxTaskResetEventItemValue( void )
TaskHandle_t pvTaskIncrementMutexHeldCount( void )
{
+ TCB_t * pxTCB;
+
+ traceENTER_pvTaskIncrementMutexHeldCount();
+
+ pxTCB = pxCurrentTCB;
+
/* If xSemaphoreCreateMutex() is called before any tasks have been created
* then pxCurrentTCB will be NULL. */
- if( pxCurrentTCB != NULL )
+ if( pxTCB != NULL )
{
- ( pxCurrentTCB->uxMutexesHeld )++;
+ ( pxTCB->uxMutexesHeld )++;
}
- return pxCurrentTCB;
+ traceRETURN_pvTaskIncrementMutexHeldCount( pxTCB );
+
+ return pxTCB;
}
#endif /* configUSE_MUTEXES */
@@ -4688,59 +7611,88 @@ TickType_t uxTaskResetEventItemValue( void )
#if ( configUSE_TASK_NOTIFICATIONS == 1 )
- uint32_t ulTaskGenericNotifyTake( UBaseType_t uxIndexToWait,
+ uint32_t ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
BaseType_t xClearCountOnExit,
TickType_t xTicksToWait )
{
uint32_t ulReturn;
+ BaseType_t xAlreadyYielded, xShouldBlock = pdFALSE;
- configASSERT( uxIndexToWait < configTASK_NOTIFICATION_ARRAY_ENTRIES );
+ traceENTER_ulTaskGenericNotifyTake( uxIndexToWaitOn, xClearCountOnExit, xTicksToWait );
- taskENTER_CRITICAL();
+ configASSERT( uxIndexToWaitOn < configTASK_NOTIFICATION_ARRAY_ENTRIES );
+
+ /* We suspend the scheduler here as prvAddCurrentTaskToDelayedList is a
+ * non-deterministic operation. */
+ vTaskSuspendAll();
{
- /* Only block if the notification count is not already non-zero. */
- if( pxCurrentTCB->ulNotifiedValue[ uxIndexToWait ] == 0UL )
+ /* We MUST enter a critical section to atomically check if a notification
+ * has occurred and set the flag to indicate that we are waiting for
+ * a notification. If we do not do so, a notification sent from an ISR
+ * will get lost. */
+ taskENTER_CRITICAL();
{
- /* Mark this task as waiting for a notification. */
- pxCurrentTCB->ucNotifyState[ uxIndexToWait ] = taskWAITING_NOTIFICATION;
-
- if( xTicksToWait > ( TickType_t ) 0 )
+ /* Only block if the notification count is not already non-zero. */
+ if( pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] == 0U )
{
- prvAddCurrentTaskToDelayedList( xTicksToWait, pdTRUE );
- traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWait );
+ /* Mark this task as waiting for a notification. */
+ pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] = taskWAITING_NOTIFICATION;
- /* All ports are written to allow a yield in a critical
- * section (some will yield immediately, others wait until the
- * critical section exits) - but it is not something that
- * application code should ever do. */
- portYIELD_WITHIN_API();
+ if( xTicksToWait > ( TickType_t ) 0 )
+ {
+ xShouldBlock = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
+ taskEXIT_CRITICAL();
+
+ /* We are now out of the critical section but the scheduler is still
+ * suspended, so we are safe to do non-deterministic operations such
+ * as prvAddCurrentTaskToDelayedList. */
+ if( xShouldBlock == pdTRUE )
+ {
+ traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWaitOn );
+ prvAddCurrentTaskToDelayedList( xTicksToWait, pdTRUE );
+ }
else
{
mtCOVERAGE_TEST_MARKER();
}
}
- taskEXIT_CRITICAL();
+ xAlreadyYielded = xTaskResumeAll();
+
+ /* Force a reschedule if xTaskResumeAll has not already done so. */
+ if( ( xShouldBlock == pdTRUE ) && ( xAlreadyYielded == pdFALSE ) )
+ {
+ taskYIELD_WITHIN_API();
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
taskENTER_CRITICAL();
{
- traceTASK_NOTIFY_TAKE( uxIndexToWait );
- ulReturn = pxCurrentTCB->ulNotifiedValue[ uxIndexToWait ];
+ traceTASK_NOTIFY_TAKE( uxIndexToWaitOn );
+ ulReturn = pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ];
- if( ulReturn != 0UL )
+ if( ulReturn != 0U )
{
if( xClearCountOnExit != pdFALSE )
{
- pxCurrentTCB->ulNotifiedValue[ uxIndexToWait ] = 0UL;
+ pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] = ( uint32_t ) 0U;
}
else
{
- pxCurrentTCB->ulNotifiedValue[ uxIndexToWait ] = ulReturn - ( uint32_t ) 1;
+ pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] = ulReturn - ( uint32_t ) 1;
}
}
else
@@ -4748,10 +7700,12 @@ TickType_t uxTaskResetEventItemValue( void )
mtCOVERAGE_TEST_MARKER();
}
- pxCurrentTCB->ucNotifyState[ uxIndexToWait ] = taskNOT_WAITING_NOTIFICATION;
+ pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] = taskNOT_WAITING_NOTIFICATION;
}
taskEXIT_CRITICAL();
+ traceRETURN_ulTaskGenericNotifyTake( ulReturn );
+
return ulReturn;
}
@@ -4760,68 +7714,95 @@ TickType_t uxTaskResetEventItemValue( void )
#if ( configUSE_TASK_NOTIFICATIONS == 1 )
- BaseType_t xTaskGenericNotifyWait( UBaseType_t uxIndexToWait,
+ BaseType_t xTaskGenericNotifyWait( UBaseType_t uxIndexToWaitOn,
uint32_t ulBitsToClearOnEntry,
uint32_t ulBitsToClearOnExit,
uint32_t * pulNotificationValue,
TickType_t xTicksToWait )
{
- BaseType_t xReturn;
+ BaseType_t xReturn, xAlreadyYielded, xShouldBlock = pdFALSE;
- configASSERT( uxIndexToWait < configTASK_NOTIFICATION_ARRAY_ENTRIES );
+ traceENTER_xTaskGenericNotifyWait( uxIndexToWaitOn, ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait );
- taskENTER_CRITICAL();
+ configASSERT( uxIndexToWaitOn < configTASK_NOTIFICATION_ARRAY_ENTRIES );
+
+ /* We suspend the scheduler here as prvAddCurrentTaskToDelayedList is a
+ * non-deterministic operation. */
+ vTaskSuspendAll();
{
- /* Only block if a notification is not already pending. */
- if( pxCurrentTCB->ucNotifyState[ uxIndexToWait ] != taskNOTIFICATION_RECEIVED )
+ /* We MUST enter a critical section to atomically check and update the
+ * task notification value. If we do not do so, a notification from
+ * an ISR will get lost. */
+ taskENTER_CRITICAL();
{
- /* Clear bits in the task's notification value as bits may get
- * set by the notifying task or interrupt. This can be used to
- * clear the value to zero. */
- pxCurrentTCB->ulNotifiedValue[ uxIndexToWait ] &= ~ulBitsToClearOnEntry;
-
- /* Mark this task as waiting for a notification. */
- pxCurrentTCB->ucNotifyState[ uxIndexToWait ] = taskWAITING_NOTIFICATION;
-
- if( xTicksToWait > ( TickType_t ) 0 )
+ /* Only block if a notification is not already pending. */
+ if( pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] != taskNOTIFICATION_RECEIVED )
{
- prvAddCurrentTaskToDelayedList( xTicksToWait, pdTRUE );
- traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWait );
+ /* Clear bits in the task's notification value as bits may get
+ * set by the notifying task or interrupt. This can be used
+ * to clear the value to zero. */
+ pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] &= ~ulBitsToClearOnEntry;
- /* All ports are written to allow a yield in a critical
- * section (some will yield immediately, others wait until the
- * critical section exits) - but it is not something that
- * application code should ever do. */
- portYIELD_WITHIN_API();
+ /* Mark this task as waiting for a notification. */
+ pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] = taskWAITING_NOTIFICATION;
+
+ if( xTicksToWait > ( TickType_t ) 0 )
+ {
+ xShouldBlock = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
+ taskEXIT_CRITICAL();
+
+ /* We are now out of the critical section but the scheduler is still
+ * suspended, so we are safe to do non-deterministic operations such
+ * as prvAddCurrentTaskToDelayedList. */
+ if( xShouldBlock == pdTRUE )
+ {
+ traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWaitOn );
+ prvAddCurrentTaskToDelayedList( xTicksToWait, pdTRUE );
+ }
else
{
mtCOVERAGE_TEST_MARKER();
}
}
- taskEXIT_CRITICAL();
+ xAlreadyYielded = xTaskResumeAll();
+
+ /* Force a reschedule if xTaskResumeAll has not already done so. */
+ if( ( xShouldBlock == pdTRUE ) && ( xAlreadyYielded == pdFALSE ) )
+ {
+ taskYIELD_WITHIN_API();
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
taskENTER_CRITICAL();
{
- traceTASK_NOTIFY_WAIT( uxIndexToWait );
+ traceTASK_NOTIFY_WAIT( uxIndexToWaitOn );
if( pulNotificationValue != NULL )
{
/* Output the current notification value, which may or may not
* have changed. */
- *pulNotificationValue = pxCurrentTCB->ulNotifiedValue[ uxIndexToWait ];
+ *pulNotificationValue = pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ];
}
/* If ucNotifyValue is set then either the task never entered the
* blocked state (because a notification was already pending) or the
* task unblocked because of a notification. Otherwise the task
* unblocked because of a timeout. */
- if( pxCurrentTCB->ucNotifyState[ uxIndexToWait ] != taskNOTIFICATION_RECEIVED )
+ if( pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] != taskNOTIFICATION_RECEIVED )
{
/* A notification was not received. */
xReturn = pdFALSE;
@@ -4830,14 +7811,16 @@ TickType_t uxTaskResetEventItemValue( void )
{
/* A notification was already pending or a notification was
* received while the task was waiting. */
- pxCurrentTCB->ulNotifiedValue[ uxIndexToWait ] &= ~ulBitsToClearOnExit;
+ pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] &= ~ulBitsToClearOnExit;
xReturn = pdTRUE;
}
- pxCurrentTCB->ucNotifyState[ uxIndexToWait ] = taskNOT_WAITING_NOTIFICATION;
+ pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] = taskNOT_WAITING_NOTIFICATION;
}
taskEXIT_CRITICAL();
+ traceRETURN_xTaskGenericNotifyWait( xReturn );
+
return xReturn;
}
@@ -4856,6 +7839,8 @@ TickType_t uxTaskResetEventItemValue( void )
BaseType_t xReturn = pdPASS;
uint8_t ucOriginalNotifyState;
+ traceENTER_xTaskGenericNotify( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotificationValue );
+
configASSERT( uxIndexToNotify < configTASK_NOTIFICATION_ARRAY_ENTRIES );
configASSERT( xTaskToNotify );
pxTCB = xTaskToNotify;
@@ -4943,16 +7928,9 @@ TickType_t uxTaskResetEventItemValue( void )
}
#endif
- if( pxTCB->uxPriority > pxCurrentTCB->uxPriority )
- {
- /* The notified task has a priority above the currently
- * executing task so a yield is required. */
- taskYIELD_IF_USING_PREEMPTION();
- }
- else
- {
- mtCOVERAGE_TEST_MARKER();
- }
+ /* Check if the notified task has a priority above the currently
+ * executing task. */
+ taskYIELD_ANY_CORE_IF_USING_PREEMPTION( pxTCB );
}
else
{
@@ -4961,6 +7939,8 @@ TickType_t uxTaskResetEventItemValue( void )
}
taskEXIT_CRITICAL();
+ traceRETURN_xTaskGenericNotify( xReturn );
+
return xReturn;
}
@@ -4981,6 +7961,8 @@ TickType_t uxTaskResetEventItemValue( void )
BaseType_t xReturn = pdPASS;
UBaseType_t uxSavedInterruptStatus;
+ traceENTER_xTaskGenericNotifyFromISR( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken );
+
configASSERT( xTaskToNotify );
configASSERT( uxIndexToNotify < configTASK_NOTIFICATION_ARRAY_ENTRIES );
@@ -5004,7 +7986,10 @@ TickType_t uxTaskResetEventItemValue( void )
pxTCB = xTaskToNotify;
- uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = ( UBaseType_t ) taskENTER_CRITICAL_FROM_ISR();
{
if( pulPreviousNotificationValue != NULL )
{
@@ -5066,7 +8051,7 @@ TickType_t uxTaskResetEventItemValue( void )
/* The task should not have been on an event list. */
configASSERT( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) == NULL );
- if( uxSchedulerSuspended == ( UBaseType_t ) pdFALSE )
+ if( uxSchedulerSuspended == ( UBaseType_t ) 0U )
{
listREMOVE_ITEM( &( pxTCB->xStateListItem ) );
prvAddTaskToReadyList( pxTCB );
@@ -5078,27 +8063,49 @@ TickType_t uxTaskResetEventItemValue( void )
listINSERT_END( &( xPendingReadyList ), &( pxTCB->xEventListItem ) );
}
- if( pxTCB->uxPriority > pxCurrentTCB->uxPriority )
+ #if ( configNUMBER_OF_CORES == 1 )
{
- /* The notified task has a priority above the currently
- * executing task so a yield is required. */
- if( pxHigherPriorityTaskWoken != NULL )
+ if( pxTCB->uxPriority > pxCurrentTCB->uxPriority )
{
- *pxHigherPriorityTaskWoken = pdTRUE;
- }
+ /* The notified task has a priority above the currently
+ * executing task so a yield is required. */
+ if( pxHigherPriorityTaskWoken != NULL )
+ {
+ *pxHigherPriorityTaskWoken = pdTRUE;
+ }
- /* Mark that a yield is pending in case the user is not
- * using the "xHigherPriorityTaskWoken" parameter to an ISR
- * safe FreeRTOS function. */
- xYieldPending = pdTRUE;
+ /* Mark that a yield is pending in case the user is not
+ * using the "xHigherPriorityTaskWoken" parameter to an ISR
+ * safe FreeRTOS function. */
+ xYieldPendings[ 0 ] = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
- else
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
{
- mtCOVERAGE_TEST_MARKER();
+ #if ( configUSE_PREEMPTION == 1 )
+ {
+ prvYieldForTask( pxTCB );
+
+ if( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE )
+ {
+ if( pxHigherPriorityTaskWoken != NULL )
+ {
+ *pxHigherPriorityTaskWoken = pdTRUE;
+ }
+ }
+ }
+ #endif /* if ( configUSE_PREEMPTION == 1 ) */
}
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
}
}
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
+
+ traceRETURN_xTaskGenericNotifyFromISR( xReturn );
return xReturn;
}
@@ -5116,6 +8123,8 @@ TickType_t uxTaskResetEventItemValue( void )
uint8_t ucOriginalNotifyState;
UBaseType_t uxSavedInterruptStatus;
+ traceENTER_vTaskGenericNotifyGiveFromISR( xTaskToNotify, uxIndexToNotify, pxHigherPriorityTaskWoken );
+
configASSERT( xTaskToNotify );
configASSERT( uxIndexToNotify < configTASK_NOTIFICATION_ARRAY_ENTRIES );
@@ -5139,7 +8148,10 @@ TickType_t uxTaskResetEventItemValue( void )
pxTCB = xTaskToNotify;
- uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
+ /* MISRA Ref 4.7.1 [Return value shall be checked] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
+ /* coverity[misra_c_2012_directive_4_7_violation] */
+ uxSavedInterruptStatus = ( UBaseType_t ) taskENTER_CRITICAL_FROM_ISR();
{
ucOriginalNotifyState = pxTCB->ucNotifyState[ uxIndexToNotify ];
pxTCB->ucNotifyState[ uxIndexToNotify ] = taskNOTIFICATION_RECEIVED;
@@ -5157,7 +8169,7 @@ TickType_t uxTaskResetEventItemValue( void )
/* The task should not have been on an event list. */
configASSERT( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) == NULL );
- if( uxSchedulerSuspended == ( UBaseType_t ) pdFALSE )
+ if( uxSchedulerSuspended == ( UBaseType_t ) 0U )
{
listREMOVE_ITEM( &( pxTCB->xStateListItem ) );
prvAddTaskToReadyList( pxTCB );
@@ -5169,27 +8181,49 @@ TickType_t uxTaskResetEventItemValue( void )
listINSERT_END( &( xPendingReadyList ), &( pxTCB->xEventListItem ) );
}
- if( pxTCB->uxPriority > pxCurrentTCB->uxPriority )
+ #if ( configNUMBER_OF_CORES == 1 )
{
- /* The notified task has a priority above the currently
- * executing task so a yield is required. */
- if( pxHigherPriorityTaskWoken != NULL )
+ if( pxTCB->uxPriority > pxCurrentTCB->uxPriority )
{
- *pxHigherPriorityTaskWoken = pdTRUE;
- }
+ /* The notified task has a priority above the currently
+ * executing task so a yield is required. */
+ if( pxHigherPriorityTaskWoken != NULL )
+ {
+ *pxHigherPriorityTaskWoken = pdTRUE;
+ }
- /* Mark that a yield is pending in case the user is not
- * using the "xHigherPriorityTaskWoken" parameter in an ISR
- * safe FreeRTOS function. */
- xYieldPending = pdTRUE;
+ /* Mark that a yield is pending in case the user is not
+ * using the "xHigherPriorityTaskWoken" parameter in an ISR
+ * safe FreeRTOS function. */
+ xYieldPendings[ 0 ] = pdTRUE;
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
}
- else
+ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
{
- mtCOVERAGE_TEST_MARKER();
+ #if ( configUSE_PREEMPTION == 1 )
+ {
+ prvYieldForTask( pxTCB );
+
+ if( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE )
+ {
+ if( pxHigherPriorityTaskWoken != NULL )
+ {
+ *pxHigherPriorityTaskWoken = pdTRUE;
+ }
+ }
+ }
+ #endif /* #if ( configUSE_PREEMPTION == 1 ) */
}
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
}
}
- portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
+ taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
+
+ traceRETURN_vTaskGenericNotifyGiveFromISR();
}
#endif /* configUSE_TASK_NOTIFICATIONS */
@@ -5203,6 +8237,8 @@ TickType_t uxTaskResetEventItemValue( void )
TCB_t * pxTCB;
BaseType_t xReturn;
+ traceENTER_xTaskGenericNotifyStateClear( xTask, uxIndexToClear );
+
configASSERT( uxIndexToClear < configTASK_NOTIFICATION_ARRAY_ENTRIES );
/* If null is passed in here then it is the calling task that is having
@@ -5223,6 +8259,8 @@ TickType_t uxTaskResetEventItemValue( void )
}
taskEXIT_CRITICAL();
+ traceRETURN_xTaskGenericNotifyStateClear( xReturn );
+
return xReturn;
}
@@ -5238,6 +8276,10 @@ TickType_t uxTaskResetEventItemValue( void )
TCB_t * pxTCB;
uint32_t ulReturn;
+ traceENTER_ulTaskGenericNotifyValueClear( xTask, uxIndexToClear, ulBitsToClear );
+
+ configASSERT( uxIndexToClear < configTASK_NOTIFICATION_ARRAY_ENTRIES );
+
/* If null is passed in here then it is the calling task that is having
* its notification state cleared. */
pxTCB = prvGetTCBFromHandle( xTask );
@@ -5251,20 +8293,85 @@ TickType_t uxTaskResetEventItemValue( void )
}
taskEXIT_CRITICAL();
+ traceRETURN_ulTaskGenericNotifyValueClear( ulReturn );
+
return ulReturn;
}
#endif /* configUSE_TASK_NOTIFICATIONS */
/*-----------------------------------------------------------*/
+#if ( configGENERATE_RUN_TIME_STATS == 1 )
+
+ configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimeCounter( const TaskHandle_t xTask )
+ {
+ TCB_t * pxTCB;
+
+ traceENTER_ulTaskGetRunTimeCounter( xTask );
+
+ pxTCB = prvGetTCBFromHandle( xTask );
+
+ traceRETURN_ulTaskGetRunTimeCounter( pxTCB->ulRunTimeCounter );
+
+ return pxTCB->ulRunTimeCounter;
+ }
+
+#endif /* if ( configGENERATE_RUN_TIME_STATS == 1 ) */
+/*-----------------------------------------------------------*/
+
+#if ( configGENERATE_RUN_TIME_STATS == 1 )
+
+ configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimePercent( const TaskHandle_t xTask )
+ {
+ TCB_t * pxTCB;
+ configRUN_TIME_COUNTER_TYPE ulTotalTime, ulReturn;
+
+ traceENTER_ulTaskGetRunTimePercent( xTask );
+
+ ulTotalTime = ( configRUN_TIME_COUNTER_TYPE ) portGET_RUN_TIME_COUNTER_VALUE();
+
+ /* For percentage calculations. */
+ ulTotalTime /= ( configRUN_TIME_COUNTER_TYPE ) 100;
+
+ /* Avoid divide by zero errors. */
+ if( ulTotalTime > ( configRUN_TIME_COUNTER_TYPE ) 0 )
+ {
+ pxTCB = prvGetTCBFromHandle( xTask );
+ ulReturn = pxTCB->ulRunTimeCounter / ulTotalTime;
+ }
+ else
+ {
+ ulReturn = 0;
+ }
+
+ traceRETURN_ulTaskGetRunTimePercent( ulReturn );
+
+ return ulReturn;
+ }
+
+#endif /* if ( configGENERATE_RUN_TIME_STATS == 1 ) */
+/*-----------------------------------------------------------*/
+
#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) )
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimeCounter( void )
{
- return xIdleTaskHandle->ulRunTimeCounter;
+ configRUN_TIME_COUNTER_TYPE ulReturn = 0;
+ BaseType_t i;
+
+ traceENTER_ulTaskGetIdleRunTimeCounter();
+
+ for( i = 0; i < ( BaseType_t ) configNUMBER_OF_CORES; i++ )
+ {
+ ulReturn += xIdleTaskHandles[ i ]->ulRunTimeCounter;
+ }
+
+ traceRETURN_ulTaskGetIdleRunTimeCounter( ulReturn );
+
+ return ulReturn;
}
-#endif
+#endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */
/*-----------------------------------------------------------*/
#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) )
@@ -5272,8 +8379,12 @@ TickType_t uxTaskResetEventItemValue( void )
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercent( void )
{
configRUN_TIME_COUNTER_TYPE ulTotalTime, ulReturn;
+ configRUN_TIME_COUNTER_TYPE ulRunTimeCounter = 0;
+ BaseType_t i;
+
+ traceENTER_ulTaskGetIdleRunTimePercent();
- ulTotalTime = portGET_RUN_TIME_COUNTER_VALUE();
+ ulTotalTime = portGET_RUN_TIME_COUNTER_VALUE() * configNUMBER_OF_CORES;
/* For percentage calculations. */
ulTotalTime /= ( configRUN_TIME_COUNTER_TYPE ) 100;
@@ -5281,13 +8392,20 @@ TickType_t uxTaskResetEventItemValue( void )
/* Avoid divide by zero errors. */
if( ulTotalTime > ( configRUN_TIME_COUNTER_TYPE ) 0 )
{
- ulReturn = xIdleTaskHandle->ulRunTimeCounter / ulTotalTime;
+ for( i = 0; i < ( BaseType_t ) configNUMBER_OF_CORES; i++ )
+ {
+ ulRunTimeCounter += xIdleTaskHandles[ i ]->ulRunTimeCounter;
+ }
+
+ ulReturn = ulRunTimeCounter / ulTotalTime;
}
else
{
ulReturn = 0;
}
+ traceRETURN_ulTaskGetIdleRunTimePercent( ulReturn );
+
return ulReturn;
}
@@ -5299,13 +8417,15 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait,
{
TickType_t xTimeToWake;
const TickType_t xConstTickCount = xTickCount;
+ List_t * const pxDelayedList = pxDelayedTaskList;
+ List_t * const pxOverflowDelayedList = pxOverflowDelayedTaskList;
#if ( INCLUDE_xTaskAbortDelay == 1 )
{
/* About to enter a delayed list, so ensure the ucDelayAborted flag is
* reset to pdFALSE so it can be detected as having been set to pdTRUE
* when the task leaves the Blocked state. */
- pxCurrentTCB->ucDelayAborted = pdFALSE;
+ pxCurrentTCB->ucDelayAborted = ( uint8_t ) pdFALSE;
}
#endif
@@ -5315,7 +8435,7 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait,
{
/* The current task must be in a ready list, so there is no need to
* check, and the port reset macro can be called directly. */
- portRESET_READY_PRIORITY( pxCurrentTCB->uxPriority, uxTopReadyPriority ); /*lint !e931 pxCurrentTCB cannot change as it is the calling task. pxCurrentTCB->uxPriority and uxTopReadyPriority cannot change as called with scheduler suspended or in a critical section. */
+ portRESET_READY_PRIORITY( pxCurrentTCB->uxPriority, uxTopReadyPriority );
}
else
{
@@ -5345,13 +8465,15 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait,
{
/* Wake time has overflowed. Place this item in the overflow
* list. */
- vListInsert( pxOverflowDelayedTaskList, &( pxCurrentTCB->xStateListItem ) );
+ traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST();
+ vListInsert( pxOverflowDelayedList, &( pxCurrentTCB->xStateListItem ) );
}
else
{
/* The wake time has not overflowed, so the current block list
* is used. */
- vListInsert( pxDelayedTaskList, &( pxCurrentTCB->xStateListItem ) );
+ traceMOVED_TASK_TO_DELAYED_LIST();
+ vListInsert( pxDelayedList, &( pxCurrentTCB->xStateListItem ) );
/* If the task entering the blocked state was placed at the
* head of the list of blocked tasks then xNextTaskUnblockTime
@@ -5379,13 +8501,15 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait,
if( xTimeToWake < xConstTickCount )
{
+ traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST();
/* Wake time has overflowed. Place this item in the overflow list. */
- vListInsert( pxOverflowDelayedTaskList, &( pxCurrentTCB->xStateListItem ) );
+ vListInsert( pxOverflowDelayedList, &( pxCurrentTCB->xStateListItem ) );
}
else
{
+ traceMOVED_TASK_TO_DELAYED_LIST();
/* The wake time has not overflowed, so the current block list is used. */
- vListInsert( pxDelayedTaskList, &( pxCurrentTCB->xStateListItem ) );
+ vListInsert( pxDelayedList, &( pxCurrentTCB->xStateListItem ) );
/* If the task entering the blocked state was placed at the head of the
* list of blocked tasks then xNextTaskUnblockTime needs to be updated
@@ -5405,6 +8529,25 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait,
}
#endif /* INCLUDE_vTaskSuspend */
}
+/*-----------------------------------------------------------*/
+
+#if ( portUSING_MPU_WRAPPERS == 1 )
+
+ xMPU_SETTINGS * xTaskGetMPUSettings( TaskHandle_t xTask )
+ {
+ TCB_t * pxTCB;
+
+ traceENTER_xTaskGetMPUSettings( xTask );
+
+ pxTCB = prvGetTCBFromHandle( xTask );
+
+ traceRETURN_xTaskGetMPUSettings( &( pxTCB->xMPUSettings ) );
+
+ return &( pxTCB->xMPUSettings );
+ }
+
+#endif /* portUSING_MPU_WRAPPERS */
+/*-----------------------------------------------------------*/
/* Code below here allows additional code to be inserted into this source file,
* especially where access to file scope functions and data is needed (for example
@@ -5427,3 +8570,127 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait,
#endif
#endif /* if ( configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H == 1 ) */
+/*-----------------------------------------------------------*/
+
+#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configKERNEL_PROVIDED_STATIC_MEMORY == 1 ) && ( portUSING_MPU_WRAPPERS == 0 ) )
+
+/*
+ * This is the kernel provided implementation of vApplicationGetIdleTaskMemory()
+ * to provide the memory that is used by the Idle task. It is used when
+ * configKERNEL_PROVIDED_STATIC_MEMORY is set to 1. The application can provide
+ * it's own implementation of vApplicationGetIdleTaskMemory by setting
+ * configKERNEL_PROVIDED_STATIC_MEMORY to 0 or leaving it undefined.
+ */
+ void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
+ StackType_t ** ppxIdleTaskStackBuffer,
+ configSTACK_DEPTH_TYPE * puxIdleTaskStackSize )
+ {
+ static StaticTask_t xIdleTaskTCB;
+ static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
+
+ *ppxIdleTaskTCBBuffer = &( xIdleTaskTCB );
+ *ppxIdleTaskStackBuffer = &( uxIdleTaskStack[ 0 ] );
+ *puxIdleTaskStackSize = configMINIMAL_STACK_SIZE;
+ }
+
+ #if ( configNUMBER_OF_CORES > 1 )
+
+ void vApplicationGetPassiveIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
+ StackType_t ** ppxIdleTaskStackBuffer,
+ configSTACK_DEPTH_TYPE * puxIdleTaskStackSize,
+ BaseType_t xPassiveIdleTaskIndex )
+ {
+ static StaticTask_t xIdleTaskTCBs[ configNUMBER_OF_CORES - 1 ];
+ static StackType_t uxIdleTaskStacks[ configNUMBER_OF_CORES - 1 ][ configMINIMAL_STACK_SIZE ];
+
+ *ppxIdleTaskTCBBuffer = &( xIdleTaskTCBs[ xPassiveIdleTaskIndex ] );
+ *ppxIdleTaskStackBuffer = &( uxIdleTaskStacks[ xPassiveIdleTaskIndex ][ 0 ] );
+ *puxIdleTaskStackSize = configMINIMAL_STACK_SIZE;
+ }
+
+ #endif /* #if ( configNUMBER_OF_CORES > 1 ) */
+
+#endif /* #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configKERNEL_PROVIDED_STATIC_MEMORY == 1 ) && ( portUSING_MPU_WRAPPERS == 0 ) ) */
+/*-----------------------------------------------------------*/
+
+#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configKERNEL_PROVIDED_STATIC_MEMORY == 1 ) && ( portUSING_MPU_WRAPPERS == 0 ) )
+
+/*
+ * This is the kernel provided implementation of vApplicationGetTimerTaskMemory()
+ * to provide the memory that is used by the Timer service task. It is used when
+ * configKERNEL_PROVIDED_STATIC_MEMORY is set to 1. The application can provide
+ * it's own implementation of vApplicationGetTimerTaskMemory by setting
+ * configKERNEL_PROVIDED_STATIC_MEMORY to 0 or leaving it undefined.
+ */
+ void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
+ StackType_t ** ppxTimerTaskStackBuffer,
+ configSTACK_DEPTH_TYPE * puxTimerTaskStackSize )
+ {
+ static StaticTask_t xTimerTaskTCB;
+ static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
+
+ *ppxTimerTaskTCBBuffer = &( xTimerTaskTCB );
+ *ppxTimerTaskStackBuffer = &( uxTimerTaskStack[ 0 ] );
+ *puxTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
+ }
+
+#endif /* #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configKERNEL_PROVIDED_STATIC_MEMORY == 1 ) && ( portUSING_MPU_WRAPPERS == 0 ) ) */
+/*-----------------------------------------------------------*/
+
+/*
+ * Reset the state in this file. This state is normally initialized at start up.
+ * This function must be called by the application before restarting the
+ * scheduler.
+ */
+void vTaskResetState( void )
+{
+ BaseType_t xCoreID;
+
+ /* Task control block. */
+ #if ( configNUMBER_OF_CORES == 1 )
+ {
+ pxCurrentTCB = NULL;
+ }
+ #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
+
+ #if ( INCLUDE_vTaskDelete == 1 )
+ {
+ uxDeletedTasksWaitingCleanUp = ( UBaseType_t ) 0U;
+ }
+ #endif /* #if ( INCLUDE_vTaskDelete == 1 ) */
+
+ #if ( configUSE_POSIX_ERRNO == 1 )
+ {
+ FreeRTOS_errno = 0;
+ }
+ #endif /* #if ( configUSE_POSIX_ERRNO == 1 ) */
+
+ /* Other file private variables. */
+ uxCurrentNumberOfTasks = ( UBaseType_t ) 0U;
+ xTickCount = ( TickType_t ) configINITIAL_TICK_COUNT;
+ uxTopReadyPriority = tskIDLE_PRIORITY;
+ xSchedulerRunning = pdFALSE;
+ xPendedTicks = ( TickType_t ) 0U;
+
+ for( xCoreID = 0; xCoreID < configNUMBER_OF_CORES; xCoreID++ )
+ {
+ xYieldPendings[ xCoreID ] = pdFALSE;
+ }
+
+ xNumOfOverflows = ( BaseType_t ) 0;
+ uxTaskNumber = ( UBaseType_t ) 0U;
+ xNextTaskUnblockTime = ( TickType_t ) 0U;
+
+ uxSchedulerSuspended = ( UBaseType_t ) 0U;
+
+ #if ( configGENERATE_RUN_TIME_STATS == 1 )
+ {
+ for( xCoreID = 0; xCoreID < configNUMBER_OF_CORES; xCoreID++ )
+ {
+ ulTaskSwitchedInTime[ xCoreID ] = 0U;
+ ulTotalRunTime[ xCoreID ] = 0U;
+ }
+ }
+ #endif /* #if ( configGENERATE_RUN_TIME_STATS == 1 ) */
+}
+/*-----------------------------------------------------------*/
diff --git a/third-party/freertos/timers.c b/third-party/freertos/timers.c
index 800a2b80b54c64c710a20ac2256812de5ca3bd46..d499db2b932749006eb82d627ad4310c3a40515b 100644
--- a/third-party/freertos/timers.c
+++ b/third-party/freertos/timers.c
@@ -1,6 +1,6 @@
/*
- * FreeRTOS Kernel V10.5.1
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * FreeRTOS Kernel V11.1.0
+ * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
@@ -43,11 +43,10 @@
#error configUSE_TIMERS must be set to 1 to make the xTimerPendFunctionCall() function available.
#endif
-/* Lint e9021, e961 and e750 are suppressed as a MISRA exception justified
- * because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
+/* The MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
* for the header files above, but not in this file, in order to generate the
* correct privileged Vs unprivileged linkage and placement. */
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e9021 !e961 !e750. */
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/* This entire source file will be skipped if the application is not configured
@@ -60,29 +59,38 @@
#define tmrNO_DELAY ( ( TickType_t ) 0U )
#define tmrMAX_TIME_BEFORE_OVERFLOW ( ( TickType_t ) -1 )
-/* The name assigned to the timer service task. This can be overridden by
- * defining trmTIMER_SERVICE_TASK_NAME in FreeRTOSConfig.h. */
+/* The name assigned to the timer service task. This can be overridden by
+ * defining configTIMER_SERVICE_TASK_NAME in FreeRTOSConfig.h. */
#ifndef configTIMER_SERVICE_TASK_NAME
#define configTIMER_SERVICE_TASK_NAME "Tmr Svc"
#endif
+ #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
+
+/* The core affinity assigned to the timer service task on SMP systems.
+ * This can be overridden by defining configTIMER_SERVICE_TASK_CORE_AFFINITY in FreeRTOSConfig.h. */
+ #ifndef configTIMER_SERVICE_TASK_CORE_AFFINITY
+ #define configTIMER_SERVICE_TASK_CORE_AFFINITY tskNO_AFFINITY
+ #endif
+ #endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) */
+
/* Bit definitions used in the ucStatus member of a timer structure. */
- #define tmrSTATUS_IS_ACTIVE ( ( uint8_t ) 0x01 )
- #define tmrSTATUS_IS_STATICALLY_ALLOCATED ( ( uint8_t ) 0x02 )
- #define tmrSTATUS_IS_AUTORELOAD ( ( uint8_t ) 0x04 )
+ #define tmrSTATUS_IS_ACTIVE ( 0x01U )
+ #define tmrSTATUS_IS_STATICALLY_ALLOCATED ( 0x02U )
+ #define tmrSTATUS_IS_AUTORELOAD ( 0x04U )
/* The definition of the timers themselves. */
- typedef struct tmrTimerControl /* The old naming convention is used to prevent breaking kernel aware debuggers. */
+ typedef struct tmrTimerControl /* The old naming convention is used to prevent breaking kernel aware debuggers. */
{
- const char * pcTimerName; /*<< Text name. This is not used by the kernel, it is included simply to make debugging easier. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
- ListItem_t xTimerListItem; /*<< Standard linked list item as used by all kernel features for event management. */
- TickType_t xTimerPeriodInTicks; /*<< How quickly and often the timer expires. */
- void * pvTimerID; /*<< An ID to identify the timer. This allows the timer to be identified when the same callback is used for multiple timers. */
- TimerCallbackFunction_t pxCallbackFunction; /*<< The function that will be called when the timer expires. */
+ const char * pcTimerName; /**< Text name. This is not used by the kernel, it is included simply to make debugging easier. */
+ ListItem_t xTimerListItem; /**< Standard linked list item as used by all kernel features for event management. */
+ TickType_t xTimerPeriodInTicks; /**< How quickly and often the timer expires. */
+ void * pvTimerID; /**< An ID to identify the timer. This allows the timer to be identified when the same callback is used for multiple timers. */
+ portTIMER_CALLBACK_ATTRIBUTE TimerCallbackFunction_t pxCallbackFunction; /**< The function that will be called when the timer expires. */
#if ( configUSE_TRACE_FACILITY == 1 )
- UBaseType_t uxTimerNumber; /*<< An ID assigned by trace tools such as FreeRTOS+Trace */
+ UBaseType_t uxTimerNumber; /**< An ID assigned by trace tools such as FreeRTOS+Trace */
#endif
- uint8_t ucStatus; /*<< Holds bits to say if the timer was statically allocated or not, and if it is active or not. */
+ uint8_t ucStatus; /**< Holds bits to say if the timer was statically allocated or not, and if it is active or not. */
} xTIMER;
/* The old xTIMER name is maintained above then typedefed to the new Timer_t
@@ -96,13 +104,14 @@
* and xCallbackParametersType respectively. */
typedef struct tmrTimerParameters
{
- TickType_t xMessageValue; /*<< An optional value used by a subset of commands, for example, when changing the period of a timer. */
- Timer_t * pxTimer; /*<< The timer to which the command will be applied. */
+ TickType_t xMessageValue; /**< An optional value used by a subset of commands, for example, when changing the period of a timer. */
+ Timer_t * pxTimer; /**< The timer to which the command will be applied. */
} TimerParameter_t;
typedef struct tmrCallbackParameters
{
+ portTIMER_CALLBACK_ATTRIBUTE
PendedFunction_t pxCallbackFunction; /* << The callback function to execute. */
void * pvParameter1; /* << The value that will be used as the callback functions first parameter. */
uint32_t ulParameter2; /* << The value that will be used as the callback functions second parameter. */
@@ -112,7 +121,7 @@
* that is used to determine which message type is valid. */
typedef struct tmrTimerQueueMessage
{
- BaseType_t xMessageID; /*<< The command being sent to the timer service task. */
+ BaseType_t xMessageID; /**< The command being sent to the timer service task. */
union
{
TimerParameter_t xTimerParameters;
@@ -125,9 +134,6 @@
} u;
} DaemonTaskMessage_t;
-/*lint -save -e956 A manual analysis and inspection has been used to determine
- * which static variables must be declared volatile. */
-
/* The list in which active timers are stored. Timers are referenced in expire
* time order, with the nearest expiry time at the front of the list. Only the
* timer service task is allowed to access these lists.
@@ -143,8 +149,6 @@
PRIVILEGED_DATA static QueueHandle_t xTimerQueue = NULL;
PRIVILEGED_DATA static TaskHandle_t xTimerTaskHandle = NULL;
-/*lint -restore */
-
/*-----------------------------------------------------------*/
/*
@@ -222,7 +226,7 @@
* Called after a Timer_t structure has been allocated either statically or
* dynamically to fill in the structure's members.
*/
- static void prvInitialiseNewTimer( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ static void prvInitialiseNewTimer( const char * const pcTimerName,
const TickType_t xTimerPeriodInTicks,
const BaseType_t xAutoReload,
void * const pvTimerID,
@@ -234,6 +238,8 @@
{
BaseType_t xReturn = pdFAIL;
+ traceENTER_xTimerCreateTimerTask();
+
/* This function is called when the scheduler is started if
* configUSE_TIMERS is set to 1. Check that the infrastructure used by the
* timer service task has been created/initialised. If timers have already
@@ -242,36 +248,75 @@
if( xTimerQueue != NULL )
{
- #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
{
- StaticTask_t * pxTimerTaskTCBBuffer = NULL;
- StackType_t * pxTimerTaskStackBuffer = NULL;
- uint32_t ulTimerTaskStackSize;
-
- vApplicationGetTimerTaskMemory( &pxTimerTaskTCBBuffer, &pxTimerTaskStackBuffer, &ulTimerTaskStackSize );
- xTimerTaskHandle = xTaskCreateStatic( prvTimerTask,
+ #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ {
+ StaticTask_t * pxTimerTaskTCBBuffer = NULL;
+ StackType_t * pxTimerTaskStackBuffer = NULL;
+ configSTACK_DEPTH_TYPE uxTimerTaskStackSize;
+
+ vApplicationGetTimerTaskMemory( &pxTimerTaskTCBBuffer, &pxTimerTaskStackBuffer, &uxTimerTaskStackSize );
+ xTimerTaskHandle = xTaskCreateStaticAffinitySet( prvTimerTask,
+ configTIMER_SERVICE_TASK_NAME,
+ uxTimerTaskStackSize,
+ NULL,
+ ( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT,
+ pxTimerTaskStackBuffer,
+ pxTimerTaskTCBBuffer,
+ configTIMER_SERVICE_TASK_CORE_AFFINITY );
+
+ if( xTimerTaskHandle != NULL )
+ {
+ xReturn = pdPASS;
+ }
+ }
+ #else /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
+ {
+ xReturn = xTaskCreateAffinitySet( prvTimerTask,
configTIMER_SERVICE_TASK_NAME,
- ulTimerTaskStackSize,
+ configTIMER_TASK_STACK_DEPTH,
NULL,
( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT,
- pxTimerTaskStackBuffer,
- pxTimerTaskTCBBuffer );
-
- if( xTimerTaskHandle != NULL )
- {
- xReturn = pdPASS;
+ configTIMER_SERVICE_TASK_CORE_AFFINITY,
+ &xTimerTaskHandle );
}
+ #endif /* configSUPPORT_STATIC_ALLOCATION */
}
- #else /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
+ #else /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) */
{
- xReturn = xTaskCreate( prvTimerTask,
- configTIMER_SERVICE_TASK_NAME,
- configTIMER_TASK_STACK_DEPTH,
- NULL,
- ( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT,
- &xTimerTaskHandle );
+ #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ {
+ StaticTask_t * pxTimerTaskTCBBuffer = NULL;
+ StackType_t * pxTimerTaskStackBuffer = NULL;
+ configSTACK_DEPTH_TYPE uxTimerTaskStackSize;
+
+ vApplicationGetTimerTaskMemory( &pxTimerTaskTCBBuffer, &pxTimerTaskStackBuffer, &uxTimerTaskStackSize );
+ xTimerTaskHandle = xTaskCreateStatic( prvTimerTask,
+ configTIMER_SERVICE_TASK_NAME,
+ uxTimerTaskStackSize,
+ NULL,
+ ( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT,
+ pxTimerTaskStackBuffer,
+ pxTimerTaskTCBBuffer );
+
+ if( xTimerTaskHandle != NULL )
+ {
+ xReturn = pdPASS;
+ }
+ }
+ #else /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
+ {
+ xReturn = xTaskCreate( prvTimerTask,
+ configTIMER_SERVICE_TASK_NAME,
+ configTIMER_TASK_STACK_DEPTH,
+ NULL,
+ ( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT,
+ &xTimerTaskHandle );
+ }
+ #endif /* configSUPPORT_STATIC_ALLOCATION */
}
- #endif /* configSUPPORT_STATIC_ALLOCATION */
+ #endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) */
}
else
{
@@ -279,13 +324,16 @@
}
configASSERT( xReturn );
+
+ traceRETURN_xTimerCreateTimerTask( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
- TimerHandle_t xTimerCreate( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ TimerHandle_t xTimerCreate( const char * const pcTimerName,
const TickType_t xTimerPeriodInTicks,
const BaseType_t xAutoReload,
void * const pvTimerID,
@@ -293,7 +341,12 @@
{
Timer_t * pxNewTimer;
- pxNewTimer = ( Timer_t * ) pvPortMalloc( sizeof( Timer_t ) ); /*lint !e9087 !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack, and the first member of Timer_t is always a pointer to the timer's mame. */
+ traceENTER_xTimerCreate( pcTimerName, xTimerPeriodInTicks, xAutoReload, pvTimerID, pxCallbackFunction );
+
+ /* MISRA Ref 11.5.1 [Malloc memory assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ pxNewTimer = ( Timer_t * ) pvPortMalloc( sizeof( Timer_t ) );
if( pxNewTimer != NULL )
{
@@ -304,6 +357,8 @@
prvInitialiseNewTimer( pcTimerName, xTimerPeriodInTicks, xAutoReload, pvTimerID, pxCallbackFunction, pxNewTimer );
}
+ traceRETURN_xTimerCreate( pxNewTimer );
+
return pxNewTimer;
}
@@ -312,7 +367,7 @@
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
- TimerHandle_t xTimerCreateStatic( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ TimerHandle_t xTimerCreateStatic( const char * const pcTimerName,
const TickType_t xTimerPeriodInTicks,
const BaseType_t xAutoReload,
void * const pvTimerID,
@@ -321,6 +376,8 @@
{
Timer_t * pxNewTimer;
+ traceENTER_xTimerCreateStatic( pcTimerName, xTimerPeriodInTicks, xAutoReload, pvTimerID, pxCallbackFunction, pxTimerBuffer );
+
#if ( configASSERT_DEFINED == 1 )
{
/* Sanity check that the size of the structure used to declare a
@@ -328,31 +385,36 @@
* structure. */
volatile size_t xSize = sizeof( StaticTimer_t );
configASSERT( xSize == sizeof( Timer_t ) );
- ( void ) xSize; /* Keeps lint quiet when configASSERT() is not defined. */
+ ( void ) xSize; /* Prevent unused variable warning when configASSERT() is not defined. */
}
#endif /* configASSERT_DEFINED */
/* A pointer to a StaticTimer_t structure MUST be provided, use it. */
configASSERT( pxTimerBuffer );
- pxNewTimer = ( Timer_t * ) pxTimerBuffer; /*lint !e740 !e9087 StaticTimer_t is a pointer to a Timer_t, so guaranteed to be aligned and sized correctly (checked by an assert()), so this is safe. */
+ /* MISRA Ref 11.3.1 [Misaligned access] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
+ /* coverity[misra_c_2012_rule_11_3_violation] */
+ pxNewTimer = ( Timer_t * ) pxTimerBuffer;
if( pxNewTimer != NULL )
{
/* Timers can be created statically or dynamically so note this
* timer was created statically in case it is later deleted. The
* auto-reload bit may get set in prvInitialiseNewTimer(). */
- pxNewTimer->ucStatus = tmrSTATUS_IS_STATICALLY_ALLOCATED;
+ pxNewTimer->ucStatus = ( uint8_t ) tmrSTATUS_IS_STATICALLY_ALLOCATED;
prvInitialiseNewTimer( pcTimerName, xTimerPeriodInTicks, xAutoReload, pvTimerID, pxCallbackFunction, pxNewTimer );
}
+ traceRETURN_xTimerCreateStatic( pxNewTimer );
+
return pxNewTimer;
}
#endif /* configSUPPORT_STATIC_ALLOCATION */
/*-----------------------------------------------------------*/
- static void prvInitialiseNewTimer( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ static void prvInitialiseNewTimer( const char * const pcTimerName,
const TickType_t xTimerPeriodInTicks,
const BaseType_t xAutoReload,
void * const pvTimerID,
@@ -376,22 +438,26 @@
if( xAutoReload != pdFALSE )
{
- pxNewTimer->ucStatus |= tmrSTATUS_IS_AUTORELOAD;
+ pxNewTimer->ucStatus |= ( uint8_t ) tmrSTATUS_IS_AUTORELOAD;
}
traceTIMER_CREATE( pxNewTimer );
}
/*-----------------------------------------------------------*/
- BaseType_t xTimerGenericCommand( TimerHandle_t xTimer,
- const BaseType_t xCommandID,
- const TickType_t xOptionalValue,
- BaseType_t * const pxHigherPriorityTaskWoken,
- const TickType_t xTicksToWait )
+ BaseType_t xTimerGenericCommandFromTask( TimerHandle_t xTimer,
+ const BaseType_t xCommandID,
+ const TickType_t xOptionalValue,
+ BaseType_t * const pxHigherPriorityTaskWoken,
+ const TickType_t xTicksToWait )
{
BaseType_t xReturn = pdFAIL;
DaemonTaskMessage_t xMessage;
+ ( void ) pxHigherPriorityTaskWoken;
+
+ traceENTER_xTimerGenericCommandFromTask( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
+
configASSERT( xTimer );
/* Send a message to the timer service task to perform a particular action
@@ -403,6 +469,8 @@
xMessage.u.xTimerParameters.xMessageValue = xOptionalValue;
xMessage.u.xTimerParameters.pxTimer = xTimer;
+ configASSERT( xCommandID < tmrFIRST_FROM_ISR_COMMAND );
+
if( xCommandID < tmrFIRST_FROM_ISR_COMMAND )
{
if( xTaskGetSchedulerState() == taskSCHEDULER_RUNNING )
@@ -414,7 +482,47 @@
xReturn = xQueueSendToBack( xTimerQueue, &xMessage, tmrNO_DELAY );
}
}
- else
+
+ traceTIMER_COMMAND_SEND( xTimer, xCommandID, xOptionalValue, xReturn );
+ }
+ else
+ {
+ mtCOVERAGE_TEST_MARKER();
+ }
+
+ traceRETURN_xTimerGenericCommandFromTask( xReturn );
+
+ return xReturn;
+ }
+/*-----------------------------------------------------------*/
+
+ BaseType_t xTimerGenericCommandFromISR( TimerHandle_t xTimer,
+ const BaseType_t xCommandID,
+ const TickType_t xOptionalValue,
+ BaseType_t * const pxHigherPriorityTaskWoken,
+ const TickType_t xTicksToWait )
+ {
+ BaseType_t xReturn = pdFAIL;
+ DaemonTaskMessage_t xMessage;
+
+ ( void ) xTicksToWait;
+
+ traceENTER_xTimerGenericCommandFromISR( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
+
+ configASSERT( xTimer );
+
+ /* Send a message to the timer service task to perform a particular action
+ * on a particular timer definition. */
+ if( xTimerQueue != NULL )
+ {
+ /* Send a command to the timer service task to start the xTimer timer. */
+ xMessage.xMessageID = xCommandID;
+ xMessage.u.xTimerParameters.xMessageValue = xOptionalValue;
+ xMessage.u.xTimerParameters.pxTimer = xTimer;
+
+ configASSERT( xCommandID >= tmrFIRST_FROM_ISR_COMMAND );
+
+ if( xCommandID >= tmrFIRST_FROM_ISR_COMMAND )
{
xReturn = xQueueSendToBackFromISR( xTimerQueue, &xMessage, pxHigherPriorityTaskWoken );
}
@@ -426,15 +534,22 @@
mtCOVERAGE_TEST_MARKER();
}
+ traceRETURN_xTimerGenericCommandFromISR( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
TaskHandle_t xTimerGetTimerDaemonTaskHandle( void )
{
+ traceENTER_xTimerGetTimerDaemonTaskHandle();
+
/* If xTimerGetTimerDaemonTaskHandle() is called before the scheduler has been
* started, then xTimerTaskHandle will be NULL. */
configASSERT( ( xTimerTaskHandle != NULL ) );
+
+ traceRETURN_xTimerGetTimerDaemonTaskHandle( xTimerTaskHandle );
+
return xTimerTaskHandle;
}
/*-----------------------------------------------------------*/
@@ -443,7 +558,12 @@
{
Timer_t * pxTimer = xTimer;
+ traceENTER_xTimerGetPeriod( xTimer );
+
configASSERT( xTimer );
+
+ traceRETURN_xTimerGetPeriod( pxTimer->xTimerPeriodInTicks );
+
return pxTimer->xTimerPeriodInTicks;
}
/*-----------------------------------------------------------*/
@@ -453,12 +573,14 @@
{
Timer_t * pxTimer = xTimer;
+ traceENTER_vTimerSetReloadMode( xTimer, xAutoReload );
+
configASSERT( xTimer );
taskENTER_CRITICAL();
{
if( xAutoReload != pdFALSE )
{
- pxTimer->ucStatus |= tmrSTATUS_IS_AUTORELOAD;
+ pxTimer->ucStatus |= ( uint8_t ) tmrSTATUS_IS_AUTORELOAD;
}
else
{
@@ -466,6 +588,8 @@
}
}
taskEXIT_CRITICAL();
+
+ traceRETURN_vTimerSetReloadMode();
}
/*-----------------------------------------------------------*/
@@ -474,10 +598,12 @@
Timer_t * pxTimer = xTimer;
BaseType_t xReturn;
+ traceENTER_xTimerGetReloadMode( xTimer );
+
configASSERT( xTimer );
taskENTER_CRITICAL();
{
- if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) == 0 )
+ if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) == 0U )
{
/* Not an auto-reload timer. */
xReturn = pdFALSE;
@@ -490,12 +616,22 @@
}
taskEXIT_CRITICAL();
+ traceRETURN_xTimerGetReloadMode( xReturn );
+
return xReturn;
}
UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer )
{
- return ( UBaseType_t ) xTimerGetReloadMode( xTimer );
+ UBaseType_t uxReturn;
+
+ traceENTER_uxTimerGetReloadMode( xTimer );
+
+ uxReturn = ( UBaseType_t ) xTimerGetReloadMode( xTimer );
+
+ traceRETURN_uxTimerGetReloadMode( uxReturn );
+
+ return uxReturn;
}
/*-----------------------------------------------------------*/
@@ -504,17 +640,58 @@
Timer_t * pxTimer = xTimer;
TickType_t xReturn;
+ traceENTER_xTimerGetExpiryTime( xTimer );
+
configASSERT( xTimer );
xReturn = listGET_LIST_ITEM_VALUE( &( pxTimer->xTimerListItem ) );
+
+ traceRETURN_xTimerGetExpiryTime( xReturn );
+
return xReturn;
}
/*-----------------------------------------------------------*/
- const char * pcTimerGetName( TimerHandle_t xTimer ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
+ #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
+ BaseType_t xTimerGetStaticBuffer( TimerHandle_t xTimer,
+ StaticTimer_t ** ppxTimerBuffer )
+ {
+ BaseType_t xReturn;
+ Timer_t * pxTimer = xTimer;
+
+ traceENTER_xTimerGetStaticBuffer( xTimer, ppxTimerBuffer );
+
+ configASSERT( ppxTimerBuffer != NULL );
+
+ if( ( pxTimer->ucStatus & tmrSTATUS_IS_STATICALLY_ALLOCATED ) != 0U )
+ {
+ /* MISRA Ref 11.3.1 [Misaligned access] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
+ /* coverity[misra_c_2012_rule_11_3_violation] */
+ *ppxTimerBuffer = ( StaticTimer_t * ) pxTimer;
+ xReturn = pdTRUE;
+ }
+ else
+ {
+ xReturn = pdFALSE;
+ }
+
+ traceRETURN_xTimerGetStaticBuffer( xReturn );
+
+ return xReturn;
+ }
+ #endif /* configSUPPORT_STATIC_ALLOCATION */
+/*-----------------------------------------------------------*/
+
+ const char * pcTimerGetName( TimerHandle_t xTimer )
{
Timer_t * pxTimer = xTimer;
+ traceENTER_pcTimerGetName( xTimer );
+
configASSERT( xTimer );
+
+ traceRETURN_pcTimerGetName( pxTimer->pcTimerName );
+
return pxTimer->pcTimerName;
}
/*-----------------------------------------------------------*/
@@ -541,7 +718,10 @@
static void prvProcessExpiredTimer( const TickType_t xNextExpireTime,
const TickType_t xTimeNow )
{
- Timer_t * const pxTimer = ( Timer_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList ); /*lint !e9087 !e9079 void * is used as this macro is used with tasks and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
+ /* MISRA Ref 11.5.3 [Void pointer assignment] */
+ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
+ /* coverity[misra_c_2012_rule_11_5_violation] */
+ Timer_t * const pxTimer = ( Timer_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList );
/* Remove the timer from the list of active timers. A check has already
* been performed to ensure the list is not empty. */
@@ -550,7 +730,7 @@
/* If the timer is an auto-reload timer then calculate the next
* expiry time and re-insert the timer in the list of active timers. */
- if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0 )
+ if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0U )
{
prvReloadTimer( pxTimer, xNextExpireTime, xTimeNow );
}
@@ -575,8 +755,6 @@
#if ( configUSE_DAEMON_TASK_STARTUP_HOOK == 1 )
{
- extern void vApplicationDaemonTaskStartupHook( void );
-
/* Allow the application writer to execute some code in the context of
* this task at the point the task starts executing. This is useful if the
* application includes initialisation code that would benefit from
@@ -585,7 +763,7 @@
}
#endif /* configUSE_DAEMON_TASK_STARTUP_HOOK */
- for( ; ; )
+ for( ; configCONTROL_INFINITE_LOOP(); )
{
/* Query the timers list to see if it contains any timers, and if so,
* obtain the time at which the next timer will expire. */
@@ -647,7 +825,7 @@
* block time to expire. If a command arrived between the
* critical section being exited and this yield then the yield
* will not cause the task to block. */
- portYIELD_WITHIN_API();
+ taskYIELD_WITHIN_API();
}
else
{
@@ -693,7 +871,7 @@
static TickType_t prvSampleTimeNow( BaseType_t * const pxTimerListsWereSwitched )
{
TickType_t xTimeNow;
- PRIVILEGED_DATA static TickType_t xLastTime = ( TickType_t ) 0U; /*lint !e956 Variable is only accessible to one task. */
+ PRIVILEGED_DATA static TickType_t xLastTime = ( TickType_t ) 0U;
xTimeNow = xTaskGetTickCount();
@@ -727,7 +905,7 @@
{
/* Has the expiry time elapsed between the command to start/reset a
* timer was issued, and the time the command was processed? */
- if( ( ( TickType_t ) ( xTimeNow - xCommandTime ) ) >= pxTimer->xTimerPeriodInTicks ) /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
+ if( ( ( TickType_t ) ( xTimeNow - xCommandTime ) ) >= pxTimer->xTimerPeriodInTicks )
{
/* The time between a command being issued and the command being
* processed actually exceeds the timers period. */
@@ -759,12 +937,12 @@
static void prvProcessReceivedCommands( void )
{
- DaemonTaskMessage_t xMessage;
+ DaemonTaskMessage_t xMessage = { 0 };
Timer_t * pxTimer;
BaseType_t xTimerListsWereSwitched;
TickType_t xTimeNow;
- while( xQueueReceive( xTimerQueue, &xMessage, tmrNO_DELAY ) != pdFAIL ) /*lint !e603 xMessage does not have to be initialised as it is passed out, not in, and it is not used unless xQueueReceive() returns pdTRUE. */
+ while( xQueueReceive( xTimerQueue, &xMessage, tmrNO_DELAY ) != pdFAIL )
{
#if ( INCLUDE_xTimerPendFunctionCall == 1 )
{
@@ -796,7 +974,7 @@
* software timer. */
pxTimer = xMessage.u.xTimerParameters.pxTimer;
- if( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) == pdFALSE ) /*lint !e961. The cast is only redundant when NULL is passed into the macro. */
+ if( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) == pdFALSE )
{
/* The timer is in a list, remove it. */
( void ) uxListRemove( &( pxTimer->xTimerListItem ) );
@@ -823,13 +1001,13 @@
case tmrCOMMAND_RESET:
case tmrCOMMAND_RESET_FROM_ISR:
/* Start or restart a timer. */
- pxTimer->ucStatus |= tmrSTATUS_IS_ACTIVE;
+ pxTimer->ucStatus |= ( uint8_t ) tmrSTATUS_IS_ACTIVE;
if( prvInsertTimerInActiveList( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow, xMessage.u.xTimerParameters.xMessageValue ) != pdFALSE )
{
/* The timer expired before it was added to the active
* timer list. Process it now. */
- if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0 )
+ if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0U )
{
prvReloadTimer( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow );
}
@@ -857,7 +1035,7 @@
case tmrCOMMAND_CHANGE_PERIOD:
case tmrCOMMAND_CHANGE_PERIOD_FROM_ISR:
- pxTimer->ucStatus |= tmrSTATUS_IS_ACTIVE;
+ pxTimer->ucStatus |= ( uint8_t ) tmrSTATUS_IS_ACTIVE;
pxTimer->xTimerPeriodInTicks = xMessage.u.xTimerParameters.xMessageValue;
configASSERT( ( pxTimer->xTimerPeriodInTicks > 0 ) );
@@ -948,14 +1126,14 @@
{
/* The timer queue is allocated statically in case
* configSUPPORT_DYNAMIC_ALLOCATION is 0. */
- PRIVILEGED_DATA static StaticQueue_t xStaticTimerQueue; /*lint !e956 Ok to declare in this manner to prevent additional conditional compilation guards in other locations. */
- PRIVILEGED_DATA static uint8_t ucStaticTimerQueueStorage[ ( size_t ) configTIMER_QUEUE_LENGTH * sizeof( DaemonTaskMessage_t ) ]; /*lint !e956 Ok to declare in this manner to prevent additional conditional compilation guards in other locations. */
+ PRIVILEGED_DATA static StaticQueue_t xStaticTimerQueue;
+ PRIVILEGED_DATA static uint8_t ucStaticTimerQueueStorage[ ( size_t ) configTIMER_QUEUE_LENGTH * sizeof( DaemonTaskMessage_t ) ];
xTimerQueue = xQueueCreateStatic( ( UBaseType_t ) configTIMER_QUEUE_LENGTH, ( UBaseType_t ) sizeof( DaemonTaskMessage_t ), &( ucStaticTimerQueueStorage[ 0 ] ), &xStaticTimerQueue );
}
#else
{
- xTimerQueue = xQueueCreate( ( UBaseType_t ) configTIMER_QUEUE_LENGTH, sizeof( DaemonTaskMessage_t ) );
+ xTimerQueue = xQueueCreate( ( UBaseType_t ) configTIMER_QUEUE_LENGTH, ( UBaseType_t ) sizeof( DaemonTaskMessage_t ) );
}
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
@@ -986,12 +1164,14 @@
BaseType_t xReturn;
Timer_t * pxTimer = xTimer;
+ traceENTER_xTimerIsTimerActive( xTimer );
+
configASSERT( xTimer );
/* Is the timer in the list of active timers? */
taskENTER_CRITICAL();
{
- if( ( pxTimer->ucStatus & tmrSTATUS_IS_ACTIVE ) == 0 )
+ if( ( pxTimer->ucStatus & tmrSTATUS_IS_ACTIVE ) == 0U )
{
xReturn = pdFALSE;
}
@@ -1002,8 +1182,10 @@
}
taskEXIT_CRITICAL();
+ traceRETURN_xTimerIsTimerActive( xReturn );
+
return xReturn;
- } /*lint !e818 Can't be pointer to const due to the typedef. */
+ }
/*-----------------------------------------------------------*/
void * pvTimerGetTimerID( const TimerHandle_t xTimer )
@@ -1011,6 +1193,8 @@
Timer_t * const pxTimer = xTimer;
void * pvReturn;
+ traceENTER_pvTimerGetTimerID( xTimer );
+
configASSERT( xTimer );
taskENTER_CRITICAL();
@@ -1019,6 +1203,8 @@
}
taskEXIT_CRITICAL();
+ traceRETURN_pvTimerGetTimerID( pvReturn );
+
return pvReturn;
}
/*-----------------------------------------------------------*/
@@ -1028,6 +1214,8 @@
{
Timer_t * const pxTimer = xTimer;
+ traceENTER_vTimerSetTimerID( xTimer, pvNewID );
+
configASSERT( xTimer );
taskENTER_CRITICAL();
@@ -1035,6 +1223,8 @@
pxTimer->pvTimerID = pvNewID;
}
taskEXIT_CRITICAL();
+
+ traceRETURN_vTimerSetTimerID();
}
/*-----------------------------------------------------------*/
@@ -1048,6 +1238,8 @@
DaemonTaskMessage_t xMessage;
BaseType_t xReturn;
+ traceENTER_xTimerPendFunctionCallFromISR( xFunctionToPend, pvParameter1, ulParameter2, pxHigherPriorityTaskWoken );
+
/* Complete the message with the function parameters and post it to the
* daemon task. */
xMessage.xMessageID = tmrCOMMAND_EXECUTE_CALLBACK_FROM_ISR;
@@ -1058,6 +1250,7 @@
xReturn = xQueueSendFromISR( xTimerQueue, &xMessage, pxHigherPriorityTaskWoken );
tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, xReturn );
+ traceRETURN_xTimerPendFunctionCallFromISR( xReturn );
return xReturn;
}
@@ -1075,6 +1268,8 @@
DaemonTaskMessage_t xMessage;
BaseType_t xReturn;
+ traceENTER_xTimerPendFunctionCall( xFunctionToPend, pvParameter1, ulParameter2, xTicksToWait );
+
/* This function can only be called after a timer has been created or
* after the scheduler has been started because, until then, the timer
* queue does not exist. */
@@ -1090,6 +1285,7 @@
xReturn = xQueueSendToBack( xTimerQueue, &xMessage, xTicksToWait );
tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, xReturn );
+ traceRETURN_xTimerPendFunctionCall( xReturn );
return xReturn;
}
@@ -1101,6 +1297,10 @@
UBaseType_t uxTimerGetTimerNumber( TimerHandle_t xTimer )
{
+ traceENTER_uxTimerGetTimerNumber( xTimer );
+
+ traceRETURN_uxTimerGetTimerNumber( ( ( Timer_t * ) xTimer )->uxTimerNumber );
+
return ( ( Timer_t * ) xTimer )->uxTimerNumber;
}
@@ -1112,12 +1312,28 @@
void vTimerSetTimerNumber( TimerHandle_t xTimer,
UBaseType_t uxTimerNumber )
{
+ traceENTER_vTimerSetTimerNumber( xTimer, uxTimerNumber );
+
( ( Timer_t * ) xTimer )->uxTimerNumber = uxTimerNumber;
+
+ traceRETURN_vTimerSetTimerNumber();
}
#endif /* configUSE_TRACE_FACILITY */
/*-----------------------------------------------------------*/
+/*
+ * Reset the state in this file. This state is normally initialized at start up.
+ * This function must be called by the application before restarting the
+ * scheduler.
+ */
+ void vTimerResetState( void )
+ {
+ xTimerQueue = NULL;
+ xTimerTaskHandle = NULL;
+ }
+/*-----------------------------------------------------------*/
+
/* This entire source file will be skipped if the application is not configured
* to include software timer functionality. If you want to include software timer
* functionality then ensure configUSE_TIMERS is set to 1 in FreeRTOSConfig.h. */
diff --git a/third-party/fsl_wifi/port/os/os.c b/third-party/fsl_wifi/port/os/os.c
index 2fea7858d928a256f6bec80c593c592cac50fe0b..f0d4015950e51cacd9f96b2833256a0b42584067 100644
--- a/third-party/fsl_wifi/port/os/os.c
+++ b/third-party/fsl_wifi/port/os/os.c
@@ -440,7 +440,7 @@ void vApplicationIdleHook(void)
}
}
-/* Freertos handles this internally? */
+/* FreeRTOS handles this internally? */
void os_thread_stackmark(char *name)
{
/* Nothing to-do */
diff --git a/third-party/fsl_wifi/port/os/os_cli.c b/third-party/fsl_wifi/port/os/os_cli.c
index 1ebebd28bc2fac0f6bf9fb1c0cbdd3f12acedade..3d5de1636dc013584fadf3db7f18d96f8409b0d6 100644
--- a/third-party/fsl_wifi/port/os/os_cli.c
+++ b/third-party/fsl_wifi/port/os/os_cli.c
@@ -12,7 +12,7 @@
#include "fsl_wifi_config.h"
#include
-/* Freertos does no size check on this buffer and hence kept higher than
+/* FreeRTOS does no size check on this buffer and hence kept higher than
* minimal size that would be required */
#define MAX_TASK_INFO_BUF 1024
diff --git a/third-party/letter-shell-3.1/src/shell.c b/third-party/letter-shell-3.1/src/shell.c
index 18b7f28d0f211b92b9868f82288b8d157edc5fa4..4c51e2eff1543e3878ca278474abaa5f86a5ef34 100644
--- a/third-party/letter-shell-3.1/src/shell.c
+++ b/third-party/letter-shell-3.1/src/shell.c
@@ -17,7 +17,9 @@
#include
#include "stdarg.h"
#include "shell_ext.h"
-
+/* FreeRTOS includes. */
+#include "FreeRTOS.h"
+#include "task.h"
#if SHELL_USING_CMD_EXPORT == 1
/**
@@ -133,10 +135,11 @@ static const char *shellText[] =
"|_| |_| |_| \\ __, | \\__| |_| \\__,_| |_| |_| |_|\r\n"
" __/ | \r\n"
" |___/ \r\n"
- "================ Freertos Letter Shell================\r\n"
+ "================ FreeRTOS Letter Shell================\r\n"
"Build: "__DATE__" "__TIME__"\r\n"
- "Version: "SHELL_VERSION"\r\n"
"Platform: "SHELL_PLATFORM""SHELL_ARCH"\r\n"
+ "Shell: "SHELL_VERSION"\r\n"
+ "FreeRTOS: "tskKERNEL_VERSION_NUMBER"\r\n"
#if defined(CONFIG_USE_BAREMETAL_AMP)
"Role: "SHELL_AMP_ROLE"\r\n"
#endif
diff --git a/third-party/lwip-2.1.2/Kconfig b/third-party/lwip-2.1.2/Kconfig
index 80b374fe5fb9392544a1b5e34349c76a70dd7ec7..a4c65856273c311aa8a53f3d8f4a121512cc9570 100644
--- a/third-party/lwip-2.1.2/Kconfig
+++ b/third-party/lwip-2.1.2/Kconfig
@@ -1,4 +1,4 @@
-menu "LWIP Freertos Port Configuration"
+menu "LWIP FreeRTOS Port Configuration"
source "$(STANDALONE_DIR)/third-party/lwip-2.1.2/Kconfig"
diff --git a/third-party/lwip-2.1.2/lwip.kconfig b/third-party/lwip-2.1.2/lwip.kconfig
index fecad1525a971273f34dc5e304afb3d75bef79d0..cab3864630f805115aef3955479bac08aad27b12 100644
--- a/third-party/lwip-2.1.2/lwip.kconfig
+++ b/third-party/lwip-2.1.2/lwip.kconfig
@@ -1,4 +1,4 @@
-menu "LWIP Freertos Port Configuration"
+menu "LWIP FreeRTOS Port Configuration"
source "$(STANDALONE_DIR)/third-party/lwip-2.1.2/lwip.kconfig"
diff --git a/third-party/mbedtls-3.6/Kconfig b/third-party/mbedtls-3.6/Kconfig
index b832fe10450d8eb2ebdd8269379f07d67b26aa12..8e81980345633e2be8c9f22c8cc64afc0554a21b 100644
--- a/third-party/mbedtls-3.6/Kconfig
+++ b/third-party/mbedtls-3.6/Kconfig
@@ -1,3 +1,3 @@
-menu "MBEDTLS Freertos Port Configuration"
+menu "MBEDTLS FreeRTOS Port Configuration"
endmenu
\ No newline at end of file
diff --git a/third-party/mbedtls-3.6/mbedtls.kconfig b/third-party/mbedtls-3.6/mbedtls.kconfig
index b832fe10450d8eb2ebdd8269379f07d67b26aa12..8e81980345633e2be8c9f22c8cc64afc0554a21b 100644
--- a/third-party/mbedtls-3.6/mbedtls.kconfig
+++ b/third-party/mbedtls-3.6/mbedtls.kconfig
@@ -1,3 +1,3 @@
-menu "MBEDTLS Freertos Port Configuration"
+menu "MBEDTLS FreeRTOS Port Configuration"
endmenu
\ No newline at end of file
diff --git a/third-party/spiffs-0.3.7/ports/fspim/fspim_spiffs_port.c b/third-party/spiffs-0.3.7/ports/fspim/fspim_spiffs_port.c
index 76c5123757bee01702e9dec88c557e6110041593..8223dca16b555f22eda622db6750421105e80483 100755
--- a/third-party/spiffs-0.3.7/ports/fspim/fspim_spiffs_port.c
+++ b/third-party/spiffs-0.3.7/ports/fspim/fspim_spiffs_port.c
@@ -42,7 +42,7 @@ static boolean is_sfud_ready = FALSE;
static const sfud_flash *flash_instance = NULL;
#if defined(CONFIG_E2000Q_DEMO_BOARD) || defined(CONFIG_E2000D_DEMO_BOARD)
static const fsize_t flash_id = SFUD_FSPIM2_INDEX;
-#elif defined(CONFIG_FIREFLY_DEMO_BOARD)
+#else
static const fsize_t flash_id = SFUD_FSPIM0_INDEX;
#endif
diff --git a/tools/makeall.mk b/tools/makeall.mk
index fb441d6ae763b2a0de53e302c01931722a185072..48935a17ea1789fe73520f0984a8e49d13ddd8a8 100644
--- a/tools/makeall.mk
+++ b/tools/makeall.mk
@@ -48,3 +48,10 @@ include $(SDK_DIR)/tools/build/menuconfig/menuconfig.mk
amp_make:
$(PYTHON) $(SDK_PYTHON_TOOLS_DIR)/amp_parse_config.py
cp ./packed_image.elf $(USR_BOOT_DIR)/freertos.elf
+
+amp_make_t:
+ $(PYTHON) $(SDK_PYTHON_TOOLS_DIR)/amp_parse_config.py test
+ cp ./packed_image.elf $(USR_BOOT_DIR)/freertos.elf
+
+check_standalone_version:
+ $(PYTHON) $(FREERTOS_SDK_DIR)/install.py