Commit graph

122 commits

Author SHA1 Message Date
Angus Gratton b355854d4d Merge branch 'master' into feature/cmake 2018-09-05 10:35:04 +08:00
Angus Gratton a9c4ed7139 Merge branch 'master' into feature/cmake 2018-08-30 18:51:01 +08:00
Tian Hao 5a8917c337 fix bluetooth security vulnerability of ECDH publick key checking 2018-08-30 11:39:19 +08:00
zwj 430d3da089 component/bt: fix crash when BLE do SMP connect and disconnect stress test 2018-08-27 11:09:29 +08:00
Ivan Grokhotkov 4dd7233b20 Merge branch 'feature/reset_reason' into 'master'
Add API to get reset reason

See merge request idf/esp-idf!2871
2018-08-21 11:34:12 +08:00
Ivan Grokhotkov 3ef650cd46 esp32/test: add tests for reset reasons 2018-08-20 16:49:20 +08:00
Angus Gratton ff2404a272 Merge branch 'master' into feature/cmake 2018-08-16 17:14:17 +10:00
Tian Hao ee787085f9 component/bt : decrease memory consumption by conn number
1. BLE only with 9(max) connection will decrease 3K DRAM
2. BR/EDR only with 7(max) connection will decrease 16K DRAM
3. Any of BLE or BR/EDR connection number decrease will also decrease DRAM consumption
4. Decrease one BLE connection will save about 1KB DRAM
5. Decrease one BR/EDR ACL connection will save about 1.2KB DRAM
6. Decrease one BR/EDR SCO/eSCO will save 2KB DRAM.
7. fix some definition and kconfig
8. remove 1.2k of vhci tx cache and make .bss & .data to heap about 1.4K
9. modify BT Reserved Memory size and modify example to support new bt kconfig
2018-08-14 02:29:17 +00:00
Angus Gratton 272b95e8ce linker: Don't link all of 'soc' into IRAM
Moves any code in *_perpih.c, memory_layout_utils.c to flash
2018-08-06 01:37:55 +00:00
Angus Gratton a5ae5ac4b3 soc: Allow components to reserve fixed memory ranges that they need
No longer necessary to keep all reserved addresses in 'soc'.

Means 'soc' does not need to know about 'bt', for example.

Also means that Bluetooth can be enabled in config without any memory being reserved for BT
controller. Only if code calling the BT controller is linked in, will this memory be reserved...
2018-08-06 01:37:55 +00:00
wangmengyang a23f857452 component/bt: bugfix on the crash during end of sco link resulted from link supervision timeout 2018-07-26 14:41:25 +08:00
Hrishikesh Dhayagude f610249bdd Reclaim BT/BTDM BSS and Data in bluetooth memory release function
1. Modify esp_bt_controller_mem_release() to release BTDM BSS and Data to heap if
ESP_BT_MODE_BTDM mode is passed to it
2. Add a new API esp_bt_mem_release() which internally calls
esp_bt_controller_mem_release() with the provided mode and then if mode
is ESP_BT_MODE_BTDM, releases BT BSS and Data to heap.

Background:
For Wi-Fi and BT/BLE applications, for e.g. the usecase is like when
Bluetooth is used for provisioning and once the device is connected to the Wi-Fi
AP, we can turn off Bluetooth completely. In such scenarios, it should be possible to
reclaim all the memory of Bluetooth. Although, currently this does not
happen.

Experiment:
Made the following modifications to examples/bluetooth/gatt_server :
1. Added support of simple_wifi to it
2. Moved all the bluetooth related code under CONFIG_BT_ENABLED config
option
3. Calculated the free heap in 2 similar scenarios:
   i. Disabled BT (CONFIG_BT_ENABLED undefined) and checked the free
heap after STA connected
   ii. Kept BT enabled and disabled it after STA connected and checked
the free heap
Ideally, the numbers for i., ii. above should have been similar. But
there was a delta of almost 30-31K. (i. > ii.)
4. Through make size-components checked the common BSS for libbta.a and libbtdm_app.a
and found it to be almost 30K. Data is around 1K

Solution:
1. Modified the linker script to mark the BSS and Data for these libraries and
free it when ESP_BT_MODE_BTDM mode is passed to mem release APIs.
2. Verified that the free heap is comparable for i. and ii. above.

Note: It is known that once this is done, Bluetooth can only be used
again post reboot.

Signed-off-by: Hrishikesh Dhayagude <hrishi@espressif.com>
2018-07-20 11:33:26 +05:30
Darian Leung 1d2727f4c8 CAN Driver
The following commit contains the first version of the ESP32 CAN Driver.

