Commit Graph

302 Commits

Author SHA1 Message Date
Angus Gratton
79d6d9f701 CI build_examples: Correctly detect example build failures
"pipefail" regression when fail-on-warnings was added...
2016-12-30 16:52:58 +11:00
Angus Gratton
2350288a33 examples: Move sdkconfig.defaults support into build system
Is used fairly widely, and a little bit buggy in the form
where it was in each Makefile (didn't always get copied in place).
2016-12-29 17:37:30 +08:00
Ivan Grokhotkov
05fcdcfedb Merge branch 'bugfix/make_erase_flash' into 'master'
build system: Fix bug where erase_flash was always invoked for flash

Order-only prerequisites do not work for phony targets!

See merge request !337
2016-12-25 09:13:58 +08:00
Angus Gratton
abb7668af7 build system: Fix bug where erase_flash was always invoked for flash
Order-only prerequisites do not work for phony targets!
2016-12-22 16:37:28 +11:00
Angus Gratton
578b627d9b Merge branch 'bugfix/build_system_tilde' into 'master'
Build system: Allow IDF_PATH to contain ~ or C:/

See github issues
* https://github.com/espressif/esp-idf/issues/118
* https://github.com/espressif/esp-idf/issues/166

(This is easier to work around in the build system than to document.)

See merge request !315
2016-12-22 12:14:16 +08:00
Ivan Grokhotkov
a760eb3980 Merge branch 'feature/erase_flash' into 'master'
Build system: Add `make erase_flash` target



See merge request !328
2016-12-22 09:53:25 +08:00
Angus Gratton
de8ecdd3c1 build system: Fix Windows case when IDF_PATH contains colons (ie C:/)
Closes github #166 https://github.com/espressif/esp-idf/issues/166
2016-12-22 10:36:25 +11:00
Angus Gratton
59e0f63d37 Build system: Add make erase_flash target 2016-12-20 10:00:04 +11:00
Angus Gratton
d6fafd00db Secure boot: Option for app & partition table signing to happen outside build system 2016-12-19 13:12:05 +11:00
Angus Gratton
9d8e110202 Build system: Deal with the case where IDF_PATH contains ~
See github issue https://github.com/espressif/esp-idf/issues/118

(This is easier to work around in the build system than to document.)
2016-12-16 11:30:37 +11:00
Angus Gratton
4f637034e8 build system tests: Add test case for sdkconfig-triggered recompilation 2016-12-15 08:45:32 +11:00
Angus Gratton
49be64a716 build system: Generate dependency make rules for assembler source
Was previously only C, C++.
2016-12-15 08:44:48 +11:00
Angus Gratton
487548e7dd Merge branch 'bugfix/build_system_linker_script_deps' into 'master'
build system: Linker scripts or binary libraries should trigger a re-link

Add binary libraries and linker scripts to the list of dependencies for the ELF file.

Fixes TW7816.


See merge request !307
2016-12-15 05:38:54 +08:00
Angus Gratton
311b7040d5 Merge branch 'feature/make_size' into 'master'
Add the size target to project Makefile

Github pull request https://github.com/espressif/esp-idf/pull/154

See merge request !305
2016-12-13 07:25:35 +08:00
Jonathan Dumaresq
2a22dc082b Add the size target to project Makefile 2016-12-13 10:03:51 +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
Angus Gratton
9a378bca0e build system: Be specific about esp-idf submodule update warnings 2016-12-12 15:58:50 +11:00
Angus Gratton
bab1d49f1f Merge branch 'feature/esptool_flash_encryption' into 'master'
Flash encryption support

Flash encryption support in build system, tooling

To come in future MR:
* On-device key generation on first boot (for production devices), need to finalise testing of bootloader entropy seeding.
* spi_flash_encrypted_write to support non-32-byte block writes (at least optionally.)
* I think a lot of the bootloader_support component can possibly be rolled into "spiflash" and other components, to use a common API.

See merge request !240
2016-12-12 06:50:46 +08:00
Angus Gratton
94d2f77643 build system: Remove FLAGS_XXX variable option, replace with per-target overrides
Use for targeted disabling of warnings in LWIP.
2016-12-07 13:49:09 -08:00
Angus Gratton
1613c180e0 CI build_examples.sh: Fail on warnings, even with -Wno-error 2016-12-06 10:39:56 -08:00
Angus Gratton
506c8cd964 secure boot & flash encryption: Rework configuration options
Add UART bootloader disable options for flash encryption
2016-12-01 23:49:12 -08:00
Angus Gratton
d0801fdbab Merge branch 'feature/sha_tls_integration' into 'master'
SHA acceleration integrated to mbedTLS incl. TLS sessions

Uses hardware SHA acceleration where available, fails over to software where not available.

Ref TW7112

See merge request !232
2016-11-25 10:12:29 +08:00
Ivan Grokhotkov
137c027274 Merge branch 'feature/integrate_unit_tests' into 'master'
Integrate unit tests into build system

This MR moves unit tests from esp-idf-tests repository into 'test' subdirectories of respective components.

Tests are run using a runner app in tools/unit-test-app.

This needs a bit of cleanup:

1. remove extra newlines added to makefiles,
2. re-format unit tests code which has tabs
3. write a document on using this test app
4. maybe some refactoring in project.mk

I think 1&2&4 need to be done in this MR, while 3 may be done in a follow-up one.

See merge request !221
2016-11-23 12:13:39 +08:00
antti
15d96eccdb add build all unit tests in project.mk and update doc 2016-11-23 11:42:12 +08:00
Angus Gratton
0b75ff5a6d Merge branch 'bugfix/build_system_secure_boot_embed' into 'master'
Build system: Fix a bug with embedding binaries in object files

Sometimes paths were generated absolute, need to keep those as-is

See merge request !228
2016-11-23 11:35:22 +08:00
Angus Gratton
5ac7810480 build system: Fix null-terminating of text files for embedding on OS X
Ref github #112
2016-11-23 08:49:15 +11:00
Angus Gratton
c48612e516 mbedTLS SHA acceleration: Allow concurrent digest calculation, works with TLS
SHA hardware allows each of SHA1, SHA256, SHA384&SHA512 to calculate digests
concurrently.

Currently incompatible with AES acceleration due to a hardware reset problem.

Ref TW7111.
2016-11-22 20:42:38 +11:00
antti
d390449371 add unit tests to esp-idf
rename nvs host test folder, modify .gitlab-ci.yml

remove unit-test-app build

re-format unit test files

remove extra newlines in project.mk

some refactoring for unit test part in project.mk

add build files of unit-test-app in gitignore

add README.md for unit test app

correct headings in README.md

remove files and make minor tweaks in unit test app

update .gitlab-ci.yml to use unit test app

delete unused lines in component_wrapper.mk

delete periph_i2s.h and lcd test

add text floating point in components/esp32/test/Kconfig

correct idf test build paths in .gitlab-ci.yml
2016-11-22 14:45:50 +08:00
Angus Gratton
4261fc5ef7 build system: If esp-idf makefiles or component.mk changes, recompile source 2016-11-21 20:56:40 +11:00
Angus Gratton
ed0612c56b Build system: Fix a bug with embedding binaries in object files
Sometimes paths were generated absolute, need to keep those as-is
2016-11-21 17:45:28 +11:00
Angus Gratton
12dd886ee1 build system: Use correct objcopy arguments for object format
Avoid ambiguous argument error on some platforms

Ref internal discussion !198

squash! build system: Use correct objcopy --input-target argument not --input
2016-11-17 14:32:56 +11:00
Angus Gratton
872a481cf1 build system: When embedding binary files, fix re-generating on partial builds
When embedding a generated file (ie secure boot public key data), the
file was being re-generated each time.
2016-11-17 09:18:51 +11: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
Angus Gratton
4eeb2bc41e build system: Fix embedding files which are themselves generated by the
build system

Used by secure boot, which generates the secure boot signing key inside build/.
2016-11-17 09:18:51 +11:00
Angus Gratton
60f29236f6 Build system: Raise warning level
Default esp-idf builds now show -Wextra warnings (except for a few:
signed/unsigned comparison, unused parameters, old-style C declarations.)

CI building of examples runs with that level raised to -Werror, to catch
those changes going into the main repo.
2016-11-16 15:57:34 +11:00
Angus Gratton
c04f05ee84 build examples: Only build verbose on failure, save on log output 2016-11-14 15:29:27 +11:00
Angus Gratton
c15024e629 Merge branch 'master' into feature/build_component_project_vars 2016-11-14 14:54:41 +11:00
Angus Gratton
ea4005e673 Merge branch 'feature/esptool_secure_boot' into 'master'
Secure boot support

Also includes a lot of esptool.py changes (two new command line tools, espefuse.py and espsecure.py)
https://github.com/themadinventor/esptool/compare/feature/esp32_v20_refactor...feature/esp32_secure_boot?expand=1


See merge request !163
2016-11-14 11:32:04 +08:00
Angus Gratton
e459f803da secure boot: Functional partition table & app signature verification 2016-11-14 11:08:42 +11:00
Angus Gratton
64f3893cb9 secure boot: Derive secure bootloader key from private key
Means only one key needs to be managed.
2016-11-14 11:08:42 +11:00
Angus Gratton
b5de581399 Secure boot: initial image signature support 2016-11-14 11:08:42 +11:00
Angus Gratton
f9e9e6b938 Build system: Change deprecation message to include component path, easier to fix 2016-11-14 10:57:45 +11:00
Angus Gratton
cc510c1d95 build system: Remove make 3.81 "component_project_vars.mk: No such file or directory" messages
Also add an explicit make version check & warning.
2016-11-14 10:55:58 +11:00
Angus Gratton
341593f7d2 build system: Remove need for $(Q) macro in recipes, use --silent in MAKEFLAGS instead 2016-11-11 12:32:47 +11:00
Angus Gratton
07f36a9437 Build system: Use ifndef X in makefiles instead of ifeq("$(X)","") 2016-11-10 18:34:43 +11: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
f1938a909a build system: Generated makefiles should contain environment-variable-relative paths where possible
Means that moving directories around then partial building should
succeed when possible.
2016-11-10 10:29:42 +11:00
Angus Gratton
2f0efe1510 build system: Fix defconfig vs menuconfig regression in 155f9124 2016-11-09 20:38:50 +11:00
Angus Gratton
d7e57eb668 build system: Refactor the three component-target-related macros into one 2016-11-09 19:09:44 +11:00
Angus Gratton
155f912433 build system: Don't build an sdkconfig for bootloader, share the top-level one
This works because all CONFIG variables are exported into child make processes.
2016-11-09 16:51:52 +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
Liu Zhi Fu
cb5f7690a4 esp32/make: add detailed return error code for wifi APIs
1. Add detailed return error code for wifi APIs
2. Add description about error code in esp_wifi.h
3. Modify esp_wifi_reg_rxcb to esp_wifi_internal_reg_rxcb
4. Modify esp_wifi_set_sta_ip to esp_wifi_internal_set_sta_ip
5. Mark system_init as deprecated API
2016-11-08 18:12:14 +08:00
Angus Gratton
fce359b240 build system: Add support for embedded arbitrary binary or text files in .rodata
Simplifies examples of embedding a certificate file or a root cert.

This is a much cruder mechanism than the full flash filesystem we want
eventually, but still sometimes useful.
2016-11-08 11:13:54 +11:00
Angus Gratton
aceb6517c0 Refactor existing bootloader common functionality into bootloader_support component 2016-11-02 17:58:41 +11:00
Angus Gratton
4ba1b73eba build system: Add espefuse/espsecure support for secure boot 2016-11-02 10:41:59 +11:00
Ivan Grokhotkov
7e201c5527 vfs and newlib: small fixes
- spaces->tabs in tasks.c
- update vfs_uart.c to use per-UART locks
- add license to vfs_uart.c
- allocate separate streams for stdout, stdin, stderr, so that they can be independently reassigned
- fix build system test failure
- use posix off_t instead of newlib internal _off_t
2016-10-27 17:22:18 +08:00
Jeroen Domburg
922839d131 Merge branch 'feature/component_hostcc_hostld_etc' into 'master'
Also export HOSTCC etc for components

As title says :)

