Wykres commitów

952 Commity (2e8c3c61b3052cc59148b09a2a6defb4968ee073)

Autor SHA1 Wiadomość Data
Darian 74ed2aa2ee Merge branch 'feature/freertos_10.4.3_sync_critical_sections_vs_suspension' into 'master'
FreeRTOS(IDF): Resolve critical section (multi-core) vs scheduler suspension (single-core)

Closes IDF-3755

See merge request espressif/esp-idf!21002
2022-11-21 18:38:43 +08:00
Omar Chebib 6fe563163c RISC-V: fix PC not saved when using backtrace 2022-11-18 15:07:38 +08:00
Omar Chebib d580f6b076 RISC-V: Create a wrapper around FreeRTOS Tasks to detect the ones returning 2022-11-18 15:07:32 +08:00
Darian eb837bbb6f Merge branch 'bugfix/freertos_smp_riscv_statement_expr_macro' into 'master'
FreeRTOS(SMP): Fix SMP FreeRTOS RISC-V statement expression macro

See merge request espressif/esp-idf!21110
2022-11-17 15:35:26 +08:00
Jakob Hasse c381fee319 Merge branch 'feature/esp_system_linux' into 'master'
esp_system partially buildable on Linux

Closes IDF-5983

See merge request espressif/esp-idf!21055
2022-11-16 22:38:48 +08:00
Darian Leung 623f20d2b5 freertos(SMP): Fix SMP FreeRTOS RISC-V statement expression macro
Macros that need to reteurn a value should use GCC statement expression macro
syntax. This commit fixes the portTRY_ENTER_CRITICAL() in the RISC-V port of
SMP FreeRTOS to be a statement expression macro.
2022-11-16 17:51:10 +08:00
Jakob Hasse cce1f9dee4 Merge branch 'feature/freertos_task_notification_configurable' into 'master'
freertos: make num of task notifications configurable

Closes IDFGH-7819

See merge request espressif/esp-idf!20880
2022-11-16 17:11:03 +08:00
Jakob Hasse 5b3a645813 feat(esp_system): Partially buildable on Linux now 2022-11-16 09:03:09 +01:00
Darian Leung 8b98e4e3b8 freertos(IDF): Restore vanilla call behavior on xTaskIncrementTick() and vTaskSwitchContext()
Due to SMP, critical sections have been added to xTaskIncrementTick() and
vTaskSwitchContext() (to take the xKernelLock). However, this is technically
not necessary when building for single-core as FreeRTOS expect these funcitons
to be called with interrupts already disabled.

This commit makes the critical secitons in those functions depend on
"configNUM_CORES > 1", and ensures that interrupts are disabled when calling
those functions. This effectively restores the vanilla behavior for these
functions when building for single-core.
2022-11-16 15:50:21 +08:00
Darian Leung 087e4318a6 freertos(IDF): Use common macros for SMP specific critical sections
In IDF FreeRTOS, when building for SMP, there are numerous functions
which require different critical sections when compared to single-core. This
commit encapsulates those difference into a common set of macros whose
behavior depends on "configNUM_CORES > 1". As such...

- Vanilla behavior has been restored for some functions when building for
  single core (i.e., used to call taskENTER_CRITICAL, now disables interrupts
  mactching vanilla behavior).
- Reduces number of "#ifdef (configNUM_CORES > 1)" in functions
- Any SMP only critical sections are now wrapped by
  "#ifdef (configNUM_CORES > 1)" and properly documented via comments.
2022-11-16 15:50:21 +08:00
Darian 4c1ff6016a Merge branch 'bugfix/freertos_smp_xtensa_port_disable_interrupt_macro' into 'master'
FreeRTOS(SMP): Fix SMP FreeRTOS portDISABLE_INTERRUPTS() macro on xtensa port

See merge request espressif/esp-idf!21093
2022-11-16 15:47:11 +08:00
Sudeep Mohanty ac99c0ad6b Merge branch 'feature/freertos_remove_untested_fn_feature' into 'master'
freertos: Removed CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION kconfig option

Closes IDF-5298

