Commit graph

57 commits

Author SHA1 Message Date
Anton Maklakov d86ec0f367 Revert "C++: add provisions for optional RTTI support"
This reverts commit 499d087c91.
2019-10-31 10:12:16 +07:00
Ivan Grokhotkov 499d087c91 C++: add provisions for optional RTTI support
Ref. https://github.com/espressif/esp-idf/issues/1684

This change allows RTTI to be enabled in menuconfig. For full RTTI
support, libstdc++.a in the toolchain should be built without
-fno-rtti, as it is done now.

Generally if libstdc++.a is built with RTTI, applications which do not
use RTTI (and build with -fno-rtti) could still include typeinfo
structures referenced from STL classes’ vtables. This change works
around this, by moving all typeinfo structures from libstdc++.a into
a non-loadable section, placed into a non-existent memory region
starting at address 0. This can be done because when the application
is compiled with -fno-rtti, typeinfo structures are not used at run
time. This way, typeinfo structures do not contribute to the
application binary size.

If the application is build with RTTI support, typeinfo structures are
linked into the application .rodata section as usual.

Note that this commit does not actually enable RTTI support.
The respective Kconfig option is hidden, and will be made visible when
the toolchain is updated.
2019-10-13 14:46:44 +02:00
morris f5b03c9ea3 misc adjustment of esp32 component 2019-04-03 19:57:46 +08:00
morris 79bb5de426 derive esp_wifi from esp32 component 2019-04-01 20:04:52 +08:00
morris 709a320f33 move hwcrypto from esp32 to mbedtls 2019-03-26 16:24:22 +08:00
morris fcedf442ce move common source files from esp32 to esp_common 2019-03-22 10:35:03 +08:00
morris c159984264 separate rom from esp32 component to esp_rom
1. separate rom include files and linkscript to esp_rom
2. modefiy "include rom/xxx.h" to "include esp32/rom/xxx.h"
3. Forward compatible
4. update mqtt
2019-03-21 18:51:45 +08:00
Angus Gratton a79c5b8271 esp32: Rename esp32.common.ld to esp32.project.ld to avoid build errors when downgrading
Linker script generator produces build/esp32/esp32.common.ld from
components/esp32/ld/esp32.common.ld.in

This works fine until IDF is downgraded to V3.1 which uses components/esp32/ld/esp32.common.ld and
doesn't track build/esp32/esp32.common.ld at all.

At this point, the linker runs in the build/esp32 directory and "-T esp32.common.ld" picks up the
linker script generated .ld file, which causes mis-builds.

As reported on forums: https://esp32.com/viewtopic.php?f=13&t=9684&p=40105
2019-03-14 09:59:31 +11:00
Renz Bagaporo 63411fc556 tools: implement linker script generation 2018-11-16 12:42:02 +08:00
TianZhongXing 01308df8a6 doc: update document of external memory 2018-09-26 10:39:57 +08:00
TianZhongXing 974112378b feature: allow .bss segment in external memory 2018-09-21 16:20:26 +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
qiyueixa 2984cdbbe3 add mesh feature 2018-04-04 22:57:45 +08:00
Angus Gratton 38e15e6241 build: Remove explict -lstdc++-psram-workaround
This is now handled internally to the toolchain.
2018-01-11 10:32:02 +11:00
Alexey Gerenkov 692a890232 esp32: Adds Stack Smashing Protection Feature
These changes add posibility to enable GCC stack protector via menuconfig
for all source files in project.
2017-11-17 12:08:36 +03:00
Ivan Grokhotkov d55ddfe56d update libstdc++.a built with pSRAM workaround 2017-10-19 21:35:22 +08:00
XiaXiaotian e4ba31a8b9 add ESPNOW feature
ESPNOW is a kind of WiFi communication bettween WiFi devices, no
    matter they are connected to each other or not. Once two WiFi
    devices are paired, they can send data to or receive data from
    each other. The data is transmitted in action frame which can
    be encrypted with CCMP method. ESPNOW also support mutilcast frame
    transmitting.
2017-09-12 12:12:13 +08:00
Angus Gratton 8670844acf build system: Restore ifdef/ifndef in Makefiles, clean up examples build 2017-09-05 16:11:03 +10:00
Deomid Ryabkov 9903ea1c11 Add --warn-undefined-variables to MAKEFLAGS
Fix warnings where undefined vars are used.

Make Kconfig emit "FOO=" for unset bool options
To ensure make variables are always defined, even if empty.

When writing auto.conf, include symbols disabled by dependency to make sure all make variables are always defined.

