This commit removes the updates the usage of queue locks in IDF FreeRTOS
Queue locks are present in Vanilla FreeRTOS to ensure that queue functions
behave deterministicly in critical sections (i.e., no walking linked lists
while interrupts are disabled). However, currently in IDF FreeRTOS...
- When configNUM_CORES > 1, IDF FreeRTOS drops the determinism requirement.
Thus, queue functions could be simplified if queue locks were not used at all
(and have a queue function do everything inside the same critical section).
- When configNUM_CORES == 1, the current queue implementation in IDF FreeRTOS
does not meet the determinism requirements, as critical sections are used
(instead of scheduler suspension) when locking/unlocking the queues.
There, this commit updates multiple queue functions so that
- When configNUM_CORES > 1
- Queue locks are no longer used. All actions are done within the same
critical section.
- Affected queue functions now need 40% less CPU clock cycles when blocking
- When configNUM_CORES = 1
- Queue locks are still used.
- Vanilla behavior of suspending the scheduler is restored when locking
the queue. Thus queue fucntions are now deterministic and have the same
behavior as Vanilla FreeRTOS.
- Affected queue functions now takes 36% more CPU clock cycles when
blocking (due to the scheduler suspension/resumption).
The following changes have been made in this commit:
1. configMINIMAL_STACK_SIZE is now defined as CONFIG_FREERTOS_IDLE_TASK_STACKSIZE.
2. Removed configIDLE_TASK_STACK_SIZE config as it was redundant.
3. Updates the order of allocating the TCB and stack memory to avoid the
stack memory overriding the TCB memory when the stack grows downwards.
4. CONFIG_FREERTOS_IDLE_TASK_STACKSIZE is now incorporated into the
FreeRTOSConfig_smp.h to configure the IDLE0 stack size.
This commit fixes flakey task delay tests when running on IDF FreeRTOS. IN IDF
FreeRTOS, core 1's tick interrupts could be up to (< 1 tick) out of phase from
core 0's tick interrupt, thus the measured delay time on core 1 could last 1
tick longer. This commit makes the test detla 2 ticks for IDF FreeRTOS.
This commit adds a copy of upstream vanilla FreeRTOS uncrustify.cfg files from
the following upstream commit:
89e4823a49
Note: "pp_indent_brace" is commented out as that was enabled after v10.4.3
Also also added a note in the ESP-IDF style guide aobut formatting FreeRTOS
source code using Uncrustify.
This commit refactors the way stream buffers initialize their spinlock.
- "prvInitialiseNewStreamBuffer()" now initializes the stream buffer fields
manually (instead of using memset()) to avoid resetting the spin lock
- Stream buffer creation functions now manually initialize the spinlock after
the other fields are initialized using "prvInitialiseNewStreamBuffer()"
Also added comments to event group spinlock initializtion.
The llvm asm pasrser doesn't support some gnu asm extensions,
like using "&" with macro arguments. So, replace such code with
code which could be compiled by llvm.
An explicit check of the mutex owner during a mutex release operation is
not necessary for FreeRTOS SMP as this is checked by default. Hence, the
corresponding Kconfig option is removed.
This commit fixes/ignores flakey freertos unit tests after migrating them to
the test app:
- Added vTaskDelay() before teardown to prevent memory leaks
- Adjusted the "main" task's priority so that scheudling tasks would work
- pytest now only runs tests that are not ignored
- Reset tests are temporarily ignored. Will be enabled to dedicate reset tests.
- Some flakey tests are fixed by adjusting delays and stack sizes.
This commit adds the sdkconfig files for the FreeRTOS test app. These
configurations were dervied from the various legacy unit test app's
config files that included the FreeRTOS component.
This commit tries to keep a 1 to 1 config parity with the legacy test app.
Meaning, if FreeRTOS test were run on a particular target with a particular
config, that config will be represented in one of the test app's
sdkconfig.ci.XXX files.
However, the following configurations were removed for FreeRTOS tests:
- The "freertos_flash" option was removed due to redudancy (already tested in
freertos_options)
Some tests were placed in the incorrect test groups (i.e., kernel, port,
performance etc). This commit fixes those placements.
The following redundant tests were also removed:
- "test_panic.c" as behavior is already covered in esp_system tests
This commit fixes a bug where if an unpinned task is interrupted by a level 1
ISR that users the FPU, the FPU usage will cause the interrupted task to
become pinned to the current core.
Note: This bug was already fixed in SMP FreeRTOS in commit
d69361779e. This commit simply backports the
fix to IDF FreeRTOS.
This commit refactors the existing FPU unit tests as follows
- Rename them from coproc to FPU
- Reorganize test placement
- Make existing tests work on both IDF and SMP FreeRTOS
- Update test documentation
- Remove old "test_float_in_isr.c"
This commit refactors the pxPortInitialiseStack() function of the riscv
FreeRTOS ports (both IDF and SMP FreeRTOS).
- Each stack area is now separated into their own functions
- Each function will individually
- Push the stack pointer to allocate the stack area
- Initiaze the allocated stack area
- Each stack area's size and usage is now clearly documented in code
This commit refactors the pxPortInitialiseStack() function of the xtensa
FreeRTOS ports (both IDF and SMP FreeRTOS).
- Each stack area is now separated into their own functions
- Each function will individually
- Push the stack pointer to allocate the stack area
- Initiaze the allocated stack area
- Each stack area's size and usage is now clearly documented in code
* Added port layer from the FreeRTOS POSIX port, added
additional port code for ESP-IDF.
* Created another hello world example using that POSIX
port in tools/test_apps.
* Removed old linux app