See merge request espressif/esp-idf!21000
2022-11-16 10:28:42 +08:00
Jakob Hasse 73d9d83a2f feat(freertos): make num of task notifications configurable
Closes https://github.com/espressif/esp-idf/issues/9349
2022-11-15 09:36:42 +01:00
Darian Leung 816ddc8867 freertos(SMP): Fix SMP FreeRTOS portDISABLE_INTERRUPTS() macro on xtensa port
The portDISABLE_INTERRUPTS() macro on Xtensa should return only the interrupt
mask/level before the interrupts were disabled. Previously, the entire contents
of PS register were returned (i.e., direct return from RSIL instruction without
any bit masking or shifting).

This commit fixes the portDISABLE_INTERRUPTS() macro to return the INTLEVEL
bitfield of the PS register.
2022-11-15 14:57:24 +08:00
Darian fd9c88ac85 Merge branch 'feature/freertos_smp_add_unit_tests_config' into 'master'
FreeRTOS(SMP): Add Amazon SMP FreeRTOS unit test configuration

See merge request espressif/esp-idf!21028
2022-11-15 14:54:23 +08:00
Omar Chebib 69d80b200c Merge branch 'bugfix/xtensa_freertos_16B_aligned' into 'master'
FreeRTOS: Make the default stack alignment 16 for Xtensa

Closes IDF-3604

See merge request espressif/esp-idf!21040
2022-11-14 10:53:10 +08:00
Omar Chebib bcb8516744 FreeRTOS: Make the default stack alignment 16 for Xtensa 2022-11-11 19:31:20 +08:00
Zim Kalinowski 69926e6915 Merge branch 'bugfix/enable_static_task_cleanup_riscv_smp' into 'master'
freertos-smp: Enabled static task cleanup for RISC-V targets with FreeRTOS SMP

Closes IDF-6207

See merge request espressif/esp-idf!21035
2022-11-11 18:42:46 +08:00
Sudeep Mohanty a0991dfffa freertos-smp: Enabled static task cleanup for RISC-V targets with FreeRTOS SMP
This commit enables static task clean up for RISC-V targets with
FreeRTOS SMP.
2022-11-10 13:40:40 +01:00
Darian Leung 915787249a freertos(IDF): Provide default value to configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS
This commit updates how configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS is defined
by default it to 0 if not defined elsewhere. Dependent code now check for
"configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS == 1" instead.
2022-11-10 18:37:42 +08:00
Darian Leung fce4ee0b80 freertos(IDF): Sync cosmetic differences to v10.4.3
This commit synchronize the cosmetic differences of IDF FreeRTOS to upstream
Vanilla v10.4.3. Comsetic differences include:

- Out of date doxygen API descriptions
  - Misnamed parameters
  - Missing examples
  - Fixed/added missing @cond/@code directives
- Extra/missing comments/lines
- Code formatting (uncrustify)

Other changes:

- Some ESP_PLATFORM directives were also removed
- xTaskIncrementTickOtherCores() now depends on "configNUM_CORES > 1"
- Updated some multi-core dummy variable names in FreeRTOS.h
2022-11-10 18:37:42 +08:00
Darian Leung 5e5a40f7ac freertos: Add Amazon SMP FreeRTOS unit test configuration 2022-11-10 16:01:15 +08:00
Darian Leung ae3383ddc5 freertos: Remove/restore queue locks for multi-core/single-core
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).
2022-11-10 14:39:47 +08:00
Kevin (Lao Kaiyao) 5bed8fab49 Merge branch 'refactor/rename_h2_to_h4' into 'master'
esp32h2: renaming esp32h2 to esp32h4

Closes IDF-6098

See merge request espressif/esp-idf!20676
2022-11-09 19:19:43 +08:00
Alexey Gerenkov dbc3409d6c Merge branch 'bugfix/fix_asm_xtensa_vectors' into 'master'
freertos: fix gnu asm extensions.

See merge request espressif/esp-idf!19167
2022-11-09 16:28:50 +08:00
Sudeep Mohanty 0744f4d5a5 freertos: Removed CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION kconfig option
This commit removes the unused FreeRTOS kconfig option
CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION.
2022-11-09 08:14:16 +01:00
laokaiyao 8677216576 esp32h2: renaming esp32h2 to esp32h4 2022-11-08 17:05:33 +08:00
Zim Kalinowski 98ff59b394 Merge branch 'bugfix/fix_stack_overflow_on_s3_with_freertos_smp' into 'master'
freertos-smp: Fixed stack overflow on esp32s3 with FreeRTOS SMP

Closes IDF-5509 and IDF-4982

