Merge branch 'feature/deprecate_freertos_assert' into 'master'

freertos: remove FREERTOS_ASSERT option

Closes IDF-2294

See merge request espressif/esp-idf!16563
pull/8219/head
Marius Vikhammer 2022-01-07 06:35:05 +00:00
commit 79cc650d75
16 zmienionych plików z 16 dodań i 68 usunięć

Wyświetl plik

@ -115,18 +115,6 @@ int xt_clock_freq(void) __attribute__((deprecated));
#endif
#endif // __ASSEMBLER__
// If CONFIG_FREERTOS_ASSERT_DISABLE is set then configASSERT is defined empty later in FreeRTOS.h and the macro
// configASSERT_DEFINED remains unset (meaning some warnings are avoided)
#if defined(CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE)
#define configASSERT(a) if (unlikely(!(a))) { \
esp_rom_printf("%s:%d (%s)- assert failed!\n", __FILE__, __LINE__, \
__FUNCTION__); \
}
#elif defined(CONFIG_FREERTOS_ASSERT_FAIL_ABORT)
#define configASSERT(a) assert(a)
#endif
#if CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION
#define UNTESTED_FUNCTION() { esp_rom_printf("Untested FreeRTOS function %s\r\n", __FUNCTION__); configASSERT(false); } while(0)
#else

Wyświetl plik

@ -175,39 +175,6 @@ menu "FreeRTOS"
This value must be at least 1. Index 0 is reserved for use by the pthreads API
thread-local-storage. Other indexes can be used for any desired purpose.
choice FREERTOS_ASSERT
prompt "FreeRTOS assertions"
default FREERTOS_ASSERT_FAIL_ABORT if !COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE
default FREERTOS_ASSERT_DISABLE if COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE
help
Failed FreeRTOS configASSERT() assertions can be configured to
behave in different ways.
By default these behave the same as the global project assert settings.
config FREERTOS_ASSERT_FAIL_ABORT
bool "abort() on failed assertions"
depends on !COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE
help
If a FreeRTOS configASSERT() fails, FreeRTOS will abort() and
halt execution. The panic handler can be configured to handle
the outcome of an abort() in different ways.
If assertions are disabled for the entire project, they are also
disabled in FreeRTOS and this option is unavailable.
config FREERTOS_ASSERT_FAIL_PRINT_CONTINUE
bool "Print and continue failed assertions"
help
If a FreeRTOS assertion fails, print it out and continue.
config FREERTOS_ASSERT_DISABLE
bool "Disable FreeRTOS assertions"
help
FreeRTOS configASSERT() will not be compiled into the binary.
endchoice
config FREERTOS_IDLE_TASK_STACKSIZE
int "Idle Task stack size"
range 768 32768

Wyświetl plik

@ -100,17 +100,7 @@
#ifndef __ASSEMBLER__
#include <assert.h>
// If CONFIG_FREERTOS_ASSERT_DISABLE is set then configASSERT is defined empty later in FreeRTOS.h and the macro
// configASSERT_DEFINED remains unset (meaning some warnings are avoided)
#if defined(CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE)
#define configASSERT(a) if (unlikely(!(a))) { \
esp_rom_printf("%s:%d (%s)- assert failed!\n", __FILE__, __LINE__, \
__FUNCTION__); \
}
#elif defined(CONFIG_FREERTOS_ASSERT_FAIL_ABORT)
#define configASSERT(a) assert(a)
#endif
#if CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION
#define UNTESTED_FUNCTION() { esp_rom_printf("Untested FreeRTOS function %s\r\n", __FUNCTION__); configASSERT(false); } while(0)

Wyświetl plik

