Commit graph

433 commits

Author SHA1 Message Date
Angus Gratton
bdf6c00154 Merge branch 'feature/likely_unlikely' into 'master'
Adding likely unlikely macros to hot code paths

Closes IDF-284

See merge request espressif/esp-idf!6368
2020-01-10 14:05:07 +08:00
Angus Gratton
6ab9f846c9 Merge branch 'bugfix/compare_and_setextram' into 'master'
bugfix/pthread: fix pthread_once() race condiion possibility adding critical section in compare and set function

Closes IDFGH-2448

See merge request espressif/esp-idf!7236
2020-01-10 12:29:54 +08:00
Krzysztof Bociurko
c7dfb435f8 Fixed error in return type of xTaskCreateStatic*
Signed-off-by: Darian <darian@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/2651
2020-01-09 14:01:20 +08:00
Felipe Neves
9800750f15 freertos/port: Put critical sections around uxPortCompareSetExtram() to prevent preemption during its execution.
Closes: https://github.com/espressif/esp-idf/issues/4561
2020-01-07 10:53:30 -03:00
michael
4220752aed ut: Move tests back from "esp32" subfolder
DISABLED_FOR_TARGETS macros are used

Partly revert "ci: disable unavailable tests for esp32s2beta"

This partly reverts commit 76a3a5fb48.

Partly revert "ci: disable UTs for esp32s2beta without runners"

This partly reverts commit eb158e9a22.

Partly revert "fix unit test and examples for s2beta"

This partly reverts commit 9baa7826be.

Partly revert "efuse: Add support for esp32s2beta"

This partly reverts commit db84ba868c.
2020-01-06 17:13:53 +08:00
Felipe Neves
d059a955ae freertos: removed likely macros from non-port specifics parts of freertos
fatfs: moved esp_compiler header file inside of disk implementation file
2020-01-03 14:42:57 -03:00
Felipe Neves
1b76253e0e newlib/assert: placed unlikely macro as part of assertion
newlib/assert: replace unlikely with likely to keep original assertion

newlib/assert: fix assert macro that uses likely

freertos/port: add the missing sdkconfig.h back

newlib/assert: assert macro back to a single line
2020-01-03 14:42:55 -03:00
Felipe Neves
fc00236d79 components/esp_common: added esp_macros.h that aims to hold useful macros
esp_common/esp_compiler: renamed esp_macros file to a more specific one

esp_common/esp_compiler: removed CONTAINER_OF macro, it was a duplicate

components/freertos: placed likely macros around port and critical sections

component/freertos: placed likely macros on lists module

components/freertos: placed unlikely macros inside of assertion points, they likely wont fail

components/freertos: added likely macros on queue modules

FreeRTOS queues are one of most hot code path, because to queues itself tend to
be used a lot by the applications, besides that, queues are the basic primitive
to form both mutexes and semaphores, The focus here is to place likely
macros inside lowest level send and receive routines, since they're common
from all kobjects: semaphores, queues, mutexes and FR internals (like timer queue)

components/lwip: placed likely/unlikey on net-interfaces code

components/fatfs: added unlikely macros on disk drivers code

components/spiffs: added unlikely macros on low level fs driver

components/freertos: added likely/unlikely macros on timers and ticker

freertos/event_group: placed likely/unlikely macros on hot event group code paths

components/sdmmc: placed likely / unlikely macros on lower level path of sdmmc

components/bt: placed unlikely macros around bt HCI functions calling

components/lwip: added likely/unlikely macros on OS port code section

components/freertos: fix code style on tick handler
2020-01-03 14:42:49 -03:00
Ivan Grokhotkov
891eb3b020 freertos: save/restore PS and EPC1 around window spilling
Since in b0491307, which has introduced the optimized window spill
procedure, _xt_context_save did not work correctly when called from
_xt_syscall_exc. This was because unlike _xt_lowint1, _xt_syscall_exc
does not save PS and EPC1. The new version of _xt_context_save
modified PS (on purpose) and EPC1 (accidentally, due to window
overflow exceptions), which resulted in a crash upon 'rfi' from the
syscall.

This commit adds restoring of PS and EPC1 in _xt_context_save. It also
slightly reduces the number of instructions used to prepare PS for
window spill.

