Commit graph

140 commits

Author SHA1 Message Date
Ivan Grokhotkov
964f5a91f7 bootloader, esp32: add workaround for Tensilica erratum 572
If zero-overhead loop buffer is enabled, under certain rare conditions
when executing a zero-overhead loop, the CPU may attempt to execute an invalid instruction. Work around by disabling the buffer.
2018-11-19 04:39:35 +00:00
Alexey Gerenkov
30e766ee6b esp32: Core dump API to retrieve current core data layout in flash 2018-11-15 06:13:48 +00:00
Jiang Jiang Jian
97e3542947 Merge branch 'bugfix/release_some_memory_on_single_core_mode' into 'master'
release memory not used in single core mode

See merge request idf/esp-idf!2733
2018-10-30 15:53:31 +08:00
Angus Gratton
31cf117404 Merge branch 'feature/bss_seg_in_external_memory' into 'master'
memory:   support .bss segment can be in psram

See merge request idf/esp-idf!2236
2018-10-10 14:40:21 +08:00
Roland Dobai
d4e572bdb1 esp32: Add macro to check a condition without abort
Closes https://github.com/espressif/esp-idf/issues/2325
2018-10-09 08:57:23 +02:00
TianZhongXing
01308df8a6 doc: update document of external memory 2018-09-26 10:39:57 +08:00
Ivan Grokhotkov
4ff262ecff ipc: initialise automatically, if called from the app 2018-09-25 15:13:47 +08:00
Jack
2efd6859ed release memory not used in single core mode
1. do not start ipc task in single core mode
2. do not use APP cpu cache memory in single core mode
3. relase data used in rom by APP cpu
2018-09-25 15:13:47 +08:00
TianZhongXing
974112378b feature: allow .bss segment in external memory 2018-09-21 16:20:26 +08:00
Ivan Grokhotkov
789855e71b esp32: abort when running on single core chip in dual core mode
Ref. https://esp32.com/viewtopic.php?f=2&t=7307
2018-09-19 15:05:26 +08:00
Konstantin Kondrashov
9c715d7946 bootloader_support: Fix enable rtc_wdt for resolve issue with varying supply
Eliminates the issue with the lock up in the bootloader due to a power drawdown during its operation.

Closes https://github.com/espressif/esp-idf/issues/1814
2018-09-03 05:43:01 +00:00
Angus Gratton
4f227a4ce3 Merge branch 'bugfix/spiram_malloc_reserve_internal_fragments' into 'master'
esp32: Allow SPIRAM_MALLOC_RESERVE_INTERNAL to span multiple regions of memory

See merge request idf/esp-idf!2891
2018-08-16 11:19:39 +08:00
Konstantin Kondrashov
a8e46775c6 soc/rtc_wdt: Add API functions for rtc_wdt
Added functions:
rtc_wdt_protect_off/on
rtc_wdt_set_length_of_reset_signal
rtc_wdt_set_stage
rtc_wdt_set_time
rtc_wdt_feed
rtc_wdt_disable/enable
2018-08-14 17:48:02 +05:00
Angus Gratton
304e9085eb esp32: Allow SPIRAM_MALLOC_RESERVE_INTERNAL to span multiple regions of memory
- Allocate this pool after main_task is running, so it can use startup stack RAM
- Raise the maximum allowed value in KConfig to 256KB
- Based on forum discussions https://esp32.com/viewtopic.php?f=2&t=6550&sid=76cd27bda76c6d0e83d3fcc9ec30c650&start=10#p28253
2018-07-31 15:17:07 +10:00
Alexey Gerenkov
c1b6a37bb1 esp32: Adds GCOV debug stubs support
Adds the following functionality
 - Debug stubs infrastructure
 - Stub for retrieveing GCOV data without user source code modification
2018-05-18 16:16:03 +03:00
Mahavir Jain
441b4a9742 esp32: fix few components with dependency on networking stack
* Move smartconfig to its component directory, it should be possible to override
  this as whole component
* Fix few header includes related to lwIP networking stack

Signed-off-by: Mahavir Jain <mahavir@espressif.com>
2018-04-19 18:28:55 +05:30
Jeroen Domburg
dc864c4108 Add option to continue running (with less ram) if psram is enabled but not detected 2018-02-12 13:44:11 +08:00
Jack
624828ce83 Dump the frame of the other core when interrupt watchdog happens 2018-01-18 23:10:29 +00:00
Angus Gratton
f8580ea98f esp32: Change 192KB runtime static limit workaround to a 176KB link time workaround
Turns out some app memory around 0x3ffdc000 is also used by APP CPU.