Fixes espressif/esp-idf#137

Cherry-picked from https://github.com/espressif/esp-idf/pull/138
2017-09-05 16:10:46 +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
Jeroen Domburg 123966deea Also do dport stalling in esp32 component 2017-08-23 16:43:57 +08:00
Kedar Sovani 6405d6f874 kconfig: Add an option for skipping binary blobs 2017-08-16 15:55:42 +05:30
Kedar Sovani ba8cd58b08 kconfig: Remove Wi-Fi on/off as a menuconfig option
This is no longer required since the functions automatically get
pulled in based on the usage. A quick summary of footprint
comparisions before and after these set of patches is shown below:

Hello-World: (simplified for readability)
 old Total image size:~ 104902 bytes (.bin may be padded larger)
 old Total image size:~ 105254 bytes (.bin may be padded larger)
 Per-archive contributions to ELF file:
             Archive File DRAM .data & .bss   IRAM Flash code & rodata   Total
 old              libesp32.a       1973    177   4445       3939     2267   12801
 new              libesp32.a       1973    185   4473       3939     2267   12837

 new             libnvs_flash.a          0     92      0        274        8     374
 new             libstdc++.a          0      0      0         24        0      24

For some reason, nvs_flash.a (~400bytes) gets pulled in (particularly
the nvs_flash_init() function).

Power-Save: (simplified for readability)
 old Total image size:~ 421347 bytes (.bin may be padded larger)
 old Total image size:~ 421235 bytes (.bin may be padded larger)

 old      libtcpip_adapter.a          0     81      0       1947      115       2143
 new      libtcpip_adapter.a          0     69      0       1897      115       2081

The size actually shrinks a bit, since the AP interface function
doesn't get pulled in.
2017-08-16 15:55:28 +05:30
Angus Gratton d664e32394 build system: Use component.mk for all components, refactor bootloader build
For config-only components, component.mk should now contain "COMPONENT_CONFIG_ONLY := 1"

Also refactored some of the generation of linker paths, library list. This required cleaning up the way the bootloader
project works, it's now mostly independent from the parent.
2017-07-19 09:10:48 +10:00
Jeroen Domburg d3290479b2 Merge panic and dport high level interrupt code to both use int level 4 2017-07-07 12:51:33 +08:00
Jeroen Domburg 1d748db209 Break out high-level interrupts so a component can override them 2017-07-07 12:51:33 +08:00
Tian Hao f7e8856520 component/esp32 : fix dualcore bug
1. When dual core cpu run access DPORT register, must do protection.
2. If access DPORT register, must use DPORT_REG_READ/DPORT_REG_WRITE and DPORT_XXX register operation macro.
2017-05-08 21:53:43 +08:00
Ivan Grokhotkov 9edab21385 Merge branch 'feature/rtc_clk_impl' into 'master'
Introduce soc component, add source of rtc_clk and rtc_pm libraries

This MR adds parts of the RTC library source code (initialization, clock selection functions, sleep functions). WiFi-related power management functions are kept inside the precompiled library. Most of RTC library APIs have been renamed.

Default CPU frequency option in Kconfig is set to 160MHz, pending qualification of 240MHz mode at high temperatures.

Register header files are moved into the new soc component, which will contain chip-specific header files and low-level non-RTOS-aware APIs (such as rtc_ APIs). Some of the files from ESP32 component were also moved: cpu_util.c, brownout.c, and the corresponding header files. Further refactoring of ESP32 component into more meaningful layers (chip-specific low level functions; chip-specific RTOS aware functions; framework-specific RTOS-related functions) will be done in future MRs.

See merge request !633
2017-04-12 10:38:23 +08:00
Ivan Grokhotkov 7ee8ee8b7e soc: add source code of rtc_clk, rtc_pm 2017-04-11 15:45:54 +08:00
Alexey Gerenkov 0860f46220 spi_flash: Fixed bug in SPI flash ROM driver to work with embedded flash chip
1) fixed SPI_read_status: added check for flash busy flag in matrix mode
2) fixed SPI_page_program: enable write before writing data to SPI FIFO
3) SPI flash ROM funcs replacement is controlled via menuconfig option
2017-04-11 10:51:19 +08:00
XiaXiaotian 6181c39f05 Reset WIFI mac when wifi start and update wifi lib
1. reset wifi mac when wifi start

2. roll back rx hung workaround for beacon timeout

3. fix amsdu ap interface wrong issue

4. fix amsdu header parse error

5. fix amsdu flag wrong issue

6. PHY: V350, fix BT rssi bug