closes #544
2018-07-04 14:01:57 +08:00
Ivan Grokhotkov ae006fed83 esp32: force pure math functions from libgcc to be linked from ROM 2018-07-02 12:49:57 +08:00
Ivan Grokhotkov 40b5f10611 esp32: fix addresses of some libgcc functions in ROM ld script 2018-07-02 12:49:57 +08:00
Angus Gratton fd88d6d89c heap: Add integer overflow checks 2018-06-19 23:31:37 +00:00
Ivan Grokhotkov 03d78e7afb Merge branch 'feature/Add_noinit_rtc_noinit_sections' into 'master'
esp32: Add .noinit and .rtc_noinit sections to the linker script

See merge request idf/esp-idf!1996
2018-06-08 16:01:30 +08:00
Angus Gratton 6b9784cc45 Merge branch 'master' into feature/cmake_update 2018-05-31 14:46:23 +10:00
Michael (XIAO Xufeng) c73575de4f feat(sdio_slave): add headers for sdio slave components: slc, host, hinf 2018-05-21 23:48:33 +08:00
wangmengyang 4c4e143a2f component/bt: implement HFP Hands Free Unit Role 2018-05-21 11:33:30 +08:00
wangmengyang 22e21b38f7 component/bt: implement bluetooth modem sleep mode, one mode for BLE only and another for dual mode bluetooth
1. provide options for bluetooth low power mode
2. provide two options for bluetooth low power clock: main XTAL and external 32kHz XTAL
3. provide function and callbacks to control bluetooth low power mode, including enable/disable sleep, software wakeup request, low power clock settings, check power state, etc
4. modify vhci API vhci_host_send_packet to use blocking mode
5. note that DFS and bluetooth modem sleep can not be used together currently.
2018-05-19 15:37:26 +08:00
Alex Lisitsyn 44b1bc0ab9 esp32: Add .noinit and .rtc_noinit sections to the linker script
Added .rtc_noinit and .noinit section definitions into linker file /esp32/ld/esp32.common.ld.
The macro __NOINIT_ATTR, RTC_NOINIT_ATTR declared in esp32/esp_attr.h file.
Added unit test file to test added behavior for noinit variables and its attributes.
Added documentation changes for new added attributes.
Make some corrections after code review:
The linker file has been corrected to place noinit section before bss_start to make it safer.
Documentation file has been modified to clarify reset behavior of allocated data .
Corrected typos in test_noinit.c and removed assertion of noinit variable to avoid possible issues with ROM boot loader memory allocation.
The linker file has been corrected to place noinit section before bss_start to make it safer.
Documentation file has been modified to clarify reset behavior of allocated data .
Corrected typos in test_noinit.c and removed assertion of noinit variable to avoid possible issues with ROM boot loader memory allocation.
Update test_noinit.c file to address RTCWDT_RTC_RESET reset reason instead of POWERON_RESET.
Test optimized to pass automated unit testing.
esp32: Add .noinit and .rtc_noinit sections to the linker script
Update of general-notes.rst documentation to fomat examples as code and attributes as identifiers.
Test test_noinit.c corrected to pass automated testing (support ofTEST_CASE_MULTIPLE_STAGES())

https://ezredmine.espressif.cn:8765/issues/15878
2018-05-16 17:33:37 +05:00
Angus Gratton b57843b66a cmake: Linker scripts need to account for .c.obj extension as well as .o 2018-04-30 09:59:20 +10:00
Alexey Gerenkov f8c42369f1 freertos: Adds C11 TLS support 2018-02-07 18:46:57 +03:00
wangmengyang a31d07ba25 move rodata segment of libphy.a to dram
1. rodata segment of libphy.a(about 1200B) can be accessed by ISRs, so put it into DRAM
2018-02-02 13:00:11 +08:00
Liu Zhi Fu 2242bf9b37 lwip/esp32/examples: wifi throughput optimizations
1. Put some lwip udp rx/tx relating functions to IRAM
2. Put some wifi rx/tx relating functions to IRAMa
3. Reduce wifi dynamic malloc from 4 to 1 for each ebuf
4. Update iperf example accordingly
5. Update libphy.a to v383
2018-01-30 16:27:49 +08: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
Ivan Grokhotkov b6f37bda97 Merge branch 'feature/i2s_built_in_adc' into 'master'
feature(I2S-ADC): add ADC mode for I2S.

See merge request !1077
2017-10-20 15:52:56 +08:00
Ivan Grokhotkov b58e19f8a2 Merge branch 'bugfix/soc_component_rodata' into 'master'
soc: place constant data from rtc_clk.c into DRAM