See merge request espressif/esp-idf!20932
2022-11-08 03:36:49 +08:00
Zim Kalinowski 9da7deaa7c Merge branch 'task/update_freertos_smp_kernel_source' into 'master'
freertos-smp: Updated the FreeRTOS SMP kernel source to the latest commit

See merge request espressif/esp-idf!20911
2022-11-07 17:32:37 +08:00
Sudeep Mohanty 9bb8f0e38d freertos-smp: Fixed stack overflow on esp32s3 with FreeRTOS SMP
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.
2022-11-07 09:59:02 +01:00
Zim Kalinowski b354b457c8 Merge branch 'feature/freertos_smp_enable_static_task_cleanup' into 'master'
freertos-smp: Enable static task cleanup

See merge request espressif/esp-idf!20870
2022-11-04 19:18:03 +08:00
Darian 7b90c608fa Merge branch 'bugfix/freertos_fix_flakey_delay_tests' into 'master'
FreeRTOS: Fix flakey vTaskDelayUntil() test

See merge request espressif/esp-idf!20931
2022-11-04 14:24:27 +08:00
Jakob Hasse a995c83060 Merge branch 'feature/freertos_linux_target_add_features' into 'master'
freertos/linux: added event group and stream buffer

Closes IDF-6007

See merge request espressif/esp-idf!20878
2022-11-03 19:05:06 +08:00
Darian Leung 95cfd32871 freertos: Fix flakey task delay tests
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.
2022-11-03 18:22:58 +08:00
Sudeep Mohanty 4bc6b9ed7e freertos-smp: Updated the FreeRTOS SMP kernel source to the latest commit
This commit updates the FreeRTOS SMP source to the latest upstream
source at commit 8128208bdee1f997f83cae631b861f36aeea9b1f
2022-11-03 08:01:44 +01:00
Darian 3c18cc482c Merge branch 'refactor/freertos_uncrustify_code_formatting' into 'master'
FreeRTOS: Uncrustify source code using upstream configuration

See merge request espressif/esp-idf!20722
2022-11-03 14:19:00 +08:00
Darian Leung ef45a3df7f freertos: Uncrustify IDF FreeRTOS
This commit uncrustifies IDF FreeRTOS source files using the upstream provided
uncrustify.cfg files.
2022-11-02 19:49:40 +08:00
Darian Leung 4b2c8c591b freertos: Add uncrustiy config files for IDF FreeRTOS v10.4.3
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.
2022-11-02 19:42:19 +08:00
Sudeep Mohanty defd6c4ec1 freertos-smp: Enable static task cleanup
This commit enables Static task cleanup feature for FreeRTOS SMP.
2022-11-02 11:24:07 +01:00
Sudeep Mohanty b3755b751e pthread: Remove pthread TLS cleanup dependency on FreeRTOS Static Task Cleanup Hook
This commit removes the need to define the vTaskCleanupTCB hook in
pthread to cleanup the thread-specific data before a thread is deleted.
2022-11-02 09:52:28 +01:00
Darian Leung 40b96cf596 freertos: Refactor stream buffer spinlock initialization
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.
2022-11-02 14:56:46 +08:00
Song Ruo Jing 2557e24a28 ci: Enable esp32c6 example, test_apps, and unit tests CI build stage 2022-11-01 11:23:21 +08:00
Jakob Hasse 37e8f1f348 feat(freertos): added event group and stream buffer to linux target 2022-10-31 16:34:23 +01:00
Andrei Safronov 847462a578 freertos: fix gnu asm extensions.
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.
2022-10-27 00:27:50 +03:00
Sudeep Mohanty d050b2b63c freertos-smp: Disable CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER for FreeRTOS SMP
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.
2022-10-26 09:02:55 +02:00
Zim Kalinowski 09587b84c2 freertos: final test cleanup 2022-10-25 17:41:29 +02:00
Darian Leung 96fce0c9c4 freertos: Fix/remove flakey tests after migration
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.
2022-10-23 20:02:14 +08:00
Darian Leung c36e06c45c freertos: Add test app sdkconfig
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)
2022-10-23 20:02:14 +08:00
Darian Leung a50a238c18 freertos: Tidy up test organization
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
2022-10-23 19:56:47 +08:00
Darian Leung 54d7a3bb66 freertos: Migrate misc tests to test app
This commit migrates the "misc" tests to the test app as a component.
2022-10-23 19:56:47 +08:00