7. RTC: V225, fix bt will be not work when wifi is reset
2017-03-23 14:28:27 +08:00
XiaXiaotian eb14284c92 disable PHY and RF when stop WiFi and disable BT
1. Add disable PHY and RF when WiFi and BT are both disabled(including call sniffer disable API).

2. Do not init PHY and RF when cpu start. Init PHY and RF when call Wifi or BT start APIs(including sniffer enable API).

3. Add a temporary lib: librtc_clk.a and will delete it when CPU frequency switching function is done.

4. Add an function to get OS tick rate.

5. Do not put the whole pp.a in iram0, only put lmac.o, ieee80211_misc.o, ets_time.o and wdev.o in iram0.
2017-02-17 10:24:54 +08:00
Angus Gratton 9a8a82e857 phyinit: Use PHY config to enable, don't need phy_get_romfunc_addr to init 2017-01-19 11:18:44 +11:00
Angus Gratton ea19838d3a Build: Handle WiFi & BT enabled/disabled combos gracefully as possible
If using WIFI_INIT_CONFIG_DEFAULT, error message will point out lack
of WiFi. Otherwise linker errors on WiFi symbols should help give a
clue as to what is broken.

Piggy-backs on changes in !420, ref github #230 #237
2017-01-16 13:03:17 +11:00
Angus Gratton bbe1bceda8 build system: Project ELF should depend on linker scripts, binary libraries
TW#7816
2016-12-12 15:58:53 +11:00
Ivan Grokhotkov 221dc13535 newlib: add "full" formatting support, add missing functions
- add two versions of libc: libc.a and libc_nano.a. First one has full C99 formatting support, second one uses “nano” formatting functions available in ROM.
- fix linker error for fmod, fmodf, atof, atoff
- update tests
2016-12-08 11:04:54 +08:00
Xia Xiaotian 1ca82de638 Merge branch 'master' into feature/wpa2_enterprise
Conflicts:
	components/esp32/component.mk
	components/wpa_supplicant/component.mk
2016-11-21 18:09:13 +08:00
Angus Gratton 24b4c17ead build system: Refactor SubmoduleCheck to work project-wide
Required at project level because some components use header files in
other components' submodules, and one component with a
submodule (esptool.py) doesn't have or need a component.mk.
2016-11-17 09:18:51 +11:00
Xia Xiao Tian c625f0e906 Merge branch 'master' into feature/wps 2016-11-14 15:24:12 +08:00
Xia Xiao Tian 8dc9e243ae wpa2 enterprise: add wpa2 enterprise API and crypto files 2016-11-11 10:38:57 +08:00
Angus Gratton 208e83def7 build system: Refactor component.mk to not need component_common.mk
New makefile component_wrapper.mk allows some variables to be set
before component.mk is evaluated. This properly fixes problems with
sdkconfig being hard to access in all phases of the build.

Including component_common.mk is no longer necessary and will print a
deprecation warning for components which use it.
2016-11-10 15:52:22 +11:00
Angus Gratton 830e5caf4d build system: Replace get_variable target w/ component_project_vars.mk generated makefiles
Reduces number of make invocations, allows variables exported in project
to be seen in all component make processes, not just the main ones.

Also makes a no-op build about 3x faster than it was.
2016-11-09 16:51:52 +11:00
Xia Xiao Tian bdd7fb7a13 Add wps API 2016-11-08 20:12:06 +08:00
Liu Zhi Fu 178db4bdd9 esp32: merge bt/wifi coexist code
1. Modify makefile to add coexist lib
2. Update bt/wifi coexist lib
2016-11-08 13:30:35 +08:00
Ivan Grokhotkov 2d88fc0329 wpa_supplicant: replace pre-built crypto library with source code 2016-11-04 14:58:47 +08:00
Angus Gratton 90cad92b9b Merge branch 'master' into bugfix/build_dir_base 2016-10-18 15:30:57 +11:00
Angus Gratton 79bd6af7e7 build system: Print a WARNING if any submodule is out of date
Inspired by Github #27 and related "gotchas" with keeping submodules up to date.
2016-10-11 07:56:08 +11:00
Angus Gratton f720e82d40 build system: Allow BUILD_DIR_BASE to be a relative directory (see github #38) 2016-10-06 18:05:51 +11:00
Angus Gratton 66882347e8 build system: Fix out-of-tree building via BUILD_DIR_BASE
Closes #38
2016-10-04 15:04:56 +11:00
Wu Jian Gang d2c938d881 esp32: add libsmartconfig.a to link libs 2016-09-30 15:40:08 +08:00