Commit graph

1120 commits

Author SHA1 Message Date
Tian Hao 4c6ccf1c23 component/bt : add cpp extern c
1. add cpp extern c
2. retab tab to 4 space
2016-12-09 14:38:21 +08:00
Tian Hao e0e6966be0 component/bt : fix the authentication req type 2016-12-09 14:38:21 +08:00
Tian Hao 8185b0f806 component/bt : fix bug of bdaddr point to resolve gattc recv notify 2016-12-09 14:38:21 +08:00
Jeroen Domburg bf57594ebe Merge branch 'feature/intr_alloc' into 'master'
Add dynamic interrupt allocation mechanism

This adds:
- Dynamic allocation of interrupts. Pass it the features of the interrupt you want, it'll set you up with an int.
- Shared interrupts. Enables multiple peripheral drivers to use the same interrupt. 
- Marking what interrupts are fully executable from IRAM; if an int isn't marked like that it will get disabled once flash cache gets disabled.

Also:
- Modifies driver to be in line with these changes

See merge request !254
2016-12-09 14:00:39 +08:00
Angus Gratton f68e1c22ab Merge branch 'bugfix/ci_fail_warnings' into 'master'
Fail CI build on warnings

This allows developers to add CFLAGS for -Wno-error=XXX while developing, but before code passes the CI build then it must be warning-free.

See merge request !279
2016-12-09 13:25:51 +08:00
Angus Gratton 9fd7908bbe Merge branch 'bugfix/spiflash_erase_block' into 'master'
SPI flash: Block erase size 64KB not 32KB

Reverts changes made in 9f9d92b2df

See merge request !298
2016-12-09 13:19:09 +08:00
Ivan Grokhotkov cf311d81ee Merge branch 'feature/newlib_full_format' into 'master'
newlib: add "full" formatting support

This change adds support for 64-bit formats and C99 features to newlib printf/scanf functions. This support is enabled by default in menuconfig, but can be switched off to reduce code size.

Also adds missing functions such as fmod and fmodf.

- Fixes https://github.com/espressif/esp-idf/issues/52
- Fixes https://github.com/espressif/esp-idf/issues/83


See merge request !274
2016-12-09 12:04:29 +08:00
Angus Gratton 8ba75a1e9f SPI flash: Block erase size 64KB not 32KB
Reverts changes made in 9f9d92b2df
2016-12-09 14:18:58 +11:00
Yinling a283042258 switch socket recv print for stress test 2016-12-09 10:45:10 +08:00
Ivan Grokhotkov bf7fbdf3cf Merge branch 'feature/mbedtls/add_menuconfig_component' into 'master'
components/mbedtls: add time and time data configuration at menuconfig



See merge request !268
2016-12-08 22:25:26 +08:00
Yinling 5e1cdd3422 fix bug in test case TCPIP_TCP_5101
test time is not set in test case and not used to control test time
2016-12-08 16:15:49 +08:00
Tian Hao 8ca6e37c12 component/bt : delete the un-used lines 2016-12-08 15:00:19 +08:00
Jeroen Domburg baa6a477c5 Fix example code, add chapter to docs about interrupts and multicore issues 2016-12-08 14:42:00 +08:00
Liu Han c1802eaa98 components/mbedtls: add time and time data configuration at menuconfig 2016-12-08 13:33:47 +08:00
Angus Gratton f807d16310 Merge branch 'feature/backtrace_dumps' into 'master'
Feature/backtrace dumps

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