Unit test for setjmp/longjmp (which were broken by this regression)
is added.

Closes https://github.com/espressif/esp-idf/issues/4541
2019-12-27 11:27:01 +01:00
KonstantinKondrashov
1687c53700 freertos: Fix save_context. Add RSYNC after WSR
RSYNC waits for all previously fetched WSR.* instructions to be performed before inter-
preting the register fields of the next instruction.
2019-12-21 14:10:38 +00:00
Mahavir Jain
2e73c2818b freertos: re-enable mutext test for esp32s2beta 2019-12-16 11:55:32 +05:30
Angus Gratton
f50df36ebf Merge branch 'feature/external_github_prs' into 'master'
Include external github PRs

Closes IDFGH-2291, IDFGH-2306, IDFGH-2315, and IDFGH-2307

See merge request espressif/esp-idf!6931
2019-12-10 12:33:32 +08:00
Mahavir Jain
8e28226935 Disable few test cases for ESP32S2BETA
These test cases will be fixed in subsequent MR
2019-12-09 16:30:55 +05:30
Mahavir Jain
a737fd4865 Fix issue with timer usage in FreeRTOS tests 2019-12-09 13:33:45 +05:30
Andrei Gramakov
6cd17c1e8c freertos: added a FreeRTOS property returning "original" include path 2019-12-06 12:16:54 +01:00
Felipe Neves
57522059aa freertos/tests: fixed wrong header file on isr latency test 2019-12-04 10:41:00 -03:00
Felipe Neves
0ea6453b1c freertos: changed isr time test case variables to static 2019-12-04 10:41:00 -03:00
Felipe Neves
55cbc213f3 components/freertos: create the test task with highest priority to ensure peer-to-peer ISR to task sync 2019-12-04 10:40:27 -03:00
Felipe Neves
64a50f0423 components/freertos: fixed isr test failling when run multiple times 2019-12-04 10:40:27 -03:00
Felipe Neves
c64e108a1d components/freertos: removed CONFIG_FREERTOS_ISR_STATS the ISR test is now self contained 2019-12-04 10:39:22 -03:00
Felipe Neves
bcdc35be59 components/freertos: refactor of isr_latency tests to perform full measurement 2019-12-04 10:39:22 -03:00
Felipe Neves
8b6b97ec57 freertos/xtensa_context: fixed small typo 2019-12-04 10:39:22 -03:00
Felipe Neves
e480435879 components/freertos: removed some dead ifdefs 2019-12-04 10:39:22 -03:00
Felipe Neves
c14fc39b0a components/freertos: fixed typos and licence placement on external code 2019-12-04 10:39:22 -03:00
Felipe Neves
64f918bd70 freertos/xtensa_context: added conditional compiling option around isr cycle measurement
It is possible to enable and disable the isr time measurement on context save and
it related test via menuconfig by the new option: FREERTOS_ISR_STATS
2019-12-04 10:39:22 -03:00
Felipe Neves
346b12e29a freertos/test: added spill register timer measurement test 2019-12-04 10:39:22 -03:00
Felipe Neves
5ce7a33c87 freertos/xtensa_context.S: fix some dread tabs 2019-12-04 10:39:22 -03:00
Felipe Neves
cd11787153 freertos/xt_asm_utils: added documentation of current windows spill solution 2019-12-04 10:39:22 -03:00
Felipe Neves
768d115e85 freertos/Kconfig: removed isr optimization option from menuconfig 2019-12-04 10:39:22 -03:00
Felipe Neves
eb740ca8e4 freertos/xtensa_context: modification of interrupt handler is workin, needs stabilization 2019-12-04 10:39:22 -03:00
Felipe Neves
d185625162 freertos/xtensa_context: added infrastructure to receive the spill register optimized code 2019-12-04 10:39:22 -03:00
Michael (XIAO Xufeng)
087c8f6065 essl: new component to communicate with esp serial slave devices 2019-12-03 22:58:41 +08:00
Ivan Grokhotkov
477e66103c Merge branch 'feature/esp32s2beta_apptrace_port' into 'master'
esp32s2: Adds apptrace support

Closes IDF-510 and IDF-1032