See merge request !143
2016-10-21 15:52:28 +08:00
Ivan Grokhotkov
4f704ac2fe Merge branch 'feature/release_build' into 'master'
Add menuconfig setting for optimization level

This change adds two options (Debug/Release) for optimization level.
- Debug (default) enables -O0
- Release enables -Os and adds `-DNDEBUG`, which removes all assert() statements

These options may be overriden at project level by adding necessary flags to CFLAGS/CXXFLAGS.

Debugging symbols are kept in both cases, although we may add an option to strip output file if necessary.

Also we used to define all common compiler flags in CPPFLAGS, and then prepended them to CFLAGS/CXXFLAGS.
It made it impossible to add preprocessor macros to CPPFLAGS at component level (one had to use CFLAGS/CXXFLAGS instead).
Some third party libraries are not compatible with this approach. Changed to the more common way of using these variables.

CI will build both debug (default) and release.


See merge request !138
2016-10-21 10:56:03 +08:00
Jeroen Domburg
6b85040059 Also export HOSTCC etc for components 2016-10-20 20:11:13 +08:00
Ivan Grokhotkov
dfe0dcaed4 build system: fix setting C**FLAGS from project makefile 2016-10-20 17:17:54 +08:00
Ivan Grokhotkov
39a06319e2 build system: use -Og instead of -O0 for debug builds, expand help text in menuconfig 2016-10-20 16:10:51 +08:00
Angus Gratton
746ad41d89 Build tests: Use & document clean_build_dir 2016-10-18 15:35:17 +11:00
Angus Gratton
90cad92b9b Merge branch 'master' into bugfix/build_dir_base 2016-10-18 15:30:57 +11:00
Ivan Grokhotkov
34fa6a60a9 build system: fix typo, move -ggdb to OPTIMIZATION_FLAGS 2016-10-17 13:47:13 +08:00
Ivan Grokhotkov
182184567e build system: add menuconfig choice for optimization level, reorganize C*FLAGS
This change adds two options (Debug/Release) for optimization level.
Debug enables -O0, release enables -Os and adds -DNDEBUG (which removes all assert() statements).
Debugging symbols are kept in both cases, although we may add an option to strip output file if necessary.
Also we used to define all common compiler flags in CPPFLAGS, and then appended them to CFLAGS/CXXFLAGS.
It makes it impossible to add preprocessor macros to CPPFLAGS at component level (one has to use CFLAGS/CXXFLAGS instead).
Some third party libraries are not compatible with this approach. Changed to the more common way of using these variables.
2016-10-17 12:38:17 +08:00
Angus Gratton
20b508e62e build system tests: Verify bootloader doesn't build any files outside build/bootloader & config
See TW7505. Looks like bug was fixed via prior refactors, but adding the
test ensures it will stay fixed.
2016-10-13 11:01:30 +11:00
Angus Gratton
609c1c2cdb build system: Add -fno-rtti when compiling C++ code 2016-10-11 07:56:08 +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
305bc9fd9c build system: Run parallel builds without warnings
Ref github #38
2016-10-06 18:29:34 +11:00
Angus Gratton
6a890e6c49 build system tests: Untabify shell script 2016-10-06 18:06:52 +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
eccf54b939 build system tests: Add some more notes about test internals 2016-10-04 15:54:27 +11:00
Angus Gratton
477d71e589 config system: Fix configuration when BUILD_DIR_BASE out-of-tree
Ref #38. Also no longer generates bootloader sdkconfig in source tree.
2016-10-04 15:38:20 +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
Angus Gratton
9c0cd10d48 Build system tests: Add test cases for out-of-tree builds (currently failing)
See github #38
2016-10-04 15:04:39 +11:00
Angus Gratton
de76546227 Build examples out-of-tree as part of CI process 2016-09-27 12:06:54 +10:00
Ivan Grokhotkov
b1ac144874 Merge branch 'driver_merge_tmp/merge_struct_header' into 'master'
add peripheral modules struct headers



