I've been reading up in the FreeRTOS documentation about how to use things like, for example, the startup hook daemon.
It says to set configUSE_DAEMON_TASK_STARTUP_HOOK = 1 in the FreeRTOSConfig.h file.
This value does not appear in ./framework-espidf/components/freertos/include/freertos/FreeRTOS.h or FreeRTOSConfig.h.
Does the ESP-IDF not include these features?
ESP-IDF and FreeRTOS
Re: ESP-IDF and FreeRTOS
ESP-IDF does not include this feature because this feature was added in FreeRTOS V9.0.0rc1. ESP-IDF FreeRTOS is based on FreeRTOS v8.2
Re: ESP-IDF and FreeRTOS
So, ESP-IDF is 2 versions behind freertos.
I searched this forum and couldn't find any discussion of freertos referring to plans for updating freertos.
Makes learning freertos a bit more challenging trying to translate tutorials and examples backward to version 8.
I started looking at this because I wanted to use the daemon hook to ensure startup sequences get executed before task start to run...
Oh well...
I searched this forum and couldn't find any discussion of freertos referring to plans for updating freertos.
Makes learning freertos a bit more challenging trying to translate tutorials and examples backward to version 8.
I started looking at this because I wanted to use the daemon hook to ensure startup sequences get executed before task start to run...
Oh well...
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP-IDF and FreeRTOS
Note that you may get the same effect (code run before FreeRTOS starts) by defining your function as a constructor:
Make sure that the C file where you put this function in has something (another function or a variable or symbol) that gets referenced by the rest of the code, though, otherwise the linker will ignore your file thinking it's never used.
Code: Select all
void __attribute__((constructor)) my_function(void) {
...
}
Re: ESP-IDF and FreeRTOS
I'll have to google that...I'm not familiar with the use of constructors in non-object oriented languages...ESP_Sprite wrote: ↑Thu Dec 19, 2019 2:44 amNote that you may get the same effect (code run before FreeRTOS starts) by defining your function as a constructor:
Make sure that the C file where you put this function in has something (another function or a variable or symbol) that gets referenced by the rest of the code, though, otherwise the linker will ignore your file thinking it's never used.Code: Select all
void __attribute__((constructor)) my_function(void) { ... }
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP-IDF and FreeRTOS
It may be a gcc extension to C, I don't know, but it works the same as static c++ constructors. The net effect is that functions marked like this are collected by the linker and their addresses are put in a list (__init_array_start to _end) in the final binary. In the startup code in esp-idf/components/esp32/cpu_start.c, we then execute all of them (in do_global_ctors()).
Who is online
Users browsing this forum: No registered users and 82 guests