This is a workaround until code to remove the 176KB limit is committed.
2017-12-27 11:59:54 +11:00
Alexey Gerenkov
7df96718a2 esp32: Adds C++ exceptions emergency pool size menuconfig option 2017-11-23 06:14:11 +03:00
Darian Leung
9d63e1da4a New Task Watchdog API (Revert of Revert)
This commit reverts the revert on the new task watchdog API. It also
fixes the following bug which caused the reversion.

- sdkconfig TASK_WDT_TIMEOUT_S has been reverted from the unit of ms back to the
unit of seconds. Fixes bug where projects using the new API without rebuilding sdkconfig
would cause the old default value of 5 to be interpreted in ms.

This commit also adds the following features to the task watchdog

- Updated idle hook registration to be compatible with dual core hooks

- Updated dual core hooks to support deregistration for cpu

- Legacy mode has been removed and esp_task_wdt_feed() is now replaced by
  esp_task_wdt_reset().  esp_task_wdt_feed() is deprecated

- Idle hooks to reset are now registered/deregistered when the idle tasks are
  added/deleted from the Task Watchdog instead of at Task Watchdog init/deinit

- Updated example
2017-11-02 16:47:51 +08:00
Ivan Grokhotkov
59b7d98fec Merge branch 'feature/dfs' into 'master'
Dynamic frequency scaling

See merge request !1189
2017-10-22 12:34:11 +08:00
Ivan Grokhotkov
fba9678c56 uart: add support for REF_TICK 2017-10-18 14:19:20 +08:00
Ivan Grokhotkov
42d51a4224 esp32: initialize PM at startup, add Kconfig options 2017-10-18 14:19:17 +08:00
Ivan Grokhotkov
37e9bc715c esp_clk.h: make public, add getters for RTC time, CPU/APB freq 2017-10-18 14:19:14 +08:00
Angus Gratton
9c7477ef34 cxx: Add KConfig option for C++ exceptions, disable by default
Fixes https://github.com/espressif/esp-idf/issues/1072

(Additional 20KB is still used if C++ exception support is enabled in
menuconfig.)
2017-10-17 15:29:25 +08:00
Ivan Grokhotkov
1da3204a7c spiram: expose function to initialize SPI RAM cache
Some frameworks based on ESP-IDF need to be able to decide whether to
initialize SPI RAM after the application has started. This change splits
out part of esp_spiram_init which manipulate cache MMU into a separate
function. Applications can disable cache, call esp_spiram_init_cache,
re-enable cache, and then call esp_spiram_init.
Disabling and re-enabling the cache can be achieved using functions
provided in esp_spi_flash.h.
2017-10-16 09:15:11 +08:00
Jeroen Domburg
b6a2bd1184 Revert "esp32: New Task Watchdog API"
This reverts commit 616baa239d.
2017-09-30 18:07:19 +08:00
Darian Leung
616baa239d esp32: New Task Watchdog API
Legacy API of task watchdog used the same function esp_task_wdt_feed() to add
and feed a task. This caused issues of implicitly adding a task to the wdt list
if the function was used in shared code.

The new API introduces init, adding, feeding, deleting, deinit functions. Tasks
must now be explicitly added to the task watchdog using their handles. Deletion
must also be explicit using task handles. This resolves the issue of implicit
task additions to the task watchdog due to shared code calling
esp_task_wdt_feed().

Task watchdog is now fully configurable at runtime by calling the init and
deinit functions.

Also added functions to get the handles of idle tasks of the other core. This
helps when adding idle tasks to the watchdog at run time.

Configuring the task watchdog using menu config is still available, however
menu config will only result in calling the init and add functions for idle
tasks shortly after the scheduler starts.

Menu config also allows for using legacy behavior, however the legacy behavior
willcall the new API functions but with slight variations to make them legacy
compatible.

Documentation and example have also been updated

gcov_rtio.c headers updated to prevent error of freertos header files being
included in the wrong order.

Resolves issue TW#13265
2017-09-29 23:10:55 +08:00
Jeroen Domburg
740f8a79f0 Add logic to make external RAM usable with malloc() 2017-09-28 17:17:50 +08:00
Alexey Gerenkov
b09f4acb27 Added proper handling of apptrace and pthread initialization errors 2017-09-14 20:47:43 +02:00
krzychb
a1ebeed303 Changed initialization sequence of application tracing component on APP CPU so it follows completion of initialization of the same component on PRO CPU. Previously, because of missing locking mechanism, both components were printing logs to UART at the same time. As results logs contained only corrupted characters / were not legible at all. Internal tracking: esp-idf/openocd-esp32, Issue 15 2017-09-14 20:47:43 +02:00
Jeroen Domburg
875ae6a134 Add option to allocate external RAM using heap_alloc_caps 2017-09-14 10:47:44 +08:00
Ivan Grokhotkov
5425d8569c Merge branch 'feature/pthread_api' into 'master'
esp32: pthread API