See merge request !88
2016-09-19 15:34:37 +08:00
Jeroen Domburg
f703acd344 Adding -fstrict-volatile-bitfields to the CFLAGS/CXXFLAGS. Without this, gcc tries to access bitfields using the smallest possible methods (eg l8i to
grab an 8-bit field from a 32-bit). Our hardware does not like that. This flag tells gcc that if a bitfield is volatile, it should always use the type
the field is defined at (uint32_t in our case) to size its access to the field. This fixes accessing the hardware through the xxx_struct.h headers.
2016-09-18 12:10:01 +08:00
Angus Gratton
cdd1b95b6e config system: Support Windows when CRLFs used for eol markers
Includes a test in test_build_system.sh to prevent regressions w/
CRLFs in text files.

Fixes Github #10
2016-09-16 18:07:58 +10:00
Wu Jian Gang
2efaf42253 Merge remote-tracking branch 'origin/feature/mbedtls' 2016-09-14 18:05:56 +08:00
Angus Gratton
fcf278848d Merge branch 'master' into feature/esptool_upstream 2016-09-12 18:02:10 +10:00
Angus Gratton
5810dbef05 make: Add macro to test for & try to fix up files required for submodules
Now applied to both esptool.py & esp32 wifi libs
2016-09-12 18:00:20 +10:00
Angus Gratton
f605e03344 make debugging: With V=1, output when including each Makefile.projbuild
also enable V=1 on CI builds
2016-09-09 11:08:28 +10:00
Angus Gratton
7c58c1e06b Build system: Allow components to add to the global CFLAGS via Makefile.projbuild
Used by mbedTLS to set MBEDTLS_CONFIG_FILE in all components.