@ -5,7 +5,7 @@
#include "test_utils.h"
/* If assertions aren't set to fail this code still crashes, but not with an abort... */
#if CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER && CONFIG_FREERTOS_ASSERT_FAIL_ABORT
#if CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER && !CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE
static void mutex_release_task(void* arg)
{

Wyświetl plik

@ -180,7 +180,6 @@
#define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY 1
#define CONFIG_FREERTOS_INTERRUPT_BACKTRACE 1
#define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1
#define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1
#define CONFIG_FREERTOS_IDLE_TASK_STACKSIZE 1536
#define CONFIG_FREERTOS_ISR_STACKSIZE 1536
#define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16

Wyświetl plik

@ -0,0 +1,12 @@
Migrate FreeRTOS to ESP-IDF 5.0
==================================
Tasks Snapshot
--------------
The header ``task_snapshot.h`` has been removed from ``freertos/task.h``. ESP-IDF developers should include ``"freertos/task_snapshot.h``` in case they need tasks snapshot API.
FreeRTOS Asserts
----------------
Previously FreeRTOS asserts were configured separately from the rest of the system using the `FREERTOS_ASSERT` kconfig option. This option has now been removed and the configuration is now done through `COMPILER_OPTIMIZATION_ASSERTION_LEVEL`.

Wyświetl plik

@ -9,5 +9,6 @@ ESP-IDF 5.0 Migration Guides
Peripherals <peripherals>
Build System <build-system>
System <system>
FreeRTOS <freertos>
Ethernet <ethernet>
Removed or deprecated components <removed-components>

Wyświetl plik

@ -34,11 +34,6 @@ ROM
---
Deprecated ROM related header files from `components/esp32/rom/` (old include path: `rom/*.h`) have been deleted. Please update to use the new target-specific path from `components/esp_rom/include/{IDF_TARGET_NAME}/` (new include path: `{IDF_TARGET_NAME}/rom/*.h`).
Tasks snapshot
--------------
The header ``task_snapshot.h`` has been removed from ``freertos/task.h``. ESP-IDF developers should include ``"freertos/task_snapshot.h``` in case they need tasks snapshot API.
ESP HW Support
--------------

Wyświetl plik

@ -0,0 +1 @@
.. include:: ../../en/migration-guides/freertos.rst

Wyświetl plik

@ -9,5 +9,6 @@ ESP-IDF 5.0 迁移指南
外设 <peripherals>
构建系统 <build-system>
系统 <system>
FreeRTOS <freertos>
以太网 <ethernet>
Removed or deprecated components <removed-components>

Wyświetl plik

@ -1,5 +1,4 @@
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y
CONFIG_FREERTOS_ASSERT_DISABLE=y
CONFIG_COMPILER_HIDE_PATHS_MACROS=n
# compiling as many files as possible here (we don't have 100% coverage of course, due to config options, but

Wyświetl plik

@ -1,5 +1,4 @@
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y
CONFIG_FREERTOS_ASSERT_DISABLE=y
CONFIG_COMPILER_HIDE_PATHS_MACROS=n
# the other sdkconfig builds Bluedroid, build NimBLE here

Wyświetl plik

@ -1,5 +1,4 @@
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y
CONFIG_FREERTOS_ASSERT_DISABLE=y
CONFIG_COMPILER_HIDE_PATHS_MACROS=n
# the other sdkconfig builds Bluedroid, build NimBLE here

Wyświetl plik

@ -10,7 +10,6 @@ CONFIG_FREERTOS_HZ=500
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL=y
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
CONFIG_FREERTOS_INTERRUPT_BACKTRACE=n
CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE=y
CONFIG_FREERTOS_LEGACY_HOOKS=y
CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP=y
CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=10

Wyświetl plik

@ -10,7 +10,6 @@ CONFIG_FREERTOS_HZ=500
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL=y
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
CONFIG_FREERTOS_INTERRUPT_BACKTRACE=n
CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE=y
CONFIG_FREERTOS_LEGACY_HOOKS=y
CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP=y

Wyświetl plik

@ -10,7 +10,6 @@ CONFIG_FREERTOS_HZ=500
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL=y
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
CONFIG_FREERTOS_INTERRUPT_BACKTRACE=n
CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE=y
CONFIG_FREERTOS_LEGACY_HOOKS=y
CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP=y
CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=10