(Plus reformatting of panic.c, as it hadn't been formatted to our code style yet.)

See merge request !290
2016-12-08 13:27:33 +08:00
Jeroen Domburg cb9ef19d3b Also add intr_alloc magic to rtc code 2016-12-08 12:57:57 +08:00
Jeroen Domburg 2c34ab3374 Mark some interrupts that are now allocated dynamically as free, add int handle param documentation, add local ints test 2016-12-08 12:39:33 +08:00
Jeroen Domburg 9dc908d105 Add test for local interrupts, fix int disable code 2016-12-08 12:39:33 +08:00
Jeroen Domburg ae8c37e0b6 Add disabling/enabling of shared interrupt, add testcase for interrupts 2016-12-08 12:39:33 +08:00
Jeroen Domburg 32fa94935d Changes according to merge request 2016-12-08 12:39:33 +08:00
Jeroen Domburg 655fd2986a Add interrupt allocation scheme / interrupt sharing. Also modifies drivers and examples. Also allows interrupts
to be marked specifically as having a handler that's all in IRAM.
2016-12-08 12:39:33 +08: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
Ivan Grokhotkov 505282bab1 Merge branch 'feature/select_default_uart' into 'master'
UART console selection

This change adds a set of menuconfig options to set custom UART#, baud rate, and pins, for console output.
Ref. TW8146

Also includes the following changes:
- `uart_tx_wait_idle`: fix issue with last character not transmitted. ROM function `uart_tx_wait_idle` may have a bug which causes the function to return before the final character is fully transmitted. This replaces `uart_tx_wait_idle` declaration with a static inline definition which fixes the issue. Also replaces the use of `uart_tx_flush` with `uart_tx_wait_idle` in `esp_restart`, to remove garbage in console output on restart.
- `rtc_printf` is temporary replaced with a no-op, pending a new release of librtc.a. Current release assumes that UART0 is used for output,
and switches UART0 baud rate while doing frequency changes and printing some log output. This doesn’t work if a different UART is used for output.
- disable boot watchdog only after starting the main task. Boot watchdogs were disabled very early in startup code. It was possible to introduce an infinite loop anywhere in the many functions called from startup code, and this would not be detected by interrupt watchdog and task watchdog. This change postpones disabling of boot watchdogs to the point when the scheduler is running. Also replaces register expressed using integer address with a name. This change is not directly related to the previous ones, but was found while debugging UART selection features.

See merge request !288
2016-12-08 10:58:44 +08:00
Ivan Grokhotkov a1542421c0 Merge branch 'bugfix/pcnt_driver' into 'master'
Fixing some syntax errors in pcnt



See merge request !278
2016-12-08 10:48:05 +08:00
Ivan Grokhotkov e3eff5deb9 cpu_start: tabs->spaces 2016-12-08 10:20:12 +08:00
Angus Gratton 81e721ebcb Merge branch 'bugfix/rmt_debug_newline' into 'master'
Removal of spurious newline character in debug statement

There was a debug statement in the code that included an additional newline character that wasn't needed.

From github PR: https://github.com/espressif/esp-idf/pull/124

See merge request !291
2016-12-08 10:05:11 +08:00
Ivan Grokhotkov a00762f1f9 Merge branch 'bugfix/netif_zero_init' into 'master'
Zero-fill netif on alloc

LwIP's `struct netif` was not zero-initialized after allocation, so `ipv6_addr_cb ` function pointer contained garbage. This caused a crash if the device was on an IPv6 capable network.

Fixes https://github.com/espressif/esp-idf/issues/133, https://github.com/espressif/esp-idf/issues/147, https://github.com/espressif/esp-idf/issues/142.

Source: https://github.com/espressif/esp-idf/pull/148

See merge request !289
2016-12-08 10:02:15 +08:00
Neil Kolban dbc5edac7e Removal of spurious newline character in debug statement
There was a debug statement in the code that included an additional newline character that wasn't needed.
2016-12-07 13:57:09 -08:00
tzx 25e4e21226 app_update: clean up warning log when compile any project 2016-12-07 13:49:53 -08:00
Tian Hao 5933ebc6b6 component/bt : cleanup all the "-W-no-xx" and all the warnings
1. cleanup the warnings.
2. fix the some function called in gap
3. fix some code in btc_main
2016-12-07 13:49:53 -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 b98405f9d9 esp32: ReformatReformat panic.c (remove tabs, etc) 2016-12-07 13:25:56 -08:00
Deomid Ryabkov 20fd57f147 Add backtrace to exception output.
On Xtensa windowed ABI backtrace is easy to do, and it's immensely
useful for debugging, so - do it by default.
We try to be careful and not deref bogus pointers while walking the
frames.

Example output (from debugging espressif/esp-idf#133):

Backtrace: 0x1:0x3ffc51e0 0x400e9dfa:0x3ffc5210 0x400e9ebc:0x3ffc5230 0x400ec487:0x3ffc5260

With just addr2line utility from binutils, this already pinpoints the
location of the crash.
2016-12-07 19:58:06 +00:00
Ivan Grokhotkov 13d802262a cpu_start: disable boot watchdog only after starting the main task
Boot watchdogs were disabled very early in startup code. It was possible to introduce an infinite loop anywhere in the many functions called from startup code, and this would not be detected by interrupt watchdog and task watchdog. This change postpones disabling of boot watchdogs to the point when the scheduler is running. Also replaces register expressed using integer address with a name.
2016-12-08 01:42:37 +08:00
Ivan Grokhotkov b57aecdfe9 uart_tx_wait_idle: fix issue with last character not transmitted
- ROM function uart_tx_wait_idle may have a bug which causes the function to return before the final character is fully transmitted.
  This replaces uart_tx_wait_idle declaration with a static inline definition which fixes the issue.
- Also replaces the use of uart_tx_flush with uart_tx_wait_idle in esp_restart, to remove garbage in console output on restart.
- rtc_printf is temporary replaced with a no-op, pending a new release of librtc.a. Current release assumes that UART0 is used for output,
  and switches UART0 baud rate while doing frequency changes and printing some log output. This doesn’t work if a different UART is used for output.
2016-12-08 01:42:37 +08:00
Ivan Grokhotkov b3f6cd08db support for console redirection to other UART
This change adds a set of menuconfig options to set custom UART#, baud rate, and pins, for console output.
Setting happens in bootloader startup code for PRO CPU, and in application startup code for APP CPU.
Ref. TW8146
2016-12-08 01:42:37 +08:00
Deomid Ryabkov ce8b52617e Zero-fill netif on alloc
Fixes espressif/esp-idf#133
2016-12-07 14:32:29 +00:00
Chu Shu Chen b1db2721dc driver: add rtc module and bugfix gpio32 gpio33
feature(rtc_module):add rtc module

1. add rtc io control API (pull,output and input)
2. add touch pad API (touch pad read and interrupt)
3. add adc1 API (the max width is 12 Bits and support attenuation)
4. add hall sensor API (support hall sensor read )
5. add dac API (the width is 8 Bits)

bugfix(gpio):gpio32 and gpio33 can not output and input

the gpio32 and gpio33 is initialize by librtc.a,and gpio_config not initialize the gpio as
digital gpio.they can not output and input,when users use gpio32 or gpio33.And there are some problems
about others driver ,when they use gpio32 or gpio33 as  matrix.
2016-12-07 15:56:13 +08:00
Ivan Grokhotkov 0dff9ed79d drivers: remove file paths from log statements
Function name and error string are usually sufficient to find the place which has triggered an error. __FILE__ macro generates a string which has absolute file name (with our build system), so there is a lot of long strings present in the program because of that.

Fixes https://github.com/espressif/esp-idf/issues/126
2016-12-07 12:01:54 +08:00
Ivan Grokhotkov 60d7440781 Merge branch 'feature/debugging_fixes' into 'master'
Small debugging fixes

Invoke panic handler when a stack overflow has been detected; unhandled interrupt handler now prints interrupt/cpu number for easier pinning down of source.

See merge request !277
2016-12-07 10:30:17 +08:00
Angus Gratton 9a774848d4 Merge branch 'bugfix/gdbstub_no_sync_gdb' into 'master'
Gdbstub: Fix bug, small cleanup

Tianzhongxing found a small bug preventing gdbstub to work in certain cases. This fixes it, as well as including some minor cleanups.

See merge request !260
2016-12-07 03:20:07 +08:00
Yinling ec40053720 add supported stress test cases to CI 2016-12-06 15:41:02 +08:00
me-no-dev 3cd9cb8911 Fix comment in the header 2016-12-06 02:10:35 +02:00
me-no-dev 2dbae95a7e Fix wrong assignment of channel and unit in pcnt_unit_config 2016-12-06 01:11:32 +02:00
Jeroen Domburg c852e9958b Invoke panic handler when a stack overflow has been detected; unhandled interrupt now prints interrupt/cpu number. 2016-12-05 20:37:59 +08:00
Ivan Grokhotkov c8685c2002 Merge branch 'feature/ulp' into 'master'
Initial support for generation of ULP coprocessor code

This adds basic support for writing ULP coprocessor programs using an assembly-like syntax, with integer labels and branches to labels.

See merge request !261
2016-12-02 22:45:47 +08:00
Liu Zhi Fu 5f47b85b87 freertos: default run program on 1st cpu
Modify the default cpu-mode to single cpu mode and always run the program on the 1st core
2016-12-02 18:17:57 +08:00
Jeroen Domburg 004aadfe70 Fix small bug in gdbstub where it sometimes would not return a valid stop reason, timing out gdb. Also clean up the code a bit. 2016-12-02 17:42:11 +08:00
Liu Zhi Fu 9423390c2e esp32: fix tw6901
1. tw6904 - esp32 mode switch cause exception
2. tw8881 - set mac cause exception
3. Make pm_open/pm_shutdown thread-safe
2016-12-02 17:35:49 +08:00
Angus Gratton ceb8566970 Flash encryption / secure boot: Temporarily disable on-device key generation
Will be enabled after seeding of HWRNG in bootloader is fully tested/qualified.
2016-12-01 23:49:13 -08:00
Angus Gratton a9d5e26748 Secure boot: Correctly re-sign if signing key changes, better error if missing 2016-12-01 23:49:12 -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 9eb135fd73 Flash encryption: Support enabling flash encryption in bootloader, app support
* App access functions are all flash encryption-aware
* Documentation for flash encryption
* Partition read/write is flash aware
* New encrypted write function
2016-12-01 23:49:12 -08:00
Ivan Grokhotkov ab3677d64c initial support for generation of ULP coprocessor code 2016-12-01 20:26:47 -08:00
Jiang Jiang Jian bd20288b81 Merge branch 'feature/btdm_bluedroid' into 'master'
Feature/btdm bluedroid

This branch contain the bluedroid host code.
Currently,  Only GAP/GATT SERVER/GATT CLIENT release to users.
Actually, the content of the codes is further more than GAP/GATT and etc.
In this release version, users only need to concern about the APIs which are in "api/include/".

Now, suggestions in comment have been resolved are following:
1. The APIs use callback function. Ivan , Jeroen and me have discussed it. Currently the code will not be changed.
2. The APIs use OPEN/CLOSE. I have ask Ivan, besides bluedroid do this, we will keep the name.
3. Coding style. I have run format.sh to handle the style. And some spell error have been fixed.
4. APIs doxygen. I have clean the warning by doxygen. But bt.rst is still need to be completed.
5. Other comment without resolved face to face that I have to add response in the comment and fix them in the code
6. Fix some incorrect things. See the git log for details.

This 1st version of bluedroid release still have lots of things to do. But it can be done after this merge.
1. Compelete the BLUFI(Bluetooth config wifi connection) documents, security, application protocol and other.
2. Add SPP-LIKE profile.
3. Do more examples codes to cover most of the APIs.
4. Test and fix bug.

Another thing:
1. Do the document of APIs.(xml->bt.rst->html) 
(I will do this before merge as Ivan's suggestion)
This is already done. Besides, the union type in doxygen have something error. Ivan will fix it.



See merge request !239
2016-12-02 12:07:20 +08:00
Tian Hao d925b96daf component/bt : cleanup the function warning in doxygen 2016-12-01 20:55:08 +08:00
Tian Hao 954ffa102f component/bt : add ble event type 2016-12-01 20:16:09 +08:00
Tian Hao bdf4006da7 component/bt : cleanup the return style 2016-12-01 19:58:52 +08:00
shangke e0040af7e5 ethernet: add first version of ethernet driver 2016-12-01 19:17:48 +08:00
Tian Hao c6ec70b67b component/bt : cleanup the function comment as doxygen type 2016-12-01 18:58:54 +08:00
Wu Jian Gang c110795718 Merge branch 'feature/tcpip_get_hostname' into 'master'
tcpip_adapter: teamwork 8964

add get netif host name feature

See merge request !264
2016-12-01 16:51:40 +08:00
Wu Jian Gang 099e3030bf Merge branch 'bugfix/init_factory_bin' into 'master'
bugfix/init_factory_bin: fix inconsistency between bootloader and OTA code

init_factory_bin: 2nd bootloader use a wrong logic select factory  image to boot,and some bug in OTA code 

See merge request !266
2016-12-01 16:14:42 +08:00
Wu Jian Gang 60ac08115f Merge branch 'bugfix/ota_doc_error' into 'master'
bugfix/ota_doc_error: fix return error of ota docs

fix doc return error of ota api 

See merge request !265
2016-12-01 16:10:06 +08:00
tzx 9b2cad4174 docs: fix return error of ota docs and fix ota.rst 2016-12-01 13:54:25 +08:00
tzx 2092d14e45 app_update: fix inconsistency between bootloader and OTA code 2016-12-01 13:46:02 +08:00
Xia Xiaotian ad555d68d3 esp32/lwip: add check sleep
1. fix tw8911 sleep in scan leads to auth frame malloc fail.

2. fix tw8913 pm state transfer wrong leads to wdt.

3. make some comments for modem sleep and wpa2 enterprise.

4. removd duplicated debug option ESP_THREAD_SAFE_DEBUG
2016-12-01 13:34:36 +08:00
Tian Hao 281a9c2761 component/bt : fix a code bug 2016-12-01 12:14:57 +08:00
Tian Hao 1abf2c4ed7 component/bt : update lib 2016-12-01 12:05:42 +08:00
Tian Hao ba96c0d2e9 Merge branch 'master' of ssh://gitlab.espressif.cn:27227/idf/esp-idf into feature/btdm_bluedroid 2016-11-30 19:08:40 +08:00
Wu Jian Gang 59f3684dee Merge branch 'bugfix/tw8868_fix_packet_length_erro_in_ap_bridge_mode' into 'master'
esp32: update wifi lib to fix tw8868

In AP bridge mode, the length of the forwarded data is wrong, it's 26Btyes longer, thus cuase
AP can't forward the data of which length is 1460. This modification is to make the
data length right.

See merge request !262
2016-11-30 18:01:31 +08:00
liuhan 1b9a4a8139 tcpip_adapter: add get netif host name api 2016-11-30 17:41:19 +08:00
Liu Zhi Fu 144a1567e3 esp32: change wap2 enterprise encrypt type to 5
1. b332f3b5 - change wap2 enterprise encrypt type to 5
2. modify the print info of station state transmition
2016-11-30 17:34:19 +08:00
liuhan 7114f933bb tcpip_adapter: fix bug 7462
modify the code execution condition
2016-11-30 15:24:49 +08:00
Liu Zhi Fu 72453e3e6b esp32: update wifi lib to fix tw8868
In AP bridge mode, the length of the forwarded data is wrong, it's 26Btyes longer, thus cuase
AP can't forward the data of which length is more than 1460. This modification is to make the
data length right.
2016-11-30 14:20:05 +08:00
Wu Jian Gang 527767d31c Merge branch 'bugfix/tw8851_some_phy_cause_wifi_connect_fail' into 'master'
esp32: fix tw8851 some phy version cause wifi connect fail

Update phy version to 258 to fix tw8851
When upgrade the phy version, the RF calibration version is not change, but the calibration data format is changed and the wrong calibration data causes wifi connection failure. The solution is to make RF calibration data and phy version the same version.

See merge request !258
2016-11-29 20:15:30 +08:00
Tian Hao 6010ea713f component/esp32/: update submodule log 2016-11-29 20:07:45 +08:00
Wu Jian Gang f4df733edf Merge branch 'tw8810' into 'master'
lwip: update open socket number.

modify default number from 4 to 10

See merge request !259
2016-11-29 20:06:06 +08:00
Liu Zhi Fu d2c61cae8c esp32: update wifi lib
1. update phy to version 258 to fix wifi upgrade cause wifi connect fail issue
2. update fix_printf.sh
3. fb5a2b07 - default set ps type to WIFI_PS_NONE
2016-11-29 19:46:34 +08:00
Tian Hao 758a9e5f06 component/bt : fix compile error 2016-11-29 19:45:10 +08:00
Tian Hao 4c83238a85 component/bt : fix compile error 2016-11-29 19:25:27 +08:00
Tian Hao 5a9801aca7 Merge branch 'master' into feature/btdm_bluedroid
# Conflicts:
#	components/esp32/cpu_freq.c
#	components/esp32/lib
2016-11-29 18:38:37 +08:00
Tian Hao 5a14e8addf component/bt : use ESP_LOGx instead of printf 2016-11-29 17:42:04 +08:00
Tian Hao 9f33d8f5c0 component/bt : add write type 2016-11-29 17:27:12 +08:00
liuhan f9d2d63e75 lwip: update open socket number.
modify default number from 4 to 10
2016-11-29 16:25:17 +08:00
Tian Hao 3a3d4276f8 component/bt : cleanup the comment and pass all doxygen check 2016-11-29 15:32:29 +08:00
Tian Hao 06e2a1d4e1 component/bt : cleanup a macro 2016-11-29 14:38:58 +08:00
Wu Jian Gang de5279ce6c Merge branch 'feature/fota_ops_api' into 'master'
Add fota ops api

add ota core function implement
1. esp_ota_begin: init ota partition need to be update, output ota handle,every partition need ota should be init firstly 
2. esp_ota_write: write image data to update partition, will record wrote size automatically
3. esp_ota_end: verify image after ota ended
4. esp_ota_set_boot_partition: set next boot partition
5. esp_ota_get_boot_partition: get current running partition

See merge request !256
2016-11-29 13:45:44 +08:00
Angus Gratton 01e94998c4 Merge branch 'bugfix/mbedtls_sha384' into 'master'
Bugfix mbedtls sha384 clone()

mbedtls_sha512_clone() on a SHA-384 hash caused incorrect digest

Also adds additional mbedtls unit tests into the unit tests project (including one for this bug).

See merge request !252
2016-11-29 03:16:30 +08:00
Tian Hao f6de7ea764 component/bt : cleanup status and spell check 2016-11-28 22:40:30 +08:00
Tian Hao 9d9e758756 component/bt : add comment for doxygen
1. use doxygen check api comment
2016-11-28 21:59:04 +08:00
Liu Zhi Fu 5b4361f60a esp32: update wifi lib to add tw8913 fix
dfe73737 - tw8913 wakeup first before scan
2016-11-28 20:11:43 +08:00
Liu Zhi Fu fc2883a59a lwip: modify according code review
1. Modify tcp window size/send buffer back to 4/2
2. Disable lwip statistics by default
2016-11-28 19:54:22 +08:00
Liu Zhi Fu 9a3f9af2db esp32/lwip: some misc changes
1. Update phy to fix HT40 rx issue
2. Add code about RX_DONE/TX_DONE/Lock-free optimization
3. Fix wifi ioctl return value error
4. Add lwip statistics debug code
5. Modify TCP window size to 10 and send buffer size to 5
2016-11-28 18:36:14 +08:00
Tian Zhong Xing 72422b32dc feature/fota_ops_api: add ota core api implement 2016-11-28 17:12:57 +08:00
Tian Hao fd0d28afc3 component/bt : cleanup some missing code 2016-11-28 16:39:53 +08:00
Tian Hao ff8ce12787 component/bt : cleanup the spell && redundant 2016-11-28 14:58:30 +08:00
Tian Hao 1173106a20 component/bt : change task to decease dram(heap)
1. decrease the task size(HCI cannot < 1024, btu cannot < 4096)
2. btc task can config by menuconfig(default 2048)
2016-11-25 23:37:46 +08:00
Tian Hao c9a0b9a45c component/bt : decrese dram
1. decrease some resource
2016-11-25 21:24:16 +08:00
Wu Jian Gang db1e86b3d9 Merge branch 'feature/modem_sleep' into 'master'
Feature/modem sleep



See merge request !251
2016-11-25 19:32:03 +08:00
Xia Xiaotian 55aa82f814 modem sleep: update wifi lib
1. add libwpa2.a
2016-11-25 19:06:52 +08:00