This change sets CFLAGS/etc at the project level and then exports those
variables for components, rather than setting them independently each time
a component Makefile is invoked.
2016-09-09 11:08:19 +10:00
Angus Gratton
02543ee895 CI: Build the esp-idf-template with the matching branch name, if it exists 2016-09-08 13:41:19 +10:00
Angus Gratton
b8634ae08b test_build_system: Print ESP_IDF_TEMPLATE_GIT for easier debugging 2016-09-08 13:41:19 +10:00
Angus Gratton
3b1c3dab4b Name component makefiles component.mk instead of Makefile
Fixes problems with Eclipse trying to build in directories it shouldn't.

This is a breaking change for existing repositories, they need to rename
any component Makefiles to component.mk and rename their references to
$(IDF_PATH)/make/component.mk to $(IDF_PATH)/make/component_common.mk
2016-09-08 13:41:19 +10:00
Angus Gratton
ee388097f6 Makefile: Fix "No rule to make target X.h" for generated header dependencies 2016-08-29 10:48:53 +10:00
Angus Gratton
7458f9193b Rename build_system_tests to less-ambiguous test_build_system
Before it was unclear if we were building the system tests or testing
the build system.
2016-08-25 11:55:47 +08:00
Angus Gratton
f54348ff83 build_system_tests.sh: Replace use of second-precision-only [ a -ot b ] 2016-08-25 11:54:37 +08:00
Ivan Grokhotkov
cb6e0b18f1 make: update template configuration before running tests
This fixes build error for non-interactive builds
2016-08-25 10:28:25 +08:00
Angus Gratton
116e730132 Makefile: Don't re-build libraries or re-link ELF files if nothing has changed in the component
make/build_system_tests.sh should now pass.
2016-08-24 13:25:06 +08:00
Angus Gratton
938d13c5a3 Makefile: Rename $(vecho) to $(summary), add new $(details) for echoing details when V=1 2016-08-24 13:25:06 +08:00
Angus Gratton
528638f5eb Add build system test (via bash script)
Currently fails due to bootloader not automatically rebuilding anything,
and ELF/BIN files generating when nothing changed.
2016-08-24 13:25:06 +08:00
Ivan Grokhotkov
f19ac2b927 make: add defconfig, don't run silentoldconfig before menuconfig
This commit fixes the case when new Kconfig configuration options were added and you run `make menuconfig`.
Previously this would first show console prompt to set values for new options, and then launch menuconfig.
Now this will just launch menuconfig.
New target is added, defconfig, which may be useful for non-interactive environments to set default values for
all new configuration options.
2016-08-23 16:18:36 +08:00
Angus Gratton
aa4c31f3b0 esptool.py & Makefile: Fix compressed upload support (enabled by default) 2016-08-22 18:44:46 +08:00
Angus Gratton
f853f94335 Use IDF_PATH instead of SDK_PATH for the environment variable pointing to esp-idf
This will require a matching change in all projects using ESP-IDF.
2016-08-19 15:01:49 +08:00
Angus Gratton
9ec0e1545d Standardise remaining uses of SDK to ESP-IDF 2016-08-19 15:01:15 +08:00
Angus Gratton
b0f530d004 Makefile: bootloader-clean shouldn't clean config or partition table
Also don't build config for 'make help', and remove some redundant
clearing of variables.
2016-08-19 14:04:51 +08:00
Angus Gratton
14eb490bb3 make: 'make all' default target builds everything, 'make flash' flashes everything
Also added 'make help' target which prints some useful usage summary.
2016-08-18 21:42:37 +08:00
Angus Gratton
45d1baa24b Make: Fix make bootloader, make bootloader-flash, cleaning of bootloader
Should resolve TW6610
2016-08-18 21:15:47 +08:00
Ivan Grokhotkov
bd6ea4393c Initial public version 2016-08-17 23:08:22 +08:00