See merge request espressif/esp-idf!5610
2019-11-22 05:33:35 +08:00
chenjianqiang
9f9da9ec96 feat(timer): refator timer group driver
1. add hal and low-level layer for timer group
2. add callback functions to handle interrupt
3. add timer deinit function
4. add timer spinlock take function
2019-11-21 14:14:19 +08:00
Alexey Gerenkov
30ff7198b8 apptrace: Renames Kconfig options 2019-11-13 15:24:01 +03:00
Mahavir Jain
4ccac94816 freertos: modify configASSERTs around scheduler state check
Regression introduced in commit 79e74e5d5f

It is possible that some FreeRTOS APIs are invoked prior to
scheduler start condition (e.g. flash initialization in unicore mode).
In that condition these asserts should not trigger (scheduler state being yet to be started),
hence changes per this fix.
2019-11-13 10:44:09 +05:30
Darian Leung
79e74e5d5f freertos: Fix configASSERT thread safety
This commit fixes thread safety issues with configASSERT() calls
regarding the value of uxSchedulerSuspended. A false negative
occurs if a context switch to the opposite core occurs in between
the getting the core ID and the assesment.

Closes https://github.com/espressif/esp-idf/issues/4230
2019-11-05 21:58:02 +08:00
Ivan Grokhotkov
faa219acdb freertos: fix defining uxTopUsedPriority for esp32s2beta 2019-10-29 16:38:48 +01:00
Angus Gratton
055cc251b7 Merge branch 'feature/esp32s2beta_merge' into 'master'
esp32s2beta: Merge support to master

Closes IDF-513, IDF-756, IDF-758, IDF-999, IDF-753, IDF-749, IDF-754, IDF-840, and IDF-755

See merge request espressif/esp-idf!6100
2019-10-29 13:02:01 +08:00
Tian Hao
4987a5ad90 fix bug that semaphore may schedule out in Critical Section
1. Since BLE full-scan feature for BLE mesh change the controller code cause this problem,
it cause coex semaphore take in "interrupt disable", then it may cause task schedule
and cause crash in freertos
2. Fix newlib lock ISR context and critical section check
3. Fix bt controller ISR context and critical section check
2019-10-28 18:43:35 +08:00
Angus Gratton
496ede9bcd Merge branch 'master' into feature/esp32s2beta_merge 2019-10-15 14:59:27 +11:00
Ivan Grokhotkov
5830f529d8 Merge branch 'master' into feature/esp32s2beta_merge 2019-10-02 19:01:39 +02:00
suda-morris
e381cec35a freertos: remove semicolon in xTaskNotifyGive 2019-09-26 15:27:48 +08:00
Roland Dobai
833822c10b Fix Kconfig issues discovered by upstream Kconfiglib 2019-09-23 16:10:57 +02:00
Angus Gratton
adfc06a530 Merge branch 'master' into feature/esp32s2beta_merge 2019-09-20 10:28:37 +10:00
Andrew
4fdaeb6b6e cmake: Add new compiler optimization levels definitions
Rename and add multiple kconfig compiler options. New compiler options
COMPILER_OPTIMIZATION_PERF and COMPILER_OPTIMIZATION_NONE have been added.
Optimize "Debug" and "Release" options to "Default" and "Size" respectively.
This commit also does the following:

- The COMPILER_OPTIMIZATION_PERF option introduced multiple bug.
This commit fixes those bugs.
- build.yml also updated to test for the new optimization options.
2019-09-06 17:37:19 +08:00
Angus Gratton
c22965b22c freertos: Restore uxPortCompareSet() in ESP32 unicore & make compatible code for ESP32S2Beta
This macro is used in places which expect it to work even without dual core being on.

Still make "mux" functions in FreeRTOS into no-ops as the mux is not needed.
2019-09-04 10:53:25 +10:00
Michael (XIAO Xufeng)
9baa7826be fix unit test and examples for s2beta 2019-09-04 10:53:25 +10:00
Angus Gratton
2085845c80 freertos: Have ESP32S2-Beta target select FREERTOS_UNICORE directly 2019-08-19 15:03:48 +10:00
Angus Gratton
6990a7cd54 Merge branch 'master' into feature/esp32s2beta_update 2019-08-19 15:03:43 +10:00