See merge request !1146
2017-09-07 17:49:42 +08:00
Alexey Gerenkov
5094965e98 According to comments 2017-09-06 10:30:23 +08:00
Alexey Gerenkov
0b09c7006d pthread: Initial version of thread API 2017-09-06 10:30:23 +08:00
Angus Gratton
5361c08989 heap: Support adding new heap regions at runtime
To facilitate this, the list of registered heap regions is now a linked list
(allowing entries to be appended at runtime.)
2017-09-05 14:07:02 +10:00
Jeroen Domburg
34372a091c Add initial SPI RAM support. This adds support for an ESP-PSRAM32 chip connected to the default flash pins and GPIO 16 and 17. The RAM is mapped to address 0x3F800000, but otherwise ignored by esp-idf as of yet. 2017-09-04 12:05:49 +08:00
Ivan Grokhotkov
f31efb697c newlib: rename esp_setup_time_syscalls to esp_set_time_from_rtc
This function no longer sets up syscalls, and new name reflects its
purpose better.
2017-09-01 10:36:14 +08:00
Ivan Grokhotkov
d4e950d311 Merge branch 'feature/cxx_exceptions' into 'master'
Partial support for C++ exceptions

See merge request !930
2017-09-01 00:27:41 +08:00
Ivan Grokhotkov
547ef83020 Merge branch 'feature/disable_some_perip_clk_when_cpu_start' into 'master'
Disable some peripheral clocks when cpu starts

See merge request !1089
2017-08-30 11:43:38 +08:00
Angus Gratton
1e22bcdfde esp32: Add KConfig option to disable ROM Console fallback on first boot 2017-08-29 14:52:00 +10:00
XiaXiaotian
4776f73ca4 Disable some peripheral clocks when cpu starts
All peripheral clocks are default enabled after chip is powered on.
    When CPU starts, if reset reason is CPU reset, disable those clocks
    that are not enabled before reset. Otherwise, disable all those
    useless clocks.
    These peripheral clocks must be enabled when the peripherals are
    initialized and disabled when they are deinitialized.
2017-08-29 11:18:42 +08:00
Ivan Grokhotkov
857a29872d esp_timer: add high resolution software timer API 2017-08-28 11:35:26 +08:00
Angus Gratton
e50870c2dc Merge branch 'bugfix/bootloader_stack_smash' into 'master'
Fix crashes when >approx 185KB of DRAM is statically allocated

See merge request !983
2017-07-17 14:11:35 +08:00
Angus Gratton
99fe61716c startup: Add assertion checks around various initialisation sequences
These may fail if close to 192KB of static RAM is allocated (remaining early heap RAM is too small.)
2017-07-12 13:06:56 +08:00
Angus Gratton
2b0f623259 bootloader/early boot: Error out if >192KB of static DRAM is allocated (temporary fix)
Currently the last 128KB of DRAM is reserved for the bootloader & early boot stacks. This means if >192KB of static DRAM
is allocated, the only available heap is this region - which is disabled until the scheduler starts. As a result, you
get either heap corruption on early boot if the static data overlaps startup heap (leading to very weird errors), or
FreeRTOS will fail to start when it can't malloc() anything.

Long term fix is to move the stacks & bootloader data to the very end of RAM, and only reserve that part for early
boot. This is a little fiddly because of also wanting to make sure this memory is not preemptively fragmented when it
gets reintroduced to the heap. This will become more important if/when we have more static allocation options in the
future.

For now, these errors make it clear why the boot has failed.

Ref TW13909
2017-07-12 13:06:56 +08:00
Angus Gratton
71c70cb15c heap: Refactor heap regions/capabilities out of FreeRTOS
Remove tagged heap API, rename caps_xxx to heap_caps_xxx

Also includes additional heap_caps_xxx inspection functions.
2017-07-10 17:46:03 +08:00
Angus Gratton
5ee49fd311 heap: Add new multi_heap heap implementation to replace FreeRTOS-based tagged heaps 2017-07-10 17:46:03 +08:00
Jan Mrázek
f698a1b2d3 Add missing support for C++ exceptions
Specifying -fexceptions for the compiler is not enough.

- add necessary zero padding after .eh_frame section
- link .gcc_except_table_table in a way flash script does not complain
- call __registrer_frame_info before global constructors

Kudos jcmvbkbc for the necessary help.
2017-06-28 13:53:42 +08:00