See merge request !1321
2017-10-17 04:54:43 +08:00
wangmengyang 2797966c47 component/bt: increase programming delay for event arbiter to allow for heavy workload 2017-09-30 18:12:45 +08:00
Ivan Grokhotkov 73e8afc5b9 soc: place constant data from rtc_clk.c into DRAM
In release mode, switches in rtc_clk_bbpll_set would be converted to
jump tables. These tables would be placed into .rodata, which caused
rtc_clk_cpu_freq_set to be unusable while cache is disabled. This
manifested itself in crashes when exiting from light sleep:

https://esp32.com/posting.php?mode=reply&f=13&t=3089#pr14590
2017-09-26 17:08:49 +08:00
Wangjialin 2fceec4d85 feature(I2S-ADC): add ADC mode for I2S.
1. Support built-in ADC for I2S.
2. Modify code of ADC, made no change to the original APIs.
3. Add APIs in I2S:
esp_err_t i2s_set_adc_mode(adc_unit_t adc_unit, adc1_channel_t adc_channel);
4. Add I2S ADC/DAC example code.
5. add old-fashion definition to make it more compatible
6. replase spi_flash_ APIs with esp_partition_ APIs
7. add example of generating audio table from wav
8. change example sound
2017-09-14 13:24:08 +08:00
Jiang Jiang Jian f1e3b0df02 Merge branch 'feature/adv_scan_simultaneously' into 'master'
component/bt : support adv & scan simultaneously

See merge request !1209
2017-09-13 11:50:57 +08:00
Jeroen Domburg 9c56d9e75e Make sure functions that are in ROM in the non-external-ram-workaround version, are in RAM (and not in flash) in the ext-ram workaround version. 2017-09-13 10:36:56 +08:00
Tian Hao 00a7cdbb0b component/bt : support adv & scan simultaneously
1. Occupy conn[9] for adv. The max connection number of bluetooth controller decrease to 9. (Previously, it is 10)
2. modify the enum of setting BLE TX power corresponding to connection's.
3. fix libbtdm_app.a cwitch jump table
2017-09-12 16:10:30 +08:00
Alexey Gerenkov 891f0db31d esp32: Adds gcov over JTAG feature
Implements function to dump GCOV data to host via JTAG.
The following functionality was added:
 - Host file I/O
 - GCOV runtime I/O stubs
 - GCOV example
2017-09-07 18:13:16 +03:00
Angus Gratton ec498ad86d libgcc: Place assembly functions (including __xtensa_libgcc_window_spill) in IRAM 2017-09-07 16:32:05 +10:00
Angus Gratton 5c417963eb multi_heap: Add heap poisoning features 2017-09-07 16:32:05 +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 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
Deomid Ryabkov 8c1acb0363 Provide a default for CONFIG_BT_RESERVE_DRAM
...when BT is not built

Merges https://github.com/espressif/esp-idf/pull/910
2017-08-30 17:55:00 +10:00
Wangjialin 842caaab21 driver(touch): fix bug and add more features
1. add sens_struct.h
2. add definition of RTCCNTL and RTCIO
3. modify touch pad examples
4. update example code.
5. add comments add option in menuconfig
6. fix issue that pad index 8 and 9 are mismatched
7. add touch_pad_read_filtered() api to get value filtered by iir filter
8. modify touch pad isr func
9. Make the items in perihperal.ld in the sequence of address
10. delete Kconfig for touch pad
11. add touchpad filter APIs to adjust the filter
12. add touch_pad into index.rst
13. add touch_pad in Doxyfile
14. add touch_pad.rst
2017-08-22 21:21:39 +08:00
Angus Gratton 105c4b7386 Merge branch 'feature/esptool_image_padding' into 'master'
esptool: Optimise app image size by using RAM-loaded data for padding

See merge request !1017
2017-07-19 15:52:22 +08:00
Angus Gratton 2d9770fd00 linker script: Add some comments about significance of 0x18 byte offset 2017-07-19 17:38:05 +10:00
Angus Gratton c230e4280c linker scripts: Limit DROM/IROM section lengths correctly 2017-07-19 16:33:48 +10:00
Angus Gratton d92c541b1a esptool: Optimise generated image size by using RAM-loaded data for padding
Can save almost 128KB from some images.
2017-07-19 16:24:17 +10:00
Angus Gratton f824829a13 Merge branch 'bugfix/dont_link_unused_data_sections' into 'master'
ld: Save RAM by removing unused .data sections at link time

See merge request !985
2017-07-17 14:10:12 +08:00
Angus Gratton 187b5fb888 ld: Remove unused .data sections at link time
Reduces static RAM, code size.
2017-07-12 13:05:54 +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