From 1977370e6fc069e93ffd8818798fbfda27ae7d99 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Mon, 20 Jan 2020 22:07:04 +0200 Subject: [PATCH] IDF release/v3.3 (#3339) * IDF release/v3.3 46b12a560 * fix build * IDF release/v3.3 367c3c09c --- platform.txt | 6 +- tools/esptool.py | 6 +- tools/gen_esp32part.py | 148 +-- tools/platformio-build.py | 9 +- tools/sdk/bin/bootloader_dio_40m.bin | Bin 15872 -> 17056 bytes tools/sdk/bin/bootloader_dio_80m.bin | Bin 15856 -> 17088 bytes tools/sdk/bin/bootloader_dout_40m.bin | Bin 15872 -> 17056 bytes tools/sdk/bin/bootloader_dout_80m.bin | Bin 15856 -> 17088 bytes tools/sdk/bin/bootloader_qio_40m.bin | Bin 17408 -> 18592 bytes tools/sdk/bin/bootloader_qio_80m.bin | Bin 17392 -> 18608 bytes tools/sdk/bin/bootloader_qout_40m.bin | Bin 17408 -> 18592 bytes tools/sdk/bin/bootloader_qout_80m.bin | Bin 17392 -> 18608 bytes tools/sdk/include/app_trace/esp_app_trace.h | 26 +- tools/sdk/include/app_update/esp_ota_ops.h | 106 ++ .../bootloader_support/bootloader_common.h | 79 +- .../bootloader_flash_config.h | 71 ++ .../include/bootloader_support/esp_efuse.h | 106 -- .../bootloader_support/esp_image_format.h | 30 +- .../bootloader_support/esp_secure_boot.h | 28 +- tools/sdk/include/bt/esp_bt.h | 2 +- tools/sdk/include/bt/esp_gap_ble_api.h | 34 +- tools/sdk/include/bt/esp_spp_api.h | 6 +- tools/sdk/include/config/sdkconfig.h | 29 +- tools/sdk/include/driver/driver/can.h | 40 +- tools/sdk/include/driver/driver/i2s.h | 37 + tools/sdk/include/driver/driver/rmt.h | 27 + tools/sdk/include/driver/driver/spi_common.h | 48 +- tools/sdk/include/driver/driver/spi_master.h | 4 + tools/sdk/include/driver/driver/spi_slave.h | 31 +- tools/sdk/include/driver/driver/uart.h | 7 +- tools/sdk/include/efuse/esp_efuse.h | 362 +++++++ tools/sdk/include/efuse/esp_efuse_table.h | 69 ++ tools/sdk/include/esp-face/dl_lib_matrix3d.h | 217 +++- tools/sdk/include/esp-face/dl_lib_matrix3dq.h | 459 +++++++-- tools/sdk/include/esp-face/fr_forward.h | 19 +- tools/sdk/include/esp-face/frmn.h | 25 +- tools/sdk/include/esp-face/image_util.h | 54 +- tools/sdk/include/esp-face/lssh.h | 91 ++ tools/sdk/include/esp-tls/esp_tls.h | 38 +- tools/sdk/include/esp32-camera/sensor.h | 2 + tools/sdk/include/esp32/esp_attr.h | 35 +- tools/sdk/include/esp32/esp_clk.h | 1 + .../sdk/include/esp32/esp_coexist_internal.h | 14 + tools/sdk/include/esp32/esp_core_dump.h | 64 -- tools/sdk/include/esp32/esp_event_legacy.h | 5 + .../sdk/include/esp32/esp_flash_data_types.h | 14 +- tools/sdk/include/esp32/esp_phy_init.h | 12 + tools/sdk/include/esp32/esp_wifi.h | 2 +- tools/sdk/include/esp32/esp_wifi_internal.h | 82 +- tools/sdk/include/esp32/esp_wifi_os_adapter.h | 3 +- tools/sdk/include/esp32/rom/crc.h | 57 +- tools/sdk/include/esp32/rom/spi_flash.h | 5 + tools/sdk/include/esp32/rom/uart.h | 6 +- tools/sdk/include/esp_event/esp_event.h | 168 ++-- .../include/esp_http_client/esp_http_client.h | 85 +- .../include/esp_http_server/esp_http_server.h | 304 +++++- .../sdk/include/esp_https_ota/esp_https_ota.h | 131 ++- .../esp_https_server/esp_https_server.h | 130 +++ tools/sdk/include/espcoredump/esp_core_dump.h | 89 ++ tools/sdk/include/expat/asciitab.h | 62 +- tools/sdk/include/expat/expat.h | 277 ++---- tools/sdk/include/expat/expat_external.h | 88 +- tools/sdk/include/expat/iasciitab.h | 62 +- tools/sdk/include/expat/internal.h | 47 +- tools/sdk/include/expat/latin1tab.h | 62 +- tools/sdk/include/expat/nametab.h | 242 ++--- tools/sdk/include/expat/siphash.h | 426 ++++---- tools/sdk/include/expat/utf8tab.h | 62 +- tools/sdk/include/expat/winconfig.h | 21 +- tools/sdk/include/expat/xmlrole.h | 13 +- tools/sdk/include/expat/xmltok.h | 212 ++-- tools/sdk/include/expat/xmltok_impl.h | 72 +- tools/sdk/include/fatfs/ffconf.h | 9 +- tools/sdk/include/freemodbus/mbcontroller.h | 2 +- .../freertos/freertos/FreeRTOSConfig.h | 7 +- .../sdk/include/freertos/freertos/portable.h | 20 + .../sdk/include/freertos/freertos/portmacro.h | 68 ++ tools/sdk/include/freertos/freertos/task.h | 2 +- tools/sdk/include/idf_test/idf_performance.h | 14 +- tools/sdk/include/lwip/apps/sntp/sntp.h | 4 +- tools/sdk/include/lwip/esp_sntp.h | 22 + tools/sdk/include/lwip/lwip/dhcp.h | 9 + tools/sdk/include/lwip/lwipopts.h | 67 +- tools/sdk/include/lwip/sntp.h | 127 +++ tools/sdk/include/lwip/sntp/sntp.h | 127 +++ tools/sdk/include/mbedtls/mbedtls/aes.h | 76 +- tools/sdk/include/mbedtls/mbedtls/aesni.h | 52 +- tools/sdk/include/mbedtls/mbedtls/arc4.h | 5 + tools/sdk/include/mbedtls/mbedtls/aria.h | 101 +- tools/sdk/include/mbedtls/mbedtls/asn1write.h | 317 +++--- tools/sdk/include/mbedtls/mbedtls/base64.h | 9 + tools/sdk/include/mbedtls/mbedtls/bignum.h | 798 +++++++++------ tools/sdk/include/mbedtls/mbedtls/blowfish.h | 139 ++- tools/sdk/include/mbedtls/mbedtls/bn_mul.h | 52 +- tools/sdk/include/mbedtls/mbedtls/camellia.h | 211 ++-- tools/sdk/include/mbedtls/mbedtls/ccm.h | 118 ++- tools/sdk/include/mbedtls/mbedtls/certs.h | 246 ++++- tools/sdk/include/mbedtls/mbedtls/chacha20.h | 54 +- .../sdk/include/mbedtls/mbedtls/chachapoly.h | 83 +- .../include/mbedtls/mbedtls/check_config.h | 15 + tools/sdk/include/mbedtls/mbedtls/cipher.h | 226 +++-- tools/sdk/include/mbedtls/mbedtls/cmac.h | 7 + .../sdk/include/mbedtls/mbedtls/compat-1.3.h | 6 + tools/sdk/include/mbedtls/mbedtls/config.h | 209 +++- tools/sdk/include/mbedtls/mbedtls/ctr_drbg.h | 72 +- tools/sdk/include/mbedtls/mbedtls/debug.h | 36 + tools/sdk/include/mbedtls/mbedtls/des.h | 6 + tools/sdk/include/mbedtls/mbedtls/dhm.h | 173 ++-- tools/sdk/include/mbedtls/mbedtls/ecdh.h | 296 ++++-- tools/sdk/include/mbedtls/mbedtls/ecdsa.h | 338 +++++-- tools/sdk/include/mbedtls/mbedtls/ecjpake.h | 148 +-- tools/sdk/include/mbedtls/mbedtls/ecp.h | 588 ++++++++--- .../include/mbedtls/mbedtls/ecp_internal.h | 6 + tools/sdk/include/mbedtls/mbedtls/error.h | 19 +- .../sdk/include/mbedtls/mbedtls/esp_config.h | 41 + tools/sdk/include/mbedtls/mbedtls/gcm.h | 107 +- tools/sdk/include/mbedtls/mbedtls/havege.h | 6 + tools/sdk/include/mbedtls/mbedtls/hkdf.h | 6 + tools/sdk/include/mbedtls/mbedtls/hmac_drbg.h | 36 +- tools/sdk/include/mbedtls/mbedtls/md.h | 2 + tools/sdk/include/mbedtls/mbedtls/md2.h | 5 + tools/sdk/include/mbedtls/mbedtls/md4.h | 5 + tools/sdk/include/mbedtls/mbedtls/md5.h | 5 + tools/sdk/include/mbedtls/mbedtls/net.h | 5 + tools/sdk/include/mbedtls/mbedtls/nist_kw.h | 6 + tools/sdk/include/mbedtls/mbedtls/padlock.h | 42 +- tools/sdk/include/mbedtls/mbedtls/pem.h | 6 + tools/sdk/include/mbedtls/mbedtls/pk.h | 215 +++- .../sdk/include/mbedtls/mbedtls/pk_internal.h | 23 + tools/sdk/include/mbedtls/mbedtls/pkcs12.h | 10 + tools/sdk/include/mbedtls/mbedtls/pkcs5.h | 14 + tools/sdk/include/mbedtls/mbedtls/platform.h | 3 + .../include/mbedtls/mbedtls/platform_util.h | 86 +- tools/sdk/include/mbedtls/mbedtls/poly1305.h | 55 +- tools/sdk/include/mbedtls/mbedtls/ripemd160.h | 6 + tools/sdk/include/mbedtls/mbedtls/rsa.h | 574 +++++++---- tools/sdk/include/mbedtls/mbedtls/sha1.h | 66 +- tools/sdk/include/mbedtls/mbedtls/sha256.h | 93 +- tools/sdk/include/mbedtls/mbedtls/sha512.h | 94 +- tools/sdk/include/mbedtls/mbedtls/ssl.h | 233 +++-- tools/sdk/include/mbedtls/mbedtls/ssl_cache.h | 6 + .../mbedtls/mbedtls/ssl_ciphersuites.h | 6 + .../sdk/include/mbedtls/mbedtls/ssl_cookie.h | 6 + .../include/mbedtls/mbedtls/ssl_internal.h | 27 +- .../sdk/include/mbedtls/mbedtls/ssl_ticket.h | 6 + tools/sdk/include/mbedtls/mbedtls/threading.h | 3 + tools/sdk/include/mbedtls/mbedtls/version.h | 10 +- tools/sdk/include/mbedtls/mbedtls/x509.h | 4 + tools/sdk/include/mbedtls/mbedtls/x509_crt.h | 139 ++- tools/sdk/include/mbedtls/mbedtls/x509_csr.h | 8 + tools/sdk/include/mbedtls/mbedtls/xtea.h | 6 + tools/sdk/include/mqtt/mqtt_client.h | 98 +- .../include/mqtt/mqtt_supported_features.h | 49 + tools/sdk/include/nvs_flash/nvs.h | 14 + tools/sdk/include/pthread/esp_pthread.h | 20 +- tools/sdk/include/soc/soc/apb_ctrl_struct.h | 2 + tools/sdk/include/soc/soc/can_struct.h | 4 +- tools/sdk/include/soc/soc/efuse_reg.h | 53 +- tools/sdk/include/soc/soc/gpio_sd_struct.h | 2 + tools/sdk/include/soc/soc/gpio_struct.h | 2 + tools/sdk/include/soc/soc/hinf_struct.h | 2 + tools/sdk/include/soc/soc/host_struct.h | 2 + tools/sdk/include/soc/soc/i2c_struct.h | 2 + tools/sdk/include/soc/soc/i2s_struct.h | 2 + tools/sdk/include/soc/soc/ledc_reg.h | 104 +- tools/sdk/include/soc/soc/ledc_struct.h | 2 + tools/sdk/include/soc/soc/mcpwm_struct.h | 2 + tools/sdk/include/soc/soc/pcnt_struct.h | 2 + tools/sdk/include/soc/soc/rmt_reg.h | 436 +++++++- tools/sdk/include/soc/soc/rmt_struct.h | 2 + tools/sdk/include/soc/soc/rtc_cntl_struct.h | 2 + tools/sdk/include/soc/soc/rtc_io_struct.h | 2 + tools/sdk/include/soc/soc/sdmmc_struct.h | 2 + tools/sdk/include/soc/soc/sens_struct.h | 2 + tools/sdk/include/soc/soc/slc_struct.h | 2 + tools/sdk/include/soc/soc/soc_memory_layout.h | 5 + tools/sdk/include/soc/soc/spi_struct.h | 2 + tools/sdk/include/soc/soc/syscon_struct.h | 2 + .../sdk/include/soc/soc/timer_group_struct.h | 2 + tools/sdk/include/soc/soc/uart_struct.h | 2 + tools/sdk/include/soc/soc/uhci_struct.h | 2 + tools/sdk/include/spi_flash/esp_partition.h | 1 + .../include/tcp_transport/esp_transport_ssl.h | 9 + .../sdk/include/tcpip_adapter/tcpip_adapter.h | 648 ++++++------ .../tcpip_adapter/tcpip_adapter_internal.h | 66 ++ tools/sdk/include/ulp/esp32/ulp.h | 3 + tools/sdk/include/unity/unity.h | 503 ++++++++++ tools/sdk/include/unity/unity_config.h | 53 + tools/sdk/include/unity/unity_internals.h | 928 ++++++++++++++++++ tools/sdk/include/unity/unity_test_runner.h | 174 ++++ tools/sdk/include/vfs/esp_vfs.h | 6 + .../wifi_provisioning/manager.h | 553 +++++++++++ .../wifi_provisioning/scheme_ble.h | 82 ++ .../wifi_provisioning/scheme_console.h | 34 + .../wifi_provisioning/scheme_softap.h | 47 + .../wifi_provisioning/wifi_scan.h | 166 ++++ .../wpa_supplicant/wpa2/eap_peer/eap_i.h | 13 +- tools/sdk/ld/esp32.common.ld | 343 ------- tools/sdk/ld/esp32.ld | 2 +- tools/sdk/ld/esp32.project.ld | 620 ++++++++++++ .../sdk/ld/esp32.spiram.rom-functions-dram.ld | 143 --- .../sdk/ld/esp32.spiram.rom-functions-iram.ld | 140 --- tools/sdk/ld/esp32_out.ld | 2 +- tools/sdk/ld/wifi_iram.ld | 4 - tools/sdk/lib/libapp_trace.a | Bin 23392 -> 23396 bytes tools/sdk/lib/libapp_update.a | Bin 53622 -> 84584 bytes tools/sdk/lib/libasio.a | Bin 2005368 -> 2005940 bytes tools/sdk/lib/libbootloader_support.a | Bin 314066 -> 309790 bytes tools/sdk/lib/libbt.a | Bin 13168296 -> 13189838 bytes tools/sdk/lib/libbtdm_app.a | Bin 379068 -> 390608 bytes tools/sdk/lib/libcoap.a | Bin 461522 -> 461522 bytes tools/sdk/lib/libcoexist.a | Bin 62032 -> 62424 bytes tools/sdk/lib/libconsole.a | Bin 402520 -> 403052 bytes tools/sdk/lib/libcore.a | Bin 11844 -> 6942 bytes tools/sdk/lib/libcxx.a | Bin 64392 -> 64392 bytes tools/sdk/lib/libdl_lib.a | Bin 775816 -> 1484640 bytes tools/sdk/lib/libdriver.a | Bin 2481178 -> 2534398 bytes tools/sdk/lib/libefuse.a | Bin 0 -> 134396 bytes tools/sdk/lib/libesp-tls.a | Bin 80712 -> 82452 bytes tools/sdk/lib/libesp32-camera.a | Bin 620514 -> 626730 bytes tools/sdk/lib/libesp32.a | Bin 1354082 -> 1399146 bytes tools/sdk/lib/libesp_adc_cal.a | Bin 40168 -> 40168 bytes tools/sdk/lib/libesp_event.a | Bin 89594 -> 96818 bytes tools/sdk/lib/libesp_http_client.a | Bin 185878 -> 194510 bytes tools/sdk/lib/libesp_http_server.a | Bin 263204 -> 278748 bytes tools/sdk/lib/libesp_https_ota.a | Bin 20990 -> 44838 bytes tools/sdk/lib/libesp_https_server.a | Bin 0 -> 33476 bytes tools/sdk/lib/libesp_ringbuf.a | Bin 118552 -> 118572 bytes tools/sdk/lib/libespcoredump.a | Bin 0 -> 20876 bytes tools/sdk/lib/libespnow.a | Bin 46778 -> 46778 bytes tools/sdk/lib/libethernet.a | Bin 182758 -> 183654 bytes tools/sdk/lib/libexpat.a | Bin 1219570 -> 1220122 bytes tools/sdk/lib/libface_detection.a | Bin 72260 -> 152668 bytes tools/sdk/lib/libface_recognition.a | Bin 87948 -> 137020 bytes tools/sdk/lib/libfatfs.a | Bin 457564 -> 469232 bytes tools/sdk/lib/libfb_gfx.a | Bin 22972 -> 22972 bytes tools/sdk/lib/libfd.a | Bin 1092162 -> 1220080 bytes tools/sdk/lib/libfr.a | Bin 7049042 -> 14747610 bytes tools/sdk/lib/libfreemodbus.a | Bin 249952 -> 249976 bytes tools/sdk/lib/libfreertos.a | Bin 541580 -> 541188 bytes tools/sdk/lib/libheap.a | Bin 232422 -> 240578 bytes tools/sdk/lib/libimage_util.a | Bin 63478 -> 170878 bytes tools/sdk/lib/libjsmn.a | Bin 21818 -> 21818 bytes tools/sdk/lib/libjson.a | Bin 304226 -> 304226 bytes tools/sdk/lib/liblibsodium.a | Bin 1826584 -> 1826584 bytes tools/sdk/lib/liblog.a | Bin 40924 -> 41636 bytes tools/sdk/lib/liblwip.a | Bin 3315688 -> 3331350 bytes tools/sdk/lib/libmbedtls.a | Bin 3459180 -> 3570060 bytes tools/sdk/lib/libmdns.a | Bin 683504 -> 685000 bytes tools/sdk/lib/libmesh.a | Bin 947578 -> 946006 bytes tools/sdk/lib/libmicro-ecc.a | Bin 155456 -> 155456 bytes tools/sdk/lib/libmqtt.a | Bin 222380 -> 233214 bytes tools/sdk/lib/libnet80211.a | Bin 989744 -> 1072336 bytes tools/sdk/lib/libnewlib.a | Bin 131182 -> 141352 bytes tools/sdk/lib/libnghttp.a | Bin 1565326 -> 1568098 bytes tools/sdk/lib/libnvs_flash.a | Bin 845000 -> 845956 bytes tools/sdk/lib/libod.a | Bin 0 -> 1251694 bytes tools/sdk/lib/libopenssl.a | Bin 290112 -> 290116 bytes tools/sdk/lib/libphy.a | Bin 503548 -> 529234 bytes tools/sdk/lib/libpp.a | Bin 496318 -> 503678 bytes tools/sdk/lib/libprotobuf-c.a | Bin 329390 -> 329390 bytes tools/sdk/lib/libprotocomm.a | Bin 441402 -> 441522 bytes tools/sdk/lib/libpthread.a | Bin 118870 -> 124166 bytes tools/sdk/lib/libsdmmc.a | Bin 257532 -> 257532 bytes tools/sdk/lib/libsmartconfig.a | Bin 108030 -> 108022 bytes tools/sdk/lib/libsmartconfig_ack.a | Bin 22666 -> 22506 bytes tools/sdk/lib/libsoc.a | Bin 235434 -> 236490 bytes tools/sdk/lib/libspi_flash.a | Bin 214692 -> 223950 bytes tools/sdk/lib/libspiffs.a | Bin 587430 -> 592010 bytes tools/sdk/lib/libtcp_transport.a | Bin 156182 -> 157634 bytes tools/sdk/lib/libtcpip_adapter.a | Bin 135352 -> 135812 bytes tools/sdk/lib/libulp.a | Bin 38022 -> 38006 bytes tools/sdk/lib/libunity.a | Bin 0 -> 174798 bytes tools/sdk/lib/libvfs.a | Bin 244094 -> 250072 bytes tools/sdk/lib/libwear_levelling.a | Bin 237860 -> 237964 bytes tools/sdk/lib/libwifi_provisioning.a | Bin 148730 -> 533596 bytes tools/sdk/lib/libwpa.a | Bin 161476 -> 161496 bytes tools/sdk/lib/libwpa2.a | Bin 30216 -> 30220 bytes tools/sdk/lib/libwpa_supplicant.a | Bin 3120678 -> 3120174 bytes tools/sdk/lib/libwps.a | Bin 71936 -> 71908 bytes tools/sdk/lib/libxtensa-debug-module.a | Bin 12438 -> 12438 bytes tools/sdk/sdkconfig | 98 +- 282 files changed, 13004 insertions(+), 4377 deletions(-) create mode 100644 tools/sdk/include/bootloader_support/bootloader_flash_config.h delete mode 100644 tools/sdk/include/bootloader_support/esp_efuse.h create mode 100644 tools/sdk/include/efuse/esp_efuse.h create mode 100644 tools/sdk/include/efuse/esp_efuse_table.h create mode 100644 tools/sdk/include/esp-face/lssh.h delete mode 100644 tools/sdk/include/esp32/esp_core_dump.h create mode 100644 tools/sdk/include/esp_https_server/esp_https_server.h create mode 100644 tools/sdk/include/espcoredump/esp_core_dump.h create mode 100644 tools/sdk/include/lwip/esp_sntp.h create mode 100644 tools/sdk/include/lwip/sntp.h create mode 100644 tools/sdk/include/lwip/sntp/sntp.h create mode 100644 tools/sdk/include/mqtt/mqtt_supported_features.h create mode 100644 tools/sdk/include/tcpip_adapter/tcpip_adapter_internal.h create mode 100644 tools/sdk/include/unity/unity.h create mode 100644 tools/sdk/include/unity/unity_config.h create mode 100644 tools/sdk/include/unity/unity_internals.h create mode 100644 tools/sdk/include/unity/unity_test_runner.h create mode 100644 tools/sdk/include/wifi_provisioning/wifi_provisioning/manager.h create mode 100644 tools/sdk/include/wifi_provisioning/wifi_provisioning/scheme_ble.h create mode 100644 tools/sdk/include/wifi_provisioning/wifi_provisioning/scheme_console.h create mode 100644 tools/sdk/include/wifi_provisioning/wifi_provisioning/scheme_softap.h create mode 100644 tools/sdk/include/wifi_provisioning/wifi_provisioning/wifi_scan.h delete mode 100644 tools/sdk/ld/esp32.common.ld create mode 100644 tools/sdk/ld/esp32.project.ld delete mode 100644 tools/sdk/ld/esp32.spiram.rom-functions-dram.ld delete mode 100644 tools/sdk/ld/esp32.spiram.rom-functions-iram.ld delete mode 100644 tools/sdk/ld/wifi_iram.ld create mode 100644 tools/sdk/lib/libefuse.a create mode 100644 tools/sdk/lib/libesp_https_server.a create mode 100644 tools/sdk/lib/libespcoredump.a create mode 100644 tools/sdk/lib/libod.a create mode 100644 tools/sdk/lib/libunity.a diff --git a/platform.txt b/platform.txt index aad26366..6583ee77 100644 --- a/platform.txt +++ b/platform.txt @@ -22,7 +22,7 @@ compiler.warning_flags.all=-Wall -Werror=all -Wextra compiler.path={runtime.tools.xtensa-esp32-elf-gcc.path}/bin/ compiler.sdk.path={runtime.platform.path}/tools/sdk -compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/app_trace" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/asio" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/esp_adc_cal" "-I{compiler.sdk.path}/include/esp_event" "-I{compiler.sdk.path}/include/esp_http_client" "-I{compiler.sdk.path}/include/esp_http_server" "-I{compiler.sdk.path}/include/esp_https_ota" "-I{compiler.sdk.path}/include/esp_ringbuf" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freemodbus" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/heap" "-I{compiler.sdk.path}/include/idf_test" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/libsodium" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/lwip" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/micro-ecc" "-I{compiler.sdk.path}/include/mqtt" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/protobuf-c" "-I{compiler.sdk.path}/include/protocomm" "-I{compiler.sdk.path}/include/pthread" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/smartconfig_ack" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/spiffs" "-I{compiler.sdk.path}/include/tcp_transport" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/wear_levelling" "-I{compiler.sdk.path}/include/wifi_provisioning" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/esp32-camera" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/fb_gfx" +compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/app_trace" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/asio" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/efuse" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/esp_adc_cal" "-I{compiler.sdk.path}/include/esp_event" "-I{compiler.sdk.path}/include/esp_http_client" "-I{compiler.sdk.path}/include/esp_http_server" "-I{compiler.sdk.path}/include/esp_https_ota" "-I{compiler.sdk.path}/include/esp_https_server" "-I{compiler.sdk.path}/include/esp_ringbuf" "-I{compiler.sdk.path}/include/espcoredump" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freemodbus" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/heap" "-I{compiler.sdk.path}/include/idf_test" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/libsodium" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/lwip" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/micro-ecc" "-I{compiler.sdk.path}/include/mqtt" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/nimble" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/protobuf-c" "-I{compiler.sdk.path}/include/protocomm" "-I{compiler.sdk.path}/include/pthread" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/smartconfig_ack" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/spiffs" "-I{compiler.sdk.path}/include/tcp_transport" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/unity" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/wear_levelling" "-I{compiler.sdk.path}/include/wifi_provisioning" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/esp32-camera" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/fb_gfx" compiler.c.cmd=xtensa-esp32-elf-gcc compiler.c.flags=-std=gnu99 -Os -g3 -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wpointer-arith {compiler.warning_flags} -Wno-maybe-uninitialized -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -MMD -c @@ -34,8 +34,8 @@ compiler.S.cmd=xtensa-esp32-elf-gcc compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls compiler.c.elf.cmd=xtensa-esp32-elf-gcc -compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception -compiler.c.elf.libs=-lgcc -lesp32 -lphy -lesp_http_client -lmbedtls -lrtc -lesp_http_server -lbtdm_app -lspiffs -lbootloader_support -lmdns -lnvs_flash -lfatfs -lpp -lnet80211 -ljsmn -lface_detection -llibsodium -lvfs -ldl_lib -llog -lfreertos -lcxx -lsmartconfig_ack -lxtensa-debug-module -lheap -ltcpip_adapter -lmqtt -lulp -lfd -lfb_gfx -lnghttp -lprotocomm -lsmartconfig -lm -lethernet -limage_util -lc_nano -lsoc -ltcp_transport -lc -lmicro-ecc -lface_recognition -ljson -lwpa_supplicant -lmesh -lesp_https_ota -lwpa2 -lexpat -llwip -lwear_levelling -lapp_update -ldriver -lbt -lespnow -lcoap -lasio -lnewlib -lconsole -lapp_trace -lesp32-camera -lhal -lprotobuf-c -lsdmmc -lcore -lpthread -lcoexist -lfreemodbus -lspi_flash -lesp-tls -lwpa -lwifi_provisioning -lwps -lesp_adc_cal -lesp_event -lopenssl -lesp_ringbuf -lfr -lstdc++ +compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception +compiler.c.elf.libs=-lgcc -lfreertos -lmesh -lod -lwear_levelling -lfb_gfx -lesp_adc_cal -lc_nano -lesp32 -ldriver -lhal -ljsmn -lsmartconfig -lesp_http_server -lprotocomm -lface_recognition -lespnow -ltcpip_adapter -lface_detection -lunity -lc -llibsodium -lesp_http_client -lapp_update -lnewlib -lcxx -ltcp_transport -lm -lefuse -lopenssl -lwifi_provisioning -lespcoredump -llog -lmbedtls -lesp_ringbuf -lwps -lnet80211 -lmqtt -lesp_https_server -lapp_trace -lesp_event -lesp32-camera -lsoc -lheap -llwip -lwpa -lrtc -lxtensa-debug-module -lspi_flash -lphy -lfr -lconsole -lcoap -lbtdm_app -lsdmmc -lfd -lmicro-ecc -ljson -lcore -lprotobuf-c -lethernet -lspiffs -lnvs_flash -lwpa_supplicant -lvfs -lasio -lwpa2 -lpp -lbootloader_support -limage_util -ldl_lib -lulp -lnghttp -lpthread -lfreemodbus -lexpat -lfatfs -lsmartconfig_ack -lmdns -lcoexist -lesp-tls -lesp_https_ota -lbt -lstdc++ compiler.as.cmd=xtensa-esp32-elf-as diff --git a/tools/esptool.py b/tools/esptool.py index d6ceb6f9..c68e6fc1 100755 --- a/tools/esptool.py +++ b/tools/esptool.py @@ -60,7 +60,7 @@ except ImportError: "Check the README for installation instructions." % (sys.VERSION, sys.executable)) raise -__version__ = "2.8-dev" +__version__ = "2.8" MAX_UINT32 = 0xffffffff MAX_UINT24 = 0xffffff @@ -1904,7 +1904,8 @@ class ESP32FirmwareImage(BaseFirmwareImage): chip_id = fields[4] if chip_id != self.ROM_LOADER.IMAGE_CHIP_ID: - print("Unexpected chip id in image. Expected %d but value was %d. Is this image for a different chip model?" % (self.ROM_LOADER.IMAGE_CHIP_ID, chip_id)) + print(("Unexpected chip id in image. Expected %d but value was %d. " + + "Is this image for a different chip model?") % (self.ROM_LOADER.IMAGE_CHIP_ID, chip_id)) # reserved fields in the middle should all be zero if any(f for f in fields[6:-1] if f != 0): @@ -1916,7 +1917,6 @@ class ESP32FirmwareImage(BaseFirmwareImage): else: raise RuntimeError("Invalid value for append_digest field (0x%02x). Should be 0 or 1.", append_digest) - def save_extended_header(self, save_file): def join_byte(ln,hn): return (ln & 0x0F) + ((hn & 0x0F) << 4) diff --git a/tools/gen_esp32part.py b/tools/gen_esp32part.py index e3c8a6dc..17075074 100755 --- a/tools/gen_esp32part.py +++ b/tools/gen_esp32part.py @@ -29,36 +29,41 @@ import struct import sys import hashlib import binascii +import errno MAX_PARTITION_LENGTH = 0xC00 # 3K for partition data (96 entries) leaves 1K in a 4K sector for signature -MD5_PARTITION_BEGIN = b"\xEB\xEB" + b"\xFF" * 14 # The first 2 bytes are like magic numbers for MD5 sum +MD5_PARTITION_BEGIN = b"\xEB\xEB" + b"\xFF" * 14 # The first 2 bytes are like magic numbers for MD5 sum PARTITION_TABLE_SIZE = 0x1000 # Size of partition table +MIN_PARTITION_SUBTYPE_APP_OTA = 0x10 +NUM_PARTITION_SUBTYPE_APP_OTA = 16 + __version__ = '1.2' APP_TYPE = 0x00 DATA_TYPE = 0x01 TYPES = { - "app" : APP_TYPE, - "data" : DATA_TYPE, + "app": APP_TYPE, + "data": DATA_TYPE, } # Keep this map in sync with esp_partition_subtype_t enum in esp_partition.h SUBTYPES = { - APP_TYPE : { - "factory" : 0x00, - "test" : 0x20, + APP_TYPE: { + "factory": 0x00, + "test": 0x20, }, - DATA_TYPE : { - "ota" : 0x00, - "phy" : 0x01, - "nvs" : 0x02, - "coredump" : 0x03, - "nvs_keys" : 0x04, - "esphttpd" : 0x80, - "fat" : 0x81, - "spiffs" : 0x82, + DATA_TYPE: { + "ota": 0x00, + "phy": 0x01, + "nvs": 0x02, + "coredump": 0x03, + "nvs_keys": 0x04, + "efuse": 0x05, + "esphttpd": 0x80, + "fat": 0x81, + "spiffs": 0x82, }, } @@ -67,16 +72,19 @@ md5sum = True secure = False offset_part_table = 0 + def status(msg): """ Print status message to stderr """ if not quiet: critical(msg) + def critical(msg): """ Print critical message to stderr """ sys.stderr.write(msg) sys.stderr.write('\n') + class PartitionTable(list): def __init__(self): super(PartitionTable, self).__init__(self) @@ -98,15 +106,15 @@ class PartitionTable(list): if line.startswith("#") or len(line) == 0: continue try: - res.append(PartitionDefinition.from_csv(line, line_no+1)) + res.append(PartitionDefinition.from_csv(line, line_no + 1)) except InputError as e: - raise InputError("Error at line %d: %s" % (line_no+1, e)) + raise InputError("Error at line %d: %s" % (line_no + 1, e)) except Exception: - critical("Unexpected error parsing CSV line %d: %s" % (line_no+1, line)) + critical("Unexpected error parsing CSV line %d: %s" % (line_no + 1, line)) raise # fix up missing offsets & negative sizes - last_end = offset_part_table + PARTITION_TABLE_SIZE # first offset after partition table + last_end = offset_part_table + PARTITION_TABLE_SIZE # first offset after partition table for e in res: if e.offset is not None and e.offset < last_end: if e == res[0]: @@ -145,14 +153,14 @@ class PartitionTable(list): ptype = TYPES[ptype] except KeyError: try: - ptypes = int(ptype, 0) + ptype = int(ptype, 0) except TypeError: pass try: subtype = SUBTYPES[int(ptype)][subtype] except KeyError: try: - ptypes = int(ptype, 0) + ptype = int(ptype, 0) except TypeError: pass @@ -171,11 +179,11 @@ class PartitionTable(list): # verify each partition individually for p in self: p.verify() - + # check on duplicate name - names = [ p.name for p in self ] - duplicates = set( n for n in names if names.count(n) > 1 ) - + names = [p.name for p in self] + duplicates = set(n for n in names if names.count(n) > 1) + # print sorted duplicate partitions by name if len(duplicates) != 0: print("A list of partitions that have the same name:") @@ -183,14 +191,14 @@ class PartitionTable(list): if len(duplicates.intersection([p.name])) != 0: print("%s" % (p.to_csv())) raise InputError("Partition names must be unique") - + # check for overlaps last = None for p in sorted(self, key=lambda x:x.offset): if p.offset < offset_part_table + PARTITION_TABLE_SIZE: raise InputError("Partition offset 0x%x is below 0x%x" % (p.offset, offset_part_table + PARTITION_TABLE_SIZE)) if last is not None and p.offset < last.offset + last.size: - raise InputError("Partition at 0x%x overlaps 0x%x-0x%x" % (p.offset, last.offset, last.offset+last.size-1)) + raise InputError("Partition at 0x%x overlaps 0x%x-0x%x" % (p.offset, last.offset, last.offset + last.size - 1)) last = p def flash_size(self): @@ -205,17 +213,17 @@ class PartitionTable(list): @classmethod def from_binary(cls, b): - md5 = hashlib.md5(); + md5 = hashlib.md5() result = cls() for o in range(0,len(b),32): - data = b[o:o+32] + data = b[o:o + 32] if len(data) != 32: raise InputError("Partition table length must be a multiple of 32 bytes") - if data == b'\xFF'*32: + if data == b'\xFF' * 32: return result # got end marker - if md5sum and data[:2] == MD5_PARTITION_BEGIN[:2]: #check only the magic number part + if md5sum and data[:2] == MD5_PARTITION_BEGIN[:2]: # check only the magic number part if data[16:] == md5.digest(): - continue # the next iteration will check for the end marker + continue # the next iteration will check for the end marker else: raise InputError("MD5 checksums don't match! (computed: 0x%s, parsed: 0x%s)" % (md5.hexdigest(), binascii.hexlify(data[16:]))) else: @@ -227,34 +235,35 @@ class PartitionTable(list): result = b"".join(e.to_binary() for e in self) if md5sum: result += MD5_PARTITION_BEGIN + hashlib.md5(result).digest() - if len(result )>= MAX_PARTITION_LENGTH: + if len(result) >= MAX_PARTITION_LENGTH: raise InputError("Binary partition table length (%d) longer than max" % len(result)) result += b"\xFF" * (MAX_PARTITION_LENGTH - len(result)) # pad the sector, for signing return result def to_csv(self, simple_formatting=False): - rows = [ "# Espressif ESP32 Partition Table", - "# Name, Type, SubType, Offset, Size, Flags" ] - rows += [ x.to_csv(simple_formatting) for x in self ] + rows = ["# Espressif ESP32 Partition Table", + "# Name, Type, SubType, Offset, Size, Flags"] + rows += [x.to_csv(simple_formatting) for x in self] return "\n".join(rows) + "\n" + class PartitionDefinition(object): MAGIC_BYTES = b"\xAA\x50" ALIGNMENT = { - APP_TYPE : 0x10000, - DATA_TYPE : 0x04, + APP_TYPE: 0x10000, + DATA_TYPE: 0x04, } # dictionary maps flag name (as used in CSV flags list, property name) # to bit set in flags words in binary format FLAGS = { - "encrypted" : 0 + "encrypted": 0 } # add subtypes for the 16 OTA slot values ("ota_XX, etc.") - for ota_slot in range(16): - SUBTYPES[TYPES["app"]]["ota_%d" % ota_slot] = 0x10 + ota_slot + for ota_slot in range(NUM_PARTITION_SUBTYPE_APP_OTA): + SUBTYPES[TYPES["app"]]["ota_%d" % ota_slot] = MIN_PARTITION_SUBTYPE_APP_OTA + ota_slot def __init__(self): self.name = "" @@ -268,7 +277,7 @@ class PartitionDefinition(object): def from_csv(cls, line, line_no): """ Parse a line from the CSV """ line_w_defaults = line + ",,,," # lazy way to support default fields - fields = [ f.strip() for f in line_w_defaults.split(",") ] + fields = [f.strip() for f in line_w_defaults.split(",")] res = PartitionDefinition() res.line_no = line_no @@ -298,7 +307,7 @@ class PartitionDefinition(object): def maybe_hex(x): return "0x%x" % x if x is not None else "None" return "PartitionDefinition('%s', 0x%x, 0x%x, %s, %s)" % (self.name, self.type, self.subtype or 0, - maybe_hex(self.offset), maybe_hex(self.size)) + maybe_hex(self.offset), maybe_hex(self.size)) def __str__(self): return "Part '%s' %d/%d @ 0x%x size 0x%x" % (self.name, self.type, self.subtype, self.offset or -1, self.size or -1) @@ -325,7 +334,7 @@ class PartitionDefinition(object): def parse_subtype(self, strval): if strval == "": - return 0 # default + return 0 # default return parse_int(strval, SUBTYPES.get(self.type, {})) def parse_address(self, strval): @@ -349,12 +358,14 @@ class PartitionDefinition(object): raise ValidationError(self, "Size field is not set") if self.name in TYPES and TYPES.get(self.name, "") != self.type: - critical("WARNING: Partition has name '%s' which is a partition type, but does not match this partition's type (0x%x). Mistake in partition table?" % (self.name, self.type)) + critical("WARNING: Partition has name '%s' which is a partition type, but does not match this partition's " + "type (0x%x). Mistake in partition table?" % (self.name, self.type)) all_subtype_names = [] for names in (t.keys() for t in SUBTYPES.values()): all_subtype_names += names if self.name in all_subtype_names and SUBTYPES.get(self.type, {}).get(self.name, "") != self.subtype: - critical("WARNING: Partition has name '%s' which is a partition subtype, but this partition has non-matching type 0x%x and subtype 0x%x. Mistake in partition table?" % (self.name, self.type, self.subtype)) + critical("WARNING: Partition has name '%s' which is a partition subtype, but this partition has " + "non-matching type 0x%x and subtype 0x%x. Mistake in partition table?" % (self.name, self.type, self.subtype)) STRUCT_FORMAT = b"<2sBBLL16sL" @@ -365,21 +376,21 @@ class PartitionDefinition(object): res = cls() (magic, res.type, res.subtype, res.offset, res.size, res.name, flags) = struct.unpack(cls.STRUCT_FORMAT, b) - if b"\x00" in res.name: # strip null byte padding from name string + if b"\x00" in res.name: # strip null byte padding from name string res.name = res.name[:res.name.index(b"\x00")] res.name = res.name.decode() if magic != cls.MAGIC_BYTES: raise InputError("Invalid magic bytes (%r) for partition definition" % magic) for flag,bit in cls.FLAGS.items(): - if flags & (1<C*gFO`rHZaQk6Tm7#sfBWnrGGwwuMxhT@O1)i9DEz# zD}b*8zGlF)0!W7bwIHVgc&iw>B;Ldo?@NF#2_x6U=i0PjiURluPzhXk3^ZUPi)P_e zyp0HIN!DDN5^u|#8gHwDj|hYTx()K%@q&Cl{+2wURq!Ve_%%-^c0wlf&nhMEIZBT} zT)Me@k4u1Bz3%jEMZPr3oHPv^KH+-$5dA(!3lw?s=t&L}s}Y15e4s8VjyKhUe7=xg zr^?`@`bpKf7Mh7r8|ThY8ru!-bfs}ON@(Gt*s%Z`s!T>953zaNg#PM97CI)zGg{>t zbq$aH3Xfx$X_bYtF(yW3BG)j5BiD8W4CgsgnLd^u)i;X2oj**K2q07_gWpVtREX!X z9vo?z%x|Z^##$!xcWtM?j5ICf+v!iSCanKB(lUqNO)th;uzmsSU7tqK28s0Jhy<27 z8)Z}^ zPfqh)?t{qY(ur?Igcy&zGm094JFbD-uZA7v^`3nKp(iDh)7O@ z9sE|`%&tBY2A56ItE&W8&KOb|B!#Ag4%Qb|_Q@Qd1fqC$LO*`9){?X{Ob2TYE3KuZ z^{C(*f(pZD9zo=2RnC^5Raxe_a>ppsv?Ux&n1k3yOu=WuV5?k~9teXn;ww?e-4SkV zGKd{vxpjQ8eADQ04u3!~v7>ViGh2R{qKOU0#b$Gfx$CkE_0?sGsMpAcs+AI(Z6iO9 z*FUcpnzvfE%V3#(&81Ea**8w_)G+&+byM`^dKgQ*jx;>A$XUc%W;_D!iPqNVva_4U z;vn<4Iynb9@kxg1kEUO6H2A4zK#OK4r8Sggo48t5wF)?CLpVwzJ^&T4`dU)V@Nwni z!GVI^W4$+QnPs3gVHa1IJfGJ?4Hu)H-lLWimyJHB>0KA*6FU;=dPFsR0F4vYVHGXHRi{Gf z!f=_ERL+PmEf3G0v9@$>*j8o`q)XeU)3WgP=@!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cMb2yq(Qf!W)rj+q;N%UNV zRn0Gf_cU)!=a)1x7-P8IBuJ~!);^u{w^$z5OM3#X&l_&CCy$KbA#8v|x;KFDQuvMK zQKu{5`5wMR(HAfZ?k3n3&^i2(v{Q{rT}#7cug7mHgxg z*?CjI^KI0y`HWI@BhqkQ%O|96g{uwY{#G%IO8q$2{j^eSA~he99uxce)Vz*j^EY^D ztRFYg+@^RQQ_Sxv@a4<=2gPM7(tz8o@ON7_YrcdeTv_*^WjhPk9E&~KcweBvF5L;s z!zJ22HkQk4mt13f+9JLEXC-rLr8KGF%%l9@-dyq8UGKbg>7xrj{_sI@-P1ST|9?^v B^V9$U diff --git a/tools/sdk/bin/bootloader_qio_80m.bin b/tools/sdk/bin/bootloader_qio_80m.bin index 944f4947edf5a1186b77fa734d62a9ede153e890..9372befba7fb2a00541a2d89633aa3a52ce0ccd5 100644 GIT binary patch delta 8965 zcmZ`e3wRS%)^{dpJ4pvfOIu1GFiD%z77A&Bz66^hlmfaIRtt+LFH?cV6YCp z?m6e4d*@D9C9~ho>|eyR^6VByT*T}X9f~b+AMA`U{s7Nucs_;aOL#8q6lW@5AG#`& zkR-#cq8NCR1Zag@q9QEIu|o`LoTf+BkYsK_6=dpilU}Q93O|OSWM)T%s`qRMBEPgNjF*Jnz9|lJ5 z;kVICp%Ls~#QuTLWrHK>Cjko>+zDo*5B5YJ_#`+0*a1|>f1^$U%1oLf?oq&ynzftuI?ajz$Q)ycRLWsw{H;5X5 zcL&owFIuySOt&0<+o8=QM& zau*t_T^A6R7zIHIAi|b9o)Ma!q0eCG?9a41BVT9dcl1GQv()l(!X-9@l>14JE~1%r z^+~%$j*kXzo=xt;CwDQ4JIge)`aY?#m^2<2T)og?_@rZq94yP(a6^{menfm`ux{LP z4l=75b%bpCQy;h|ouzyFELM%SDG1qj_tn;Ew7dJn6$u6AI+nMxgDkcvm`+DNuK<5- zxT%Q}+})Cn9X#qNv*BizA~Yu(o5n?^FGYxsCxy+bY3Z!}bk zAaQqn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}SKON3pA-xX9UWPj(h}Af-u1_o!5^cra8{hVL*qc6bBIS0&kS z%>uEMGoK2<*C_MKkdTWr74Mz4YK;SG<87BWf@ABr#4pCQka-c` diff --git a/tools/sdk/bin/bootloader_qout_40m.bin b/tools/sdk/bin/bootloader_qout_40m.bin index 07a6be715c063be4b0156f385d0d7c13c88bed09..066559ee5728f15ae299b43abe284b8ab0da9768 100644 GIT binary patch delta 8894 zcmZuW4O~=J_V>LR;LY&V0RfQ@of#Me6dO?aN@FlZOxw^3U9&?7 zoO|xaGg%m$mDy9qbnxs}Mkr(65p1%pF(2;?GyDwY1e7nJd=2H?PT@ZJTO(Jc6Oy36 zSr7#!K@GL~rXUN+(674SD~KsOMhH*H!YX3m|4a;L-y{YO_|#BDQIruvRuF@V)B&$h z5)w6nTq7jP_GEj$;Z8>1p3z*$5Tft?r%cD+UnKe1xLI+<8-lNI)bylE82 z5_0SaF%V=0@wp#k`@aP<$hCsSPzdSl6tNd_<8PvvMTqHU!NPjb3HUd3h8R{cV!=u1 z(gd{}>g{@vfl>!$E0jHei-ocZ$^6m(gCf+0J)Nd@s9j+M z{&nL?IU$MHvI~iIirA?p7R6M))1rn}jiM)06h0iTi%dhp8LqP%(Z@NOA__N#CmXe_ zOs$^G_f|)S@Y*UEn9riIQXibDCb=S2Ph${j=B&|TU8~9(CDt`z4~<*^8v(GYOdFw2 zLu?wCc&(yXPZdEKPLc`xjg0)3jB!wCp`P~p16}s{aUh@n&Vf7t-#HKnoaabs+$ern z_b~nu{t)#dLW1J?_0%mvJdf?0LzMCSW_mS98P6Lx(|-?<=J2ibmmmq-KMzsv=9}n+ zAO+j!vAy?8N#St%x!(i|_kh}HgO>2Up9ctl9YUS_U(_)`8A)^a?Q9?4Vhfl#+`3Of zDNLJH_I-X^(5q-E1?}(y7LA`O8DF7!-)~{zZ(PIU);1KgC^Q{@bx_9I8bA%fyZxO; z1#-A;BGmZ5C}N>XGwvu1kHn9ub}&uD$Ci4kD`! z#|Y~5>HwH0m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?edwU~wdGZ_cdRh08zWe8Y#HN_X z`T22hQf2vc_y58%*v!kfmKs@)PTpENpRJ3R50;w8c{KjBEO}9z0*)KyuSyqdJP}`C zURgTJc;rP3s#y0PxoLr$HE)+^FT5qM&Q6@?LJpVB-GXEI4Jj$?9W-=ON9R-St>k37 zyG3yg8tR<#frVRHk5e{X_r1 zza}acqv-xhIa#&_-yklBgXSS*oE-#&7M)mDP~UodP$Y_FRCUdeHVc5TF>m# z@@a6ogpaYrlnjR!+K7ruZh%^JE}Rpkm#1`0~?eFH}Xw@>+|D3d;o zEhU`s&jI*yWLy>yvN6i&7M$6hh&3Kj8}Gcb5gc2?HKiom9FC@x6q{qXDPJwwPrYb=lGrRM`}&l*nBV$w=14U74v%veEBlJs<=#r8gRP}{%*@=&6kjbD{B*4wzF`}vDlN1_XVcgrF&p` zxJ270#&UV>vTKabao5zWn6>#!;nSNuh4BZ^+_3w=sp8VX$C_?Ed+V!*S~h?8A6Mt` Aw*UYD diff --git a/tools/sdk/bin/bootloader_qout_80m.bin b/tools/sdk/bin/bootloader_qout_80m.bin index 8cfb0c2529efdd97f35f3226b5c76c8f5ee5d87a..d4b6fe86c8380f432714c1bbb6fa3bec49b434a6 100644 GIT binary patch delta 8965 zcmZ`e4_s7L*7v;`;LY&V0RfRe`etAdP;@{AB#proQENlD&^60{4WVnBxwe_vH*?35 z0cn@vS%T>{GdhYUrBG^?yI`%UVWsxR-L%YY%v?)X-5F+pdEYs22GsWZ=J$JZ?>YDU zyXTyH?tS-NuV(hznY{~{HlE$chzprLqC>GU;lpiF#vkB00ncafdBDvpCEMSxbgB`P9v3@a`MiW3$dBZMbp?s{V6Unjg)X zcNFL+j2IVXOi_YUM!`dXO5l12!2k}j=pb=Fx182GRlZZaf(F{qv zIWXOH(?AmtYUb?mQvGg?Jx;3Mj1ro-5H<#2 z%|cy_kcHSRF7)RVehu}?5YJ=(R{zLIzLs7KkBsEawe+X{p_%+{`eS$q`#I}aAYjq?nX>a$+INCB7XC&wF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7^Sb)4^L0I*{NGvGXyg16H>eoHR#o>w4A!`V{(ob7!nXz2^` z+jzbAEiAGuP^|R0i1%Qy``s9?uj>rf0p>;d^Vyb3n}Xh%0m}{O(q9xf;{FTHs_KnZ z&Y5$YZ5ktW#po-s#@EN3dL=gSQfz&;`=ywrkfEMfW679P9kBsVZ2dI1C*~^{*6oW8 z?2W-)aBs{zMSgQm59>YBd;i>z*bK{_ivUSPw zfilY&pC)*gB`;|+z;BcMW!YklFBa%6D9>UUpS)yq~`+{(CR^EKb;EG7Ph`djsu^>Sv# z>x{4W!-^dmV{#t3;V!&FZAz+?!?tQ%ddrjKmPIucM_s8sF0IE^PandY?}x4@_&pfR zdU_wq$@wttH!MkT?;qjv<@6S82OBx^O^X+$uZpub53`rc9gBq}m8d;r+7K}hb2|^w^b%5eHVgnWjl9i z`Aj&m!UtYrPKSdK{UbI{<n_H4T`~)A z{z-O-Z<~vyKSv{QwsAM8PUvY@2w%Y7&~Wl~Kayy8QEliLZFn(M_dR^qq8=Q7oil!& zgd1No-K$1qQ-av866cH%C3M^l*$QKoII+0bC%{js;MNhadv(Zi9!$fC>ONG8Z$uc* z>HG=C$Kk5P_`X(rqEbJOt!q_E%%tWc(qm>1O)Kaqsrw2&svkGe*QR(MQ{bi!U($TP zQ#@u3oB=nr!oTnGSj$BO;i~!tT6VHo{Zf80O2bV?EnA( diff --git a/tools/sdk/include/app_trace/esp_app_trace.h b/tools/sdk/include/app_trace/esp_app_trace.h index dbac4f47..a623ada7 100644 --- a/tools/sdk/include/app_trace/esp_app_trace.h +++ b/tools/sdk/include/app_trace/esp_app_trace.h @@ -51,7 +51,7 @@ void esp_apptrace_down_buffer_config(uint8_t *buf, uint32_t size); * * @param dest Indicates HW interface to send data. * @param size Size of data to write to trace buffer. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. + * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely. * * @return non-NULL on success, otherwise NULL. */ @@ -63,7 +63,7 @@ uint8_t *esp_apptrace_buffer_get(esp_apptrace_dest_t dest, uint32_t size, uint32 * * @param dest Indicates HW interface to send data. Should be identical to the same parameter in call to esp_apptrace_buffer_get. * @param ptr Address of trace buffer to release. Should be the value returned by call to esp_apptrace_buffer_get. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. + * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely. * * @return ESP_OK on success, otherwise see esp_err_t */ @@ -75,7 +75,7 @@ esp_err_t esp_apptrace_buffer_put(esp_apptrace_dest_t dest, uint8_t *ptr, uint32 * @param dest Indicates HW interface to send data. * @param data Address of data to write to trace buffer. * @param size Size of data to write to trace buffer. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. + * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely. * * @return ESP_OK on success, otherwise see esp_err_t */ @@ -85,7 +85,7 @@ esp_err_t esp_apptrace_write(esp_apptrace_dest_t dest, const void *data, uint32_ * @brief vprintf-like function to sent log messages to host via specified HW interface. * * @param dest Indicates HW interface to send data. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. + * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely. * @param fmt Address of format string. * @param ap List of arguments. * @@ -107,7 +107,7 @@ int esp_apptrace_vprintf(const char *fmt, va_list ap); * @brief Flushes remaining data in trace buffer to host. * * @param dest Indicates HW interface to flush data on. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. + * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely. * * @return ESP_OK on success, otherwise see esp_err_t */ @@ -119,7 +119,7 @@ esp_err_t esp_apptrace_flush(esp_apptrace_dest_t dest, uint32_t tmo); * * @param dest Indicates HW interface to flush data on. * @param min_sz Threshold for flushing data. If current filling level is above this value, data will be flushed. TRAX destinations only. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. + * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely. * * @return ESP_OK on success, otherwise see esp_err_t */ @@ -131,31 +131,31 @@ esp_err_t esp_apptrace_flush_nolock(esp_apptrace_dest_t dest, uint32_t min_sz, u * @param dest Indicates HW interface to read the data on. * @param data Address of buffer to put data from trace buffer. * @param size Pointer to store size of read data. Before call to this function pointed memory must hold requested size of data - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. + * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely. * * @return ESP_OK on success, otherwise see esp_err_t */ esp_err_t esp_apptrace_read(esp_apptrace_dest_t dest, void *data, uint32_t *size, uint32_t tmo); /** - * @brief Rertrieves incoming data buffer if any. + * @brief Retrieves incoming data buffer if any. * After data in buffer are processed esp_apptrace_down_buffer_put must be called to indicate it. * * @param dest Indicates HW interface to receive data. - * @param size Address to store size of available data in down buffer. Must be initializaed with requested value. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. + * @param size Address to store size of available data in down buffer. Must be initialized with requested value. + * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely. * * @return non-NULL on success, otherwise NULL. */ uint8_t *esp_apptrace_down_buffer_get(esp_apptrace_dest_t dest, uint32_t *size, uint32_t tmo); /** - * @brief Indicates that the data in down buffer are processesd. + * @brief Indicates that the data in down buffer are processed. * This function is a counterpart of and must be preceeded by esp_apptrace_down_buffer_get. * * @param dest Indicates HW interface to receive data. Should be identical to the same parameter in call to esp_apptrace_down_buffer_get. * @param ptr Address of trace buffer to release. Should be the value returned by call to esp_apptrace_down_buffer_get. - * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly. + * @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely. * * @return ESP_OK on success, otherwise see esp_err_t */ @@ -247,7 +247,7 @@ int esp_apptrace_ftell(esp_apptrace_dest_t dest, void *stream); /** * @brief Indicates to the host that all file operations are completed. - * This function should be called after all file operations are finished and + * This function should be called after all file operations are finished and * indicate to the host that it can perform cleanup operations (close open files etc.). * * @param dest Indicates HW interface to use. diff --git a/tools/sdk/include/app_update/esp_ota_ops.h b/tools/sdk/include/app_update/esp_ota_ops.h index ca77b542..63514463 100644 --- a/tools/sdk/include/app_update/esp_ota_ops.h +++ b/tools/sdk/include/app_update/esp_ota_ops.h @@ -20,6 +20,8 @@ #include #include "esp_err.h" #include "esp_partition.h" +#include "esp_image_format.h" +#include "esp_flash_data_types.h" #ifdef __cplusplus extern "C" @@ -32,6 +34,10 @@ extern "C" #define ESP_ERR_OTA_PARTITION_CONFLICT (ESP_ERR_OTA_BASE + 0x01) /*!< Error if request was to write or erase the current running partition */ #define ESP_ERR_OTA_SELECT_INFO_INVALID (ESP_ERR_OTA_BASE + 0x02) /*!< Error if OTA data partition contains invalid content */ #define ESP_ERR_OTA_VALIDATE_FAILED (ESP_ERR_OTA_BASE + 0x03) /*!< Error if OTA app image is invalid */ +#define ESP_ERR_OTA_SMALL_SEC_VER (ESP_ERR_OTA_BASE + 0x04) /*!< Error if the firmware has a secure version less than the running firmware. */ +#define ESP_ERR_OTA_ROLLBACK_FAILED (ESP_ERR_OTA_BASE + 0x05) /*!< Error if flash does not have valid firmware in passive partition and hence rollback is not possible */ +#define ESP_ERR_OTA_ROLLBACK_INVALID_STATE (ESP_ERR_OTA_BASE + 0x06) /*!< Error if current active firmware is still marked in pending validation state (ESP_OTA_IMG_PENDING_VERIFY), essentially first boot of firmware image post upgrade and hence firmware upgrade is not possible */ + /** * @brief Opaque handle for an application OTA update @@ -41,6 +47,24 @@ extern "C" */ typedef uint32_t esp_ota_handle_t; +/** + * @brief Return esp_app_desc structure. This structure includes app version. + * + * Return description for running app. + * @return Pointer to esp_app_desc structure. + */ +const esp_app_desc_t *esp_ota_get_app_description(void); + +/** + * @brief Fill the provided buffer with SHA256 of the ELF file, formatted as hexadecimal, null-terminated. + * If the buffer size is not sufficient to fit the entire SHA256 in hex plus a null terminator, + * the largest possible number of bytes will be written followed by a null. + * @param dst Destination buffer + * @param size Size of the buffer + * @return Number of bytes written to dst (including null terminator) + */ +int esp_ota_get_app_elf_sha256(char* dst, size_t size); + /** * @brief Commence an OTA update writing to the specified partition. @@ -52,6 +76,10 @@ typedef uint32_t esp_ota_handle_t; * On success, this function allocates memory that remains in use * until esp_ota_end() is called with the returned handle. * + * Note: If the rollback option is enabled and the running application has the ESP_OTA_IMG_PENDING_VERIFY state then + * it will lead to the ESP_ERR_OTA_ROLLBACK_INVALID_STATE error. Confirm the running app before to run download a new app, + * use esp_ota_mark_app_valid_cancel_rollback() function for it (this should be done as early as possible when you first download a new application). + * * @param partition Pointer to info for partition which will receive the OTA update. Required. * @param image_size Size of new OTA app image. Partition will be erased in order to receive this size of image. If 0 or OTA_SIZE_UNKNOWN, the entire partition is erased. * @param out_handle On success, returns a handle which should be used for subsequent esp_ota_write() and esp_ota_end() calls. @@ -65,6 +93,7 @@ typedef uint32_t esp_ota_handle_t; * - ESP_ERR_OTA_SELECT_INFO_INVALID: The OTA data partition contains invalid data. * - ESP_ERR_INVALID_SIZE: Partition doesn't fit in configured flash size. * - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed. + * - ESP_ERR_OTA_ROLLBACK_INVALID_STATE: If the running app has not confirmed state. Before performing an update, the application must be valid. */ esp_err_t esp_ota_begin(const esp_partition_t* partition, size_t image_size, esp_ota_handle_t* out_handle); @@ -170,6 +199,83 @@ const esp_partition_t* esp_ota_get_running_partition(void); */ const esp_partition_t* esp_ota_get_next_update_partition(const esp_partition_t *start_from); +/** + * @brief Returns esp_app_desc structure for app partition. This structure includes app version. + * + * Returns a description for the requested app partition. + * @param[in] partition Pointer to app partition. (only app partition) + * @param[out] app_desc Structure of info about app. + * @return + * - ESP_OK Successful. + * - ESP_ERR_NOT_FOUND app_desc structure is not found. Magic word is incorrect. + * - ESP_ERR_NOT_SUPPORTED Partition is not application. + * - ESP_ERR_INVALID_ARG Arguments is NULL or if partition's offset exceeds partition size. + * - ESP_ERR_INVALID_SIZE Read would go out of bounds of the partition. + * - or one of error codes from lower-level flash driver. + */ +esp_err_t esp_ota_get_partition_description(const esp_partition_t *partition, esp_app_desc_t *app_desc); + +/** + * @brief This function is called to indicate that the running app is working well. + * + * @return + * - ESP_OK: if successful. + */ +esp_err_t esp_ota_mark_app_valid_cancel_rollback(); + +/** + * @brief This function is called to roll back to the previously workable app with reboot. + * + * If rollback is successful then device will reset else API will return with error code. + * Checks applications on a flash drive that can be booted in case of rollback. + * If the flash does not have at least one app (except the running app) then rollback is not possible. + * @return + * - ESP_FAIL: if not successful. + * - ESP_ERR_OTA_ROLLBACK_FAILED: The rollback is not possible due to flash does not have any apps. + */ +esp_err_t esp_ota_mark_app_invalid_rollback_and_reboot(); + +/** + * @brief Returns last partition with invalid state (ESP_OTA_IMG_INVALID or ESP_OTA_IMG_ABORTED). + * + * @return partition. + */ +const esp_partition_t* esp_ota_get_last_invalid_partition(); + +/** + * @brief Returns state for given partition. + * + * @param[in] partition Pointer to partition. + * @param[out] ota_state state of partition (if this partition has a record in otadata). + * @return + * - ESP_OK: Successful. + * - ESP_ERR_INVALID_ARG: partition or ota_state arguments were NULL. + * - ESP_ERR_NOT_SUPPORTED: partition is not ota. + * - ESP_ERR_NOT_FOUND: Partition table does not have otadata or state was not found for given partition. + */ +esp_err_t esp_ota_get_state_partition(const esp_partition_t *partition, esp_ota_img_states_t *ota_state); + +/** + * @brief Erase previous boot app partition and corresponding otadata select for this partition. + * + * When current app is marked to as valid then you can erase previous app partition. + * @return + * - ESP_OK: Successful, otherwise ESP_ERR. + */ +esp_err_t esp_ota_erase_last_boot_app_partition(void); + +/** + * @brief Checks applications on the slots which can be booted in case of rollback. + * + * These applications should be valid (marked in otadata as not UNDEFINED, INVALID or ABORTED and crc is good) and be able booted, + * and secure_version of app >= secure_version of efuse (if anti-rollback is enabled). + * + * @return + * - True: Returns true if the slots have at least one app (except the running app). + * - False: The rollback is not possible. + */ +bool esp_ota_check_rollback_is_possible(void); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/include/bootloader_support/bootloader_common.h b/tools/sdk/include/bootloader_support/bootloader_common.h index e884856f..a948adbe 100644 --- a/tools/sdk/include/bootloader_support/bootloader_common.h +++ b/tools/sdk/include/bootloader_support/bootloader_common.h @@ -15,6 +15,7 @@ #pragma once #include "esp_flash_data_types.h" #include "esp_image_format.h" +#include "esp_image_format.h" /// Type of hold a GPIO in low state typedef enum { @@ -23,22 +24,35 @@ typedef enum { GPIO_NOT_HOLD = 0 /*!< If the GPIO input is not low */ } esp_comm_gpio_hold_t; +typedef enum { + ESP_IMAGE_BOOTLOADER, + ESP_IMAGE_APPLICATION +} esp_image_type; + /** - * @brief Calculate crc for the OTA data partition. + * @brief Calculate crc for the OTA data select. * - * @param[in] ota_data The OTA data partition. + * @param[in] s The OTA data select. * @return Returns crc value. */ uint32_t bootloader_common_ota_select_crc(const esp_ota_select_entry_t *s); /** - * @brief Verifies the validity of the OTA data partition + * @brief Verifies the validity of the OTA data select * - * @param[in] ota_data The OTA data partition. + * @param[in] s The OTA data select. * @return Returns true on valid, false otherwise. */ bool bootloader_common_ota_select_valid(const esp_ota_select_entry_t *s); +/** + * @brief Returns true if OTADATA is not marked as bootable partition. + * + * @param[in] s The OTA data select. + * @return Returns true if OTADATA invalid, false otherwise. + */ +bool bootloader_common_ota_select_invalid(const esp_ota_select_entry_t *s); + /** * @brief Check if the GPIO input is a long hold or a short hold. * @@ -93,26 +107,61 @@ bool bootloader_common_label_search(const char *list, char *label); */ esp_err_t bootloader_common_get_sha256_of_partition(uint32_t address, uint32_t size, int type, uint8_t *out_sha_256); +/** + * @brief Returns the number of active otadata. + * + * @param[in] two_otadata Pointer on array from two otadata structures. + * + * @return The number of active otadata (0 or 1). + * - -1: If it does not have active otadata. + */ +int bootloader_common_get_active_otadata(esp_ota_select_entry_t *two_otadata); + +/** + * @brief Returns the number of active otadata. + * + * @param[in] two_otadata Pointer on array from two otadata structures. + * @param[in] valid_two_otadata Pointer on array from two bools. True means select. + * @param[in] max True - will select the maximum ota_seq number, otherwise the minimum. + * + * @return The number of active otadata (0 or 1). + * - -1: If it does not have active otadata. + */ +int bootloader_common_select_otadata(const esp_ota_select_entry_t *two_otadata, bool *valid_two_otadata, bool max); + +/** + * @brief Returns esp_app_desc structure for app partition. This structure includes app version. + * + * Returns a description for the requested app partition. + * @param[in] partition App partition description. + * @param[out] app_desc Structure of info about app. + * @return + * - ESP_OK: Successful. + * - ESP_ERR_INVALID_ARG: The arguments passed are not valid. + * - ESP_ERR_NOT_FOUND: app_desc structure is not found. Magic word is incorrect. + * - ESP_FAIL: mapping is fail. + */ +esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t *partition, esp_app_desc_t *app_desc); + +/** + * @brief Get chip revision + * + * @return Chip revision number + */ +uint8_t bootloader_common_get_chip_revision(void); + /** * @brief Check if the image (bootloader and application) has valid chip ID and revision * - * @param img_hdr: image header + * @param[in] img_hdr: image header + * @param[in] type: image type, bootloader or application * @return * - ESP_OK: image and chip are matched well * - ESP_FAIL: image doesn't match to the chip */ -esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hdr); - +esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hdr, esp_image_type type); /** * @brief Configure VDDSDIO, call this API to rise VDDSDIO to 1.9V when VDDSDIO regulator is enabled as 1.8V mode. */ void bootloader_common_vddsdio_configure(); - -/** - * @brief Set the flash CS setup and hold time. - * - * CS setup time is recomemded to be 1.5T, and CS hold time is recommended to be 2.5T. - * cs_setup = 1, cs_setup_time = 0; cs_hold = 1, cs_hold_time = 1 - */ -void bootloader_common_set_flash_cs_timing(); diff --git a/tools/sdk/include/bootloader_support/bootloader_flash_config.h b/tools/sdk/include/bootloader_support/bootloader_flash_config.h new file mode 100644 index 00000000..2f716cce --- /dev/null +++ b/tools/sdk/include/bootloader_support/bootloader_flash_config.h @@ -0,0 +1,71 @@ +// Copyright 2018 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "esp_image_format.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Update the flash id in g_rom_flashchip(global esp_rom_spiflash_chip_t structure). + * + * @return None + */ +void bootloader_flash_update_id(); + +/** + * @brief Set the flash CS setup and hold time. + * + * @note CS setup time is recomemded to be 1.5T, and CS hold time is recommended to be 2.5T. + * cs_setup = 1, cs_setup_time = 0; cs_hold = 1, cs_hold_time = 1. + * + * @return None + */ +void bootloader_flash_cs_timing_config(); + +/** + * @brief Configure SPI flash clock. + * + * @note This function only set clock frequency for SPI0. + * + * @param pfhdr Pointer to App image header, from where to fetch flash settings. + * + * @return None + */ +void bootloader_flash_clock_config(const esp_image_header_t* pfhdr); + +/** + * @brief Configure SPI flash gpio, include the IO matrix and drive strength configuration. + * + * @param pfhdr Pointer to App image header, from where to fetch flash settings. + * + * @return None + */ +void bootloader_flash_gpio_config(const esp_image_header_t* pfhdr); + +/** + * @brief Configure SPI flash read dummy based on different mode and frequency. + * + * @param pfhdr Pointer to App image header, from where to fetch flash settings. + * + * @return None + */ +void bootloader_flash_dummy_config(const esp_image_header_t* pfhdr); + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/include/bootloader_support/esp_efuse.h b/tools/sdk/include/bootloader_support/esp_efuse.h deleted file mode 100644 index 047a971a..00000000 --- a/tools/sdk/include/bootloader_support/esp_efuse.h +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#ifndef _ESP_EFUSE_H -#define _ESP_EFUSE_H - -#include "soc/efuse_reg.h" -#include "esp_err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* @brief Permanently update values written to the efuse write registers - * - * After updating EFUSE_BLKx_WDATAx_REG registers with new values to - * write, call this function to permanently write them to efuse. - * - * @note Setting bits in efuse is permanent, they cannot be unset. - * - * @note Due to this restriction you don't need to copy values to - * Efuse write registers from the matching read registers, bits which - * are set in the read register but unset in the matching write - * register will be unchanged when new values are burned. - * - * @note This function is not threadsafe, if calling code updates - * efuse values from multiple tasks then this is caller's - * responsibility to serialise. - * - * After burning new efuses, the read registers are updated to match - * the new efuse values. - */ -void esp_efuse_burn_new_values(void); - -/* @brief Reset efuse write registers - * - * Efuse write registers are written to zero, to negate - * any changes that have been staged here. - */ -void esp_efuse_reset(void); - -/* @brief Disable BASIC ROM Console via efuse - * - * By default, if booting from flash fails the ESP32 will boot a - * BASIC console in ROM. - * - * Call this function (from bootloader or app) to permanently - * disable the console on this chip. - */ -void esp_efuse_disable_basic_rom_console(void); - -/* @brief Encode one or more sets of 6 byte sequences into - * 8 bytes suitable for 3/4 Coding Scheme. - * - * This function is only useful if the CODING_SCHEME efuse - * is set to value 1 for 3/4 Coding Scheme. - * - * @param[in] in_bytes Pointer to a sequence of bytes to encode for 3/4 Coding Scheme. Must have length in_bytes_len. After being written to hardware, these bytes will read back as little-endian words. - * @param[out] out_words Pointer to array of words suitable for writing to efuse write registers. Array must contain 2 words (8 bytes) for every 6 bytes in in_bytes_len. Can be a pointer to efuse write registers. - * @param in_bytes_len. Length of array pointed to by in_bytes, in bytes. Must be a multiple of 6. - * - * @return ESP_ERR_INVALID_ARG if either pointer is null or in_bytes_len is not a multiple of 6. ESP_OK otherwise. - */ -esp_err_t esp_efuse_apply_34_encoding(const uint8_t *in_bytes, uint32_t *out_words, size_t in_bytes_len); - -/* @brief Write random data to efuse key block write registers - * - * @note Caller is responsible for ensuring efuse - * block is empty and not write protected, before calling. - * - * @note Behaviour depends on coding scheme: a 256-bit key is - * generated and written for Coding Scheme "None", a 192-bit key - * is generated, extended to 256-bits by the Coding Scheme, - * and then writtten for 3/4 Coding Scheme. - * - * @note This function does not burn the new values, caller should - * call esp_efuse_burn_new_values() when ready to do this. - * - * @param blk_wdata0_reg Address of the first data write register - * in the block - */ -void esp_efuse_write_random_key(uint32_t blk_wdata0_reg); - -/** - * @brief Returns chip version from efuse - * - * @return chip version - */ -uint8_t esp_efuse_get_chip_ver(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __ESP_EFUSE_H */ - diff --git a/tools/sdk/include/bootloader_support/esp_image_format.h b/tools/sdk/include/bootloader_support/esp_image_format.h index 0e2bb528..fe6cf89b 100644 --- a/tools/sdk/include/bootloader_support/esp_image_format.h +++ b/tools/sdk/include/bootloader_support/esp_image_format.h @@ -66,7 +66,7 @@ typedef enum { /** @cond */ _Static_assert(sizeof(esp_chip_id_t) == 2, "esp_chip_id_t should be 16 bit"); - +/** @endcond */ /* Main header of binary image */ typedef struct { @@ -84,12 +84,9 @@ typedef struct { uint8_t wp_pin; /* Drive settings for the SPI flash pins (read by ROM bootloader) */ uint8_t spi_pin_drv[3]; - /*!< Chip identification number */ - esp_chip_id_t chip_id; - /*!< Minimum chip revision supported by image */ - uint8_t min_chip_rev; - /*!< Reserved bytes in additional header space, currently unused */ - uint8_t reserved[8]; + esp_chip_id_t chip_id; /*!< Chip identification number */ + uint8_t min_chip_rev; /*!< Minimum chip revision supported by image */ + uint8_t reserved[8]; /*!< Reserved bytes in additional header space, currently unused */ /* If 1, a SHA256 digest "simple hash" (of the entire image) is appended after the checksum. Included in image length. This digest * is separate to secure boot and only used for detecting corruption. For secure boot signed images, the signature * is appended after this (and the simple hash is included in the signed data). */ @@ -106,6 +103,25 @@ typedef struct { uint32_t data_len; } esp_image_segment_header_t; +#define ESP_APP_DESC_MAGIC_WORD 0xABCD5432 /*!< The magic word for the esp_app_desc structure that is in DROM. */ + +/** + * @brief Description about application. + */ +typedef struct { + uint32_t magic_word; /*!< Magic word ESP_APP_DESC_MAGIC_WORD */ + uint32_t secure_version; /*!< Secure version */ + uint32_t reserv1[2]; /*!< --- */ + char version[32]; /*!< Application version */ + char project_name[32]; /*!< Project name */ + char time[16]; /*!< Compile time */ + char date[16]; /*!< Compile date*/ + char idf_ver[32]; /*!< Version IDF */ + uint8_t app_elf_sha256[32]; /*!< sha256 of elf file */ + uint32_t reserv2[20]; /*!< --- */ +} esp_app_desc_t; +_Static_assert(sizeof(esp_app_desc_t) == 256, "esp_app_desc_t should be 256 bytes"); + #define ESP_IMAGE_MAX_SEGMENTS 16 /* Structure to hold on-flash image metadata */ diff --git a/tools/sdk/include/bootloader_support/esp_secure_boot.h b/tools/sdk/include/bootloader_support/esp_secure_boot.h index 370bdd36..17b405e4 100644 --- a/tools/sdk/include/bootloader_support/esp_secure_boot.h +++ b/tools/sdk/include/bootloader_support/esp_secure_boot.h @@ -46,6 +46,25 @@ static inline bool esp_secure_boot_enabled(void) { return REG_READ(EFUSE_BLK0_RDATA6_REG) & EFUSE_RD_ABS_DONE_0; } +/** @brief Generate secure digest from bootloader image + * + * @important This function is intended to be called from bootloader code only. + * + * If secure boot is not yet enabled for bootloader, this will: + * 1) generate the secure boot key and burn it on EFUSE + * (without enabling R/W protection) + * 2) generate the digest from bootloader and save it + * to flash address 0x0 + * + * If first boot gets interrupted after calling this function + * but before esp_secure_boot_permanently_enable() is called, then + * the key burned on EFUSE will not be regenerated, unless manually + * done using espefuse.py tool + * + * @return ESP_OK if secure boot digest is generated + * successfully or found to be already present + */ +esp_err_t esp_secure_boot_generate_digest(void); /** @brief Enable secure boot if it is not already enabled. * @@ -54,9 +73,13 @@ static inline bool esp_secure_boot_enabled(void) { * * @important This function is intended to be called from bootloader code only. * + * @important This will enable r/w protection of secure boot key on EFUSE, + * therefore it is to be ensured that esp_secure_boot_generate_digest() + * is called before this + * * If secure boot is not yet enabled for bootloader, this will - * generate the secure boot digest and enable secure boot by blowing - * the EFUSE_RD_ABS_DONE_0 efuse. + * 1) enable R/W protection of secure boot key on EFUSE + * 2) enable secure boot by blowing the EFUSE_RD_ABS_DONE_0 efuse. * * This function does not verify secure boot of the bootloader (the * ROM bootloader does this.) @@ -64,7 +87,6 @@ static inline bool esp_secure_boot_enabled(void) { * Will fail if efuses have been part-burned in a way that indicates * secure boot should not or could not be correctly enabled. * - * * @return ESP_ERR_INVALID_STATE if efuse state doesn't allow * secure boot to be enabled cleanly. ESP_OK if secure boot * is enabled on this chip from now on. diff --git a/tools/sdk/include/bt/esp_bt.h b/tools/sdk/include/bt/esp_bt.h index a0648645..1ee7edf9 100644 --- a/tools/sdk/include/bt/esp_bt.h +++ b/tools/sdk/include/bt/esp_bt.h @@ -117,7 +117,7 @@ the adv packet will be discarded until the memory is restored. */ .mode = BTDM_CONTROLLER_MODE_EFF, \ .ble_max_conn = CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF, \ .bt_max_acl_conn = CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF, \ - .bt_sco_datapath = CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_EFF, \ + .bt_sco_datapath = CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_EFF, \ .bt_max_sync_conn = CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF, \ .magic = ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL, \ }; diff --git a/tools/sdk/include/bt/esp_gap_ble_api.h b/tools/sdk/include/bt/esp_gap_ble_api.h index ff30f5f3..12bc48f1 100644 --- a/tools/sdk/include/bt/esp_gap_ble_api.h +++ b/tools/sdk/include/bt/esp_gap_ble_api.h @@ -54,6 +54,7 @@ typedef uint8_t esp_ble_key_type_t; #define ESP_LE_AUTH_NO_BOND 0x00 /*!< 0*/ /* relate to BTM_LE_AUTH_NO_BOND in stack/btm_api.h */ #define ESP_LE_AUTH_BOND 0x01 /*!< 1 << 0 */ /* relate to BTM_LE_AUTH_BOND in stack/btm_api.h */ #define ESP_LE_AUTH_REQ_MITM (1 << 2) /*!< 1 << 2 */ /* relate to BTM_LE_AUTH_REQ_MITM in stack/btm_api.h */ +#define ESP_LE_AUTH_REQ_BOND_MITM (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_MITM)/*!< 0101*/ #define ESP_LE_AUTH_REQ_SC_ONLY (1 << 3) /*!< 1 << 3 */ /* relate to BTM_LE_AUTH_REQ_SC_ONLY in stack/btm_api.h */ #define ESP_LE_AUTH_REQ_SC_BOND (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1001 */ /* relate to BTM_LE_AUTH_REQ_SC_BOND in stack/btm_api.h */ #define ESP_LE_AUTH_REQ_SC_MITM (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1100 */ /* relate to BTM_LE_AUTH_REQ_SC_MITM in stack/btm_api.h */ @@ -63,6 +64,9 @@ typedef uint8_t esp_ble_auth_req_t; /*!< combination of the above bit #define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_DISABLE 0 #define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_ENABLE 1 +#define ESP_BLE_OOB_DISABLE 0 +#define ESP_BLE_OOB_ENABLE 1 + /* relate to BTM_IO_CAP_xxx in stack/btm_api.h */ #define ESP_IO_CAP_OUT 0 /*!< DisplayOnly */ /* relate to BTM_IO_CAP_OUT in stack/btm_api.h */ #define ESP_IO_CAP_IO 1 /*!< DisplayYesNo */ /* relate to BTM_IO_CAP_IO in stack/btm_api.h */ @@ -263,14 +267,26 @@ typedef enum { typedef enum { ESP_BLE_SM_PASSKEY = 0, + /* Authentication requirements of local device */ ESP_BLE_SM_AUTHEN_REQ_MODE, + /* The IO capability of local device */ ESP_BLE_SM_IOCAP_MODE, + /* Initiator Key Distribution/Generation */ ESP_BLE_SM_SET_INIT_KEY, + /* Responder Key Distribution/Generation */ ESP_BLE_SM_SET_RSP_KEY, + /* Maximum Encryption key size to support */ ESP_BLE_SM_MAX_KEY_SIZE, + /* Minimum Encryption key size requirement from Peer */ + ESP_BLE_SM_MIN_KEY_SIZE, + /* Set static Passkey */ ESP_BLE_SM_SET_STATIC_PASSKEY, + /* Reset static Passkey */ ESP_BLE_SM_CLEAR_STATIC_PASSKEY, + /* Accept only specified SMP Authentication requirement */ ESP_BLE_SM_ONLY_ACCEPT_SPECIFIED_SEC_AUTH, + /* Enable/Disable OOB support */ + ESP_BLE_SM_OOB_SUPPORT, ESP_BLE_SM_MAX_PARAM, } esp_ble_sm_param_t; @@ -584,7 +600,7 @@ typedef enum { typedef enum { ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_ADV_ADDR = 0, /*!< BLE advertising address , device info will be added into ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_ADDR_LIST */ ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_LINK_ID, /*!< BLE mesh link ID, it is for BLE mesh, device info will be added into ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_MESH_LINK_ID_LIST */ - ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_BEACON_TYPE, /*!< BLE mesh beacon AD type, the format is | Len | 0x2B | Beacon Type | Beacon Data | */ + ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_BEACON_TYPE, /*!< BLE mesh beacon AD type, the format is | Len | 0x2B | Beacon Type | Beacon Data | */ ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROV_SRV_ADV, /*!< BLE mesh provisioning service uuid, the format is | 0x02 | 0x01 | flags | 0x03 | 0x03 | 0x1827 | .... |` */ ESP_BLE_DUPLICATE_SCAN_EXCEPTIONAL_INFO_MESH_PROXY_SRV_ADV, /*!< BLE mesh adv with proxy service uuid, the format is | 0x02 | 0x01 | flags | 0x03 | 0x03 | 0x1828 | .... |` */ } esp_ble_duplicate_exceptional_info_type_t; @@ -1145,7 +1161,7 @@ esp_err_t esp_ble_passkey_reply(esp_bd_addr_t bd_addr, bool accept, uint32_t pas /** -* @brief Reply the confirm value to the peer device in the legacy connection stage. +* @brief Reply the confirm value to the peer device in the secure connection stage. * * @param[in] bd_addr : BD address of the peer device * @param[in] accept : numbers to compare are the same or different. @@ -1194,6 +1210,20 @@ int esp_ble_get_bond_device_num(void); */ esp_err_t esp_ble_get_bond_device_list(int *dev_num, esp_ble_bond_dev_t *dev_list); +/** +* @brief This function is called to provide the OOB data for +* SMP in response to ESP_GAP_BLE_OOB_REQ_EVT +* +* @param[in] bd_addr: BD address of the peer device. +* @param[in] TK: TK value, the TK value shall be a 128-bit random number +* @param[in] len: length of tk, should always be 128-bit +* +* @return - ESP_OK : success +* - other : failed +* +*/ +esp_err_t esp_ble_oob_req_reply(esp_bd_addr_t bd_addr, uint8_t *TK, uint8_t len); + #endif /* #if (SMP_INCLUDED == TRUE) */ /** diff --git a/tools/sdk/include/bt/esp_spp_api.h b/tools/sdk/include/bt/esp_spp_api.h index 31bcf1c6..9628a1ed 100644 --- a/tools/sdk/include/bt/esp_spp_api.h +++ b/tools/sdk/include/bt/esp_spp_api.h @@ -30,7 +30,7 @@ typedef enum { ESP_SPP_NO_RESOURCE /*!< No more set pm control block */ } esp_spp_status_t; -/* Security Setting Mask */ +/* Security Setting Mask, Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHORIZE or ESP_SPP_SEC_AUTHENTICATE only.*/ #define ESP_SPP_SEC_NONE 0x0000 /*!< No security. relate to BTA_SEC_NONE in bta/bta_api.h */ #define ESP_SPP_SEC_AUTHORIZE 0x0001 /*!< Authorization required (only needed for out going connection ) relate to BTA_SEC_AUTHORIZE in bta/bta_api.h*/ #define ESP_SPP_SEC_AUTHENTICATE 0x0012 /*!< Authentication required. relate to BTA_SEC_AUTHENTICATE in bta/bta_api.h*/ @@ -229,7 +229,7 @@ esp_err_t esp_spp_start_discovery(esp_bd_addr_t bd_addr); * When the connection is established or failed, * the callback is called with ESP_SPP_OPEN_EVT. * - * @param[in] sec_mask: Security Setting Mask . + * @param[in] sec_mask: Security Setting Mask. Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHORIZE or ESP_SPP_SEC_AUTHENTICATE only. * @param[in] role: Master or slave. * @param[in] remote_scn: Remote device bluetooth device SCN. * @param[in] peer_bd_addr: Remote device bluetooth device address. @@ -260,7 +260,7 @@ esp_err_t esp_spp_disconnect(uint32_t handle); * When the connection is established, the callback is called * with ESP_SPP_SRV_OPEN_EVT. * - * @param[in] sec_mask: Security Setting Mask . + * @param[in] sec_mask: Security Setting Mask. Security Setting Mask. Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHORIZE or ESP_SPP_SEC_AUTHENTICATE only. * @param[in] role: Master or slave. * @param[in] local_scn: The specific channel you want to get. * If channel is 0, means get any channel. diff --git a/tools/sdk/include/config/sdkconfig.h b/tools/sdk/include/config/sdkconfig.h index 444fb1a6..8722dcc6 100644 --- a/tools/sdk/include/config/sdkconfig.h +++ b/tools/sdk/include/config/sdkconfig.h @@ -24,6 +24,7 @@ #define CONFIG_SPIFFS_USE_MAGIC_LENGTH 1 #define CONFIG_ESPTOOLPY_FLASHSIZE_4MB 1 #define CONFIG_IPC_TASK_STACK_SIZE 1024 +#define CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES 16 #define CONFIG_FATFS_PER_FILE_CACHE 1 #define CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY 1 #define CONFIG_ESPTOOLPY_FLASHFREQ "40m" @@ -58,13 +59,13 @@ #define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1 #define CONFIG_MBEDTLS_ECDH_C 1 #define CONFIG_SPIRAM_USE_CAPS_ALLOC 1 -#define CONFIG_FRMN1_QUANT 1 #define CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE 1 #define CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM 16 #define CONFIG_MBEDTLS_SSL_ALPN 1 #define CONFIG_MBEDTLS_PEM_WRITE_C 1 #define CONFIG_BT_SPP_ENABLED 1 #define CONFIG_BT_RESERVE_DRAM 0xdb5c +#define CONFIG_APP_COMPILE_TIME_DATE 1 #define CONFIG_CXX_EXCEPTIONS 1 #define CONFIG_D2WD_PSRAM_CLK_IO 9 #define CONFIG_FATFS_FS_LOCK 0 @@ -79,14 +80,17 @@ #define CONFIG_MB_SERIAL_BUF_SIZE 256 #define CONFIG_CONSOLE_UART_BAUDRATE 115200 #define CONFIG_SPIRAM_SUPPORT 1 +#define CONFIG_MFN56_1X 1 #define CONFIG_LWIP_MAX_SOCKETS 10 #define CONFIG_LWIP_NETIF_LOOPBACK 1 +#define CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT "pthread" #define CONFIG_EMAC_TASK_PRIORITY 20 #define CONFIG_TIMER_TASK_STACK_DEPTH 2048 #define CONFIG_TCP_MSS 1436 #define CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED 1 #define CONFIG_BTDM_CONTROLLER_MODE_BTDM 1 #define CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF 3 +#define CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4 1 #define CONFIG_TCPIP_TASK_AFFINITY_CPU0 1 #define CONFIG_FATFS_CODEPAGE 850 #define CONFIG_SPIRAM_SPIWP_SD3_PIN 7 @@ -124,12 +128,15 @@ #define CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE 1 #define CONFIG_SPIRAM_BANKSWITCH_ENABLE 1 #define CONFIG_MBEDTLS_X509_CRL_PARSE_C 1 +#define CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER 1 #define CONFIG_HTTPD_PURGE_BUF_LEN 32 #define CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR 1 +#define CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER 1 #define CONFIG_MB_SERIAL_TASK_STACK_SIZE 2048 #define CONFIG_MBEDTLS_PSK_MODES 1 #define CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO 1 #define CONFIG_LWIP_DHCPS_LEASE_UNIT 60 +#define CONFIG_EFUSE_MAX_BLK_LEN 192 #define CONFIG_SPIFFS_USE_MAGIC 1 #define CONFIG_OV7725_SUPPORT 1 #define CONFIG_TCPIP_TASK_STACK_SIZE 2560 @@ -173,10 +180,13 @@ #define CONFIG_ESP32_WIFI_NVS_ENABLED 1 #define CONFIG_MDNS_MAX_SERVICES 10 #define CONFIG_ULP_COPROC_ENABLED 1 +#define CONFIG_LSSH_SPARSE_MN_5 1 #define CONFIG_HFP_AUDIO_DATA_PATH_PCM 1 +#define CONFIG_IDF_TARGET_ESP32 1 #define CONFIG_EMAC_CHECK_LINK_PERIOD_MS 2000 #define CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL 1 #define CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED 1 +#define CONFIG_LWIP_SNTP_UPDATE_DELAY 3600000 #define CONFIG_LIBSODIUM_USE_MBEDTLS_SHA 1 #define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK 1 #define CONFIG_DMA_RX_BUF_NUM 10 @@ -203,6 +213,7 @@ #define CONFIG_ESP32_WIFI_MGMT_SBUF_NUM 32 #define CONFIG_PARTITION_TABLE_SINGLE_APP 1 #define CONFIG_XTENSA_IMPL 1 +#define CONFIG_UNITY_ENABLE_FLOAT 1 #define CONFIG_ESP32_WIFI_RX_BA_WIN 16 #define CONFIG_MBEDTLS_X509_CSR_PARSE_C 1 #define CONFIG_SPIFFS_USE_MTIME 1 @@ -223,7 +234,6 @@ #define CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V 1 #define CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY 2000 #define CONFIG_BROWNOUT_DET_LVL 0 -#define CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_PCM 1 #define CONFIG_MBEDTLS_PEM_PARSE_C 1 #define CONFIG_SPIFFS_GC_MAX_RUNS 10 #define CONFIG_ARDUINO_RUN_CORE1 1 @@ -249,6 +259,7 @@ #define CONFIG_D2WD_PSRAM_CS_IO 10 #define CONFIG_MBEDTLS_TLS_ENABLED 1 #define CONFIG_LWIP_MAX_RAW_PCBS 16 +#define CONFIG_BTU_TASK_STACK_SIZE 4096 #define CONFIG_SMP_ENABLE 1 #define CONFIG_SPIRAM_SIZE -1 #define CONFIG_MBEDTLS_SSL_SESSION_TICKETS 1 @@ -286,12 +297,14 @@ #define CONFIG_PPP_PAP_SUPPORT 1 #define CONFIG_MBEDTLS_TLS_CLIENT 1 #define CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI 1 -#define CONFIG_BTDM_CONTROLLER_BR_EDR_SCO_DATA_PATH_EFF 1 #define CONFIG_BT_ENABLED 1 +#define CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY 1 #define CONFIG_D0WD_PSRAM_CLK_IO 17 +#define CONFIG_BT_SSP_ENABLED 1 #define CONFIG_SW_COEXIST_PREFERENCE_BALANCE 1 #define CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED 1 #define CONFIG_MONITOR_BAUD 115200 +#define CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT -1 #define CONFIG_ESP32_DEBUG_STUBS_ENABLE 1 #define CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT 30 #define CONFIG_TCPIP_LWIP 1 @@ -303,6 +316,7 @@ #define CONFIG_MBEDTLS_HAVE_TIME 1 #define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY 1 #define CONFIG_TCP_QUEUE_OOSEQ 1 +#define CONFIG_FATFS_ALLOC_PREFER_EXTRAM 1 #define CONFIG_GATTS_ENABLE 1 #define CONFIG_CXX_EXCEPTIONS_EMG_POOL_SIZE 0 #define CONFIG_ADC_CAL_EFUSE_VREF_ENABLE 1 @@ -315,10 +329,12 @@ #define CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK 1 #define CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK 1 #define CONFIG_OPENSSL_ASSERT_DO_NOTHING 1 +#define CONFIG_IDF_TARGET "esp32" #define CONFIG_WL_SECTOR_SIZE_4096 1 #define CONFIG_OPTIMIZATION_LEVEL_DEBUG 1 #define CONFIG_FREERTOS_NO_AFFINITY 0x7FFFFFFF #define CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED 1 +#define CONFIG_HTTPD_ERR_RESP_NO_DELAY 1 #define CONFIG_MB_TIMER_INDEX 0 #define CONFIG_SCAN_DUPLICATE_TYPE 0 #define CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED 1 @@ -352,13 +368,16 @@ #define CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF 1 #define CONFIG_ESPTOOLPY_PORT "/dev/cu.usbserial-DO00EAB0" #define CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS 1 +#define CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_EFF 0 +#define CONFIG_LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 1 #define CONFIG_TASK_WDT_PANIC 1 #define CONFIG_OV3660_SUPPORT 1 +#define CONFIG_UNITY_ENABLE_DOUBLE 1 #define CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 #define CONFIG_BLUEDROID_PINNED_TO_CORE 0 #define CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG 1 #define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR 1 #define CONFIG_ESP32_WIFI_IRAM_OPT 1 #define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1 -#define CONFIG_ARDUINO_IDF_COMMIT "d3e562907" -#define CONFIG_ARDUINO_IDF_BRANCH "release/v3.2" +#define CONFIG_ARDUINO_IDF_COMMIT "367c3c09c" +#define CONFIG_ARDUINO_IDF_BRANCH "release/v3.3" diff --git a/tools/sdk/include/driver/driver/can.h b/tools/sdk/include/driver/driver/can.h index af7b66e0..28d42077 100644 --- a/tools/sdk/include/driver/driver/can.h +++ b/tools/sdk/include/driver/driver/can.h @@ -19,6 +19,7 @@ extern "C" { #endif +#include "freertos/FreeRTOS.h" #include "esp_types.h" #include "esp_intr.h" #include "esp_err.h" @@ -44,7 +45,13 @@ extern "C" { * The following initializer macros offer commonly found bit rates. * * @note These timing values are based on the assumption APB clock is at 80MHz + * @note The 20K, 16K and 12.5K bit rates are only available from ESP32 Revision 2 onwards */ +#if (CONFIG_ESP32_REV_MIN >= 2) +#define CAN_TIMING_CONFIG_12_5KBITS() {.brp = 256, .tseg_1 = 16, .tseg_2 = 8, .sjw = 3, .triple_sampling = false} +#define CAN_TIMING_CONFIG_16KBITS() {.brp = 200, .tseg_1 = 16, .tseg_2 = 8, .sjw = 3, .triple_sampling = false} +#define CAN_TIMING_CONFIG_20KBITS() {.brp = 200, .tseg_1 = 15, .tseg_2 = 4, .sjw = 3, .triple_sampling = false} +#endif #define CAN_TIMING_CONFIG_25KBITS() {.brp = 128, .tseg_1 = 16, .tseg_2 = 8, .sjw = 3, .triple_sampling = false} #define CAN_TIMING_CONFIG_50KBITS() {.brp = 80, .tseg_1 = 15, .tseg_2 = 4, .sjw = 3, .triple_sampling = false} #define CAN_TIMING_CONFIG_100KBITS() {.brp = 40, .tseg_1 = 15, .tseg_2 = 4, .sjw = 3, .triple_sampling = false} @@ -105,7 +112,7 @@ extern "C" { #define CAN_EXTD_ID_MASK 0x1FFFFFFF /**< Bit mask for 29 bit Extended Frame Format ID */ #define CAN_STD_ID_MASK 0x7FF /**< Bit mask for 11 bit Standard Frame Format ID */ #define CAN_MAX_DATA_LEN 8 /**< Maximum number of data bytes in a CAN2.0B frame */ -#define CAN_IO_UNUSED (-1) /**< Marks GPIO as unused in CAN configuration */ +#define CAN_IO_UNUSED ((gpio_num_t) -1) /**< Marks GPIO as unused in CAN configuration */ /** @endcond */ /* ----------------------- Enum and Struct Definitions ---------------------- */ @@ -152,7 +159,8 @@ typedef struct { * @note Macro initializers are available for this structure */ typedef struct { - uint8_t brp; /**< Baudrate prescaler (APB clock divider, even number from 2 to 128) */ + uint32_t brp; /**< Baudrate prescaler (i.e., APB clock divider) can be any even number from 2 to 128. + For ESP32 Rev 2 or later, multiples of 4 from 132 to 256 are also supported */ uint8_t tseg_1; /**< Timing segment 1 (Number of time quanta, between 1 to 16) */ uint8_t tseg_2; /**< Timing segment 2 (Number of time quanta, 1 to 8) */ uint8_t sjw; /**< Synchronization Jump Width (Max time quanta jump for synchronize from 1 to 4) */ @@ -392,6 +400,34 @@ esp_err_t can_initiate_recovery(); */ esp_err_t can_get_status_info(can_status_info_t *status_info); +/** + * @brief Clear the transmit queue + * + * This function will clear the transmit queue of all messages. + * + * @note The transmit queue is automatically cleared when can_stop() or + * can_initiate_recovery() is called. + * + * @return + * - ESP_OK: Transmit queue cleared + * - ESP_ERR_INVALID_STATE: CAN driver is not installed or TX queue is disabled + */ +esp_err_t can_clear_transmit_queue(); + +/** + * @brief Clear the receive queue + * + * This function will clear the receive queue of all messages. + * + * @note The receive queue is automatically cleared when can_start() is + * called. + * + * @return + * - ESP_OK: Transmit queue cleared + * - ESP_ERR_INVALID_STATE: CAN driver is not installed + */ +esp_err_t can_clear_receive_queue(); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/include/driver/driver/i2s.h b/tools/sdk/include/driver/driver/i2s.h index 1f73e1f5..6179ec3c 100644 --- a/tools/sdk/include/driver/driver/i2s.h +++ b/tools/sdk/include/driver/driver/i2s.h @@ -189,6 +189,14 @@ typedef struct { int data_in_num; /*!< DATA in pin*/ } i2s_pin_config_t; +/** + * @brief I2S PDM RX downsample mode + */ +typedef enum { + I2S_PDM_DSR_8S = 0, /*!< downsampling number is 8 for PDM RX mode*/ + I2S_PDM_DSR_16S, /*!< downsampling number is 16 for PDM RX mode*/ + I2S_PDM_DSR_MAX, +} i2s_pdm_dsr_t; typedef intr_handle_t i2s_isr_handle_t; /** @@ -215,6 +223,25 @@ typedef intr_handle_t i2s_isr_handle_t; */ esp_err_t i2s_set_pin(i2s_port_t i2s_num, const i2s_pin_config_t *pin); +/** + * @brief Set PDM mode down-sample rate + * In PDM RX mode, there would be 2 rounds of downsample process in hardware. + * In the first downsample process, the sampling number can be 16 or 8. + * In the second downsample process, the sampling number is fixed as 8. + * So the clock frequency in PDM RX mode would be (fpcm * 64) or (fpcm * 128) accordingly. + * @param i2s_num I2S_NUM_0, I2S_NUM_1 + * @param dsr i2s RX down sample rate for PDM mode. + * + * @note After calling this function, it would call i2s_set_clk inside to update the clock frequency. + * Please call this function after I2S driver has been initialized. + * + * @return + * - ESP_OK Success + * - ESP_ERR_INVALID_ARG Parameter error + * - ESP_ERR_NO_MEM Out of memory + */ +esp_err_t i2s_set_pdm_rx_down_sample(i2s_port_t i2s_num, i2s_pdm_dsr_t dsr); + /** * @brief Set I2S dac mode, I2S built-in DAC is disabled by default * @@ -476,6 +503,16 @@ esp_err_t i2s_zero_dma_buffer(i2s_port_t i2s_num); */ esp_err_t i2s_set_clk(i2s_port_t i2s_num, uint32_t rate, i2s_bits_per_sample_t bits, i2s_channel_t ch); +/** + * @brief get clock set on particular port number. + * + * @param i2s_num I2S_NUM_0, I2S_NUM_1 + * + * @return + * - actual clock set by i2s driver + */ +float i2s_get_clk(i2s_port_t i2s_num); + /** * @brief Set built-in ADC mode for I2S DMA, this function will initialize ADC pad, * and set ADC parameters. diff --git a/tools/sdk/include/driver/driver/rmt.h b/tools/sdk/include/driver/driver/rmt.h index bf6632f5..87916b37 100644 --- a/tools/sdk/include/driver/driver/rmt.h +++ b/tools/sdk/include/driver/driver/rmt.h @@ -80,6 +80,19 @@ typedef enum { RMT_CARRIER_LEVEL_MAX } rmt_carrier_level_t; +typedef enum { + RMT_CHANNEL_UNINIT = 0, /*!< RMT channel uninitialized */ + RMT_CHANNEL_IDLE = 1, /*!< RMT channel status idle */ + RMT_CHANNEL_BUSY = 2, /*!< RMT channel status busy */ +} rmt_channel_status_t; + +/** + * @brief Data struct of RMT channel status + */ +typedef struct { + rmt_channel_status_t status[RMT_CHANNEL_MAX]; /*!< Store the current status of each channel */ +} rmt_channel_status_result_t; + /** * @brief Data struct of RMT TX configure parameters */ @@ -479,6 +492,7 @@ esp_err_t rmt_get_idle_level(rmt_channel_t channel, bool* idle_out_en, rmt_idle_ * * @param channel RMT channel (0-7) * @param status Pointer to accept channel status. + * Please refer to RMT_CHnSTATUS_REG(n=0~7) in `rmt_reg.h` for more details of each field. * * @return * - ESP_ERR_INVALID_ARG Parameter error @@ -650,6 +664,19 @@ esp_err_t rmt_driver_install(rmt_channel_t channel, size_t rx_buf_size, int intr */ esp_err_t rmt_driver_uninstall(rmt_channel_t channel); +/** + * @brief Get the current status of eight channels. + * + * @note Do not call this function if it is possible that `rmt_driver_uninstall` will be called at the same time. + * + * @param[out] channel_status store the current status of each channel + * + * @return + * - ESP_ERR_INVALID_ARG Parameter is NULL + * - ESP_OK Success + */ +esp_err_t rmt_get_channel_status(rmt_channel_status_result_t *channel_status); + /** * @brief RMT send waveform from rmt_item array. * diff --git a/tools/sdk/include/driver/driver/spi_common.h b/tools/sdk/include/driver/driver/spi_common.h index b3a92613..c2d64556 100644 --- a/tools/sdk/include/driver/driver/spi_common.h +++ b/tools/sdk/include/driver/driver/spi_common.h @@ -42,11 +42,11 @@ extern "C" * * Then points tx_buffer to ``&data``. * - * @param data Data to be sent, can be uint8_t, uint16_t or uint32_t. @param - * len Length of data to be sent, since the SPI peripheral sends from the MSB, - * this helps to shift the data to the MSB. + * @param DATA Data to be sent, can be uint8_t, uint16_t or uint32_t. + * @param LEN Length of data to be sent, since the SPI peripheral sends from + * the MSB, this helps to shift the data to the MSB. */ -#define SPI_SWAP_DATA_TX(data, len) __builtin_bswap32((uint32_t)data<<(32-len)) +#define SPI_SWAP_DATA_TX(DATA, LEN) __builtin_bswap32((uint32_t)(DATA)<<(32-(LEN))) /** * Transform received data of length <= 32 bits to the format of an unsigned integer. @@ -55,11 +55,11 @@ extern "C" * * uint16_t data = SPI_SWAP_DATA_RX(*(uint32_t*)t->rx_data, 15); * - * @param data Data to be rearranged, can be uint8_t, uint16_t or uint32_t. - * @param len Length of data received, since the SPI peripheral writes from + * @param DATA Data to be rearranged, can be uint8_t, uint16_t or uint32_t. + * @param LEN Length of data received, since the SPI peripheral writes from * the MSB, this helps to shift the data to the LSB. */ -#define SPI_SWAP_DATA_RX(data, len) (__builtin_bswap32(data)>>(32-len)) +#define SPI_SWAP_DATA_RX(DATA, LEN) (__builtin_bswap32(DATA)>>(32-(LEN))) /** * @brief Enum with the three SPI peripherals that are software-accessible in it @@ -101,9 +101,32 @@ typedef struct { * Call this if your driver wants to manage a SPI peripheral. * * @param host Peripheral to claim + * @param source The caller indentification string. + * * @return True if peripheral is claimed successfully; false if peripheral already is claimed. */ -bool spicommon_periph_claim(spi_host_device_t host); +bool spicommon_periph_claim(spi_host_device_t host, const char* source); + +// The macro is to keep the back-compatibility of IDF v3.2 and before +// In this way we can call spicommon_periph_claim with two arguments, or the host with the source set to the calling function name +// When two arguments (host, func) are given, __spicommon_periph_claim2 is called +// or if only one arguments (host) is given, __spicommon_periph_claim1 is called +#define spicommon_periph_claim(host...) __spicommon_periph_claim(host, 2, 1) +#define __spicommon_periph_claim(host, source, n, ...) __spicommon_periph_claim ## n(host, source) +#define __spicommon_periph_claim1(host, _) ({ \ + char* warning_str = "calling spicommon_periph_claim without source string is deprecated.";\ + spicommon_periph_claim(host, __FUNCTION__); }) + +#define __spicommon_periph_claim2(host, func) spicommon_periph_claim(host, func) + +/** + * @brief Check whether the spi periph is in use. + * + * @param host Peripheral to check. + * + * @return True if in use, otherwise false. + */ +bool spicommon_periph_in_use(spi_host_device_t host); /** * @brief Return the SPI peripheral so another driver can claim it. @@ -124,6 +147,15 @@ bool spicommon_periph_free(spi_host_device_t host); */ bool spicommon_dma_chan_claim(int dma_chan); +/** + * @brief Check whether the spi DMA channel is in use. + * + * @param dma_chan DMA channel to check. + * + * @return True if in use, otherwise false. + */ +bool spicommon_dma_chan_in_use(int dma_chan); + /** * @brief Return the SPI DMA channel so other driver can claim it, or just to power down DMA. * diff --git a/tools/sdk/include/driver/driver/spi_master.h b/tools/sdk/include/driver/driver/spi_master.h index 46085d62..b2acee0d 100644 --- a/tools/sdk/include/driver/driver/spi_master.h +++ b/tools/sdk/include/driver/driver/spi_master.h @@ -168,6 +168,10 @@ typedef struct spi_device_t* spi_device_handle_t; ///< Handle for a device on a * @warning If a DMA channel is selected, any transmit and receive buffer used should be allocated in * DMA-capable memory. * + * @warning The ISR of SPI is always executed on the core which calls this + * function. Never starve the ISR on this core or the SPI transactions will not + * be handled. + * * @return * - ESP_ERR_INVALID_ARG if configuration is invalid * - ESP_ERR_INVALID_STATE if host already is in use diff --git a/tools/sdk/include/driver/driver/spi_slave.h b/tools/sdk/include/driver/driver/spi_slave.h index 546f3b67..522c9fb8 100644 --- a/tools/sdk/include/driver/driver/spi_slave.h +++ b/tools/sdk/include/driver/driver/spi_slave.h @@ -73,7 +73,10 @@ struct spi_slave_transaction_t { size_t length; ///< Total data length, in bits size_t trans_len; ///< Transaction data length, in bits const void *tx_buffer; ///< Pointer to transmit buffer, or NULL for no MOSI phase - void *rx_buffer; ///< Pointer to receive buffer, or NULL for no MISO phase + void *rx_buffer; /**< Pointer to receive buffer, or NULL for no MISO phase. + * When the DMA is anabled, must start at WORD boundary (``rx_buffer%4==0``), + * and has length of a multiple of 4 bytes. + */ void *user; ///< User-defined variable. Can be used to store eg transaction ID. }; @@ -89,10 +92,14 @@ struct spi_slave_transaction_t { * it. The SPI hardware has two DMA channels to share. This parameter indicates which * one to use. * - * @warning If a DMA channel is selected, any transmit and receive buffer used should be allocated in + * @warning If a DMA channel is selected, any transmit and receive buffer used should be allocated in * DMA-capable memory. * - * @return + * @warning The ISR of SPI is always executed on the core which calls this + * function. Never starve the ISR on this core or the SPI transactions will not + * be handled. + * + * @return * - ESP_ERR_INVALID_ARG if configuration is invalid * - ESP_ERR_INVALID_STATE if host already is in use * - ESP_ERR_NO_MEM if out of memory @@ -104,7 +111,7 @@ esp_err_t spi_slave_initialize(spi_host_device_t host, const spi_bus_config_t *b * @brief Free a SPI bus claimed as a SPI slave interface * * @param host SPI peripheral to free - * @return + * @return * - ESP_ERR_INVALID_ARG if parameter is invalid * - ESP_ERR_INVALID_STATE if not all devices on the bus are freed * - ESP_OK on success @@ -128,7 +135,7 @@ esp_err_t spi_slave_free(spi_host_device_t host); * into the transaction description. * @param ticks_to_wait Ticks to wait until there's room in the queue; use portMAX_DELAY to * never time out. - * @return + * @return * - ESP_ERR_INVALID_ARG if parameter is invalid * - ESP_OK on success */ @@ -138,19 +145,19 @@ esp_err_t spi_slave_queue_trans(spi_host_device_t host, const spi_slave_transact /** * @brief Get the result of a SPI transaction queued earlier * - * This routine will wait until a transaction to the given device (queued earlier with + * This routine will wait until a transaction to the given device (queued earlier with * spi_slave_queue_trans) has succesfully completed. It will then return the description of the - * completed transaction so software can inspect the result and e.g. free the memory or + * completed transaction so software can inspect the result and e.g. free the memory or * re-use the buffers. * * It is mandatory to eventually use this function for any transaction queued by ``spi_slave_queue_trans``. * * @param host SPI peripheral to that is acting as a slave - * @param[out] trans_desc Pointer to variable able to contain a pointer to the description of the + * @param[out] trans_desc Pointer to variable able to contain a pointer to the description of the * transaction that is executed * @param ticks_to_wait Ticks to wait until there's a returned item; use portMAX_DELAY to never time * out. - * @return + * @return * - ESP_ERR_INVALID_ARG if parameter is invalid * - ESP_OK on success */ @@ -161,16 +168,16 @@ esp_err_t spi_slave_get_trans_result(spi_host_device_t host, spi_slave_transacti * @brief Do a SPI transaction * * Essentially does the same as spi_slave_queue_trans followed by spi_slave_get_trans_result. Do - * not use this when there is still a transaction queued that hasn't been finalized + * not use this when there is still a transaction queued that hasn't been finalized * using spi_slave_get_trans_result. * * @param host SPI peripheral to that is acting as a slave - * @param trans_desc Pointer to variable able to contain a pointer to the description of the + * @param trans_desc Pointer to variable able to contain a pointer to the description of the * transaction that is executed. Not const because we may want to write status back * into the transaction description. * @param ticks_to_wait Ticks to wait until there's a returned item; use portMAX_DELAY to never time * out. - * @return + * @return * - ESP_ERR_INVALID_ARG if parameter is invalid * - ESP_OK on success */ diff --git a/tools/sdk/include/driver/driver/uart.h b/tools/sdk/include/driver/driver/uart.h index 93c65c66..e716e542 100644 --- a/tools/sdk/include/driver/driver/uart.h +++ b/tools/sdk/include/driver/driver/uart.h @@ -801,7 +801,7 @@ esp_err_t uart_get_collision_flag(uart_port_t uart_num, bool* collision_flag); * light sleep. This function allows setting the threshold value. * * Stop bit and parity bits (if enabled) also contribute to the number of edges. - * For example, letter 'a' with ASCII code 97 is encoded as 010001101 on the wire + * For example, letter 'a' with ASCII code 97 is encoded as 0100001101 on the wire * (with 8n1 configuration), start and stop bits included. This sequence has 3 * positive edges (transitions from 0 to 1). Therefore, to wake up the system * when 'a' is sent, set wakeup_threshold=3. @@ -813,7 +813,10 @@ esp_err_t uart_get_collision_flag(uart_port_t uart_num, bool* collision_flag); * correct baud rate all the time, select REF_TICK as UART clock source, * by setting use_ref_tick field in uart_config_t to true. * - * @note in ESP32, UART2 does not support light sleep wakeup feature. + * @note in ESP32, the wakeup signal can only be input via IO_MUX (i.e. + * GPIO3 should be configured as function_1 to wake up UART0, + * GPIO9 should be configured as function_5 to wake up UART1), UART2 + * does not support light sleep wakeup feature. * * @param uart_num UART number * @param wakeup_threshold number of RX edges for light sleep wakeup, value is 3 .. 0x3ff. diff --git a/tools/sdk/include/efuse/esp_efuse.h b/tools/sdk/include/efuse/esp_efuse.h new file mode 100644 index 00000000..68f8491e --- /dev/null +++ b/tools/sdk/include/efuse/esp_efuse.h @@ -0,0 +1,362 @@ +// Copyright 2017-2018 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _ESP_EFUSE_MANAGER_H_ +#define _ESP_EFUSE_MANAGER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include "esp_err.h" +#include "esp_log.h" + +#define ESP_ERR_EFUSE 0x1600 /*!< Base error code for efuse api. */ +#define ESP_OK_EFUSE_CNT (ESP_ERR_EFUSE + 0x01) /*!< OK the required number of bits is set. */ +#define ESP_ERR_EFUSE_CNT_IS_FULL (ESP_ERR_EFUSE + 0x02) /*!< Error field is full. */ +#define ESP_ERR_EFUSE_REPEATED_PROG (ESP_ERR_EFUSE + 0x03) /*!< Error repeated programming of programmed bits is strictly forbidden. */ +#define ESP_ERR_CODING (ESP_ERR_EFUSE + 0x04) /*!< Error while a encoding operation. */ + +/** + * @brief Type of eFuse blocks + */ +typedef enum { + EFUSE_BLK0 = 0, /**< Number of eFuse block. Reserved. */ + EFUSE_BLK1 = 1, /**< Number of eFuse block. Used for Flash Encryption. If not using that Flash Encryption feature, they can be used for another purpose. */ + EFUSE_BLK2 = 2, /**< Number of eFuse block. Used for Secure Boot. If not using that Secure Boot feature, they can be used for another purpose. */ + EFUSE_BLK3 = 3 /**< Number of eFuse block. Uses for the purpose of the user. */ +} esp_efuse_block_t; + +/** + * @brief Type of coding scheme + */ +typedef enum { + EFUSE_CODING_SCHEME_NONE = 0, /**< None */ + EFUSE_CODING_SCHEME_3_4 = 1, /**< 3/4 coding */ + EFUSE_CODING_SCHEME_REPEAT = 2, /**< Repeat coding */ +} esp_efuse_coding_scheme_t; + +/** +* @brief Structure eFuse field + */ +typedef struct { + esp_efuse_block_t efuse_block: 8; /**< Block of eFuse */ + uint8_t bit_start; /**< Start bit [0..255] */ + uint16_t bit_count; /**< Length of bit field [1..-]*/ +} esp_efuse_desc_t; + +/** + * @brief Reads bits from EFUSE field and writes it into an array. + * + * The number of read bits will be limited to the minimum value + * from the description of the bits in "field" structure or "dst_size_bits" required size. + * Use "esp_efuse_get_field_size()" function to determine the length of the field. + * @param[in] field A pointer to the structure describing the fields of efuse. + * @param[out] dst A pointer to array that will contain the result of reading. + * @param[in] dst_size_bits The number of bits required to read. + * If the requested number of bits is greater than the field, + * the number will be limited to the field size. + * + * @return + * - ESP_OK: The operation was successfully completed. + * - ESP_ERR_INVALID_ARG: Error in the passed arguments. + */ +esp_err_t esp_efuse_read_field_blob(const esp_efuse_desc_t* field[], void* dst, size_t dst_size_bits); + +/** + * @brief Reads bits from EFUSE field and returns number of bits programmed as "1". + * + * If the bits are set not sequentially, they will still be counted. + * @param[in] field A pointer to the structure describing the fields of efuse. + * @param[out] out_cnt A pointer that will contain the number of programmed as "1" bits. + * + * @return + * - ESP_OK: The operation was successfully completed. + * - ESP_ERR_INVALID_ARG: Error in the passed arguments. + */ +esp_err_t esp_efuse_read_field_cnt(const esp_efuse_desc_t* field[], size_t* out_cnt); + +/** + * @brief Writes array to EFUSE field. + * + * The number of write bits will be limited to the minimum value + * from the description of the bits in "field" structure or "src_size_bits" required size. + * Use "esp_efuse_get_field_size()" function to determine the length of the field. + * After the function is completed, the writing registers are cleared. + * @param[in] field A pointer to the structure describing the fields of efuse. + * @param[in] src A pointer to array that contains the data for writing. + * @param[in] src_size_bits The number of bits required to write. + * + * @return + * - ESP_OK: The operation was successfully completed. + * - ESP_ERR_INVALID_ARG: Error in the passed arguments. + * - ESP_ERR_EFUSE_REPEATED_PROG: Error repeated programming of programmed bits is strictly forbidden. + * - ESP_ERR_CODING: Error range of data does not match the coding scheme. + */ +esp_err_t esp_efuse_write_field_blob(const esp_efuse_desc_t* field[], const void* src, size_t src_size_bits); + +/** + * @brief Writes a required count of bits as "1" to EFUSE field. + * + * If there are no free bits in the field to set the required number of bits to "1", + * ESP_ERR_EFUSE_CNT_IS_FULL error is returned, the field will not be partially recorded. + * After the function is completed, the writing registers are cleared. + * @param[in] field A pointer to the structure describing the fields of efuse. + * @param[in] cnt Required number of programmed as "1" bits. + * + * @return + * - ESP_OK: The operation was successfully completed. + * - ESP_ERR_INVALID_ARG: Error in the passed arguments. + * - ESP_ERR_EFUSE_CNT_IS_FULL: Not all requested cnt bits is set. + */ +esp_err_t esp_efuse_write_field_cnt(const esp_efuse_desc_t* field[], size_t cnt); + +/** + * @brief Sets a write protection for the whole block. + * + * After that, it is impossible to write to this block. + * The write protection does not apply to block 0. + * @param[in] blk Block number of eFuse. (EFUSE_BLK1, EFUSE_BLK2 and EFUSE_BLK3) + * + * @return + * - ESP_OK: The operation was successfully completed. + * - ESP_ERR_INVALID_ARG: Error in the passed arguments. + * - ESP_ERR_EFUSE_CNT_IS_FULL: Not all requested cnt bits is set. + * - ESP_ERR_NOT_SUPPORTED: The block does not support this command. + */ +esp_err_t esp_efuse_set_write_protect(esp_efuse_block_t blk); + +/** + * @brief Sets a read protection for the whole block. + * + * After that, it is impossible to read from this block. + * The read protection does not apply to block 0. + * @param[in] blk Block number of eFuse. (EFUSE_BLK1, EFUSE_BLK2 and EFUSE_BLK3) + * + * @return + * - ESP_OK: The operation was successfully completed. + * - ESP_ERR_INVALID_ARG: Error in the passed arguments. + * - ESP_ERR_EFUSE_CNT_IS_FULL: Not all requested cnt bits is set. + * - ESP_ERR_NOT_SUPPORTED: The block does not support this command. + */ +esp_err_t esp_efuse_set_read_protect(esp_efuse_block_t blk); + +/** + * @brief Returns the number of bits used by field. + * + * @param[in] field A pointer to the structure describing the fields of efuse. + * + * @return Returns the number of bits used by field. + */ +int esp_efuse_get_field_size(const esp_efuse_desc_t* field[]); + +/** + * @brief Returns value of efuse register. + * + * This is a thread-safe implementation. + * Example: EFUSE_BLK2_RDATA3_REG where (blk=2, num_reg=3) + * @param[in] blk Block number of eFuse. + * @param[in] num_reg The register number in the block. + * + * @return Value of register + */ +uint32_t esp_efuse_read_reg(esp_efuse_block_t blk, unsigned int num_reg); + +/** + * @brief Write value to efuse register. + * + * Apply a coding scheme if necessary. + * This is a thread-safe implementation. + * Example: EFUSE_BLK3_WDATA0_REG where (blk=3, num_reg=0) + * @param[in] blk Block number of eFuse. + * @param[in] num_reg The register number in the block. + * @param[in] val Value to write. + * + * @return + * - ESP_OK: The operation was successfully completed. + * - ESP_ERR_EFUSE_REPEATED_PROG: Error repeated programming of programmed bits is strictly forbidden. + */ +esp_err_t esp_efuse_write_reg(esp_efuse_block_t blk, unsigned int num_reg, uint32_t val); + +/** + * @brief Return efuse coding scheme for blocks. + * + * Note: The coding scheme is applicable only to 1, 2 and 3 blocks. For 0 block, the coding scheme is always ``NONE``. + * + * @param[in] blk Block number of eFuse. + * @return Return efuse coding scheme for blocks + */ +esp_efuse_coding_scheme_t esp_efuse_get_coding_scheme(esp_efuse_block_t blk); + +/** + * @brief Read key to efuse block starting at the offset and the required size. + * + * @param[in] blk Block number of eFuse. + * @param[in] dst_key A pointer to array that will contain the result of reading. + * @param[in] offset_in_bits Start bit in block. + * @param[in] size_bits The number of bits required to read. + * + * @return + * - ESP_OK: The operation was successfully completed. + * - ESP_ERR_INVALID_ARG: Error in the passed arguments. + * - ESP_ERR_CODING: Error range of data does not match the coding scheme. + */ +esp_err_t esp_efuse_read_block(esp_efuse_block_t blk, void* dst_key, size_t offset_in_bits, size_t size_bits); + +/** + * @brief Write key to efuse block starting at the offset and the required size. + * + * @param[in] blk Block number of eFuse. + * @param[in] src_key A pointer to array that contains the key for writing. + * @param[in] offset_in_bits Start bit in block. + * @param[in] size_bits The number of bits required to write. + * + * @return + * - ESP_OK: The operation was successfully completed. + * - ESP_ERR_INVALID_ARG: Error in the passed arguments. + * - ESP_ERR_CODING: Error range of data does not match the coding scheme. + * - ESP_ERR_EFUSE_REPEATED_PROG: Error repeated programming of programmed bits + */ +esp_err_t esp_efuse_write_block(esp_efuse_block_t blk, const void* src_key, size_t offset_in_bits, size_t size_bits); + +/** + * @brief Returns chip version from efuse + * + * @return chip version + */ +uint8_t esp_efuse_get_chip_ver(void); + +/** + * @brief Returns chip package from efuse + * + * @return chip package + */ +uint32_t esp_efuse_get_pkg_ver(void); + +/* @brief Permanently update values written to the efuse write registers + * + * After updating EFUSE_BLKx_WDATAx_REG registers with new values to + * write, call this function to permanently write them to efuse. + * + * @note Setting bits in efuse is permanent, they cannot be unset. + * + * @note Due to this restriction you don't need to copy values to + * Efuse write registers from the matching read registers, bits which + * are set in the read register but unset in the matching write + * register will be unchanged when new values are burned. + * + * @note This function is not threadsafe, if calling code updates + * efuse values from multiple tasks then this is caller's + * responsibility to serialise. + * + * After burning new efuses, the read registers are updated to match + * the new efuse values. + */ +void esp_efuse_burn_new_values(void); + +/* @brief Reset efuse write registers + * + * Efuse write registers are written to zero, to negate + * any changes that have been staged here. + * + * @note This function is not threadsafe, if calling code updates + * efuse values from multiple tasks then this is caller's + * responsibility to serialise. + */ +void esp_efuse_reset(void); + +/* @brief Disable BASIC ROM Console via efuse + * + * By default, if booting from flash fails the ESP32 will boot a + * BASIC console in ROM. + * + * Call this function (from bootloader or app) to permanently + * disable the console on this chip. + */ +void esp_efuse_disable_basic_rom_console(void); + +/* @brief Encode one or more sets of 6 byte sequences into + * 8 bytes suitable for 3/4 Coding Scheme. + * + * This function is only useful if the CODING_SCHEME efuse + * is set to value 1 for 3/4 Coding Scheme. + * + * @param[in] in_bytes Pointer to a sequence of bytes to encode for 3/4 Coding Scheme. Must have length in_bytes_len. After being written to hardware, these bytes will read back as little-endian words. + * @param[out] out_words Pointer to array of words suitable for writing to efuse write registers. Array must contain 2 words (8 bytes) for every 6 bytes in in_bytes_len. Can be a pointer to efuse write registers. + * @param in_bytes_len. Length of array pointed to by in_bytes, in bytes. Must be a multiple of 6. + * + * @return ESP_ERR_INVALID_ARG if either pointer is null or in_bytes_len is not a multiple of 6. ESP_OK otherwise. + */ +esp_err_t esp_efuse_apply_34_encoding(const uint8_t *in_bytes, uint32_t *out_words, size_t in_bytes_len); + +/* @brief Write random data to efuse key block write registers + * + * @note Caller is responsible for ensuring efuse + * block is empty and not write protected, before calling. + * + * @note Behaviour depends on coding scheme: a 256-bit key is + * generated and written for Coding Scheme "None", a 192-bit key + * is generated, extended to 256-bits by the Coding Scheme, + * and then writtten for 3/4 Coding Scheme. + * + * @note This function does not burn the new values, caller should + * call esp_efuse_burn_new_values() when ready to do this. + * + * @param blk_wdata0_reg Address of the first data write register + * in the block + */ +void esp_efuse_write_random_key(uint32_t blk_wdata0_reg); + +/* @brief Return secure_version from efuse field. + * @return Secure version from efuse field + */ +uint32_t esp_efuse_read_secure_version(); + +/* @brief Check secure_version from app and secure_version and from efuse field. + * + * @param secure_version Secure version from app. + * @return + * - True: If version of app is equal or more then secure_version from efuse. + */ +bool esp_efuse_check_secure_version(uint32_t secure_version); + +/* @brief Write efuse field by secure_version value. + * + * Update the secure_version value is available if the coding scheme is None. + * Note: Do not use this function in your applications. This function is called as part of the other API. + * + * @param[in] secure_version Secure version from app. + * @return + * - ESP_OK: Successful. + * - ESP_FAIL: secure version of app cannot be set to efuse field. + * - ESP_ERR_NOT_SUPPORTED: Anti rollback is not supported with the 3/4 and Repeat coding scheme. + */ +esp_err_t esp_efuse_update_secure_version(uint32_t secure_version); + +/* @brief Initializes variables: offset and size to simulate the work of an eFuse. + * + * Note: To simulate the work of an eFuse need to set CONFIG_EFUSE_SECURE_VERSION_EMULATE option + * and to add in the partition.csv file a line `efuse_em, data, efuse, , 0x2000,`. + * + * @param[in] offset The starting address of the partition where the eFuse data will be located. + * @param[in] size The size of the partition. + */ +void esp_efuse_init(uint32_t offset, uint32_t size); + +#ifdef __cplusplus +} +#endif + +#endif // _ESP_EFUSE_MANAGER_H_ diff --git a/tools/sdk/include/efuse/esp_efuse_table.h b/tools/sdk/include/efuse/esp_efuse_table.h new file mode 100644 index 00000000..a0137c01 --- /dev/null +++ b/tools/sdk/include/efuse/esp_efuse_table.h @@ -0,0 +1,69 @@ +// Copyright 2017-2018 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at", +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License + +#ifdef __cplusplus +extern "C" { +#endif + + +// md5_digest_table 2e23344575b3d07f01ecb695294e9770 +// This file was generated from the file esp_efuse_table.csv. DO NOT CHANGE THIS FILE MANUALLY. +// If you want to change some fields, you need to change esp_efuse_table.csv file +// then run `efuse_common_table` or `efuse_custom_table` command it will generate this file. +// To show efuse_table run the command 'show_efuse_table'. + + +extern const esp_efuse_desc_t* ESP_EFUSE_MAC_FACTORY[]; +extern const esp_efuse_desc_t* ESP_EFUSE_MAC_FACTORY_CRC[]; +extern const esp_efuse_desc_t* ESP_EFUSE_MAC_CUSTOM_CRC[]; +extern const esp_efuse_desc_t* ESP_EFUSE_MAC_CUSTOM[]; +extern const esp_efuse_desc_t* ESP_EFUSE_MAC_CUSTOM_VER[]; +extern const esp_efuse_desc_t* ESP_EFUSE_SECURE_BOOT_KEY[]; +extern const esp_efuse_desc_t* ESP_EFUSE_ABS_DONE_0[]; +extern const esp_efuse_desc_t* ESP_EFUSE_ENCRYPT_FLASH_KEY[]; +extern const esp_efuse_desc_t* ESP_EFUSE_ENCRYPT_CONFIG[]; +extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_DL_ENCRYPT[]; +extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_DL_DECRYPT[]; +extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_DL_CACHE[]; +extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_JTAG[]; +extern const esp_efuse_desc_t* ESP_EFUSE_CONSOLE_DEBUG_DISABLE[]; +extern const esp_efuse_desc_t* ESP_EFUSE_FLASH_CRYPT_CNT[]; +extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_CRYPT_CNT[]; +extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK1[]; +extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK2[]; +extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK3[]; +extern const esp_efuse_desc_t* ESP_EFUSE_RD_DIS_BLK1[]; +extern const esp_efuse_desc_t* ESP_EFUSE_RD_DIS_BLK2[]; +extern const esp_efuse_desc_t* ESP_EFUSE_RD_DIS_BLK3[]; +extern const esp_efuse_desc_t* ESP_EFUSE_CHIP_VER_DIS_APP_CPU[]; +extern const esp_efuse_desc_t* ESP_EFUSE_CHIP_VER_DIS_BT[]; +extern const esp_efuse_desc_t* ESP_EFUSE_CHIP_VER_PKG[]; +extern const esp_efuse_desc_t* ESP_EFUSE_CHIP_CPU_FREQ_LOW[]; +extern const esp_efuse_desc_t* ESP_EFUSE_CHIP_CPU_FREQ_RATED[]; +extern const esp_efuse_desc_t* ESP_EFUSE_CHIP_VER_REV1[]; +extern const esp_efuse_desc_t* ESP_EFUSE_CHIP_VER_REV2[]; +extern const esp_efuse_desc_t* ESP_EFUSE_XPD_SDIO_REG[]; +extern const esp_efuse_desc_t* ESP_EFUSE_SDIO_TIEH[]; +extern const esp_efuse_desc_t* ESP_EFUSE_SDIO_FORCE[]; +extern const esp_efuse_desc_t* ESP_EFUSE_ADC_VREF_AND_SDIO_DREF[]; +extern const esp_efuse_desc_t* ESP_EFUSE_ADC1_TP_LOW[]; +extern const esp_efuse_desc_t* ESP_EFUSE_ADC2_TP_LOW[]; +extern const esp_efuse_desc_t* ESP_EFUSE_ADC1_TP_HIGH[]; +extern const esp_efuse_desc_t* ESP_EFUSE_ADC2_TP_HIGH[]; +extern const esp_efuse_desc_t* ESP_EFUSE_SECURE_VERSION[]; + +#ifdef __cplusplus +} +#endif + diff --git a/tools/sdk/include/esp-face/dl_lib_matrix3d.h b/tools/sdk/include/esp-face/dl_lib_matrix3d.h index 4de26b42..8863c05d 100644 --- a/tools/sdk/include/esp-face/dl_lib_matrix3d.h +++ b/tools/sdk/include/esp-face/dl_lib_matrix3d.h @@ -4,8 +4,21 @@ #include #include #include +#include #include +#if CONFIG_SPIRAM_SUPPORT +#include "freertos/FreeRTOS.h" +#endif + +#ifndef max +#define max(x, y) (((x) < (y)) ? (y) : (x)) +#endif + +#ifndef min +#define min(x, y) (((x) < (y)) ? (x) : (y)) +#endif + typedef float fptp_t; typedef uint8_t uc_t; @@ -19,30 +32,37 @@ typedef enum { PADDING_VALID = 0, PADDING_SAME = 1, + PADDING_SAME_DONT_FREE_INPUT = 2, + PADDING_SAME_MXNET = 3, } dl_padding_type; +typedef enum +{ + DL_POOLING_MAX = 0, + DL_POOLING_AVG = 1, +} dl_pooling_type; /* * Matrix for 3d * @Warning: the sequence of variables is fixed, cannot be modified, otherwise there will be errors in esp_dsp_dot_float */ typedef struct { - int w; /*!< Width */ - int h; /*!< Height */ - int c; /*!< Channel */ - int n; /*!< Number of filter, input and output must be 1 */ - int stride; /*!< Step between lines */ - fptp_t *item; /*!< Data */ + int w; /*!< Width */ + int h; /*!< Height */ + int c; /*!< Channel */ + int n; /*!< Number of filter, input and output must be 1 */ + int stride; /*!< Step between lines */ + fptp_t *item; /*!< Data */ } dl_matrix3d_t; typedef struct { - int w; /*!< Width */ - int h; /*!< Height */ - int c; /*!< Channel */ - int n; /*!< Number of filter, input and output must be 1 */ - int stride; /*!< Step between lines */ - uc_t *item; /*!< Data */ + int w; /*!< Width */ + int h; /*!< Height */ + int c; /*!< Channel */ + int n; /*!< Number of filter, input and output must be 1 */ + int stride; /*!< Step between lines */ + uc_t *item; /*!< Data */ } dl_matrix3du_t; typedef struct @@ -52,6 +72,51 @@ typedef struct dl_padding_type padding; } dl_matrix3d_mobilenet_config_t; +/* + * @brief Allocate a zero-initialized space. Must use 'dl_lib_free' to free the memory. + * + * @param cnt Count of units. + * @param size Size of unit. + * @param align Align of memory. If not required, set 0. + * @return Pointer of allocated memory. Null for failed. + */ +static inline void *dl_lib_calloc(int cnt, int size, int align) +{ + int total_size = cnt * size + align + sizeof(void *); + void *res = malloc(total_size); + if (NULL == res) + { +#if CONFIG_SPIRAM_SUPPORT + res = heap_caps_malloc(total_size, MALLOC_CAP_8BIT | MALLOC_CAP_SPIRAM); + } + if (NULL == res) + { + printf("Item psram alloc failed. Size: %d x %d\n", cnt, size); +#else + printf("Item alloc failed. Size: %d x %d\n", cnt, size); +#endif + return NULL; + } + bzero(res, total_size); + void **data = (void **)res + 1; + void **aligned; + if (align) + aligned = (void **)(((size_t)data + (align - 1)) & -align); + else + aligned = data; + + aligned[-1] = res; + return (void *)aligned; +} + +static inline void dl_lib_free(void *d) +{ + if (NULL == d) + return; + + free(((void **)d)[-1]); +} + /* * @brief Allocate a 3D matrix with float items, the access sequence is NHWC * @@ -61,7 +126,31 @@ typedef struct * @param c Channel of matrix3d * @return 3d matrix */ -dl_matrix3d_t *dl_matrix3d_alloc(int n, int w, int h, int c); +static inline dl_matrix3d_t *dl_matrix3d_alloc(int n, int w, int h, int c) +{ + dl_matrix3d_t *r = (dl_matrix3d_t *)dl_lib_calloc(1, sizeof(dl_matrix3d_t), 0); + if (NULL == r) + { + printf("internal r failed.\n"); + return NULL; + } + fptp_t *items = (fptp_t *)dl_lib_calloc(n * w * h * c, sizeof(fptp_t), 0); + if (NULL == items) + { + printf("matrix3d item alloc failed.\n"); + dl_lib_free(r); + return NULL; + } + + r->w = w; + r->h = h; + r->c = c; + r->n = n; + r->stride = w * c; + r->item = items; + + return r; +} /* * @brief Allocate a 3D matrix with 8-bits items, the access sequence is NHWC @@ -72,21 +161,68 @@ dl_matrix3d_t *dl_matrix3d_alloc(int n, int w, int h, int c); * @param c Channel of matrix3d * @return 3d matrix */ -dl_matrix3du_t *dl_matrix3du_alloc(int n, int w, int h, int c); +static inline dl_matrix3du_t *dl_matrix3du_alloc(int n, int w, int h, int c) +{ + dl_matrix3du_t *r = (dl_matrix3du_t *)dl_lib_calloc(1, sizeof(dl_matrix3du_t), 0); + if (NULL == r) + { + printf("internal r failed.\n"); + return NULL; + } + uc_t *items = (uc_t *)dl_lib_calloc(n * w * h * c, sizeof(uc_t), 0); + if (NULL == items) + { + printf("matrix3du item alloc failed.\n"); + dl_lib_free(r); + return NULL; + } + + r->w = w; + r->h = h; + r->c = c; + r->n = n; + r->stride = w * c; + r->item = items; + + return r; +} /* * @brief Free a matrix3d * * @param m matrix3d with float items */ -void dl_matrix3d_free(dl_matrix3d_t *m); +static inline void dl_matrix3d_free(dl_matrix3d_t *m) +{ + if (NULL == m) + return; + if (NULL == m->item) + { + dl_lib_free(m); + return; + } + dl_lib_free(m->item); + dl_lib_free(m); +} /* * @brief Free a matrix3d * * @param m matrix3d with 8-bits items */ -void dl_matrix3du_free(dl_matrix3du_t *m); +static inline void dl_matrix3du_free(dl_matrix3du_t *m) +{ + if (NULL == m) + return; + if (NULL == m->item) + { + dl_lib_free(m); + return; + } + dl_lib_free(m->item); + dl_lib_free(m); +} + /* * @brief Dot product with a vector and matrix @@ -138,6 +274,15 @@ void dl_matrix3du_slice_copy(dl_matrix3du_t *dst, int w, int h); +/** + * @brief Transform a sliced matrix block from nhwc to nchw, the block needs to be memory continous. + * + * @param out The destination sliced matrix in nchw + * @param in The source sliced matrix in nhwc + */ +void dl_matrix3d_sliced_transform_nchw(dl_matrix3d_t *out, + dl_matrix3d_t *in); + /** * @brief Do a general CNN layer pass, dimension is (number, width, height, channel) * @@ -159,20 +304,6 @@ dl_matrix3d_t *dl_matrix3d_conv(dl_matrix3d_t *in, int padding, int mode); -/** - * @brief Do a general CNN layer pass, dimension is (number, width, height, channel) - * - * @param in Input matrix3d - * @param filter Weights of the neurons - * @param bias Bias for the CNN layer - * @param stride_x The step length of the convolution window in x(width) direction - * @param stride_y The step length of the convolution window in y(height) direction - * @param padding One of VALID or SAME - * @param mode Do convolution using C implement or xtensa implement, 0 or 1, with respect - * If ESP_PLATFORM is not defined, this value is not used. Default is 0 - * @return The result of CNN layer - */ - /** * @brief Do a global average pooling layer pass, dimension is (number, width, height, channel) * @@ -182,6 +313,25 @@ dl_matrix3d_t *dl_matrix3d_conv(dl_matrix3d_t *in, */ dl_matrix3d_t *dl_matrix3d_global_pool(dl_matrix3d_t *in); +/** + * @brief Calculate pooling layer of a feature map + * + * @param in Input matrix, size (1, w, h, c) + * @param f_w Window width + * @param f_h Window height + * @param stride_x Stride in horizontal direction + * @param stride_y Stride in vertical direction + * @param padding Padding type: PADDING_VALID and PADDING_SAME + * @param pooling_type Pooling type: DL_POOLING_MAX and POOLING_AVG + * @return Resulting matrix, size (1, w', h', c) + */ +dl_matrix3d_t *dl_matrix3d_pooling(dl_matrix3d_t *in, + int f_w, + int f_h, + int stride_x, + int stride_y, + dl_padding_type padding, + dl_pooling_type pooling_type); /** * @brief Do a batch normalization operation, update the input matrix3d: input = input * scale + offset * @@ -414,6 +564,13 @@ dl_matrix3d_t *dl_matrix3duf_conv_common(dl_matrix3du_t *in, int stride_y, dl_padding_type padding); +dl_matrix3d_t *dl_matrix3dff_conv_common(dl_matrix3d_t *in, + dl_matrix3d_t *filter, + dl_matrix3d_t *bias, + int stride_x, + int stride_y, + dl_padding_type padding); + // // Depthwise 3x3 // diff --git a/tools/sdk/include/esp-face/dl_lib_matrix3dq.h b/tools/sdk/include/esp-face/dl_lib_matrix3dq.h index 57e5e92c..593cbe89 100644 --- a/tools/sdk/include/esp-face/dl_lib_matrix3dq.h +++ b/tools/sdk/include/esp-face/dl_lib_matrix3dq.h @@ -11,13 +11,13 @@ typedef int16_t qtp_t; typedef struct { /******* fix start *******/ - int w; /*!< Width */ - int h; /*!< Height */ - int c; /*!< Channel */ - int n; /*!< Number of filter, input and output must be 1 */ - int stride; /*!< Step between lines */ - int exponent; /*!< Exponent for quantization */ - qtp_t *item; /*!< Data */ + int w; /*!< Width */ + int h; /*!< Height */ + int c; /*!< Channel */ + int n; /*!< Number of filter, input and output must be 1 */ + int stride; /*!< Step between lines */ + int exponent; /*!< Exponent for quantization */ + qtp_t *item; /*!< Data */ /******* fix end *******/ } dl_matrix3dq_t; @@ -38,23 +38,22 @@ typedef struct */ typedef enum { - DL_C_IMPL = 0, /*!< ANSI C */ - DL_XTENSA_IMPL = 1 /*!< Handwrite xtensa instruction */ + DL_C_IMPL = 0, /*!< ANSI C */ + DL_XTENSA_IMPL = 1 /*!< Handwrite xtensa instruction */ } dl_conv_mode; - /** * Configuration of mobilenet operation */ typedef struct { - int stride_x; /*!< Strides of width */ - int stride_y; /*!< Strides of height */ - dl_padding_type padding; /*!< Padding type */ - dl_conv_mode mode; /*!< Implementation mode */ - int dilate_exponent; /*!< Exponent of dilation filter */ - int depthwise_exponent; /*!< Exponent of depthwise filter */ - int compress_exponent; /*!< Exponent of compress filter */ + int stride_x; /*!< Strides of width */ + int stride_y; /*!< Strides of height */ + dl_padding_type padding; /*!< Padding type */ + dl_conv_mode mode; /*!< Implementation mode */ + int dilate_exponent; /*!< Exponent of dilation filter */ + int depthwise_exponent; /*!< Exponent of depthwise filter */ + int compress_exponent; /*!< Exponent of compress filter */ } dl_matrix3dq_mobilenet_config_t; // @@ -71,14 +70,52 @@ typedef struct * @param e Exponent of matrix data * @return 3d quantized matrix */ -dl_matrix3dq_t *dl_matrix3dq_alloc(int n, int w, int h, int c, int e); +static inline dl_matrix3dq_t *dl_matrix3dq_alloc(int n, int w, int h, int c, int e) +{ + dl_matrix3dq_t *r = (dl_matrix3dq_t *)dl_lib_calloc(1, sizeof(dl_matrix3dq_t), 0); + if (NULL == r) + { + printf("dl_matrix3dq alloc failed.\n"); + return NULL; + } + + qtp_t *items = (qtp_t *)dl_lib_calloc(n * w * h * c, sizeof(qtp_t), 16); + if (NULL == items) + { + printf("matrix3dq item alloc failed.\n"); + dl_lib_free(r); + return NULL; + } + + r->w = w; + r->h = h; + r->c = c; + r->n = n; + r->exponent = e; + r->stride = w * c; + r->item = items; + + return r; +} /* * @brief Free a 3d quantized matrix * * @param m 3d quantised matrix */ -void dl_matrix3dq_free(dl_matrix3dq_t *m); +static inline void dl_matrix3dq_free(dl_matrix3dq_t *m) +{ + if (NULL == m) + return; + if (NULL == m->item) + { + dl_lib_free(m); + return; + } + dl_lib_free(m->item); + dl_lib_free(m); +} + /** * @brief Copy a range of items from an existing matrix to a preallocated matrix @@ -92,6 +129,15 @@ void dl_matrix3dq_free(dl_matrix3dq_t *m); */ void dl_matrix3dq_slice_copy(dl_matrix3dq_t *dst, dl_matrix3dq_t *src, int x, int y, int w, int h); +/** + * @brief Transform a sliced matrix block from nhwc to nchw, the block needs to be memory continous. + * + * @param out The destination sliced matrix in nchw + * @param in The source sliced matrix in nhwc + */ +void dl_matrix3dq_sliced_transform_nchw(dl_matrix3dq_t *out, + dl_matrix3dq_t *in); + /** * @brief Transform a fixed point matrix to a float point matrix * @@ -245,7 +291,8 @@ dl_matrix3dq_t *dl_matrix3dq_concat_8(dl_matrix3dq_t *in_1, void dl_matrix3dqq_conv_1x1(dl_matrix3dq_t *out, dl_matrix3dq_t *in, dl_matrix3dq_t *filter, - dl_conv_mode mode); + dl_conv_mode mode, + char *name); /** * @brief Do 1x1 convolution with a quantized matrix, with relu activation @@ -258,7 +305,8 @@ void dl_matrix3dqq_conv_1x1(dl_matrix3dq_t *out, void dl_matrix3dqq_conv_1x1_with_relu(dl_matrix3dq_t *out, dl_matrix3dq_t *in, dl_matrix3dq_t *filter, - dl_conv_mode mode); + dl_conv_mode mode, + char *name); /** * @brief Do 1x1 convolution with a quantized matrix, with bias adding @@ -290,13 +338,25 @@ void dl_matrix3dqq_conv_1x1_with_bias_relu(dl_matrix3dq_t *out, dl_matrix3dq_t *in, dl_matrix3dq_t *filter, dl_matrix3dq_t *bias, - dl_conv_mode mode); + dl_conv_mode mode, + char *name); +/** + * @brief + * + * @param out + * @param in + * @param filter + * @param prelu + * @param mode + * @param name + */ void dl_matrix3dqq_conv_1x1_with_prelu(dl_matrix3dq_t *out, dl_matrix3dq_t *in, dl_matrix3dq_t *filter, dl_matrix3dq_t *prelu, - dl_conv_mode mode); + dl_conv_mode mode, + char *name); /** * @brief Do 1x1 convolution with an 8-bit fixed point matrix @@ -309,7 +369,8 @@ void dl_matrix3dqq_conv_1x1_with_prelu(dl_matrix3dq_t *out, void dl_matrix3duq_conv_1x1(dl_matrix3dq_t *out, dl_matrix3du_t *in, dl_matrix3dq_t *filter, - dl_conv_mode mode); + dl_conv_mode mode, + char *name); /** * @brief Do 1x1 convolution with an 8-bit fixed point matrix, with bias adding @@ -324,66 +385,47 @@ void dl_matrix3duq_conv_1x1_with_bias(dl_matrix3dq_t *out, dl_matrix3du_t *in, dl_matrix3dq_t *filter, dl_matrix3dq_t *bias, - dl_conv_mode mode); + dl_conv_mode mode, + char *name); // // Conv 3x3 // -/** - * @brief Do 3x3 convolution basic operation with a quantized matrix - * - * @param out Preallocated quantized matrix - * @param in Input matrix, size (1, w, h, c) - * @param filter 3x3 filter, size (n, 3, 3, c) - * @param stride_x Stride of width - * @param stride_y Stride of height - */ -void dl_matrix3dqq_conv_3x3_op(dl_matrix3dq_t *out, - dl_matrix3dq_t *in, - dl_matrix3dq_t *filter, - int stride_x, - int stride_y); /** * @brief Do 3x3 convolution with a quantized matrix - * - * @param in Input matrix, size (1, w, h, c) - * @param filter 3x3 filter, size (n, 3, 3, c) - * @param stride_x Stride of width - * @param stride_y Stride of height - * @param padding Padding type, 0: valid, 1: same - * @param exponent Exponent for resulting matrix - * @return Resulting quantized matrix + * + * @param input Input matrix, size (1, w, h, c) + * @param filter 3x3 filter, size (n, 3, 3, c) + * @param stride_x Stride of width + * @param stride_y Stride of height + * @param padding Padding type, 0: valid, 1: same + * @param exponent Exponent for resulting matrix + * @param name + * @return dl_matrix3dq_t* Resulting quantized matrix */ -dl_matrix3dq_t *dl_matrix3dqq_conv_3x3(dl_matrix3dq_t *in, +dl_matrix3dq_t *dl_matrix3dqq_conv_3x3(dl_matrix3dq_t *input, dl_matrix3dq_t *filter, int stride_x, int stride_y, dl_padding_type padding, - int exponent); + int exponent, + char *name); /** * @brief Do 3x3 convolution with a quantized matrix, with bias adding - * - * @param in Input matrix, size (1, w, h, c) - * @param filter 3x3 filter, size (n, 3, 3, c) - * @param bias Bias, size (1, 1, 1, n) - * @param stride_x Stride of width - * @param stride_y Stride of height - * @param padding Padding type, 0: valid, 1: same - * @param exponent Exponent for resulting matrix - * @return Resulting quantized matrix + * + * @param input Input matrix, size (1, w, h, c) + * @param filter 3x3 filter, size (n, 3, 3, c) + * @param bias Bias, size (1, 1, 1, n) + * @param stride_x Stride of width + * @param stride_y Stride of height + * @param padding + * @param exponent Exponent for resulting matrix + * @param name + * @return dl_matrix3dq_t* Resulting quantized matrix */ -dl_matrix3dq_t *dl_matrix3dqq_conv_3x3_with_bias(dl_matrix3dq_t *in, - dl_matrix3dq_t *f, - dl_matrix3dq_t *bias, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent, - int relu); - -dl_matrix3dq_t *dl_matrix3duq_conv_3x3_with_bias(dl_matrix3du_t *in, +dl_matrix3dq_t *dl_matrix3dqq_conv_3x3_with_bias(dl_matrix3dq_t *input, dl_matrix3dq_t *filter, dl_matrix3dq_t *bias, int stride_x, @@ -392,7 +434,65 @@ dl_matrix3dq_t *dl_matrix3duq_conv_3x3_with_bias(dl_matrix3du_t *in, int exponent, char *name); -dl_matrix3dq_t *dl_matrix3duq_conv_3x3_with_bias_prelu(dl_matrix3du_t *in, +/** + * @brief Do 3x3 convolution with a quantized matrix, with bias adding, relu activation + * + * @param input Input matrix, size (1, w, h, c) + * @param filter 3x3 filter, size (n, 3, 3, c) + * @param bias Bias, size (1, 1, 1, n) + * @param stride_x Stride of width + * @param stride_y Stride of height + * @param padding + * @param exponent Exponent for resulting matrix + * @param name + * @return dl_matrix3dq_t* Resulting quantized matrix + */ +dl_matrix3dq_t *dl_matrix3dqq_conv_3x3_with_bias_relu(dl_matrix3dq_t *input, + dl_matrix3dq_t *filter, + dl_matrix3dq_t *bias, + int stride_x, + int stride_y, + dl_padding_type padding, + int exponent, + char *name); + +/** + * @brief + * + * @param input + * @param filter + * @param bias + * @param stride_x + * @param stride_y + * @param padding + * @param exponent + * @param name + * @return dl_matrix3dq_t* + */ +dl_matrix3dq_t *dl_matrix3duq_conv_3x3_with_bias(dl_matrix3du_t *input, + dl_matrix3dq_t *filter, + dl_matrix3dq_t *bias, + int stride_x, + int stride_y, + dl_padding_type padding, + int exponent, + char *name); + +/** + * @brief + * + * @param input + * @param filter + * @param bias + * @param prelu + * @param stride_x + * @param stride_y + * @param padding + * @param exponent + * @param name + * @return dl_matrix3dq_t* + */ +dl_matrix3dq_t *dl_matrix3duq_conv_3x3_with_bias_prelu(dl_matrix3du_t *input, dl_matrix3dq_t *filter, dl_matrix3dq_t *bias, dl_matrix3dq_t *prelu, @@ -402,6 +502,17 @@ dl_matrix3dq_t *dl_matrix3duq_conv_3x3_with_bias_prelu(dl_matrix3du_t *in, int exponent, char *name); + + +dl_matrix3dq_t *dl_matrix3dqq_conv_3x3_with_bias_prelu(dl_matrix3dq_t *input, + dl_matrix3dq_t *filter, + dl_matrix3dq_t *bias, + dl_matrix3dq_t *prelu, + int stride_x, + int stride_y, + dl_padding_type padding, + int exponent, + char *name); // // Conv common // @@ -469,7 +580,8 @@ dl_matrix3dq_t *dl_matrix3duq_depthwise_conv_3x3(dl_matrix3du_t *in, int stride_x, int stride_y, dl_padding_type padding, - int exponent); + int exponent, + char *name); /** * @brief Do 3x3 depthwise convolution with a quantized matrix @@ -487,7 +599,8 @@ dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3(dl_matrix3dq_t *in, int stride_x, int stride_y, dl_padding_type padding, - int exponent); + int exponent, + char *name); #if CONFIG_DEVELOPING_CODE dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3_2(dl_matrix3dq_t *in, @@ -495,14 +608,16 @@ dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3_2(dl_matrix3dq_t *in, int stride_x, int stride_y, dl_padding_type padding, - int exponent); + int exponent, + char *name); dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3_3(dl_matrix3dq_t *in, dl_matrix3dq_t *filter, int stride_x, int stride_y, dl_padding_type padding, - int exponent); + int exponent, + char *name); #endif /** @@ -519,13 +634,14 @@ dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3_3(dl_matrix3dq_t *in, * @return Resulting quantized matrix */ dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3_with_bias(dl_matrix3dq_t *in, - dl_matrix3dq_t *f, - dl_matrix3dq_t *bias, - int stride_x, - int stride_y, - dl_padding_type padding, - int exponent, - int relu); + dl_matrix3dq_t *f, + dl_matrix3dq_t *bias, + int stride_x, + int stride_y, + dl_padding_type padding, + int exponent, + int relu, + char *name); /** * @brief Do 3x3 depthwise convolution with a quantized matrix, with bias adding and stride 1 @@ -539,11 +655,12 @@ dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3_with_bias(dl_matrix3dq_t *in, * @return Resulting quantized matrix */ dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3s1_with_bias(dl_matrix3dq_t *in, - dl_matrix3dq_t *f, - dl_matrix3dq_t *bias, - dl_padding_type padding, - int exponent, - int relu); + dl_matrix3dq_t *f, + dl_matrix3dq_t *bias, + dl_padding_type padding, + int exponent, + int relu, + char *name); dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3_with_prelu(dl_matrix3dq_t *in, dl_matrix3dq_t *filter, @@ -551,9 +668,25 @@ dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3_with_prelu(dl_matrix3dq_t *in, int stride_x, int stride_y, dl_padding_type padding, - int exponent); + int exponent, + char *name); +dl_matrix3dq_t *dl_matrix3dqq_depthwise_conv_3x3_with_bias_prelu(dl_matrix3dq_t *in, + dl_matrix3dq_t *f, + dl_matrix3dq_t *bias, + dl_matrix3dq_t *prelu, + int stride_x, + int stride_y, + dl_padding_type padding, + int exponent, + char *name); +dl_matrix3dq_t *dl_matrix3dqq_global_depthwise_conv_with_bias(dl_matrix3dq_t *in, + dl_matrix3dq_t *filter, + dl_matrix3dq_t *bias, + int exponent, + char *name); + // // Depthwise Common // @@ -594,11 +727,13 @@ void dl_matrix3dqq_dot_product(dl_matrix3dq_t *out, * @param in Input matrix, size (1, 1, 1, w) * @param filter Filter matrix, size (1, w, h, 1) * @param mode Implementation mode + * @param name */ void dl_matrix3dqq_fc(dl_matrix3dq_t *out, dl_matrix3dq_t *in, dl_matrix3dq_t *filter, - dl_conv_mode mode); + dl_conv_mode mode, + char *name); /** * @brief Do fully connected layer forward, with bias adding @@ -695,6 +830,86 @@ dl_matrix3dq_t *dl_matrix3dqq_mobilefaceblock(dl_matrix3dq_t *in, dl_conv_mode mode, int shortcut); +dl_matrix3dq_t *dl_matrix3dqq_mobilefaceblock_prelu(dl_matrix3dq_t *in, + dl_matrix3dq_t *pw, + dl_matrix3dq_t *pw_bias, + dl_matrix3dq_t *pw_prelu, + dl_matrix3dq_t *dw, + dl_matrix3dq_t *dw_bias, + dl_matrix3dq_t *dw_prelu, + dl_matrix3dq_t *pw_linear, + dl_matrix3dq_t *pw_linear_bias, + int pw_exponent, + int dw_exponent, + int pw_linear_exponent, + int stride_x, + int stride_y, + dl_padding_type padding, + dl_conv_mode mode, + int shortcut); + +dl_matrix3dq_t *dl_matrix3dqq_mobilefaceblock_prelu_split_2_2(dl_matrix3dq_t *in, + dl_matrix3dq_t *pw_1, + dl_matrix3dq_t *pw_2, + dl_matrix3dq_t *pw_bias, + dl_matrix3dq_t *pw_prelu, + dl_matrix3dq_t *dw, + dl_matrix3dq_t *dw_bias, + dl_matrix3dq_t *dw_prelu, + dl_matrix3dq_t *pw_linear_1, + dl_matrix3dq_t *pw_linear_2, + dl_matrix3dq_t *pw_linear_bias, + int pw_exponent, + int dw_exponent, + int pw_linear_exponent, + int stride_x, + int stride_y, + dl_padding_type padding, + dl_conv_mode mode, + int shortcut); + +dl_matrix3dq_t *dl_matrix3dqq_mobilefaceblock_prelu_split_4_4(dl_matrix3dq_t *in, + dl_matrix3dq_t *pw_1, + dl_matrix3dq_t *pw_2, + dl_matrix3dq_t *pw_3, + dl_matrix3dq_t *pw_4, + dl_matrix3dq_t *pw_bias, + dl_matrix3dq_t *pw_prelu, + dl_matrix3dq_t *dw, + dl_matrix3dq_t *dw_bias, + dl_matrix3dq_t *dw_prelu, + dl_matrix3dq_t *pw_linear_1, + dl_matrix3dq_t *pw_linear_2, + dl_matrix3dq_t *pw_linear_3, + dl_matrix3dq_t *pw_linear_4, + dl_matrix3dq_t *pw_linear_bias, + int pw_exponent, + int dw_exponent, + int pw_linear_exponent, + int stride_x, + int stride_y, + dl_padding_type padding, + dl_conv_mode mode, + int shortcut); + +dl_matrix3dq_t *dl_matrix3dqq_mobilefaceblock_prelu_split_1_2(dl_matrix3dq_t *in, + dl_matrix3dq_t *pw, + dl_matrix3dq_t *pw_bias, + dl_matrix3dq_t *pw_prelu, + dl_matrix3dq_t *dw, + dl_matrix3dq_t *dw_bias, + dl_matrix3dq_t *dw_prelu, + dl_matrix3dq_t *pw_linear_1, + dl_matrix3dq_t *pw_linear_2, + dl_matrix3dq_t *pw_linear_bias, + int pw_exponent, + int dw_exponent, + int pw_linear_exponent, + int stride_x, + int stride_y, + dl_padding_type padding, + dl_conv_mode mode, + int shortcut); // // Mobilenet // @@ -749,23 +964,49 @@ dl_matrix3dq_t *dl_matrix3duq_mobilenet(dl_matrix3du_t *in, // Padding // -dl_error_type dl_matrix3dqq_padding(dl_matrix3dq_t **padded_in, - dl_matrix3dq_t **out, - dl_matrix3dq_t *in, - int out_c, +/** + * @brief + * + * @param padded_input + * @param output_height + * @param output_width + * @param input + * @param stride_x + * @param stride_y + * @param kernel_size + * @param padding_type + * @return dl_error_type + */ +dl_error_type dl_matrix3dqq_padding(dl_matrix3dq_t **padded_input, + int *output_height, + int *output_width, + dl_matrix3dq_t *input, int stride_x, int stride_y, - int padding, - int exponent); + int kernel_size, + dl_padding_type padding_type); -dl_error_type dl_matrix3duq_padding(dl_matrix3du_t **padded_in, - dl_matrix3dq_t **out, - dl_matrix3du_t *in, - int out_c, +/** + * @brief + * + * @param padded_input + * @param output_height + * @param output_width + * @param input + * @param stride_x + * @param stride_y + * @param kernel_size + * @param padding_type + * @return dl_error_type + */ +dl_error_type dl_matrix3duq_padding(dl_matrix3du_t **padded_input, + int *output_height, + int *output_width, + dl_matrix3du_t *input, int stride_x, int stride_y, - int padding, - int exponent); + int kernel_size, + dl_padding_type padding_type); // // Pooling @@ -777,3 +1018,23 @@ dl_error_type dl_matrix3duq_padding(dl_matrix3du_t **padded_in, * @return Resulting matrix, size (1, 1, 1, c) */ dl_matrix3dq_t *dl_matrix3dq_global_pool(dl_matrix3dq_t *in); + +/** + * @brief Calculate pooling layer of a feature map + * + * @param in Input matrix, size (1, w, h, c) + * @param f_w Window width + * @param f_h Window height + * @param stride_x Stride in horizontal direction + * @param stride_y Stride in vertical direction + * @param padding Padding type: PADDING_VALID and PADDING_SAME + * @param pooling_type Pooling type: DL_POOLING_MAX and POOLING_AVG + * @return Resulting matrix, size (1, w', h', c) + */ +dl_matrix3dq_t *dl_matrix3dq_pooling(dl_matrix3dq_t *in, + int f_w, + int f_h, + int stride_x, + int stride_y, + dl_padding_type padding, + dl_pooling_type pooling_type); diff --git a/tools/sdk/include/esp-face/fr_forward.h b/tools/sdk/include/esp-face/fr_forward.h index a6db0a1b..c9dfd2a0 100644 --- a/tools/sdk/include/esp-face/fr_forward.h +++ b/tools/sdk/include/esp-face/fr_forward.h @@ -12,7 +12,7 @@ extern "C" #define FACE_WIDTH 56 #define FACE_HEIGHT 56 #define FACE_ID_SIZE 512 -#define FACE_REC_THRESHOLD 0.5 +#define FACE_REC_THRESHOLD 0.55 #define LEFT_EYE_X 0 #define LEFT_EYE_Y 1 @@ -20,6 +20,10 @@ extern "C" #define RIGHT_EYE_Y 7 #define NOSE_X 4 #define NOSE_Y 5 +#define LEFT_MOUTH_X 2 +#define LEFT_MOUTH_Y 3 +#define RIGHT_MOUTH_X 8 +#define RIGHT_MOUTH_Y 9 #define EYE_DIST_SET 16.5f #define NOSE_EYE_RATIO_THRES_MIN 0.49f @@ -81,13 +85,24 @@ extern "C" * @return ESP_OK Input face is good for recognition * @return ESP_FAIL Input face is not good for recognition */ - int8_t align_face(box_array_t *onet_boxes, + int8_t align_face_rot(box_array_t *onet_boxes, dl_matrix3du_t *src, dl_matrix3du_t *dest); int8_t align_face2(fptp_t *landmark, dl_matrix3du_t *src, dl_matrix3du_t *dest); + + int8_t align_face_sim(box_array_t *onet_boxes, + dl_matrix3du_t *src, + dl_matrix3du_t *dest); + + inline int8_t align_face(box_array_t *onet_boxes, + dl_matrix3du_t *src, + dl_matrix3du_t *dest) + { + return align_face_sim(onet_boxes, src, dest); + } /** * @brief Run the face recognition model to get the face feature diff --git a/tools/sdk/include/esp-face/frmn.h b/tools/sdk/include/esp-face/frmn.h index 171f69ad..6fb6d50d 100644 --- a/tools/sdk/include/esp-face/frmn.h +++ b/tools/sdk/include/esp-face/frmn.h @@ -25,15 +25,6 @@ extern "C" */ dl_matrix3dq_t *frmn_q(dl_matrix3dq_t *in, dl_conv_mode mode); - /** - * @brief Forward the face recognition process with frmn2 model. Calculate in quantization. - * - * @param in Image matrix, rgb888 format, size is 56x56, normalized - * @param mode 0: C implement; 1: handwrite xtensa instruction implement - * @return Face ID feature vector, size is 512 - */ - dl_matrix3dq_t *frmn2_q(dl_matrix3dq_t *in, dl_conv_mode mode); - /** * @brief Forward the face recognition process with frmn2p model. Calculate in quantization. * @@ -43,14 +34,14 @@ extern "C" */ dl_matrix3dq_t *frmn2p_q(dl_matrix3dq_t *in, dl_conv_mode mode); - /** - * @brief Forward the face recognition process with frmn2c model. Calculate in quantization. - * - * @param in Image matrix, rgb888 format, size is 56x56, normalized - * @param mode 0: C implement; 1: handwrite xtensa instruction implement - * @return Face ID feature vector, size is 512 - */ - dl_matrix3dq_t *frmn2c_q(dl_matrix3dq_t *in, dl_conv_mode mode); + + dl_matrix3dq_t *mfn56_42m_q(dl_matrix3dq_t *in, dl_conv_mode mode); + + dl_matrix3dq_t *mfn56_72m_q(dl_matrix3dq_t *in, dl_conv_mode mode); + + dl_matrix3dq_t *mfn56_112m_q(dl_matrix3dq_t *in, dl_conv_mode mode); + + dl_matrix3dq_t *mfn56_156m_q(dl_matrix3dq_t *in, dl_conv_mode mode); #if __cplusplus } diff --git a/tools/sdk/include/esp-face/image_util.h b/tools/sdk/include/esp-face/image_util.h index 961a1229..65df1bc7 100644 --- a/tools/sdk/include/esp-face/image_util.h +++ b/tools/sdk/include/esp-face/image_util.h @@ -35,9 +35,6 @@ extern "C" #define DL_IMAGE_MIN(A, B) ((A) < (B) ? (A) : (B)) #define DL_IMAGE_MAX(A, B) ((A) < (B) ? (B) : (A)) -#define IMAGE_WIDTH 320 -#define IMAGE_HEIGHT 240 - #define RGB565_MASK_RED 0xF800 #define RGB565_MASK_GREEN 0x07E0 #define RGB565_MASK_BLUE 0x001F @@ -93,7 +90,7 @@ extern "C" *area = w * h; } - static inline void image_calibrate_by_offset(image_list_t *image_list) + static inline void image_calibrate_by_offset(image_list_t *image_list, int image_height, int image_width) { for (image_box_t *head = image_list->head; head; head = head->next) { @@ -102,16 +99,16 @@ extern "C" head->box.box_p[0] = DL_IMAGE_MAX(0, head->box.box_p[0] + head->offset.box_p[0] * w); head->box.box_p[1] = DL_IMAGE_MAX(0, head->box.box_p[1] + head->offset.box_p[1] * w); head->box.box_p[2] += head->offset.box_p[2] * w; - if (head->box.box_p[2] > IMAGE_WIDTH) + if (head->box.box_p[2] > image_width) { - head->box.box_p[2] = IMAGE_WIDTH - 1; - head->box.box_p[0] = IMAGE_WIDTH - w; + head->box.box_p[2] = image_width - 1; + head->box.box_p[0] = image_width - w; } head->box.box_p[3] += head->offset.box_p[3] * h; - if (head->box.box_p[3] > IMAGE_HEIGHT) + if (head->box.box_p[3] > image_height) { - head->box.box_p[3] = IMAGE_HEIGHT - 1; - head->box.box_p[1] = IMAGE_HEIGHT - h; + head->box.box_p[3] = image_height - 1; + head->box.box_p[1] = image_height - h; } } } @@ -154,8 +151,8 @@ extern "C" int h = y2 - y1 + 1; int l = DL_IMAGE_MAX(w, h); - box->box_p[0] = round(DL_IMAGE_MAX(0, x1) + 0.5 * (w - l)); - box->box_p[1] = round(DL_IMAGE_MAX(0, y1) + 0.5 * (h - l)); + box->box_p[0] = DL_IMAGE_MAX(round(DL_IMAGE_MAX(0, x1) + 0.5 * (w - l)), 0); + box->box_p[1] = DL_IMAGE_MAX(round(DL_IMAGE_MAX(0, y1) + 0.5 * (h - l)), 0); box->box_p[2] = box->box_p[0] + l - 1; if (box->box_p[2] > width) @@ -193,20 +190,30 @@ extern "C" * * @param score * @param offset + * @param landmark * @param width * @param height - * @param p_net_size + * @param anchor_number + * @param anchors_size * @param score_threshold - * @param scale + * @param stride + * @param resized_height_scale + * @param resized_width_scale + * @param do_regression * @return image_list_t* */ image_list_t *image_get_valid_boxes(fptp_t *score, fptp_t *offset, + fptp_t *landmark, int width, int height, - int p_net_size, + int anchor_number, + int *anchors_size, fptp_t score_threshold, - fptp_t scale); + int stride, + fptp_t resized_height_scale, + fptp_t resized_width_scale, + bool do_regression); /** * @brief * @@ -284,6 +291,7 @@ extern "C" * @param count */ void transform_output_image(uint16_t *bmp, uint8_t *m, int count); + void transform_output_image_adjustable(uint16_t *bmp, uint8_t *m, int src_w, int src_h, int dst_w, int dst_h); /** * @brief @@ -305,6 +313,20 @@ extern "C" void image_abs_diff(uint8_t *dst, uint8_t *src1, uint8_t *src2, int count); void image_threshold(uint8_t *dst, uint8_t *src, int threshold, int value, int count, en_threshold_mode mode); void image_erode(uint8_t *dst, uint8_t *src, int src_w, int src_h, int src_c); + + typedef float matrixType; + typedef struct + { + int w; + int h; + matrixType **array; + } Matrix; + + Matrix *matrix_alloc(int h, int w); + void matrix_free(Matrix *m); + Matrix *get_similarity_matrix(float *srcx, float *srcy, float *dstx, float *dsty, int num); + void warp_affine(dl_matrix3du_t *img, dl_matrix3du_t *crop, Matrix *M); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/include/esp-face/lssh.h b/tools/sdk/include/esp-face/lssh.h new file mode 100644 index 00000000..69c661c5 --- /dev/null +++ b/tools/sdk/include/esp-face/lssh.h @@ -0,0 +1,91 @@ +/* + * ESPRESSIF MIT License + * + * Copyright (c) 2018 + * + * Permission is hereby granted for use on ESPRESSIF SYSTEMS products only, in which case, + * it is free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ +#pragma once + +#ifdef __cplusplus +extern "C" +{ +#endif +#include "dl_lib_matrix3d.h" +#include "dl_lib_matrix3dq.h" +#include "freertos/FreeRTOS.h" + + typedef struct + { + int resized_height; + int resized_width; + fptp_t y_resize_scale; + fptp_t x_resize_scale; + int enabled_top_k; + fptp_t score_threshold; + fptp_t nms_threshold; + + dl_conv_mode mode; + } lssh_config_t; + + typedef struct + { + int *anchor_size; + int stride; + int boundary; + } lssh_module_config_t; + + typedef struct + { + lssh_module_config_t *module_config; + int number; + } lssh_modules_config_t; + + typedef struct + { + dl_matrix3d_t *category; + dl_matrix3d_t *box_offset; + dl_matrix3d_t *landmark_offset; + } lssh_module_result_t; + + /** + * @brief + * + * @param value + */ + void lssh_module_result_free(lssh_module_result_t value); + + /** + * @brief + * + * @param values + * @param length + */ + void lssh_module_results_free(lssh_module_result_t *values, int length); + + ///////////////////////// + //////sparse_mn_5_q////// + ///////////////////////// + extern lssh_modules_config_t sparse_mn_5_modules_config; + lssh_module_result_t *sparse_mn_5_q_without_landmark(dl_matrix3du_t *image, bool free_image, int enabled_top_k, dl_conv_mode mode); + lssh_module_result_t *sparse_mn_5_q_with_landmark(dl_matrix3du_t *image, bool free_image, int enabled_top_k, dl_conv_mode mode); + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/include/esp-tls/esp_tls.h b/tools/sdk/include/esp-tls/esp_tls.h index 15830d5a..a1cceabe 100644 --- a/tools/sdk/include/esp-tls/esp_tls.h +++ b/tools/sdk/include/esp-tls/esp_tls.h @@ -17,6 +17,7 @@ #include #include #include +#include "esp_err.h" #include "mbedtls/platform.h" #include "mbedtls/net_sockets.h" @@ -56,17 +57,20 @@ typedef struct esp_tls_cfg { - where the first '2' is the length of the protocol and - the subsequent 'h2' is the protocol name */ - const unsigned char *cacert_pem_buf; /*!< Certificate Authority's certificate in a buffer */ + const unsigned char *cacert_pem_buf; /*!< Certificate Authority's certificate in a buffer. + This buffer should be NULL terminated */ unsigned int cacert_pem_bytes; /*!< Size of Certificate Authority certificate pointed to by cacert_pem_buf */ - const unsigned char *clientcert_pem_buf;/*!< Client certificate in a buffer */ + const unsigned char *clientcert_pem_buf;/*!< Client certificate in a buffer + This buffer should be NULL terminated */ unsigned int clientcert_pem_bytes; /*!< Size of client certificate pointed to by clientcert_pem_buf */ - const unsigned char *clientkey_pem_buf; /*!< Client key in a buffer */ + const unsigned char *clientkey_pem_buf; /*!< Client key in a buffer + This buffer should be NULL terminated */ unsigned int clientkey_pem_bytes; /*!< Size of client key pointed to by clientkey_pem_buf */ @@ -84,6 +88,11 @@ typedef struct esp_tls_cfg { bool use_global_ca_store; /*!< Use a global ca_store for all the connections in which this bool is set. */ + + const char *common_name; /*!< If non-NULL, server certificate CN must match this name. + If NULL, server certificate CN must match hostname. */ + + bool skip_common_name; /*!< Skip any validation of server certificate CN field */ } esp_tls_cfg_t; /** @@ -260,10 +269,25 @@ void esp_tls_conn_delete(esp_tls_t *tls); size_t esp_tls_get_bytes_avail(esp_tls_t *tls); /** - * @brief Create a global CA store with the buffer provided in cfg. + * @brief Create a global CA store, initially empty. * - * This function should be called if the application wants to use the same CA store for - * multiple connections. The application must call this function before calling esp_tls_conn_new(). + * This function should be called if the application wants to use the same CA store for multiple connections. + * This function initialises the global CA store which can be then set by calling esp_tls_set_global_ca_store(). + * To be effective, this function must be called before any call to esp_tls_set_global_ca_store(). + * + * @return + * - ESP_OK if creating global CA store was successful. + * - ESP_ERR_NO_MEM if an error occured when allocating the mbedTLS resources. + */ +esp_err_t esp_tls_init_global_ca_store(); + +/** + * @brief Set the global CA store with the buffer provided in pem format. + * + * This function should be called if the application wants to set the global CA store for + * multiple connections i.e. to add the certificates in the provided buffer to the certificate chain. + * This function implicitly calls esp_tls_init_global_ca_store() if it has not already been called. + * The application must call this function before calling esp_tls_conn_new(). * * @param[in] cacert_pem_buf Buffer which has certificates in pem format. This buffer * is used for creating a global CA store, which can be used @@ -271,7 +295,7 @@ size_t esp_tls_get_bytes_avail(esp_tls_t *tls); * @param[in] cacert_pem_bytes Length of the buffer. * * @return - * - ESP_OK if creating global CA store was successful. + * - ESP_OK if adding certificates was successful. * - Other if an error occured or an action must be taken by the calling process. */ esp_err_t esp_tls_set_global_ca_store(const unsigned char *cacert_pem_buf, const unsigned int cacert_pem_bytes); diff --git a/tools/sdk/include/esp32-camera/sensor.h b/tools/sdk/include/esp32-camera/sensor.h index fc778649..e8b4e0cc 100755 --- a/tools/sdk/include/esp32-camera/sensor.h +++ b/tools/sdk/include/esp32-camera/sensor.h @@ -27,10 +27,12 @@ typedef enum { } pixformat_t; typedef enum { + FRAMESIZE_96x96, // 96x96 FRAMESIZE_QQVGA, // 160x120 FRAMESIZE_QQVGA2, // 128x160 FRAMESIZE_QCIF, // 176x144 FRAMESIZE_HQVGA, // 240x176 + FRAMESIZE_240x240, // 240x240 FRAMESIZE_QVGA, // 320x240 FRAMESIZE_CIF, // 400x296 FRAMESIZE_VGA, // 640x480 diff --git a/tools/sdk/include/esp32/esp_attr.h b/tools/sdk/include/esp32/esp_attr.h index 6d2d5ea8..c9e3879e 100644 --- a/tools/sdk/include/esp32/esp_attr.h +++ b/tools/sdk/include/esp32/esp_attr.h @@ -14,17 +14,19 @@ #ifndef __ESP_ATTR_H__ #define __ESP_ATTR_H__ +#include "sdkconfig.h" + #define ROMFN_ATTR //Normally, the linker script will put all code and rodata in flash, //and all variables in shared RAM. These macros can be used to redirect //particular functions/variables to other memory regions. -// Forces code into IRAM instead of flash. -#define IRAM_ATTR __attribute__((section(".iram1"))) +// Forces code into IRAM instead of flash +#define IRAM_ATTR _SECTION_ATTR_IMPL(".iram1", __COUNTER__) // Forces data into DRAM instead of flash -#define DRAM_ATTR __attribute__((section(".dram1"))) +#define DRAM_ATTR _SECTION_ATTR_IMPL(".dram1", __COUNTER__) // Forces data to be 4 bytes aligned #define WORD_ALIGNED_ATTR __attribute__((aligned(4))) @@ -37,11 +39,11 @@ #define DRAM_STR(str) (__extension__({static const DRAM_ATTR char __c[] = (str); (const char *)&__c;})) // Forces code into RTC fast memory. See "docs/deep-sleep-stub.rst" -#define RTC_IRAM_ATTR __attribute__((section(".rtc.text"))) +#define RTC_IRAM_ATTR _SECTION_ATTR_IMPL(".rtc.text", __COUNTER__) #if CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY // Forces bss variable into external memory. " -#define EXT_RAM_ATTR __attribute__((section(".ext_ram.bss"))) +#define EXT_RAM_ATTR _SECTION_ATTR_IMPL(".ext_ram.bss", __COUNTER__) #else #define EXT_RAM_ATTR #endif @@ -49,26 +51,37 @@ // Forces data into RTC slow memory. See "docs/deep-sleep-stub.rst" // Any variable marked with this attribute will keep its value // during a deep sleep / wake cycle. -#define RTC_DATA_ATTR __attribute__((section(".rtc.data"))) +#define RTC_DATA_ATTR _SECTION_ATTR_IMPL(".rtc.data", __COUNTER__) // Forces read-only data into RTC memory. See "docs/deep-sleep-stub.rst" -#define RTC_RODATA_ATTR __attribute__((section(".rtc.rodata"))) +#define RTC_RODATA_ATTR _SECTION_ATTR_IMPL(".rtc.rodata", __COUNTER__) // Allows to place data into RTC_SLOW memory. -#define RTC_SLOW_ATTR __attribute__((section(".rtc.force_slow"))) +#define RTC_SLOW_ATTR _SECTION_ATTR_IMPL(".rtc.force_slow", __COUNTER__) // Allows to place data into RTC_FAST memory. -#define RTC_FAST_ATTR __attribute__((section(".rtc.force_fast"))) +#define RTC_FAST_ATTR _SECTION_ATTR_IMPL(".rtc.force_fast", __COUNTER__) // Forces data into noinit section to avoid initialization after restart. -#define __NOINIT_ATTR __attribute__((section(".noinit"))) +#define __NOINIT_ATTR _SECTION_ATTR_IMPL(".noinit", __COUNTER__) // Forces data into RTC slow memory of .noinit section. // Any variable marked with this attribute will keep its value // after restart or during a deep sleep / wake cycle. -#define RTC_NOINIT_ATTR __attribute__((section(".rtc_noinit"))) +#define RTC_NOINIT_ATTR _SECTION_ATTR_IMPL(".rtc_noinit", __COUNTER__) // Forces to not inline function #define NOINLINE_ATTR __attribute__((noinline)) +// Implementation for a unique custom section +// +// This prevents gcc producing "x causes a section type conflict with y" +// errors if two variables in the same source file have different linkage (maybe const & non-const) but are placed in the same custom section +// +// Using unique sections also means --gc-sections can remove unused +// data with a custom section type set +#define _SECTION_ATTR_IMPL(SECTION, COUNTER) __attribute__((section(SECTION "." _COUNTER_STRINGIFY(COUNTER)))) + +#define _COUNTER_STRINGIFY(COUNTER) #COUNTER + #endif /* __ESP_ATTR_H__ */ diff --git a/tools/sdk/include/esp32/esp_clk.h b/tools/sdk/include/esp32/esp_clk.h index 1a91d26f..99e4f307 100644 --- a/tools/sdk/include/esp32/esp_clk.h +++ b/tools/sdk/include/esp32/esp_clk.h @@ -13,6 +13,7 @@ // limitations under the License. #pragma once +#include /** * @file esp_clk.h diff --git a/tools/sdk/include/esp32/esp_coexist_internal.h b/tools/sdk/include/esp32/esp_coexist_internal.h index 1d94d6db..bdd023a9 100644 --- a/tools/sdk/include/esp32/esp_coexist_internal.h +++ b/tools/sdk/include/esp32/esp_coexist_internal.h @@ -31,6 +31,14 @@ typedef enum { typedef void (* coex_func_cb_t)(uint32_t event, int sched_cnt); +/** + * @brief Pre-Init software coexist + * extern function for internal use. + * + * @return Init ok or failed. + */ +esp_err_t coex_pre_init(void); + /** * @brief Init software coexist * extern function for internal use. @@ -79,6 +87,12 @@ esp_err_t coex_preference_set(coex_prefer_t prefer); */ uint32_t coex_status_get(void); +/** + * @brief Set software coexist condition. + * @return : software coexist condition + */ +void coex_condition_set(uint32_t type, bool dissatisfy); + /** * @brief WiFi requests coexistence. * diff --git a/tools/sdk/include/esp32/esp_core_dump.h b/tools/sdk/include/esp32/esp_core_dump.h deleted file mode 100644 index c6634364..00000000 --- a/tools/sdk/include/esp32/esp_core_dump.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#ifndef ESP_CORE_DUMP_H_ -#define ESP_CORE_DUMP_H_ - -/** - * @brief Initializes core dump module internal data. - * - * @note Should be called at system startup. - */ -void esp_core_dump_init(); - -/** - * @brief Saves core dump to flash. - * - * The structure of data stored in flash is as follows: - * | MAGIC1 | - * | TOTAL_LEN | TASKS_NUM | TCB_SIZE | - * | TCB_ADDR_1 | STACK_TOP_1 | STACK_END_1 | TCB_1 | STACK_1 | - * . . . . - * . . . . - * | TCB_ADDR_N | STACK_TOP_N | STACK_END_N | TCB_N | STACK_N | - * | MAGIC2 | - * Core dump in flash consists of header and data for every task in the system at the moment of crash. - * For flash data integrity control two magic numbers are used at the beginning and the end of core dump. - * The structure of core dump data is described below in details. - * 1) MAGIC1 and MAGIC2 are special numbers stored at the beginning and the end of core dump. - * They are used to control core dump data integrity. Size of every number is 4 bytes. - * 2) Core dump starts with header: - * 2.1) TOTAL_LEN is total length of core dump data in flash including magic numbers. Size is 4 bytes. - * 2.2) TASKS_NUM is the number of tasks for which data are stored. Size is 4 bytes. - * 2.3) TCB_SIZE is the size of task's TCB structure. Size is 4 bytes. - * 3) Core dump header is followed by the data for every task in the system. - * Task data are started with task header: - * 3.1) TCB_ADDR is the address of TCB in memory. Size is 4 bytes. - * 3.2) STACK_TOP is the top of task's stack (address of the topmost stack item). Size is 4 bytes. - * 3.2) STACK_END is the end of task's stack (address from which task's stack starts). Size is 4 bytes. - * 4) Task header is followed by TCB data. Size is TCB_SIZE bytes. - * 5) Task's stack is placed after TCB data. Size is (STACK_END - STACK_TOP) bytes. - */ -void esp_core_dump_to_flash(); - -/** - * @brief Print base64-encoded core dump to UART. - * - * The structure of core dump data is the same as for data stored in flash (@see esp_core_dump_to_flash) with some notes: - * 1) Magic numbers are not present in core dump printed to UART. - * 2) Since magic numbers are omitted TOTAL_LEN does not include their size. - * 3) Printed base64 data are surrounded with special messages to help user recognize the start and end of actual data. - */ -void esp_core_dump_to_uart(); - -#endif diff --git a/tools/sdk/include/esp32/esp_event_legacy.h b/tools/sdk/include/esp32/esp_event_legacy.h index a2518841..0ee6046c 100644 --- a/tools/sdk/include/esp32/esp_event_legacy.h +++ b/tools/sdk/include/esp32/esp_event_legacy.h @@ -121,6 +121,10 @@ typedef struct { uint8_t mac[6]; /**< MAC address of the station which send probe request */ } system_event_ap_probe_req_rx_t; +typedef struct { + ip4_addr_t ip; +} system_event_ap_staipassigned_t; + typedef union { system_event_sta_connected_t connected; /**< ESP32 station connected to AP */ system_event_sta_disconnected_t disconnected; /**< ESP32 station disconnected to AP */ @@ -132,6 +136,7 @@ typedef union { system_event_ap_staconnected_t sta_connected; /**< a station connected to ESP32 soft-AP */ system_event_ap_stadisconnected_t sta_disconnected; /**< a station disconnected to ESP32 soft-AP */ system_event_ap_probe_req_rx_t ap_probereqrecved; /**< ESP32 soft-AP receive probe request packet */ + system_event_ap_staipassigned_t ap_staipassigned; /**< ESP32 soft-AP assign an IP to the station*/ system_event_got_ip6_t got_ip6; /**< ESP32 station or ap or ethernet ipv6 addr state change to preferred */ } system_event_info_t; diff --git a/tools/sdk/include/esp32/esp_flash_data_types.h b/tools/sdk/include/esp32/esp_flash_data_types.h index 9a26281b..998e522f 100644 --- a/tools/sdk/include/esp32/esp_flash_data_types.h +++ b/tools/sdk/include/esp32/esp_flash_data_types.h @@ -24,11 +24,22 @@ extern "C" #define ESP_PARTITION_MAGIC 0x50AA #define ESP_PARTITION_MAGIC_MD5 0xEBEB +/// OTA_DATA states for checking operability of the app. +typedef enum { + ESP_OTA_IMG_NEW = 0x0U, /*!< Monitor the first boot. In bootloader this state is changed to ESP_OTA_IMG_PENDING_VERIFY. */ + ESP_OTA_IMG_PENDING_VERIFY = 0x1U, /*!< First boot for this app was. If while the second boot this state is then it will be changed to ABORTED. */ + ESP_OTA_IMG_VALID = 0x2U, /*!< App was confirmed as workable. App can boot and work without limits. */ + ESP_OTA_IMG_INVALID = 0x3U, /*!< App was confirmed as non-workable. This app will not selected to boot at all. */ + ESP_OTA_IMG_ABORTED = 0x4U, /*!< App could not confirm the workable or non-workable. In bootloader IMG_PENDING_VERIFY state will be changed to IMG_ABORTED. This app will not selected to boot at all. */ + ESP_OTA_IMG_UNDEFINED = 0xFFFFFFFFU, /*!< Undefined. App can boot and work without limits. */ +} esp_ota_img_states_t; + /* OTA selection structure (two copies in the OTA data partition.) Size of 32 bytes is friendly to flash encryption */ typedef struct { uint32_t ota_seq; - uint8_t seq_label[24]; + uint8_t seq_label[20]; + uint32_t ota_state; uint32_t crc; /* CRC32 of ota_seq field only */ } esp_ota_select_entry_t; @@ -61,6 +72,7 @@ typedef struct { #define PART_SUBTYPE_DATA_RF 0x01 #define PART_SUBTYPE_DATA_WIFI 0x02 #define PART_SUBTYPE_DATA_NVS_KEYS 0x04 +#define PART_SUBTYPE_DATA_EFUSE_EM 0x05 #define PART_TYPE_END 0xff #define PART_SUBTYPE_END 0xff diff --git a/tools/sdk/include/esp32/esp_phy_init.h b/tools/sdk/include/esp32/esp_phy_init.h index 2dfb7447..6783ff54 100644 --- a/tools/sdk/include/esp32/esp_phy_init.h +++ b/tools/sdk/include/esp32/esp_phy_init.h @@ -156,6 +156,18 @@ esp_err_t esp_phy_load_cal_data_from_nvs(esp_phy_calibration_data_t* out_cal_dat */ esp_err_t esp_phy_store_cal_data_to_nvs(const esp_phy_calibration_data_t* cal_data); +/** + * @brief Erase PHY calibration data which is stored in the NVS + * + * This is a function which can be used to trigger full calibration as a last-resort remedy + * if partial calibration is used. It can be called in the application based on some conditions + * (e.g. an option provided in some diagnostic mode). + * + * @return ESP_OK on success + * @return others on fail. Please refer to NVS API return value error number. + */ +esp_err_t esp_phy_erase_cal_data_in_nvs(void); + /** * @brief Initialize PHY and RF module * diff --git a/tools/sdk/include/esp32/esp_wifi.h b/tools/sdk/include/esp32/esp_wifi.h index 57014b8d..3285fd35 100644 --- a/tools/sdk/include/esp32/esp_wifi.h +++ b/tools/sdk/include/esp32/esp_wifi.h @@ -543,7 +543,7 @@ esp_err_t esp_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw); * @brief Set primary/secondary channel of ESP32 * * @attention 1. This is a special API for sniffer - * @attention 2. This API should be called after esp_wifi_start() or esp_wifi_set_promiscuous() + * @attention 2. This API should be called after esp_wifi_start() and esp_wifi_set_promiscuous() * * @param primary for HT20, primary is the channel number, for HT40, primary is the primary channel * @param second for HT20, second is ignored, for HT40, second is the second channel diff --git a/tools/sdk/include/esp32/esp_wifi_internal.h b/tools/sdk/include/esp32/esp_wifi_internal.h index d41b099d..468a1809 100644 --- a/tools/sdk/include/esp32/esp_wifi_internal.h +++ b/tools/sdk/include/esp32/esp_wifi_internal.h @@ -46,6 +46,40 @@ typedef struct { void *storage; /**< storage for FreeRTOS queue */ } wifi_static_queue_t; +/** + * @brief WiFi log level + * + */ +typedef enum { + WIFI_LOG_ERROR = 0, /*enabled by default*/ + WIFI_LOG_WARNING, /*enabled by default*/ + WIFI_LOG_INFO, /*enabled by default*/ + WIFI_LOG_DEBUG, /*can be set in menuconfig*/ + WIFI_LOG_VERBOSE, /*can be set in menuconfig*/ +} wifi_log_level_t; + +/** + * @brief WiFi log module definition + * + */ +typedef enum { + WIFI_LOG_MODULE_ALL = 0, /*all log modules */ + WIFI_LOG_MODULE_WIFI, /*logs related to WiFi*/ + WIFI_LOG_MODULE_COEX, /*logs related to WiFi and BT(or BLE) coexist*/ + WIFI_LOG_MODULE_MESH, /*logs related to Mesh*/ +} wifi_log_module_t; + +/** + * @brief WiFi log submodule definition + * + */ +#define WIFI_LOG_SUBMODULE_ALL (0) /*all log submodules*/ +#define WIFI_LOG_SUBMODULE_INIT (1) /*logs related to initialization*/ +#define WIFI_LOG_SUBMODULE_IOCTL (1<<1) /*logs related to API calling*/ +#define WIFI_LOG_SUBMODULE_CONN (1<<2) /*logs related to connecting*/ +#define WIFI_LOG_SUBMODULE_SCAN (1<<3) /*logs related to scaning*/ + + /** * @brief Initialize Wi-Fi Driver * Alloc resource for WiFi driver, such as WiFi control structure, RX/TX buffer, @@ -245,16 +279,44 @@ typedef esp_err_t (* wifi_mac_time_update_cb_t)( uint32_t time_delta ); esp_err_t esp_wifi_internal_update_mac_time( uint32_t time_delta ); /** - * @brief A general API to set/get WiFi internal configuration, it's for debug only - * - * @param cmd : ioctl command type - * @param cfg : configuration for the command - * - * @return - * - ESP_OK: succeed - * - others: failed - */ -esp_err_t esp_wifi_internal_ioctl(int cmd, wifi_ioctl_config_t *cfg); + * @brief Set current WiFi log level + * + * @param level Log level. + * + * @return + * - ESP_OK: succeed + * - ESP_FAIL: level is invalid + */ +esp_err_t esp_wifi_internal_set_log_level(wifi_log_level_t level); + +/** + * @brief Set current log module and submodule + * + * @param module Log module + * @param submodule Log submodule + * @param enable enable or disable + * If module == 0 && enable == 0, all log modules are disabled. + * If module == 0 && enable == 1, all log modules are enabled. + * If submodule == 0 && enable == 0, all log submodules are disabled. + * If submodule == 0 && enable == 1, all log submodules are enabled. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_ARG: invalid argument + */ +esp_err_t esp_wifi_internal_set_log_mod(wifi_log_module_t module, uint32_t submodule, bool enable); + +/** + * @brief Get current WiFi log info + * + * @param log_level the return log level. + * @param log_mod the return log module and submodule + * + * @return + * - ESP_OK: succeed + */ +esp_err_t esp_wifi_internal_get_log(wifi_log_level_t *log_level, uint32_t *log_mod); #ifdef __cplusplus } diff --git a/tools/sdk/include/esp32/esp_wifi_os_adapter.h b/tools/sdk/include/esp32/esp_wifi_os_adapter.h index 165caa6e..c8b8766d 100644 --- a/tools/sdk/include/esp32/esp_wifi_os_adapter.h +++ b/tools/sdk/include/esp32/esp_wifi_os_adapter.h @@ -21,7 +21,7 @@ extern "C" { #endif -#define ESP_WIFI_OS_ADAPTER_VERSION 0x00000002 +#define ESP_WIFI_OS_ADAPTER_VERSION 0x00000004 #define ESP_WIFI_OS_ADAPTER_MAGIC 0xDEADBEAF #define OSI_FUNCS_TIME_BLOCKING 0xffffffff @@ -121,6 +121,7 @@ typedef struct { void (* _sc_ack_send)(void *param); void (* _sc_ack_send_stop)(void); uint32_t (* _coex_status_get)(void); + void (* _coex_condition_set)(uint32_t type, bool dissatisfy); int32_t (* _coex_wifi_request)(uint32_t event, uint32_t latency, uint32_t duration); int32_t (* _coex_wifi_release)(uint32_t event); int32_t _magic; diff --git a/tools/sdk/include/esp32/rom/crc.h b/tools/sdk/include/esp32/rom/crc.h index 84e17882..faa1e8c3 100644 --- a/tools/sdk/include/esp32/rom/crc.h +++ b/tools/sdk/include/esp32/rom/crc.h @@ -30,15 +30,48 @@ extern "C" { */ -/* Standard CRC8/16/32 algorithms. */ -// CRC-8 x8+x2+x1+1 0x07 -// CRC16-CCITT x16+x12+x5+1 1021 ISO HDLC, ITU X.25, V.34/V.41/V.42, PPP-FCS -// CRC32: -//G(x) = x32 +x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x1 + 1 -//If your buf is not continuous, you can use the first result to be the second parameter. +/* Notes about CRC APIs usage + * The ESP32 ROM include some CRC tables and CRC APIs to speed up CRC calculation. + * The CRC APIs include CRC8, CRC16, CRC32 algorithms for both little endian and big endian modes. + * Here are the polynomials for the algorithms: + * CRC-8 x8+x2+x1+1 0x07 + * CRC16-CCITT x16+x12+x5+1 0x1021 + * CRC32 x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x1+1 0x04c11db7 + * + * These group of CRC APIs are designed to calculate the data in buffers either continuous or not. + * To make it easy, we had added a `~` at the beginning and the end of the functions. + * To calculate non-continuous buffers, we can write the code like this: + * init = ~init; + * crc = crc32_le(init, buf0, length0); + * crc = crc32_le(crc, buf1, length1); + * crc = ~crc; + * + * However, it is not easy to select which API to use and give the correct parameters. + * A specific CRC algorithm will include this parameters: width, polynomials, init, refin, refout, xorout + * refin and refout show the endian of the algorithm: + * if both of them are true, please use the little endian API. + * if both of them are false, please use the big endian API. + * xorout is the value which you need to be xored to the raw result. + * However, these group of APIs need one '~' before and after the APIs. + * + * Here are some examples for CRC16: + * CRC-16/CCITT, poly = 0x1021, init = 0x0000, refin = true, refout = true, xorout = 0x0000 + * crc = ~crc16_le((uint16_t)~0x0000, buf, length); + * + * CRC-16/CCITT-FALSE, poly = 0x1021, init = 0xffff, refin = false, refout = false, xorout = 0x0000 + * crc = ~crc16_be((uint16_t)~0xffff, buf, length); + * + * CRC-16/X25, poly = 0x1021, init = 0xffff, refin = true, refout = true, xorout = 0xffff + * crc = (~crc16_le((uint16_t)~(0xffff), buf, length))^0xffff; + * + * CRC-16/XMODEM, poly= 0x1021, init = 0x0000, refin = false, refout = false, xorout = 0x0000 + * crc = ~crc16_be((uint16_t)~0x0000, buf, length); + * + * + */ /** - * @brief Crc32 value that is in little endian. + * @brief CRC32 value that is in little endian. * * @param uint32_t crc : init crc value, use 0 at the first use. * @@ -51,7 +84,7 @@ extern "C" { uint32_t crc32_le(uint32_t crc, uint8_t const *buf, uint32_t len); /** - * @brief Crc32 value that is in big endian. + * @brief CRC32 value that is in big endian. * * @param uint32_t crc : init crc value, use 0 at the first use. * @@ -64,7 +97,7 @@ uint32_t crc32_le(uint32_t crc, uint8_t const *buf, uint32_t len); uint32_t crc32_be(uint32_t crc, uint8_t const *buf, uint32_t len); /** - * @brief Crc16 value that is in little endian. + * @brief CRC16 value that is in little endian. * * @param uint16_t crc : init crc value, use 0 at the first use. * @@ -77,7 +110,7 @@ uint32_t crc32_be(uint32_t crc, uint8_t const *buf, uint32_t len); uint16_t crc16_le(uint16_t crc, uint8_t const *buf, uint32_t len); /** - * @brief Crc16 value that is in big endian. + * @brief CRC16 value that is in big endian. * * @param uint16_t crc : init crc value, use 0 at the first use. * @@ -90,7 +123,7 @@ uint16_t crc16_le(uint16_t crc, uint8_t const *buf, uint32_t len); uint16_t crc16_be(uint16_t crc, uint8_t const *buf, uint32_t len); /** - * @brief Crc8 value that is in little endian. + * @brief CRC8 value that is in little endian. * * @param uint8_t crc : init crc value, use 0 at the first use. * @@ -103,7 +136,7 @@ uint16_t crc16_be(uint16_t crc, uint8_t const *buf, uint32_t len); uint8_t crc8_le(uint8_t crc, uint8_t const *buf, uint32_t len); /** - * @brief Crc8 value that is in big endian. + * @brief CRC8 value that is in big endian. * * @param uint32_t crc : init crc value, use 0 at the first use. * diff --git a/tools/sdk/include/esp32/rom/spi_flash.h b/tools/sdk/include/esp32/rom/spi_flash.h index 165aaefe..a6ed793d 100644 --- a/tools/sdk/include/esp32/rom/spi_flash.h +++ b/tools/sdk/include/esp32/rom/spi_flash.h @@ -118,6 +118,11 @@ extern "C" { #define ESP_ROM_SPIFLASH_WR_PROTECT (ESP_ROM_SPIFLASH_BP0|ESP_ROM_SPIFLASH_BP1|ESP_ROM_SPIFLASH_BP2) #define ESP_ROM_SPIFLASH_QE BIT9 +//Extra dummy for flash read +#define ESP_ROM_SPIFLASH_DUMMY_LEN_PLUS_20M 0 +#define ESP_ROM_SPIFLASH_DUMMY_LEN_PLUS_40M 1 +#define ESP_ROM_SPIFLASH_DUMMY_LEN_PLUS_80M 2 + #define FLASH_ID_GD25LQ32C 0xC86016 typedef enum { diff --git a/tools/sdk/include/esp32/rom/uart.h b/tools/sdk/include/esp32/rom/uart.h index 87224457..a010bfbc 100644 --- a/tools/sdk/include/esp32/rom/uart.h +++ b/tools/sdk/include/esp32/rom/uart.h @@ -36,7 +36,7 @@ extern "C" { #define RX_BUFF_SIZE 0x100 #define TX_BUFF_SIZE 100 -//uart int enalbe register ctrl bits +//uart int enable register ctrl bits #define UART_RCV_INTEN BIT0 #define UART_TRX_INTEN BIT1 #define UART_LINE_STATUS_INTEN BIT2 @@ -301,14 +301,14 @@ char uart_rx_one_char_block(void); * * @param uint8_t *pString : the pointer to store the string. * - * @param uint8_t MaxStrlen : the max string length, incude '\0'. + * @param uint8_t MaxStrlen : the max string length, include '\0'. * * @return OK. */ STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen); /** - * @brief Process uart recevied information in the interrupt handler. + * @brief Process uart received information in the interrupt handler. * Please do not call this function in SDK. * * @param void *para : the message receive buffer. diff --git a/tools/sdk/include/esp_event/esp_event.h b/tools/sdk/include/esp_event/esp_event.h index f095844a..f97deaf8 100644 --- a/tools/sdk/include/esp_event/esp_event.h +++ b/tools/sdk/include/esp_event/esp_event.h @@ -33,11 +33,11 @@ extern "C" { /// Configuration for creating event loops typedef struct { int32_t queue_size; /**< size of the event loop queue */ - const char* task_name; /**< name of the event loop task; if NULL, + const char* task_name; /**< name of the event loop task; if NULL, a dedicated task is not created for event loop*/ UBaseType_t task_priority; /**< priority of the event loop task, ignored if task name is NULL */ uint32_t task_stack_size; /**< stack size of the event loop task, ignored if task name is NULL */ - BaseType_t task_core_id; /**< core to which the event loop task is pinned to, + BaseType_t task_core_id; /**< core to which the event loop task is pinned to, ignored if task name is NULL */ } esp_event_loop_args_t; @@ -47,7 +47,7 @@ typedef struct { * @param[in] event_loop_args configuration structure for the event loop to create * @param[out] event_loop handle to the created event loop * - * @return + * @return * - ESP_OK: Success * - ESP_ERR_NO_MEM: Cannot allocate memory for event loops list * - ESP_FAIL: Failed to create task loop @@ -60,7 +60,7 @@ esp_err_t esp_event_loop_create(const esp_event_loop_args_t* event_loop_args, es * * @param[in] event_loop event loop to delete * - * @return + * @return * - ESP_OK: Success * - Others: Fail */ @@ -68,8 +68,8 @@ esp_err_t esp_event_loop_delete(esp_event_loop_handle_t event_loop); /** * @brief Create default event loop - * - * @return + * + * @return * - ESP_OK: Success * - ESP_ERR_NO_MEM: Cannot allocate memory for event loops list * - ESP_FAIL: Failed to create task loop @@ -79,8 +79,8 @@ esp_err_t esp_event_loop_create_default(); /** * @brief Delete the default event loop - * - * @return + * + * @return * - ESP_OK: Success * - Others: Fail */ @@ -89,18 +89,18 @@ esp_err_t esp_event_loop_delete_default(); /** * @brief Dispatch events posted to an event loop. * - * This function is used to dispatch events posted to a loop with no dedicated task, i.e task name was set to NULL - * in event_loop_args argument during loop creation. This function includes an argument to limit the amount of time - * it runs, returning control to the caller when that time expires (or some time afterwards). There is no guarantee - * that a call to this function will exit at exactly the time of expiry. There is also no guarantee that events have + * This function is used to dispatch events posted to a loop with no dedicated task, i.e task name was set to NULL + * in event_loop_args argument during loop creation. This function includes an argument to limit the amount of time + * it runs, returning control to the caller when that time expires (or some time afterwards). There is no guarantee + * that a call to this function will exit at exactly the time of expiry. There is also no guarantee that events have * been dispatched during the call, as the function might have spent all of the alloted time waiting on the event queue. - * Once an event has been unqueued, however, it is guaranteed to be dispatched. This guarantee contributes to not being - * able to exit exactly at time of expiry as (1) blocking on internal mutexes is necessary for dispatching the unqueued - * event, and (2) during dispatch of the unqueued event there is no way to control the time occupied by handler code + * Once an event has been unqueued, however, it is guaranteed to be dispatched. This guarantee contributes to not being + * able to exit exactly at time of expiry as (1) blocking on internal mutexes is necessary for dispatching the unqueued + * event, and (2) during dispatch of the unqueued event there is no way to control the time occupied by handler code * execution. The guaranteed time of exit is therefore the alloted time + amount of time required to dispatch * the last unqueued event. * - * In cases where waiting on the queue times out, ESP_OK is returned and not ESP_ERR_TIMEOUT, since it is + * In cases where waiting on the queue times out, ESP_OK is returned and not ESP_ERR_TIMEOUT, since it is * normal behavior. * * @param[in] event_loop event loop to dispatch posted events from @@ -108,7 +108,7 @@ esp_err_t esp_event_loop_delete_default(); * * @note encountering an unknown event that has been posted to the loop will only generate a warning, not an error. * - * @return + * @return * - ESP_OK: Success * - Others: Fail */ @@ -124,8 +124,8 @@ esp_err_t esp_event_loop_run(esp_event_loop_handle_t event_loop, TickType_t tick * - all events of a certain base: specify exact event_base and use ESP_EVENT_ANY_ID as the event_id * - all events known by the loop: use ESP_EVENT_ANY_BASE for event_base and ESP_EVENT_ANY_ID as the event_id * - * Registering multiple handlers to events is possible. Registering a single handler to multiple events is - * also possible. However, registering the same handler to the same event multiple times would cause the + * Registering multiple handlers to events is possible. Registering a single handler to multiple events is + * also possible. However, registering the same handler to the same event multiple times would cause the * previous registrations to be overwritten. * * @param[in] event_base the base id of the event to register the handler for @@ -133,24 +133,24 @@ esp_err_t esp_event_loop_run(esp_event_loop_handle_t event_loop, TickType_t tick * @param[in] event_handler the handler function which gets called when the event is dispatched * @param[in] event_handler_arg data, aside from event data, that is passed to the handler when it is called * - * @note the event loop library does not maintain a copy of event_handler_arg, therefore the user should + * @note the event loop library does not maintain a copy of event_handler_arg, therefore the user should * ensure that event_handler_arg still points to a valid location by the time the handler gets called * - * @return + * @return * - ESP_OK: Success * - ESP_ERR_NO_MEM: Cannot allocate memory for the handler - * - ESP_ERR_INVALIG_ARG: Invalid combination of event base and event id + * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id * - Others: Fail */ -esp_err_t esp_event_handler_register(esp_event_base_t event_base, - int32_t event_id, - esp_event_handler_t event_handler, +esp_err_t esp_event_handler_register(esp_event_base_t event_base, + int32_t event_id, + esp_event_handler_t event_handler, void* event_handler_arg); /** * @brief Register an event handler to a specific loop. * - * This function behaves in the same manner as esp_event_handler_register, except the additional + * This function behaves in the same manner as esp_event_handler_register, except the additional * specification of the event loop to register the handler to. * * @param[in] event_loop the event loop to register this handler function to @@ -159,23 +159,26 @@ esp_err_t esp_event_handler_register(esp_event_base_t event_base, * @param[in] event_handler the handler function which gets called when the event is dispatched * @param[in] event_handler_arg data, aside from event data, that is passed to the handler when it is called * - * @return + * @note the event loop library does not maintain a copy of event_handler_arg, therefore the user should + * ensure that event_handler_arg still points to a valid location by the time the handler gets called + * + * @return * - ESP_OK: Success * - ESP_ERR_NO_MEM: Cannot allocate memory for the handler - * - ESP_ERR_INVALIG_ARG: Invalid combination of event base and event id + * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id * - Others: Fail */ -esp_err_t esp_event_handler_register_with(esp_event_loop_handle_t event_loop, - esp_event_base_t event_base, - int32_t event_id, - esp_event_handler_t event_handler, +esp_err_t esp_event_handler_register_with(esp_event_loop_handle_t event_loop, + esp_event_base_t event_base, + int32_t event_id, + esp_event_handler_t event_handler, void* event_handler_arg); /** * @brief Unregister a handler with the system event loop. * * This function can be used to unregister a handler so that it no longer gets called during dispatch. - * Handlers can be unregistered for either: (1) specific events, (2) all events of a certain event base, + * Handlers can be unregistered for either: (1) specific events, (2) all events of a certain event base, * or (3) all events known by the system event loop * * - specific events: specify exact event_base and event_id @@ -189,7 +192,7 @@ esp_err_t esp_event_handler_register_with(esp_event_loop_handle_t event_loop, * @param[in] event_handler the handler to unregister * * @return ESP_OK success - * @return ESP_ERR_INVALIG_ARG invalid combination of event base and event id + * @return ESP_ERR_INVALID_ARG invalid combination of event base and event id * @return others fail */ esp_err_t esp_event_handler_unregister(esp_event_base_t event_base, int32_t event_id, esp_event_handler_t event_handler); @@ -197,7 +200,7 @@ esp_err_t esp_event_handler_unregister(esp_event_base_t event_base, int32_t even /** * @brief Unregister a handler with the system event loop. * - * This function behaves in the same manner as esp_event_handler_unregister, except the additional specification of + * This function behaves in the same manner as esp_event_handler_unregister, except the additional specification of * the event loop to unregister the handler with. * * @param[in] event_loop the event loop with which to unregister this handler function @@ -205,21 +208,21 @@ esp_err_t esp_event_handler_unregister(esp_event_base_t event_base, int32_t even * @param[in] event_id the id of the event with which to unregister the handler * @param[in] event_handler the handler to unregister * - * @return + * @return * - ESP_OK: Success - * - ESP_ERR_INVALIG_ARG: Invalid combination of event base and event id + * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id * - Others: Fail */ -esp_err_t esp_event_handler_unregister_with(esp_event_loop_handle_t event_loop, - esp_event_base_t event_base, - int32_t event_id, +esp_err_t esp_event_handler_unregister_with(esp_event_loop_handle_t event_loop, + esp_event_base_t event_base, + int32_t event_id, esp_event_handler_t event_handler); /** - * @brief Posts an event to the system default event loop. The event loop library keeps a copy of event_data and manages - * the copy's lifetime automatically (allocation + deletion); this ensures that the data the + * @brief Posts an event to the system default event loop. The event loop library keeps a copy of event_data and manages + * the copy's lifetime automatically (allocation + deletion); this ensures that the data the * handler recieves is always valid. - * + * * @param[in] event_base the event base that identifies the event * @param[in] event_id the the event id that identifies the event * @param[in] event_data the data, specific to the event occurence, that gets passed to the handler @@ -228,21 +231,21 @@ esp_err_t esp_event_handler_unregister_with(esp_event_loop_handle_t event_loop, * * @note posting events from an ISR is not supported * - * @return + * @return * - ESP_OK: Success * - ESP_ERR_TIMEOUT: Time to wait for event queue to unblock expired - * - ESP_ERR_INVALIG_ARG: Invalid combination of event base and event id + * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id * - Others: Fail */ -esp_err_t esp_event_post(esp_event_base_t event_base, - int32_t event_id, - void* event_data, - size_t event_data_size, +esp_err_t esp_event_post(esp_event_base_t event_base, + int32_t event_id, + void* event_data, + size_t event_data_size, TickType_t ticks_to_wait); /** - * @brief Posts an event to the specified event loop. The event loop library keeps a copy of event_data and manages - * the copy's lifetime automatically (allocation + deletion); this ensures that the data the + * @brief Posts an event to the specified event loop. The event loop library keeps a copy of event_data and manages + * the copy's lifetime automatically (allocation + deletion); this ensures that the data the * handler recieves is always valid. * * This function behaves in the same manner as esp_event_post_to, except the additional specification of the event loop @@ -256,73 +259,60 @@ esp_err_t esp_event_post(esp_event_base_t event_base, * @param[in] ticks_to_wait number of ticks to block on a full event queue * * @note posting events from an ISR is not supported - * - * @return + * + * @return * - ESP_OK: Success * - ESP_ERR_TIMEOUT: Time to wait for event queue to unblock expired - * - ESP_ERR_INVALIG_ARG: Invalid combination of event base and event id + * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id * - Others: Fail */ -esp_err_t esp_event_post_to(esp_event_loop_handle_t event_loop, - esp_event_base_t event_base, - int32_t event_id, - void* event_data, - size_t event_data_size, +esp_err_t esp_event_post_to(esp_event_loop_handle_t event_loop, + esp_event_base_t event_base, + int32_t event_id, + void* event_data, + size_t event_data_size, TickType_t ticks_to_wait); /** * @brief Dumps statistics of all event loops. * * Dumps event loop info in the format: - * + * @verbatim event loop - event - handler - handler - event - handler - handler - event loop - event - handler - ... + handler + handler ... - ... - + event loop + handler + handler + ... + where: - + event loop - format: address,name rx:total_recieved dr:total_dropped inv:total_number_of_invocations run:total_runtime + format: address,name rx:total_recieved dr:total_dropped where: address - memory address of the event loop - name - name of the event loop + name - name of the event loop, 'none' if no dedicated task total_recieved - number of successfully posted events - total_number_of_invocations - total number of handler invocations performed so far - total_runtime - total runtime of all invocations so far - - event - format: base:id proc:total_processed run:total_runtime - where: - base - event base - id - event id - total_processed - number of instances of this event that has been processed - total_runtime - total amount of time in microseconds used for invoking handlers of this event - + total_dropped - number of events unsucessfully posted due to queue being full + handler - format: address inv:total_invoked run:total_runtime + format: address ev:base,id inv:total_invoked run:total_runtime where: address - address of the handler function + base,id - the event specified by event base and id this handler executes total_invoked - number of times this handler has been invoked total_runtime - total amount of time used for invoking this handler - + @endverbatim * * @param[in] file the file stream to output to * * @note this function is a noop when CONFIG_EVENT_LOOP_PROFILING is disabled * - * @return + * @return * - ESP_OK: Success * - ESP_ERR_NO_MEM: Cannot allocate memory for event loops list * - Others: Fail diff --git a/tools/sdk/include/esp_http_client/esp_http_client.h b/tools/sdk/include/esp_http_client/esp_http_client.h index 18b68b88..3292bafa 100644 --- a/tools/sdk/include/esp_http_client/esp_http_client.h +++ b/tools/sdk/include/esp_http_client/esp_http_client.h @@ -118,8 +118,20 @@ typedef struct { void *user_data; /*!< HTTP user_data context */ bool is_async; /*!< Set asynchronous mode, only supported with HTTPS for now */ bool use_global_ca_store; /*!< Use a global ca_store for all the connections in which this bool is set. */ + bool skip_cert_common_name_check; /*!< Skip any validation of server certificate CN field */ } esp_http_client_config_t; +/** + * Enum for the HTTP status codes. + */ +typedef enum { + /* 3xx - Redirection */ + HttpStatus_MovedPermanently = 301, + HttpStatus_Found = 302, + + /* 4xx - Client Error */ + HttpStatus_Unauthorized = 401 +} HttpStatus_Code; #define ESP_ERR_HTTP_BASE (0x7000) /*!< Starting number of HTTP error codes */ #define ESP_ERR_HTTP_MAX_REDIRECT (ESP_ERR_HTTP_BASE + 1) /*!< The error exceeds the number of HTTP redirects */ @@ -235,13 +247,71 @@ esp_err_t esp_http_client_set_header(esp_http_client_handle_t client, const char */ esp_err_t esp_http_client_get_header(esp_http_client_handle_t client, const char *key, char **value); +/** + * @brief Get http request username. + * The address of username buffer will be assigned to value parameter. + * This function must be called after `esp_http_client_init`. + * + * @param[in] client The esp_http_client handle + * @param[out] value The username value + * + * @return + * - ESP_OK + * - ESP_ERR_INVALID_ARG + */ +esp_err_t esp_http_client_get_username(esp_http_client_handle_t client, char **value); + +/** + * @brief Set http request username. + * The value of username parameter will be assigned to username buffer. + * If the username parameter is NULL then username buffer will be freed. + * + * @param[in] client The esp_http_client handle + * @param[in] username The username value + * + * @return + * - ESP_OK + * - ESP_ERR_INVALID_ARG + */ +esp_err_t esp_http_client_set_username(esp_http_client_handle_t client, const char *username); + +/** + * @brief Get http request password. + * The address of password buffer will be assigned to value parameter. + * This function must be called after `esp_http_client_init`. + * + * @param[in] client The esp_http_client handle + * @param[out] value The password value + * + * @return + * - ESP_OK + * - ESP_ERR_INVALID_ARG + */ +esp_err_t esp_http_client_get_password(esp_http_client_handle_t client, char **value); + +/** + * @brief Set http request password. + * The value of password parameter will be assigned to password buffer. + * If the password parameter is NULL then password buffer will be freed. + * + * @param[in] client The esp_http_client handle + * @param[in] password The password value + * + * @return + * - ESP_OK + * - ESP_ERR_INVALID_ARG + */ +esp_err_t esp_http_client_set_password(esp_http_client_handle_t client, char *password); + /** * @brief Set http request method * * @param[in] client The esp_http_client handle * @param[in] method The method * - * @return ESP_OK + * @return + * - ESP_OK + * - ESP_ERR_INVALID_ARG */ esp_err_t esp_http_client_set_method(esp_http_client_handle_t client, esp_http_client_method_t method); @@ -383,12 +453,23 @@ esp_http_client_transport_t esp_http_client_get_transport_type(esp_http_client_h * * @param[in] client The esp_http_client handle * - * @return + * @return * - ESP_OK * - ESP_FAIL */ esp_err_t esp_http_client_set_redirection(esp_http_client_handle_t client); +/** + * @brief On receiving HTTP Status code 401, this API can be invoked to add authorization + * information. + * + * @note There is a possibility of receiving body message with redirection status codes, thus make sure + * to flush off body data after calling this API. + * + * @param[in] client The esp_http_client handle + */ +void esp_http_client_add_auth(esp_http_client_handle_t client); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/include/esp_http_server/esp_http_server.h b/tools/sdk/include/esp_http_server/esp_http_server.h index 7d4b1a63..fc448500 100644 --- a/tools/sdk/include/esp_http_server/esp_http_server.h +++ b/tools/sdk/include/esp_http_server/esp_http_server.h @@ -49,6 +49,7 @@ initializer that should be kept in sync .global_transport_ctx_free_fn = NULL, \ .open_fn = NULL, \ .close_fn = NULL, \ + .uri_match_fn = NULL \ } #define ESP_ERR_HTTPD_BASE (0x8000) /*!< Starting number of HTTPD error codes */ @@ -61,6 +62,10 @@ initializer that should be kept in sync #define ESP_ERR_HTTPD_ALLOC_MEM (ESP_ERR_HTTPD_BASE + 7) /*!< Failed to dynamically allocate memory for resource */ #define ESP_ERR_HTTPD_TASK (ESP_ERR_HTTPD_BASE + 8) /*!< Failed to launch server task/thread */ +/* Symbol to be used as length parameter in httpd_resp_send APIs + * for setting buffer length to string length */ +#define HTTPD_RESP_USE_STRLEN -1 + /* ************** Group: Initialization ************** */ /** @name Initialization * APIs related to the Initialization of the web server @@ -82,7 +87,7 @@ typedef enum http_method httpd_method_t; /** * @brief Prototype for freeing context data (if any) - * @param[in] ctx : object to free + * @param[in] ctx object to free */ typedef void (*httpd_free_ctx_fn_t)(void *ctx); @@ -92,9 +97,11 @@ typedef void (*httpd_free_ctx_fn_t)(void *ctx); * Called immediately after the socket was opened to set up the send/recv functions and * other parameters of the socket. * - * @param[in] hd : server instance - * @param[in] sockfd : session socket file descriptor - * @return status + * @param[in] hd server instance + * @param[in] sockfd session socket file descriptor + * @return + * - ESP_OK : On success + * - Any value other than ESP_OK will signal the server to close the socket immediately */ typedef esp_err_t (*httpd_open_func_t)(httpd_handle_t hd, int sockfd); @@ -104,11 +111,26 @@ typedef esp_err_t (*httpd_open_func_t)(httpd_handle_t hd, int sockfd); * @note It's possible that the socket descriptor is invalid at this point, the function * is called for all terminated sessions. Ensure proper handling of return codes. * - * @param[in] hd : server instance - * @param[in] sockfd : session socket file descriptor + * @param[in] hd server instance + * @param[in] sockfd session socket file descriptor */ typedef void (*httpd_close_func_t)(httpd_handle_t hd, int sockfd); +/** + * @brief Function prototype for URI matching. + * + * @param[in] reference_uri URI/template with respect to which the other URI is matched + * @param[in] uri_to_match URI/template being matched to the reference URI/template + * @param[in] match_upto For specifying the actual length of `uri_to_match` up to + * which the matching algorithm is to be applied (The maximum + * value is `strlen(uri_to_match)`, independent of the length + * of `reference_uri`) + * @return true on match + */ +typedef bool (*httpd_uri_match_func_t)(const char *reference_uri, + const char *uri_to_match, + size_t match_upto); + /** * @brief HTTP Server Configuration Structure * @@ -179,6 +201,8 @@ typedef struct httpd_config { * * If a context needs to be maintained between these functions, store it in the session using * httpd_sess_set_transport_ctx() and retrieve it later with httpd_sess_get_transport_ctx() + * + * Returning a value other than ESP_OK will immediately close the new socket. */ httpd_open_func_t open_fn; @@ -195,6 +219,24 @@ typedef struct httpd_config { * was closed by the network stack - that is, the file descriptor may not be valid anymore. */ httpd_close_func_t close_fn; + + /** + * URI matcher function. + * + * Called when searching for a matching URI: + * 1) whose request handler is to be executed right + * after an HTTP request is successfully parsed + * 2) in order to prevent duplication while registering + * a new URI handler using `httpd_register_uri_handler()` + * + * Available options are: + * 1) NULL : Internally do basic matching using `strncmp()` + * 2) `httpd_uri_match_wildcard()` : URI wildcard matcher + * + * Users can implement their own matching functions (See description + * of the `httpd_uri_match_func_t` function prototype) + */ + httpd_uri_match_func_t uri_match_fn; } httpd_config_t; /** @@ -227,8 +269,8 @@ typedef struct httpd_config { * * @endcode * - * @param[in] config : Configuration for new instance of the server - * @param[out] handle : Handle to newly created instance of the server. NULL on error + * @param[in] config Configuration for new instance of the server + * @param[out] handle Handle to newly created instance of the server. NULL on error * @return * - ESP_OK : Instance created successfully * - ESP_ERR_INVALID_ARG : Null argument(s) @@ -445,6 +487,122 @@ esp_err_t httpd_unregister_uri(httpd_handle_t handle, const char* uri); * @} */ +/* ************** Group: HTTP Error ************** */ +/** @name HTTP Error + * Prototype for HTTP errors and error handling functions + * @{ + */ + +/** + * @brief Error codes sent as HTTP response in case of errors + * encountered during processing of an HTTP request + */ +typedef enum { + /* For any unexpected errors during parsing, like unexpected + * state transitions, or unhandled errors. + */ + HTTPD_500_INTERNAL_SERVER_ERROR = 0, + + /* For methods not supported by http_parser. Presently + * http_parser halts parsing when such methods are + * encountered and so the server responds with 400 Bad + * Request error instead. + */ + HTTPD_501_METHOD_NOT_IMPLEMENTED, + + /* When HTTP version is not 1.1 */ + HTTPD_505_VERSION_NOT_SUPPORTED, + + /* Returned when http_parser halts parsing due to incorrect + * syntax of request, unsupported method in request URI or + * due to chunked encoding / upgrade field present in headers + */ + HTTPD_400_BAD_REQUEST, + + /* When requested URI is not found */ + HTTPD_404_NOT_FOUND, + + /* When URI found, but method has no handler registered */ + HTTPD_405_METHOD_NOT_ALLOWED, + + /* Intended for recv timeout. Presently it's being sent + * for other recv errors as well. Client should expect the + * server to immediately close the connection after + * responding with this. + */ + HTTPD_408_REQ_TIMEOUT, + + /* Intended for responding to chunked encoding, which is + * not supported currently. Though unhandled http_parser + * callback for chunked request returns "400 Bad Request" + */ + HTTPD_411_LENGTH_REQUIRED, + + /* URI length greater than CONFIG_HTTPD_MAX_URI_LEN */ + HTTPD_414_URI_TOO_LONG, + + /* Headers section larger than CONFIG_HTTPD_MAX_REQ_HDR_LEN */ + HTTPD_431_REQ_HDR_FIELDS_TOO_LARGE, + + /* Used internally for retrieving the total count of errors */ + HTTPD_ERR_CODE_MAX +} httpd_err_code_t; + +/** + * @brief Function prototype for HTTP error handling. + * + * This function is executed upon HTTP errors generated during + * internal processing of an HTTP request. This is used to override + * the default behavior on error, which is to send HTTP error response + * and close the underlying socket. + * + * @note + * - If implemented, the server will not automatically send out HTTP + * error response codes, therefore, httpd_resp_send_err() must be + * invoked inside this function if user wishes to generate HTTP + * error responses. + * - When invoked, the validity of `uri`, `method`, `content_len` + * and `user_ctx` fields of the httpd_req_t parameter is not + * guaranteed as the HTTP request may be partially received/parsed. + * - The function must return ESP_OK if underlying socket needs to + * be kept open. Any other value will ensure that the socket is + * closed. The return value is ignored when error is of type + * `HTTPD_500_INTERNAL_SERVER_ERROR` and the socket closed anyway. + * + * @param[in] req HTTP request for which the error needs to be handled + * @param[in] error Error type + * + * @return + * - ESP_OK : error handled successful + * - ESP_FAIL : failure indicates that the underlying socket needs to be closed + */ +typedef esp_err_t (*httpd_err_handler_func_t)(httpd_req_t *req, + httpd_err_code_t error); + +/** + * @brief Function for registering HTTP error handlers + * + * This function maps a handler function to any supported error code + * given by `httpd_err_code_t`. See prototype `httpd_err_handler_func_t` + * above for details. + * + * @param[in] handle HTTP server handle + * @param[in] error Error type + * @param[in] handler_fn User implemented handler function + * (Pass NULL to unset any previously set handler) + * + * @return + * - ESP_OK : handler registered successfully + * - ESP_ERR_INVALID_ARG : invalid error code or server handle + */ +esp_err_t httpd_register_err_handler(httpd_handle_t handle, + httpd_err_code_t error, + httpd_err_handler_func_t handler_fn); + +/** End of HTTP Error + * @} + */ + /* ************** Group: TX/RX ************** */ /** @name TX / RX * Prototype for HTTPDs low-level send/recv functions @@ -463,11 +621,11 @@ esp_err_t httpd_unregister_uri(httpd_handle_t handle, const char* uri); * HTTPD_SOCK_ERR_ codes, which will eventually be conveyed as * return value of httpd_send() function * - * @param[in] hd : server instance - * @param[in] sockfd : session socket file descriptor - * @param[in] buf : buffer with bytes to send - * @param[in] buf_len : data size - * @param[in] flags : flags for the send() function + * @param[in] hd server instance + * @param[in] sockfd session socket file descriptor + * @param[in] buf buffer with bytes to send + * @param[in] buf_len data size + * @param[in] flags flags for the send() function * @return * - Bytes : The number of bytes sent successfully * - HTTPD_SOCK_ERR_INVALID : Invalid arguments @@ -484,11 +642,11 @@ typedef int (*httpd_send_func_t)(httpd_handle_t hd, int sockfd, const char *buf, * HTTPD_SOCK_ERR_ codes, which will eventually be conveyed as * return value of httpd_req_recv() function * - * @param[in] hd : server instance - * @param[in] sockfd : session socket file descriptor - * @param[in] buf : buffer with bytes to send - * @param[in] buf_len : data size - * @param[in] flags : flags for the send() function + * @param[in] hd server instance + * @param[in] sockfd session socket file descriptor + * @param[in] buf buffer with bytes to send + * @param[in] buf_len data size + * @param[in] flags flags for the send() function * @return * - Bytes : The number of bytes received successfully * - 0 : Buffer length parameter is zero / connection closed by peer @@ -506,8 +664,8 @@ typedef int (*httpd_recv_func_t)(httpd_handle_t hd, int sockfd, char *buf, size_ * HTTPD_SOCK_ERR_ codes, which will be handled accordingly in * the server task. * - * @param[in] hd : server instance - * @param[in] sockfd : session socket file descriptor + * @param[in] hd server instance + * @param[in] sockfd session socket file descriptor * @return * - Bytes : The number of bytes waiting to be received * - HTTPD_SOCK_ERR_INVALID : Invalid arguments @@ -759,6 +917,30 @@ esp_err_t httpd_req_get_url_query_str(httpd_req_t *r, char *buf, size_t buf_len) */ esp_err_t httpd_query_key_value(const char *qry, const char *key, char *val, size_t val_size); +/** + * @brief Test if a URI matches the given wildcard template. + * + * Template may end with "?" to make the previous character optional (typically a slash), + * "*" for a wildcard match, and "?*" to make the previous character optional, and if present, + * allow anything to follow. + * + * Example: + * - * matches everything + * - /foo/? matches /foo and /foo/ + * - /foo/\* (sans the backslash) matches /foo/ and /foo/bar, but not /foo or /fo + * - /foo/?* or /foo/\*? (sans the backslash) matches /foo/, /foo/bar, and also /foo, but not /foox or /fo + * + * The special characters "?" and "*" anywhere else in the template will be taken literally. + * + * @param[in] uri_template URI template (pattern) + * @param[in] uri_to_match URI to be matched + * @param[in] match_upto how many characters of the URI buffer to test + * (there may be trailing query string etc.) + * + * @return true if a match was found + */ +bool httpd_uri_match_wildcard(const char *uri_template, const char *uri_to_match, size_t match_upto); + /** * @brief API to send a complete HTTP response. * @@ -787,7 +969,7 @@ esp_err_t httpd_query_key_value(const char *qry, const char *key, char *val, siz * * @param[in] r The request being responded to * @param[in] buf Buffer from where the content is to be fetched - * @param[in] buf_len Length of the buffer, -1 to use strlen() + * @param[in] buf_len Length of the buffer, HTTPD_RESP_USE_STRLEN to use strlen() * * @return * - ESP_OK : On successfully sending the response packet @@ -826,7 +1008,7 @@ esp_err_t httpd_resp_send(httpd_req_t *r, const char *buf, ssize_t buf_len); * * @param[in] r The request being responded to * @param[in] buf Pointer to a buffer that stores the data - * @param[in] buf_len Length of the data from the buffer that should be sent out, -1 to use strlen() + * @param[in] buf_len Length of the buffer, HTTPD_RESP_USE_STRLEN to use strlen() * * @return * - ESP_OK : On successfully sending the response packet chunk @@ -837,6 +1019,48 @@ esp_err_t httpd_resp_send(httpd_req_t *r, const char *buf, ssize_t buf_len); */ esp_err_t httpd_resp_send_chunk(httpd_req_t *r, const char *buf, ssize_t buf_len); +/** + * @brief API to send a complete string as HTTP response. + * + * This API simply calls http_resp_send with buffer length + * set to string length assuming the buffer contains a null + * terminated string + * + * @param[in] r The request being responded to + * @param[in] str String to be sent as response body + * + * @return + * - ESP_OK : On successfully sending the response packet + * - ESP_ERR_INVALID_ARG : Null request pointer + * - ESP_ERR_HTTPD_RESP_HDR : Essential headers are too large for internal buffer + * - ESP_ERR_HTTPD_RESP_SEND : Error in raw send + * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request + */ +static inline esp_err_t httpd_resp_sendstr(httpd_req_t *r, const char *str) { + return httpd_resp_send(r, str, (str == NULL) ? 0 : strlen(str)); +} + +/** + * @brief API to send a string as an HTTP response chunk. + * + * This API simply calls http_resp_send_chunk with buffer length + * set to string length assuming the buffer contains a null + * terminated string + * + * @param[in] r The request being responded to + * @param[in] str String to be sent as response body (NULL to finish response packet) + * + * @return + * - ESP_OK : On successfully sending the response packet + * - ESP_ERR_INVALID_ARG : Null request pointer + * - ESP_ERR_HTTPD_RESP_HDR : Essential headers are too large for internal buffer + * - ESP_ERR_HTTPD_RESP_SEND : Error in raw send + * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request + */ +static inline esp_err_t httpd_resp_sendstr_chunk(httpd_req_t *r, const char *str) { + return httpd_resp_send_chunk(r, str, (str == NULL) ? 0 : strlen(str)); +} + /* Some commonly used status codes */ #define HTTPD_200 "200 OK" /*!< HTTP Response 200 */ #define HTTPD_204 "204 No Content" /*!< HTTP Response 204 */ @@ -925,6 +1149,30 @@ esp_err_t httpd_resp_set_type(httpd_req_t *r, const char *type); */ esp_err_t httpd_resp_set_hdr(httpd_req_t *r, const char *field, const char *value); +/** + * @brief For sending out error code in response to HTTP request. + * + * @note + * - This API is supposed to be called only from the context of + * a URI handler where httpd_req_t* request pointer is valid. + * - Once this API is called, all request headers are purged, so + * request headers need be copied into separate buffers if + * they are required later. + * - If you wish to send additional data in the body of the + * response, please use the lower-level functions directly. + * + * @param[in] req Pointer to the HTTP request for which the response needs to be sent + * @param[in] error Error type to send + * @param[in] msg Error message string (pass NULL for default message) + * + * @return + * - ESP_OK : On successfully sending the response packet + * - ESP_ERR_INVALID_ARG : Null arguments + * - ESP_ERR_HTTPD_RESP_SEND : Error in raw send + * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request pointer + */ +esp_err_t httpd_resp_send_err(httpd_req_t *req, httpd_err_code_t error, const char *msg); + /** * @brief Helper function for HTTP 404 * @@ -946,7 +1194,9 @@ esp_err_t httpd_resp_set_hdr(httpd_req_t *r, const char *field, const char *valu * - ESP_ERR_HTTPD_RESP_SEND : Error in raw send * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request pointer */ -esp_err_t httpd_resp_send_404(httpd_req_t *r); +static inline esp_err_t httpd_resp_send_404(httpd_req_t *r) { + return httpd_resp_send_err(r, HTTPD_404_NOT_FOUND, NULL); +} /** * @brief Helper function for HTTP 408 @@ -969,7 +1219,9 @@ esp_err_t httpd_resp_send_404(httpd_req_t *r); * - ESP_ERR_HTTPD_RESP_SEND : Error in raw send * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request pointer */ -esp_err_t httpd_resp_send_408(httpd_req_t *r); +static inline esp_err_t httpd_resp_send_408(httpd_req_t *r) { + return httpd_resp_send_err(r, HTTPD_408_REQ_TIMEOUT, NULL); +} /** * @brief Helper function for HTTP 500 @@ -992,7 +1244,9 @@ esp_err_t httpd_resp_send_408(httpd_req_t *r); * - ESP_ERR_HTTPD_RESP_SEND : Error in raw send * - ESP_ERR_HTTPD_INVALID_REQ : Invalid request pointer */ -esp_err_t httpd_resp_send_500(httpd_req_t *r); +static inline esp_err_t httpd_resp_send_500(httpd_req_t *r) { + return httpd_resp_send_err(r, HTTPD_500_INTERNAL_SERVER_ERROR, NULL); +} /** * @brief Raw HTTP send diff --git a/tools/sdk/include/esp_https_ota/esp_https_ota.h b/tools/sdk/include/esp_https_ota/esp_https_ota.h index 15719560..0c8fd069 100644 --- a/tools/sdk/include/esp_https_ota/esp_https_ota.h +++ b/tools/sdk/include/esp_https_ota/esp_https_ota.h @@ -15,24 +15,45 @@ #pragma once #include +#include #ifdef __cplusplus extern "C" { #endif +typedef void *esp_https_ota_handle_t; + +/** + * @brief ESP HTTPS OTA configuration + */ +typedef struct { + const esp_http_client_config_t *http_config; /*!< ESP HTTP client configuration */ +} esp_https_ota_config_t; + +#define ESP_ERR_HTTPS_OTA_BASE (0x9000) +#define ESP_ERR_HTTPS_OTA_IN_PROGRESS (ESP_ERR_HTTPS_OTA_BASE + 1) /* OTA operation in progress */ + /** * @brief HTTPS OTA Firmware upgrade. * - * This function performs HTTPS OTA Firmware upgrade - * + * This function allocates HTTPS OTA Firmware upgrade context, establishes HTTPS connection, + * reads image data from HTTP stream and writes it to OTA partition and + * finishes HTTPS OTA Firmware upgrade operation. + * This API supports URL redirection, but if CA cert of URLs differ then it + * should be appended to `cert_pem` member of `config`. + * * @param[in] config pointer to esp_http_client_config_t structure. * - * @note For secure HTTPS updates, the `cert_pem` member of `config` - * structure must be set to the server certificate. + * @note This API handles the entire OTA operation, so if this API is being used + * then no other APIs from `esp_https_ota` component should be called. + * If more information and control is needed during the HTTPS OTA process, + * then one can use `esp_https_ota_begin` and subsequent APIs. If this API returns + * successfully, esp_restart() must be called to boot from the new firmware image. * * @return * - ESP_OK: OTA data updated, next reboot will use specified partition. * - ESP_FAIL: For generic failure. + * - ESP_ERR_INVALID_ARG: Invalid argument * - ESP_ERR_OTA_VALIDATE_FAILED: Invalid app image * - ESP_ERR_NO_MEM: Cannot allocate memory for OTA operation. * - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed. @@ -40,6 +61,108 @@ extern "C" { */ esp_err_t esp_https_ota(const esp_http_client_config_t *config); +/** + * @brief Start HTTPS OTA Firmware upgrade + * + * This function initializes ESP HTTPS OTA context and establishes HTTPS connection. + * This function must be invoked first. If this function returns successfully, then `esp_https_ota_perform` should be + * called to continue with the OTA process and there should be a call to `esp_https_ota_finish` on + * completion of OTA operation or on failure in subsequent operations. + * This API supports URL redirection, but if CA cert of URLs differ then it + * should be appended to `cert_pem` member of `http_config`, which is a part of `ota_config`. + * In case of error, this API explicitly sets `handle` to NULL. + * + * @param[in] ota_config pointer to esp_https_ota_config_t structure + * @param[out] handle pointer to an allocated data of type `esp_https_ota_handle_t` + * which will be initialised in this function + * + * @note This API is blocking, so setting `is_async` member of `http_config` structure will + * result in an error. + * + * @return + * - ESP_OK: HTTPS OTA Firmware upgrade context initialised and HTTPS connection established + * - ESP_FAIL: For generic failure. + * - ESP_ERR_INVALID_ARG: Invalid argument (missing/incorrect config, certificate, etc.) + * - For other return codes, refer documentation in app_update component and esp_http_client + * component in esp-idf. + */ +esp_err_t esp_https_ota_begin(esp_https_ota_config_t *ota_config, esp_https_ota_handle_t *handle); + +/** + * @brief Read image data from HTTP stream and write it to OTA partition + * + * This function reads image data from HTTP stream and writes it to OTA partition. This function + * must be called only if esp_https_ota_begin() returns successfully. + * This function must be called in a loop since it returns after every HTTP read operation thus + * giving you the flexibility to stop OTA operation midway. + * + * @param[in] https_ota_handle pointer to esp_https_ota_handle_t structure + * + * @return + * - ESP_ERR_HTTPS_OTA_IN_PROGRESS: OTA update is in progress, call this API again to continue. + * - ESP_OK: OTA update was successful + * - ESP_FAIL: OTA update failed + * - ESP_ERR_INVALID_ARG: Invalid argument + * - ESP_ERR_OTA_VALIDATE_FAILED: Invalid app image + * - ESP_ERR_NO_MEM: Cannot allocate memory for OTA operation. + * - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed. + * - For other return codes, refer OTA documentation in esp-idf's app_update component. + */ +esp_err_t esp_https_ota_perform(esp_https_ota_handle_t https_ota_handle); + +/** + * @brief Clean-up HTTPS OTA Firmware upgrade and close HTTPS connection + * + * This function closes the HTTP connection and frees the ESP HTTPS OTA context. + * This function switches the boot partition to the OTA partition containing the + * new firmware image. + * + * @note If this API returns successfully, esp_restart() must be called to + * boot from the new firmware image + * + * @param[in] https_ota_handle pointer to esp_https_ota_handle_t structure + * + * @return + * - ESP_OK: Clean-up successful + * - ESP_ERR_INVALID_STATE + * - ESP_ERR_INVALID_ARG: Invalid argument + * - ESP_ERR_OTA_VALIDATE_FAILED: Invalid app image + */ +esp_err_t esp_https_ota_finish(esp_https_ota_handle_t https_ota_handle); + + +/** + * @brief Reads app description from image header. The app description provides information + * like the "Firmware version" of the image. + * + * @note This API can be called only after esp_https_ota_begin() and before esp_https_ota_perform(). + * Calling this API is not mandatory. + * + * @param[in] https_ota_handle pointer to esp_https_ota_handle_t structure + * @param[out] new_app_info pointer to an allocated esp_app_desc_t structure + * + * @return + * - ESP_ERR_INVALID_ARG: Invalid arguments + * - ESP_FAIL: Failed to read image descriptor + * - ESP_OK: Successfully read image descriptor + */ +esp_err_t esp_https_ota_get_img_desc(esp_https_ota_handle_t https_ota_handle, esp_app_desc_t *new_app_info); + + +/* +* @brief This function returns OTA image data read so far. +* +* @note This API should be called only if `esp_https_ota_perform()` has been called atleast once or +* if `esp_https_ota_get_img_desc` has been called before. +* +* @param[in] https_ota_handle pointer to esp_https_ota_handle_t structure +* +* @return +* - -1 On failure +* - total bytes read so far +*/ +int esp_https_ota_get_image_len_read(esp_https_ota_handle_t https_ota_handle); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/include/esp_https_server/esp_https_server.h b/tools/sdk/include/esp_https_server/esp_https_server.h new file mode 100644 index 00000000..e69a5a29 --- /dev/null +++ b/tools/sdk/include/esp_https_server/esp_https_server.h @@ -0,0 +1,130 @@ +// Copyright 2018 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _ESP_HTTPS_SERVER_H_ +#define _ESP_HTTPS_SERVER_H_ + +#include +#include "esp_err.h" +#include "esp_http_server.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + HTTPD_SSL_TRANSPORT_SECURE, // SSL Enabled + HTTPD_SSL_TRANSPORT_INSECURE // SSL disabled +} httpd_ssl_transport_mode_t; + +/** + * HTTPS server config struct + * + * Please use HTTPD_SSL_CONFIG_DEFAULT() to initialize it. + */ +struct httpd_ssl_config { + /** + * Underlying HTTPD server config + * + * Parameters like task stack size and priority can be adjusted here. + */ + httpd_config_t httpd; + + /** CA certificate */ + const uint8_t *cacert_pem; + + /** CA certificate byte length */ + size_t cacert_len; + + /** Private key */ + const uint8_t *prvtkey_pem; + + /** Private key byte length */ + size_t prvtkey_len; + + /** Transport Mode (default secure) */ + httpd_ssl_transport_mode_t transport_mode; + + /** Port used when transport mode is secure (default 443) */ + uint16_t port_secure; + + /** Port used when transport mode is insecure (default 80) */ + uint16_t port_insecure; +}; + +typedef struct httpd_ssl_config httpd_ssl_config_t; + +/** + * Default config struct init + * + * (http_server default config had to be copied for customization) + * + * Notes: + * - port is set when starting the server, according to 'transport_mode' + * - one socket uses ~ 40kB RAM with SSL, we reduce the default socket count to 4 + * - SSL sockets are usually long-lived, closing LRU prevents pool exhaustion DOS + * - Stack size may need adjustments depending on the user application + */ +#define HTTPD_SSL_CONFIG_DEFAULT() { \ + .httpd = { \ + .task_priority = tskIDLE_PRIORITY+5, \ + .stack_size = 10240, \ + .server_port = 0, \ + .ctrl_port = 32768, \ + .max_open_sockets = 4, \ + .max_uri_handlers = 8, \ + .max_resp_headers = 8, \ + .backlog_conn = 5, \ + .lru_purge_enable = true, \ + .recv_wait_timeout = 5, \ + .send_wait_timeout = 5, \ + .global_user_ctx = NULL, \ + .global_user_ctx_free_fn = NULL, \ + .global_transport_ctx = NULL, \ + .global_transport_ctx_free_fn = NULL, \ + .open_fn = NULL, \ + .close_fn = NULL, \ + .uri_match_fn = NULL \ + }, \ + .cacert_pem = NULL, \ + .cacert_len = 0, \ + .prvtkey_pem = NULL, \ + .prvtkey_len = 0, \ + .transport_mode = HTTPD_SSL_TRANSPORT_SECURE, \ + .port_secure = 443, \ + .port_insecure = 80, \ +} + +/** + * Create a SSL capable HTTP server (secure mode may be disabled in config) + * + * @param[in,out] config - server config, must not be const. Does not have to stay valid after + * calling this function. + * @param[out] handle - storage for the server handle, must be a valid pointer + * @return success + */ +esp_err_t httpd_ssl_start(httpd_handle_t *handle, httpd_ssl_config_t *config); + +/** + * Stop the server. Blocks until the server is shut down. + * + * @param[in] handle + */ +void httpd_ssl_stop(httpd_handle_t handle); + +#ifdef __cplusplus +} +#endif + +#endif // _ESP_HTTPS_SERVER_H_ diff --git a/tools/sdk/include/espcoredump/esp_core_dump.h b/tools/sdk/include/espcoredump/esp_core_dump.h new file mode 100644 index 00000000..e19b45c9 --- /dev/null +++ b/tools/sdk/include/espcoredump/esp_core_dump.h @@ -0,0 +1,89 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef ESP_CORE_DUMP_H_ +#define ESP_CORE_DUMP_H_ + +#include +#include "esp_err.h" +#include "freertos/xtensa_context.h" + +/**************************************************************************************/ +/******************************** EXCEPTION MODE API **********************************/ +/**************************************************************************************/ + +/** + * @brief Initializes core dump module internal data. + * + * @note Should be called at system startup. + */ +void esp_core_dump_init(); + +/** + * @brief Saves core dump to flash. + * + * The structure of data stored in flash is as follows: + * + * | TOTAL_LEN | VERSION | TASKS_NUM | TCB_SIZE | + * | TCB_ADDR_1 | STACK_TOP_1 | STACK_END_1 | TCB_1 | STACK_1 | + * . . . . + * . . . . + * | TCB_ADDR_N | STACK_TOP_N | STACK_END_N | TCB_N | STACK_N | + * | CRC32 | + * + * Core dump in flash consists of header and data for every task in the system at the moment of crash. + * For flash data integrity control CRC is used at the end of core the dump data. + * The structure of core dump data is described below in details. + * 1) Core dump starts with header: + * 1.1) TOTAL_LEN is total length of core dump data in flash including CRC. Size is 4 bytes. + * 1.2) VERSION field keeps 4 byte version of core dump. + * 1.2) TASKS_NUM is the number of tasks for which data are stored. Size is 4 bytes. + * 1.3) TCB_SIZE is the size of task's TCB structure. Size is 4 bytes. + * 2) Core dump header is followed by the data for every task in the system. + * Task data are started with task header: + * 2.1) TCB_ADDR is the address of TCB in memory. Size is 4 bytes. + * 2.2) STACK_TOP is the top of task's stack (address of the topmost stack item). Size is 4 bytes. + * 2.2) STACK_END is the end of task's stack (address from which task's stack starts). Size is 4 bytes. + * 3) Task header is followed by TCB data. Size is TCB_SIZE bytes. + * 4) Task's stack is placed after TCB data. Size is (STACK_END - STACK_TOP) bytes. + * 5) CRC is placed at the end of the data. + */ +void esp_core_dump_to_flash(XtExcFrame *frame); + +/** + * @brief Print base64-encoded core dump to UART. + * + * The structure of core dump data is the same as for data stored in flash (@see esp_core_dump_to_flash) with some notes: + * 1) CRC is not present in core dump printed to UART. + * 2) Since CRC is omitted TOTAL_LEN does not include its size. + * 3) Printed base64 data are surrounded with special messages to help user recognize the start and end of actual data. + */ +void esp_core_dump_to_uart(XtExcFrame *frame); + + +/**************************************************************************************/ +/*********************************** USER MODE API ************************************/ +/**************************************************************************************/ + +/** + * @brief Retrieves address and size of coredump data in flash. + * This function is always available, even when core dump is disabled in menuconfig. + * + * @param out_addr pointer to store image address in flash. + * @param out_size pointer to store image size in flash (including CRC). In bytes. + * + * @return ESP_OK on success, otherwise \see esp_err_t + */ +esp_err_t esp_core_dump_image_get(size_t* out_addr, size_t *out_size); + +#endif diff --git a/tools/sdk/include/expat/asciitab.h b/tools/sdk/include/expat/asciitab.h index 2f59fd92..63b1d1b4 100644 --- a/tools/sdk/include/expat/asciitab.h +++ b/tools/sdk/include/expat/asciitab.h @@ -31,34 +31,34 @@ */ /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, -/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, -/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, -/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, -/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, -/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, -/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, -/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, -/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, -/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, -/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, + /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, + /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, + /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, + /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, + /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, + /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, + /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, + /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, + /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, + /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, + /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, + /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, + /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, + /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, + /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, + /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, + /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, + /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, + /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, + /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, + /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, + /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, diff --git a/tools/sdk/include/expat/expat.h b/tools/sdk/include/expat/expat.h index 1f608c02..48a6e2a3 100644 --- a/tools/sdk/include/expat/expat.h +++ b/tools/sdk/include/expat/expat.h @@ -33,15 +33,6 @@ #ifndef Expat_INCLUDED #define Expat_INCLUDED 1 -#ifdef __VMS -/* 0 1 2 3 0 1 2 3 - 1234567890123456789012345678901 1234567890123456789012345678901 */ -#define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler -#define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler -#define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler -#define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg -#endif - #include #include "expat_external.h" @@ -53,8 +44,8 @@ struct XML_ParserStruct; typedef struct XML_ParserStruct *XML_Parser; typedef unsigned char XML_Bool; -#define XML_TRUE ((XML_Bool) 1) -#define XML_FALSE ((XML_Bool) 0) +#define XML_TRUE ((XML_Bool)1) +#define XML_FALSE ((XML_Bool)0) /* The XML_Status enum gives the possible return values for several API functions. The preprocessor #defines are included so this @@ -164,25 +155,23 @@ enum XML_Content_Quant { typedef struct XML_cp XML_Content; struct XML_cp { - enum XML_Content_Type type; - enum XML_Content_Quant quant; - XML_Char * name; - unsigned int numchildren; - XML_Content * children; + enum XML_Content_Type type; + enum XML_Content_Quant quant; + XML_Char *name; + unsigned int numchildren; + XML_Content *children; }; - /* This is called for an element declaration. See above for description of the model argument. It's the caller's responsibility to free model when finished with it. */ -typedef void (XMLCALL *XML_ElementDeclHandler) (void *userData, - const XML_Char *name, - XML_Content *model); +typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData, + const XML_Char *name, + XML_Content *model); XMLPARSEAPI(void) -XML_SetElementDeclHandler(XML_Parser parser, - XML_ElementDeclHandler eldecl); +XML_SetElementDeclHandler(XML_Parser parser, XML_ElementDeclHandler eldecl); /* The Attlist declaration handler is called for *each* attribute. So a single Attlist declaration with multiple attributes declared will @@ -192,17 +181,12 @@ XML_SetElementDeclHandler(XML_Parser parser, value will be NULL in the case of "#REQUIRED". If "isrequired" is true and default is non-NULL, then this is a "#FIXED" default. */ -typedef void (XMLCALL *XML_AttlistDeclHandler) ( - void *userData, - const XML_Char *elname, - const XML_Char *attname, - const XML_Char *att_type, - const XML_Char *dflt, - int isrequired); +typedef void(XMLCALL *XML_AttlistDeclHandler)( + void *userData, const XML_Char *elname, const XML_Char *attname, + const XML_Char *att_type, const XML_Char *dflt, int isrequired); XMLPARSEAPI(void) -XML_SetAttlistDeclHandler(XML_Parser parser, - XML_AttlistDeclHandler attdecl); +XML_SetAttlistDeclHandler(XML_Parser parser, XML_AttlistDeclHandler attdecl); /* The XML declaration handler is called for *both* XML declarations and text declarations. The way to distinguish is that the version @@ -212,15 +196,13 @@ XML_SetAttlistDeclHandler(XML_Parser parser, was no standalone parameter in the declaration, that it was given as no, or that it was given as yes. */ -typedef void (XMLCALL *XML_XmlDeclHandler) (void *userData, - const XML_Char *version, - const XML_Char *encoding, - int standalone); +typedef void(XMLCALL *XML_XmlDeclHandler)(void *userData, + const XML_Char *version, + const XML_Char *encoding, + int standalone); XMLPARSEAPI(void) -XML_SetXmlDeclHandler(XML_Parser parser, - XML_XmlDeclHandler xmldecl); - +XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler xmldecl); typedef struct { void *(*malloc_fcn)(size_t size); @@ -248,7 +230,6 @@ XML_ParserCreate(const XML_Char *encoding); XMLPARSEAPI(XML_Parser) XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); - /* Constructs a new parser using the memory management suite referred to by memsuite. If memsuite is NULL, then use the standard library memory suite. If namespaceSeparator is non-NULL it creates a parser with @@ -264,7 +245,7 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Char *namespaceSeparator); /* Prepare a parser object to be re-used. This is particularly - valuable when memory allocation overhead is disproportionatly high, + valuable when memory allocation overhead is disproportionately high, such as when a large number of small documnents need to be parsed. All handlers are cleared from the parser, except for the unknownEncodingHandler. The parser's external state is re-initialized @@ -278,31 +259,27 @@ XML_ParserReset(XML_Parser parser, const XML_Char *encoding); /* atts is array of name/value pairs, terminated by 0; names and values are 0 terminated. */ -typedef void (XMLCALL *XML_StartElementHandler) (void *userData, - const XML_Char *name, - const XML_Char **atts); - -typedef void (XMLCALL *XML_EndElementHandler) (void *userData, - const XML_Char *name); +typedef void(XMLCALL *XML_StartElementHandler)(void *userData, + const XML_Char *name, + const XML_Char **atts); +typedef void(XMLCALL *XML_EndElementHandler)(void *userData, + const XML_Char *name); /* s is not 0 terminated. */ -typedef void (XMLCALL *XML_CharacterDataHandler) (void *userData, - const XML_Char *s, - int len); +typedef void(XMLCALL *XML_CharacterDataHandler)(void *userData, + const XML_Char *s, int len); /* target and data are 0 terminated */ -typedef void (XMLCALL *XML_ProcessingInstructionHandler) ( - void *userData, - const XML_Char *target, - const XML_Char *data); +typedef void(XMLCALL *XML_ProcessingInstructionHandler)(void *userData, + const XML_Char *target, + const XML_Char *data); /* data is 0 terminated */ -typedef void (XMLCALL *XML_CommentHandler) (void *userData, - const XML_Char *data); +typedef void(XMLCALL *XML_CommentHandler)(void *userData, const XML_Char *data); -typedef void (XMLCALL *XML_StartCdataSectionHandler) (void *userData); -typedef void (XMLCALL *XML_EndCdataSectionHandler) (void *userData); +typedef void(XMLCALL *XML_StartCdataSectionHandler)(void *userData); +typedef void(XMLCALL *XML_EndCdataSectionHandler)(void *userData); /* This is called for any characters in the XML document for which there is no applicable handler. This includes both characters that @@ -317,25 +294,23 @@ typedef void (XMLCALL *XML_EndCdataSectionHandler) (void *userData); default handler: for example, a comment might be split between multiple calls. */ -typedef void (XMLCALL *XML_DefaultHandler) (void *userData, - const XML_Char *s, - int len); +typedef void(XMLCALL *XML_DefaultHandler)(void *userData, const XML_Char *s, + int len); /* This is called for the start of the DOCTYPE declaration, before any DTD or internal subset is parsed. */ -typedef void (XMLCALL *XML_StartDoctypeDeclHandler) ( - void *userData, - const XML_Char *doctypeName, - const XML_Char *sysid, - const XML_Char *pubid, - int has_internal_subset); +typedef void(XMLCALL *XML_StartDoctypeDeclHandler)(void *userData, + const XML_Char *doctypeName, + const XML_Char *sysid, + const XML_Char *pubid, + int has_internal_subset); /* This is called for the start of the DOCTYPE declaration when the closing > is encountered, but after processing any external subset. */ -typedef void (XMLCALL *XML_EndDoctypeDeclHandler)(void *userData); +typedef void(XMLCALL *XML_EndDoctypeDeclHandler)(void *userData); /* This is called for entity declarations. The is_parameter_entity argument will be non-zero if the entity is a parameter entity, zero @@ -355,20 +330,14 @@ typedef void (XMLCALL *XML_EndDoctypeDeclHandler)(void *userData); Note that is_parameter_entity can't be changed to XML_Bool, since that would break binary compatibility. */ -typedef void (XMLCALL *XML_EntityDeclHandler) ( - void *userData, - const XML_Char *entityName, - int is_parameter_entity, - const XML_Char *value, - int value_length, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId, - const XML_Char *notationName); +typedef void(XMLCALL *XML_EntityDeclHandler)( + void *userData, const XML_Char *entityName, int is_parameter_entity, + const XML_Char *value, int value_length, const XML_Char *base, + const XML_Char *systemId, const XML_Char *publicId, + const XML_Char *notationName); XMLPARSEAPI(void) -XML_SetEntityDeclHandler(XML_Parser parser, - XML_EntityDeclHandler handler); +XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler); /* OBSOLETE -- OBSOLETE -- OBSOLETE This handler has been superseded by the EntityDeclHandler above. @@ -379,24 +348,20 @@ XML_SetEntityDeclHandler(XML_Parser parser, entityName, systemId and notationName arguments will never be NULL. The other arguments may be. */ -typedef void (XMLCALL *XML_UnparsedEntityDeclHandler) ( - void *userData, - const XML_Char *entityName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId, - const XML_Char *notationName); +typedef void(XMLCALL *XML_UnparsedEntityDeclHandler)( + void *userData, const XML_Char *entityName, const XML_Char *base, + const XML_Char *systemId, const XML_Char *publicId, + const XML_Char *notationName); /* This is called for a declaration of notation. The base argument is whatever was set by XML_SetBase. The notationName will never be NULL. The other arguments can be. */ -typedef void (XMLCALL *XML_NotationDeclHandler) ( - void *userData, - const XML_Char *notationName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId); +typedef void(XMLCALL *XML_NotationDeclHandler)(void *userData, + const XML_Char *notationName, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId); /* When namespace processing is enabled, these are called once for each namespace declaration. The call to the start and end element @@ -404,14 +369,12 @@ typedef void (XMLCALL *XML_NotationDeclHandler) ( declaration handlers. For an xmlns attribute, prefix will be NULL. For an xmlns="" attribute, uri will be NULL. */ -typedef void (XMLCALL *XML_StartNamespaceDeclHandler) ( - void *userData, - const XML_Char *prefix, - const XML_Char *uri); +typedef void(XMLCALL *XML_StartNamespaceDeclHandler)(void *userData, + const XML_Char *prefix, + const XML_Char *uri); -typedef void (XMLCALL *XML_EndNamespaceDeclHandler) ( - void *userData, - const XML_Char *prefix); +typedef void(XMLCALL *XML_EndNamespaceDeclHandler)(void *userData, + const XML_Char *prefix); /* This is called if the document is not standalone, that is, it has an external subset or a reference to a parameter entity, but does not @@ -422,7 +385,7 @@ typedef void (XMLCALL *XML_EndNamespaceDeclHandler) ( conditions above this handler will only be called if the referenced entity was actually read. */ -typedef int (XMLCALL *XML_NotStandaloneHandler) (void *userData); +typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData); /* This is called for a reference to an external parsed general entity. The referenced entity is not automatically parsed. The @@ -458,12 +421,11 @@ typedef int (XMLCALL *XML_NotStandaloneHandler) (void *userData); Note that unlike other handlers the first argument is the parser, not userData. */ -typedef int (XMLCALL *XML_ExternalEntityRefHandler) ( - XML_Parser parser, - const XML_Char *context, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId); +typedef int(XMLCALL *XML_ExternalEntityRefHandler)(XML_Parser parser, + const XML_Char *context, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId); /* This is called in two situations: 1) An entity reference is encountered for which no declaration @@ -475,10 +437,9 @@ typedef int (XMLCALL *XML_ExternalEntityRefHandler) ( the event would be out of sync with the reporting of the declarations or attribute values */ -typedef void (XMLCALL *XML_SkippedEntityHandler) ( - void *userData, - const XML_Char *entityName, - int is_parameter_entity); +typedef void(XMLCALL *XML_SkippedEntityHandler)(void *userData, + const XML_Char *entityName, + int is_parameter_entity); /* This structure is filled in by the XML_UnknownEncodingHandler to provide information to the parser about encodings that are unknown @@ -535,8 +496,8 @@ typedef void (XMLCALL *XML_SkippedEntityHandler) ( typedef struct { int map[256]; void *data; - int (XMLCALL *convert)(void *data, const char *s); - void (XMLCALL *release)(void *data); + int(XMLCALL *convert)(void *data, const char *s); + void(XMLCALL *release)(void *data); } XML_Encoding; /* This is called for an encoding that is unknown to the parser. @@ -554,23 +515,19 @@ typedef struct { If info does not describe a suitable encoding, then the parser will return an XML_UNKNOWN_ENCODING error. */ -typedef int (XMLCALL *XML_UnknownEncodingHandler) ( - void *encodingHandlerData, - const XML_Char *name, - XML_Encoding *info); +typedef int(XMLCALL *XML_UnknownEncodingHandler)(void *encodingHandlerData, + const XML_Char *name, + XML_Encoding *info); XMLPARSEAPI(void) -XML_SetElementHandler(XML_Parser parser, - XML_StartElementHandler start, +XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end); XMLPARSEAPI(void) -XML_SetStartElementHandler(XML_Parser parser, - XML_StartElementHandler handler); +XML_SetStartElementHandler(XML_Parser parser, XML_StartElementHandler handler); XMLPARSEAPI(void) -XML_SetEndElementHandler(XML_Parser parser, - XML_EndElementHandler handler); +XML_SetEndElementHandler(XML_Parser parser, XML_EndElementHandler handler); XMLPARSEAPI(void) XML_SetCharacterDataHandler(XML_Parser parser, @@ -580,8 +537,7 @@ XMLPARSEAPI(void) XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler handler); XMLPARSEAPI(void) -XML_SetCommentHandler(XML_Parser parser, - XML_CommentHandler handler); +XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler handler); XMLPARSEAPI(void) XML_SetCdataSectionHandler(XML_Parser parser, @@ -601,20 +557,17 @@ XML_SetEndCdataSectionHandler(XML_Parser parser, default handler, or to the skipped entity handler, if one is set. */ XMLPARSEAPI(void) -XML_SetDefaultHandler(XML_Parser parser, - XML_DefaultHandler handler); +XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler); /* This sets the default handler but does not inhibit expansion of internal entities. The entity reference will not be passed to the default handler. */ XMLPARSEAPI(void) -XML_SetDefaultHandlerExpand(XML_Parser parser, - XML_DefaultHandler handler); +XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler); XMLPARSEAPI(void) -XML_SetDoctypeDeclHandler(XML_Parser parser, - XML_StartDoctypeDeclHandler start, +XML_SetDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start, XML_EndDoctypeDeclHandler end); XMLPARSEAPI(void) @@ -622,16 +575,14 @@ XML_SetStartDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start); XMLPARSEAPI(void) -XML_SetEndDoctypeDeclHandler(XML_Parser parser, - XML_EndDoctypeDeclHandler end); +XML_SetEndDoctypeDeclHandler(XML_Parser parser, XML_EndDoctypeDeclHandler end); XMLPARSEAPI(void) XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler handler); XMLPARSEAPI(void) -XML_SetNotationDeclHandler(XML_Parser parser, - XML_NotationDeclHandler handler); +XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler handler); XMLPARSEAPI(void) XML_SetNamespaceDeclHandler(XML_Parser parser, @@ -659,8 +610,7 @@ XML_SetExternalEntityRefHandler(XML_Parser parser, instead of the parser object. */ XMLPARSEAPI(void) -XML_SetExternalEntityRefHandlerArg(XML_Parser parser, - void *arg); +XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg); XMLPARSEAPI(void) XML_SetSkippedEntityHandler(XML_Parser parser, @@ -740,7 +690,6 @@ XML_UseParserAsHandlerArg(XML_Parser parser); XMLPARSEAPI(enum XML_Error) XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD); - /* Sets the base to be used for resolving relative URIs in system identifiers in declarations. Resolving relative identifiers is left to the application: this value will be passed through as the @@ -780,10 +729,10 @@ XML_GetIdAttributeIndex(XML_Parser parser); info->valueEnd - info->valueStart = 4 bytes. */ typedef struct { - XML_Index nameStart; /* Offset to beginning of the attribute name. */ - XML_Index nameEnd; /* Offset after the attribute name's last byte. */ - XML_Index valueStart; /* Offset to beginning of the attribute value. */ - XML_Index valueEnd; /* Offset after the attribute value's last byte. */ + XML_Index nameStart; /* Offset to beginning of the attribute name. */ + XML_Index nameEnd; /* Offset after the attribute name's last byte. */ + XML_Index valueStart; /* Offset to beginning of the attribute value. */ + XML_Index valueEnd; /* Offset after the attribute value's last byte. */ } XML_AttrInfo; /* Returns an array of XML_AttrInfo structures for the attribute/value pairs @@ -819,20 +768,20 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal); (resumable = 0) an already suspended parser. Some call-backs may still follow because they would otherwise get lost. Examples: - endElementHandler() for empty elements when stopped in - startElementHandler(), - - endNameSpaceDeclHandler() when stopped in endElementHandler(), + startElementHandler(), + - endNameSpaceDeclHandler() when stopped in endElementHandler(), and possibly others. Can be called from most handlers, including DTD related call-backs, except when parsing an external parameter entity and resumable != 0. Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise. - Possible error codes: + Possible error codes: - XML_ERROR_SUSPENDED: when suspending an already suspended parser. - XML_ERROR_FINISHED: when the parser has already finished. - XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE. - When resumable != 0 (true) then parsing is suspended, that is, - XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. + When resumable != 0 (true) then parsing is suspended, that is, + XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer() return XML_STATUS_ERROR with error code XML_ERROR_ABORTED. @@ -843,7 +792,7 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal); the externalEntityRefHandler() to call XML_StopParser() on the parent parser (recursively), if one wants to stop parsing altogether. - When suspended, parsing can be resumed by calling XML_ResumeParser(). + When suspended, parsing can be resumed by calling XML_ResumeParser(). */ XMLPARSEAPI(enum XML_Status) XML_StopParser(XML_Parser parser, XML_Bool resumable); @@ -851,7 +800,7 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable); /* Resumes parsing after it has been suspended with XML_StopParser(). Must not be called from within a handler call-back. Returns same status codes as XML_Parse() or XML_ParseBuffer(). - Additional error code XML_ERROR_NOT_SUSPENDED possible. + Additional error code XML_ERROR_NOT_SUSPENDED possible. *Note*: This must be called on the most deeply nested child parser instance @@ -863,12 +812,7 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable); XMLPARSEAPI(enum XML_Status) XML_ResumeParser(XML_Parser parser); -enum XML_Parsing { - XML_INITIALIZED, - XML_PARSING, - XML_FINISHED, - XML_SUSPENDED -}; +enum XML_Parsing { XML_INITIALIZED, XML_PARSING, XML_FINISHED, XML_SUSPENDED }; typedef struct { enum XML_Parsing parsing; @@ -900,8 +844,7 @@ XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status); Otherwise returns a new XML_Parser object. */ XMLPARSEAPI(XML_Parser) -XML_ExternalEntityParserCreate(XML_Parser parser, - const XML_Char *context, +XML_ExternalEntityParserCreate(XML_Parser parser, const XML_Char *context, const XML_Char *encoding); enum XML_ParamEntityParsing { @@ -945,8 +888,7 @@ XML_SetParamEntityParsing(XML_Parser parser, Note: If parser == NULL, the function will do nothing and return 0. */ XMLPARSEAPI(int) -XML_SetHashSalt(XML_Parser parser, - unsigned long hash_salt); +XML_SetHashSalt(XML_Parser parser, unsigned long hash_salt); /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then XML_GetErrorCode returns information about the error. @@ -963,7 +905,7 @@ XML_GetErrorCode(XML_Parser parser); be within the relevant markup. When called outside of the callback functions, the position indicated will be just past the last parse event (regardless of whether there was an associated callback). - + They may also be called after returning from a call to XML_Parse or XML_ParseBuffer. If the return value is XML_STATUS_ERROR then the location is the location of the character at which the error @@ -995,14 +937,12 @@ XML_GetCurrentByteCount(XML_Parser parser); the handler that makes the call. */ XMLPARSEAPI(const char *) -XML_GetInputContext(XML_Parser parser, - int *offset, - int *size); +XML_GetInputContext(XML_Parser parser, int *offset, int *size); /* For backwards compatibility with previous versions. */ -#define XML_GetErrorLineNumber XML_GetCurrentLineNumber +#define XML_GetErrorLineNumber XML_GetCurrentLineNumber #define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber -#define XML_GetErrorByteIndex XML_GetCurrentByteIndex +#define XML_GetErrorByteIndex XML_GetCurrentByteIndex /* Frees the content model passed to the element declaration handler */ XMLPARSEAPI(void) @@ -1062,21 +1002,20 @@ enum XML_FeatureEnum { }; typedef struct { - enum XML_FeatureEnum feature; - const XML_LChar *name; - long int value; + enum XML_FeatureEnum feature; + const XML_LChar *name; + long int value; } XML_Feature; XMLPARSEAPI(const XML_Feature *) XML_GetFeatureList(void); - /* Expat follows the semantic versioning convention. See http://semver.org. */ #define XML_MAJOR_VERSION 2 #define XML_MINOR_VERSION 2 -#define XML_MICRO_VERSION 5 +#define XML_MICRO_VERSION 9 #ifdef __cplusplus } diff --git a/tools/sdk/include/expat/expat_external.h b/tools/sdk/include/expat/expat_external.h index 629483a9..b3b6e74d 100644 --- a/tools/sdk/include/expat/expat_external.h +++ b/tools/sdk/include/expat/expat_external.h @@ -35,10 +35,6 @@ /* External API definitions */ -#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) -# define XML_USE_MSC_EXTENSIONS 1 -#endif - /* Expat tries very hard to make the API boundary very specifically defined. There are two macros defined to control this boundary; each of these can be defined before including this header to @@ -62,11 +58,11 @@ system headers may assume the cdecl convention. */ #ifndef XMLCALL -# if defined(_MSC_VER) -# define XMLCALL __cdecl -# elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER) -# define XMLCALL __attribute__((cdecl)) -# else +# if defined(_MSC_VER) +# define XMLCALL __cdecl +# elif defined(__GNUC__) && defined(__i386) && ! defined(__INTEL_COMPILER) +# define XMLCALL __attribute__((cdecl)) +# else /* For any platform which uses this definition and supports more than one calling convention, we need to extend this definition to declare the convention used on that platform, if it's possible to @@ -77,41 +73,46 @@ pre-processor and how to specify the same calling convention as the platform's malloc() implementation. */ -# define XMLCALL -# endif -#endif /* not defined XMLCALL */ +# define XMLCALL +# endif +#endif /* not defined XMLCALL */ - -#if !defined(XML_STATIC) && !defined(XMLIMPORT) -# ifndef XML_BUILDING_EXPAT +#if ! defined(XML_STATIC) && ! defined(XMLIMPORT) +# ifndef XML_BUILDING_EXPAT /* using Expat from an application */ -# ifdef XML_USE_MSC_EXTENSIONS -# define XMLIMPORT __declspec(dllimport) +# if defined(_MSC_EXTENSIONS) && ! defined(__BEOS__) && ! defined(__CYGWIN__) +# define XMLIMPORT __declspec(dllimport) +# endif + # endif +#endif /* not defined XML_STATIC */ -# endif -#endif /* not defined XML_STATIC */ +#ifndef XML_ENABLE_VISIBILITY +# define XML_ENABLE_VISIBILITY 0 +#endif -#if !defined(XMLIMPORT) && defined(__GNUC__) && (__GNUC__ >= 4) -# define XMLIMPORT __attribute__ ((visibility ("default"))) +#if ! defined(XMLIMPORT) && XML_ENABLE_VISIBILITY +# define XMLIMPORT __attribute__((visibility("default"))) #endif /* If we didn't define it above, define it away: */ #ifndef XMLIMPORT -# define XMLIMPORT +# define XMLIMPORT #endif -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)) -# define XML_ATTR_MALLOC __attribute__((__malloc__)) +#if defined(__GNUC__) \ + && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)) +# define XML_ATTR_MALLOC __attribute__((__malloc__)) #else -# define XML_ATTR_MALLOC +# define XML_ATTR_MALLOC #endif -#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) -# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x))) +#if defined(__GNUC__) \ + && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) +# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x))) #else -# define XML_ATTR_ALLOC_SIZE(x) +# define XML_ATTR_ALLOC_SIZE(x) #endif #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL @@ -121,35 +122,30 @@ extern "C" { #endif #ifdef XML_UNICODE_WCHAR_T -# ifndef XML_UNICODE -# define XML_UNICODE -# endif -# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2) -# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc" -# endif +# ifndef XML_UNICODE +# define XML_UNICODE +# endif +# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2) +# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc" +# endif #endif -#ifdef XML_UNICODE /* Information is UTF-16 encoded. */ -# ifdef XML_UNICODE_WCHAR_T +#ifdef XML_UNICODE /* Information is UTF-16 encoded. */ +# ifdef XML_UNICODE_WCHAR_T typedef wchar_t XML_Char; typedef wchar_t XML_LChar; -# else +# else typedef unsigned short XML_Char; typedef char XML_LChar; -# endif /* XML_UNICODE_WCHAR_T */ -#else /* Information is UTF-8 encoded. */ +# endif /* XML_UNICODE_WCHAR_T */ +#else /* Information is UTF-8 encoded. */ typedef char XML_Char; typedef char XML_LChar; -#endif /* XML_UNICODE */ +#endif /* XML_UNICODE */ -#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */ -# if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 -typedef __int64 XML_Index; -typedef unsigned __int64 XML_Size; -# else +#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */ typedef long long XML_Index; typedef unsigned long long XML_Size; -# endif #else typedef long XML_Index; typedef unsigned long XML_Size; diff --git a/tools/sdk/include/expat/iasciitab.h b/tools/sdk/include/expat/iasciitab.h index ce4a4bf7..ea97cfcf 100644 --- a/tools/sdk/include/expat/iasciitab.h +++ b/tools/sdk/include/expat/iasciitab.h @@ -32,34 +32,34 @@ /* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, -/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, -/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, -/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, -/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, -/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, -/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, -/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, -/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, -/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, -/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, + /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, + /* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, + /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, + /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, + /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, + /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, + /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, + /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, + /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, + /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, + /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, + /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, + /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, + /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, + /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, + /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, + /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, + /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, + /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, + /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, + /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, + /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, diff --git a/tools/sdk/include/expat/internal.h b/tools/sdk/include/expat/internal.h index e33fdcb0..60913dab 100644 --- a/tools/sdk/include/expat/internal.h +++ b/tools/sdk/include/expat/internal.h @@ -49,7 +49,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__) +#if defined(__GNUC__) && defined(__i386__) && ! defined(__MINGW32__) /* We'll use this version by default only where we know it helps. regparm() generates warnings on Solaris boxes. See SF bug #692878. @@ -59,8 +59,8 @@ #define FASTCALL __attribute__((stdcall, regparm(3))) and let's try this: */ -#define FASTCALL __attribute__((regparm(3))) -#define PTRFASTCALL __attribute__((regparm(3))) +# define FASTCALL __attribute__((regparm(3))) +# define PTRFASTCALL __attribute__((regparm(3))) #endif /* Using __fastcall seems to have an unexpected negative effect under @@ -74,50 +74,49 @@ /* Make sure all of these are defined if they aren't already. */ #ifndef FASTCALL -#define FASTCALL +# define FASTCALL #endif #ifndef PTRCALL -#define PTRCALL +# define PTRCALL #endif #ifndef PTRFASTCALL -#define PTRFASTCALL +# define PTRFASTCALL #endif #ifndef XML_MIN_SIZE -#if !defined(__cplusplus) && !defined(inline) -#ifdef __GNUC__ -#define inline __inline -#endif /* __GNUC__ */ -#endif +# if ! defined(__cplusplus) && ! defined(inline) +# ifdef __GNUC__ +# define inline __inline +# endif /* __GNUC__ */ +# endif #endif /* XML_MIN_SIZE */ #ifdef __cplusplus -#define inline inline +# define inline inline #else -#ifndef inline -#define inline -#endif +# ifndef inline +# define inline +# endif #endif #ifndef UNUSED_P -# ifdef __GNUC__ -# define UNUSED_P(p) UNUSED_ ## p __attribute__((__unused__)) -# else -# define UNUSED_P(p) UNUSED_ ## p -# endif +# define UNUSED_P(p) (void)p #endif - #ifdef __cplusplus extern "C" { #endif - +#ifdef XML_ENABLE_VISIBILITY +# if XML_ENABLE_VISIBILITY +__attribute__((visibility("default"))) +# endif +#endif void -_INTERNAL_trim_to_complete_utf8_characters(const char * from, const char ** fromLimRef); - +_INTERNAL_trim_to_complete_utf8_characters(const char *from, + const char **fromLimRef); #ifdef __cplusplus } diff --git a/tools/sdk/include/expat/latin1tab.h b/tools/sdk/include/expat/latin1tab.h index 95dfa52b..6f916041 100644 --- a/tools/sdk/include/expat/latin1tab.h +++ b/tools/sdk/include/expat/latin1tab.h @@ -31,34 +31,34 @@ */ /* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, -/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, -/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, -/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, + /* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, + /* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, + /* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, + /* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, + /* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, + /* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, + /* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, diff --git a/tools/sdk/include/expat/nametab.h b/tools/sdk/include/expat/nametab.h index bfa2bd38..3681df34 100644 --- a/tools/sdk/include/expat/nametab.h +++ b/tools/sdk/include/expat/nametab.h @@ -31,152 +31,106 @@ */ static const unsigned namingBitmap[] = { -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE, -0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF, -0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF, -0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, -0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, -0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, -0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, -0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, -0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF, -0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000, -0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060, -0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003, -0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003, -0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000, -0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001, -0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003, -0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000, -0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003, -0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003, -0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000, -0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000, -0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF, -0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB, -0x40000000, 0xF580C900, 0x00000007, 0x02010800, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF, -0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF, -0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, -0x00000000, 0x00004C40, 0x00000000, 0x00000000, -0x00000007, 0x00000000, 0x00000000, 0x00000000, -0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF, -0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF, -0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000, -0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE, -0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF, -0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, -0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003, -0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, -0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, -0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, -0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, -0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF, -0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF, -0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF, -0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF, -0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF, -0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0, -0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1, -0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3, -0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80, -0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3, -0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3, -0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000, -0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000, -0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF, -0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x1FFF0000, 0x00000002, -0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF, -0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x04000000, + 0x87FFFFFE, 0x07FFFFFE, 0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF, + 0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFE00F, 0xFC31FFFF, 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, + 0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, + 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, 0xFFFF0003, 0xFFFFFFFF, + 0xFFFF199F, 0x033FCFFF, 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, + 0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF, 0x00000000, 0x07FFFFFE, + 0x000007FE, 0xFFFE0000, 0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060, + 0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003, 0xFFF99FE0, 0x03C5FDFF, + 0xB0000000, 0x00030003, 0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000, + 0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001, 0xFFF99FE0, 0x23CDFDFF, + 0xB0000000, 0x00000003, 0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000, + 0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003, 0xFFFDDFE0, 0x03EFFDFF, + 0x40000000, 0x00000003, 0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFE, 0x000D7FFF, + 0x0000003F, 0x00000000, 0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000, + 0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF, 0x0007DAED, 0x50000000, + 0x82315001, 0x002C62AB, 0x40000000, 0xF580C900, 0x00000007, 0x02010800, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0x03FFFFFF, 0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF, + 0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, 0x00000000, 0x00004C40, + 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000000, + 0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF, 0x001FFFFF, 0xFFFFFFFE, + 0xFFFFFFFF, 0x07FFFFFF, 0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000000F, + 0x00000000, 0x00000000, 0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE, + 0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF, 0x00FFFFFF, 0x00000000, + 0xFFFF0000, 0xFFFFFFFF, 0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000, + 0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003, 0xFFFFD7C0, 0xFFFFFFFB, + 0x547F7FFF, 0x000FFFFD, 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, + 0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, 0x00000000, 0xFFFE0000, + 0x027FFFFF, 0xFFFFFFFE, 0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF, + 0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF, 0xFFFFFFFF, 0x7CFFFFFF, + 0xFFEF7FFF, 0x03FF3DFF, 0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF, + 0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF, 0xFFF987E4, 0xD36DFDFF, + 0x5E003987, 0x001FFFC0, 0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1, + 0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3, 0xD63DC7EC, 0xC3BFC718, + 0x00803DC7, 0x0000FF80, 0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3, + 0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3, 0xFFFDDFEC, 0xC3FFFDFF, + 0x00803DCF, 0x0000FFC3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000, 0xFEF02596, 0x3BFF6CAE, + 0x03FF3F5F, 0x00000000, 0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF, + 0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x1FFF0000, 0x00000002, + 0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF, 0x661FFFFF, 0xFFFFFFFE, + 0xFFFFFFFF, 0x77FFFFFF, }; static const unsigned char nmstrtPages[] = { -0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, -0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, -0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, -0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x09, 0x0A, 0x0B, + 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x00, 0x14, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, }; static const unsigned char namePages[] = { -0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00, -0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, -0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, -0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00, 0x00, 0x1F, 0x20, 0x21, + 0x22, 0x23, 0x24, 0x25, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x26, 0x14, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, }; diff --git a/tools/sdk/include/expat/siphash.h b/tools/sdk/include/expat/siphash.h index 581872df..bfee65a3 100644 --- a/tools/sdk/include/expat/siphash.h +++ b/tools/sdk/include/expat/siphash.h @@ -11,6 +11,16 @@ * -------------------------------------------------------------------------- * HISTORY: * + * 2019-08-03 (Sebastian Pipping) + * - Mark part of sip24_valid as to be excluded from clang-format + * - Re-format code using clang-format 9 + * + * 2018-07-08 (Anton Maklakov) + * - Add "fall through" markers for GCC's -Wimplicit-fallthrough + * + * 2017-11-03 (Sebastian Pipping) + * - Hide sip_tobin and sip_binof unless SIPHASH_TOBIN macro is defined + * * 2017-07-25 (Vadim Zeitlin) * - Fix use of SIPHASH_MAIN macro * @@ -88,175 +98,186 @@ #include /* size_t */ #if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1600) - /* For vs2003/7.1 up to vs2008/9.0; _MSC_VER 1600 is vs2010/10.0 */ - typedef unsigned __int8 uint8_t; - typedef unsigned __int32 uint32_t; - typedef unsigned __int64 uint64_t; +/* For vs2003/7.1 up to vs2008/9.0; _MSC_VER 1600 is vs2010/10.0 */ +typedef unsigned __int8 uint8_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; #else - #include /* uint64_t uint32_t uint8_t */ +# include /* uint64_t uint32_t uint8_t */ #endif - /* * Workaround to not require a C++11 compiler for using ULL suffix * if this code is included and compiled as C++; related GCC warning is: * warning: use of C++11 long long integer constant [-Wlong-long] */ -#define _SIP_ULL(high, low) (((uint64_t)high << 32) | low) +#define _SIP_ULL(high, low) (((uint64_t)high << 32) | low) +#define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b)))) -#define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ( (x) >> (64 - (b)))) +#define SIP_U32TO8_LE(p, v) \ + (p)[0] = (uint8_t)((v) >> 0); \ + (p)[1] = (uint8_t)((v) >> 8); \ + (p)[2] = (uint8_t)((v) >> 16); \ + (p)[3] = (uint8_t)((v) >> 24); -#define SIP_U32TO8_LE(p, v) \ - (p)[0] = (uint8_t)((v) >> 0); (p)[1] = (uint8_t)((v) >> 8); \ - (p)[2] = (uint8_t)((v) >> 16); (p)[3] = (uint8_t)((v) >> 24); +#define SIP_U64TO8_LE(p, v) \ + SIP_U32TO8_LE((p) + 0, (uint32_t)((v) >> 0)); \ + SIP_U32TO8_LE((p) + 4, (uint32_t)((v) >> 32)); -#define SIP_U64TO8_LE(p, v) \ - SIP_U32TO8_LE((p) + 0, (uint32_t)((v) >> 0)); \ - SIP_U32TO8_LE((p) + 4, (uint32_t)((v) >> 32)); +#define SIP_U8TO64_LE(p) \ + (((uint64_t)((p)[0]) << 0) | ((uint64_t)((p)[1]) << 8) \ + | ((uint64_t)((p)[2]) << 16) | ((uint64_t)((p)[3]) << 24) \ + | ((uint64_t)((p)[4]) << 32) | ((uint64_t)((p)[5]) << 40) \ + | ((uint64_t)((p)[6]) << 48) | ((uint64_t)((p)[7]) << 56)) -#define SIP_U8TO64_LE(p) \ - (((uint64_t)((p)[0]) << 0) | \ - ((uint64_t)((p)[1]) << 8) | \ - ((uint64_t)((p)[2]) << 16) | \ - ((uint64_t)((p)[3]) << 24) | \ - ((uint64_t)((p)[4]) << 32) | \ - ((uint64_t)((p)[5]) << 40) | \ - ((uint64_t)((p)[6]) << 48) | \ - ((uint64_t)((p)[7]) << 56)) - - -#define SIPHASH_INITIALIZER { 0, 0, 0, 0, { 0 }, 0, 0 } +#define SIPHASH_INITIALIZER \ + { 0, 0, 0, 0, {0}, 0, 0 } struct siphash { - uint64_t v0, v1, v2, v3; + uint64_t v0, v1, v2, v3; - unsigned char buf[8], *p; - uint64_t c; + unsigned char buf[8], *p; + uint64_t c; }; /* struct siphash */ - #define SIP_KEYLEN 16 struct sipkey { - uint64_t k[2]; + uint64_t k[2]; }; /* struct sipkey */ -#define sip_keyof(k) sip_tokey(&(struct sipkey){ { 0 } }, (k)) +#define sip_keyof(k) sip_tokey(&(struct sipkey){{0}}, (k)) -static struct sipkey *sip_tokey(struct sipkey *key, const void *src) { - key->k[0] = SIP_U8TO64_LE((const unsigned char *)src); - key->k[1] = SIP_U8TO64_LE((const unsigned char *)src + 8); - return key; +static struct sipkey * +sip_tokey(struct sipkey *key, const void *src) { + key->k[0] = SIP_U8TO64_LE((const unsigned char *)src); + key->k[1] = SIP_U8TO64_LE((const unsigned char *)src + 8); + return key; } /* sip_tokey() */ +#ifdef SIPHASH_TOBIN -#define sip_binof(v) sip_tobin((unsigned char[8]){ 0 }, (v)) +# define sip_binof(v) sip_tobin((unsigned char[8]){0}, (v)) -static void *sip_tobin(void *dst, uint64_t u64) { - SIP_U64TO8_LE((unsigned char *)dst, u64); - return dst; +static void * +sip_tobin(void *dst, uint64_t u64) { + SIP_U64TO8_LE((unsigned char *)dst, u64); + return dst; } /* sip_tobin() */ +#endif /* SIPHASH_TOBIN */ -static void sip_round(struct siphash *H, const int rounds) { - int i; +static void +sip_round(struct siphash *H, const int rounds) { + int i; - for (i = 0; i < rounds; i++) { - H->v0 += H->v1; - H->v1 = SIP_ROTL(H->v1, 13); - H->v1 ^= H->v0; - H->v0 = SIP_ROTL(H->v0, 32); + for (i = 0; i < rounds; i++) { + H->v0 += H->v1; + H->v1 = SIP_ROTL(H->v1, 13); + H->v1 ^= H->v0; + H->v0 = SIP_ROTL(H->v0, 32); - H->v2 += H->v3; - H->v3 = SIP_ROTL(H->v3, 16); - H->v3 ^= H->v2; + H->v2 += H->v3; + H->v3 = SIP_ROTL(H->v3, 16); + H->v3 ^= H->v2; - H->v0 += H->v3; - H->v3 = SIP_ROTL(H->v3, 21); - H->v3 ^= H->v0; + H->v0 += H->v3; + H->v3 = SIP_ROTL(H->v3, 21); + H->v3 ^= H->v0; - H->v2 += H->v1; - H->v1 = SIP_ROTL(H->v1, 17); - H->v1 ^= H->v2; - H->v2 = SIP_ROTL(H->v2, 32); - } + H->v2 += H->v1; + H->v1 = SIP_ROTL(H->v1, 17); + H->v1 ^= H->v2; + H->v2 = SIP_ROTL(H->v2, 32); + } } /* sip_round() */ +static struct siphash * +sip24_init(struct siphash *H, const struct sipkey *key) { + H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0]; + H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1]; + H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0]; + H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1]; -static struct siphash *sip24_init(struct siphash *H, - const struct sipkey *key) { - H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0]; - H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1]; - H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0]; - H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1]; + H->p = H->buf; + H->c = 0; - H->p = H->buf; - H->c = 0; - - return H; + return H; } /* sip24_init() */ +#define sip_endof(a) (&(a)[sizeof(a) / sizeof *(a)]) -#define sip_endof(a) (&(a)[sizeof (a) / sizeof *(a)]) +static struct siphash * +sip24_update(struct siphash *H, const void *src, size_t len) { + const unsigned char *p = (const unsigned char *)src, *pe = p + len; + uint64_t m; -static struct siphash *sip24_update(struct siphash *H, const void *src, - size_t len) { - const unsigned char *p = (const unsigned char *)src, *pe = p + len; - uint64_t m; + do { + while (p < pe && H->p < sip_endof(H->buf)) + *H->p++ = *p++; - do { - while (p < pe && H->p < sip_endof(H->buf)) - *H->p++ = *p++; + if (H->p < sip_endof(H->buf)) + break; - if (H->p < sip_endof(H->buf)) - break; + m = SIP_U8TO64_LE(H->buf); + H->v3 ^= m; + sip_round(H, 2); + H->v0 ^= m; - m = SIP_U8TO64_LE(H->buf); - H->v3 ^= m; - sip_round(H, 2); - H->v0 ^= m; + H->p = H->buf; + H->c += 8; + } while (p < pe); - H->p = H->buf; - H->c += 8; - } while (p < pe); - - return H; + return H; } /* sip24_update() */ +static uint64_t +sip24_final(struct siphash *H) { + const char left = (char)(H->p - H->buf); + uint64_t b = (H->c + left) << 56; -static uint64_t sip24_final(struct siphash *H) { - const char left = (char)(H->p - H->buf); - uint64_t b = (H->c + left) << 56; + switch (left) { + case 7: + b |= (uint64_t)H->buf[6] << 48; + /* fall through */ + case 6: + b |= (uint64_t)H->buf[5] << 40; + /* fall through */ + case 5: + b |= (uint64_t)H->buf[4] << 32; + /* fall through */ + case 4: + b |= (uint64_t)H->buf[3] << 24; + /* fall through */ + case 3: + b |= (uint64_t)H->buf[2] << 16; + /* fall through */ + case 2: + b |= (uint64_t)H->buf[1] << 8; + /* fall through */ + case 1: + b |= (uint64_t)H->buf[0] << 0; + /* fall through */ + case 0: + break; + } - switch (left) { - case 7: b |= (uint64_t)H->buf[6] << 48; - case 6: b |= (uint64_t)H->buf[5] << 40; - case 5: b |= (uint64_t)H->buf[4] << 32; - case 4: b |= (uint64_t)H->buf[3] << 24; - case 3: b |= (uint64_t)H->buf[2] << 16; - case 2: b |= (uint64_t)H->buf[1] << 8; - case 1: b |= (uint64_t)H->buf[0] << 0; - case 0: break; - } + H->v3 ^= b; + sip_round(H, 2); + H->v0 ^= b; + H->v2 ^= 0xff; + sip_round(H, 4); - H->v3 ^= b; - sip_round(H, 2); - H->v0 ^= b; - H->v2 ^= 0xff; - sip_round(H, 4); - - return H->v0 ^ H->v1 ^ H->v2 ^ H->v3; + return H->v0 ^ H->v1 ^ H->v2 ^ H->v3; } /* sip24_final() */ - -static uint64_t siphash24(const void *src, size_t len, - const struct sipkey *key) { - struct siphash state = SIPHASH_INITIALIZER; - return sip24_final(sip24_update(sip24_init(&state, key), src, len)); +static uint64_t +siphash24(const void *src, size_t len, const struct sipkey *key) { + struct siphash state = SIPHASH_INITIALIZER; + return sip24_final(sip24_update(sip24_init(&state, key), src, len)); } /* siphash24() */ - /* * SipHash-2-4 output with * k = 00 01 02 ... @@ -268,107 +289,110 @@ static uint64_t siphash24(const void *src, size_t len, * ... * in = 00 01 02 ... 3e (63 bytes) */ -static int sip24_valid(void) { - static const unsigned char vectors[64][8] = { - { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, }, - { 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, }, - { 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, }, - { 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, }, - { 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, }, - { 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, }, - { 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, }, - { 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, }, - { 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, }, - { 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, }, - { 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, }, - { 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, }, - { 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, }, - { 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, }, - { 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, }, - { 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, }, - { 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, }, - { 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, }, - { 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, }, - { 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, }, - { 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, }, - { 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, }, - { 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, }, - { 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, }, - { 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, }, - { 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, }, - { 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, }, - { 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, }, - { 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, }, - { 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, }, - { 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, }, - { 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, }, - { 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, }, - { 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, }, - { 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, }, - { 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, }, - { 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, }, - { 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, }, - { 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, }, - { 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, }, - { 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, }, - { 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, }, - { 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, }, - { 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, }, - { 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, }, - { 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, }, - { 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, }, - { 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, }, - { 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, }, - { 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, }, - { 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, }, - { 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, }, - { 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, }, - { 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, }, - { 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, }, - { 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, }, - { 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, }, - { 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, }, - { 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, }, - { 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, }, - { 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, }, - { 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, }, - { 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, }, - { 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, } - }; - unsigned char in[64]; - struct sipkey k; - size_t i; +static int +sip24_valid(void) { + /* clang-format off */ + static const unsigned char vectors[64][8] = { + { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, }, + { 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, }, + { 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, }, + { 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, }, + { 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, }, + { 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, }, + { 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, }, + { 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, }, + { 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, }, + { 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, }, + { 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, }, + { 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, }, + { 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, }, + { 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, }, + { 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, }, + { 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, }, + { 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, }, + { 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, }, + { 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, }, + { 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, }, + { 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, }, + { 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, }, + { 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, }, + { 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, }, + { 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, }, + { 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, }, + { 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, }, + { 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, }, + { 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, }, + { 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, }, + { 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, }, + { 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, }, + { 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, }, + { 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, }, + { 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, }, + { 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, }, + { 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, }, + { 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, }, + { 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, }, + { 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, }, + { 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, }, + { 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, }, + { 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, }, + { 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, }, + { 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, }, + { 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, }, + { 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, }, + { 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, }, + { 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, }, + { 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, }, + { 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, }, + { 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, }, + { 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, }, + { 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, }, + { 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, }, + { 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, }, + { 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, }, + { 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, }, + { 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, }, + { 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, }, + { 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, }, + { 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, }, + { 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, }, + { 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, } + }; + /* clang-format on */ - sip_tokey(&k, "\000\001\002\003\004\005\006\007\010\011" - "\012\013\014\015\016\017"); + unsigned char in[64]; + struct sipkey k; + size_t i; - for (i = 0; i < sizeof in; ++i) { - in[i] = (unsigned char)i; + sip_tokey(&k, "\000\001\002\003\004\005\006\007\010\011" + "\012\013\014\015\016\017"); - if (siphash24(in, i, &k) != SIP_U8TO64_LE(vectors[i])) - return 0; - } + for (i = 0; i < sizeof in; ++i) { + in[i] = (unsigned char)i; - return 1; + if (siphash24(in, i, &k) != SIP_U8TO64_LE(vectors[i])) + return 0; + } + + return 1; } /* sip24_valid() */ - #ifdef SIPHASH_MAIN -#include +# include -int main(void) { - const int ok = sip24_valid(); +int +main(void) { + const int ok = sip24_valid(); - if (ok) - puts("OK"); - else - puts("FAIL"); + if (ok) + puts("OK"); + else + puts("FAIL"); - return !ok; + return ! ok; } /* main() */ #endif /* SIPHASH_MAIN */ - #endif /* SIPHASH_H */ diff --git a/tools/sdk/include/expat/utf8tab.h b/tools/sdk/include/expat/utf8tab.h index fa0bed6f..a22986ac 100644 --- a/tools/sdk/include/expat/utf8tab.h +++ b/tools/sdk/include/expat/utf8tab.h @@ -31,34 +31,34 @@ */ /* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, -/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, + /* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, + /* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, + /* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, + /* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, + /* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, + /* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, + /* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, + /* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, + /* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, + /* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, + /* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, + /* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, + /* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, + /* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, + /* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, + /* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, + /* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, diff --git a/tools/sdk/include/expat/winconfig.h b/tools/sdk/include/expat/winconfig.h index 17fea468..562a4a82 100644 --- a/tools/sdk/include/expat/winconfig.h +++ b/tools/sdk/include/expat/winconfig.h @@ -40,24 +40,17 @@ #include #include +#if defined(HAVE_EXPAT_CONFIG_H) /* e.g. MinGW */ +# include +#else /* !defined(HAVE_EXPAT_CONFIG_H) */ -#if defined(HAVE_EXPAT_CONFIG_H) /* e.g. MinGW */ -# include -#else /* !defined(HAVE_EXPAT_CONFIG_H) */ - - -#define XML_NS 1 -#define XML_DTD 1 -#define XML_CONTEXT_BYTES 1024 +# define XML_NS 1 +# define XML_DTD 1 +# define XML_CONTEXT_BYTES 1024 /* we will assume all Windows platforms are little endian */ -#define BYTEORDER 1234 - -/* Windows has memmove() available. */ -#define HAVE_MEMMOVE - +# define BYTEORDER 1234 #endif /* !defined(HAVE_EXPAT_CONFIG_H) */ - #endif /* ndef WINCONFIG_H */ diff --git a/tools/sdk/include/expat/xmlrole.h b/tools/sdk/include/expat/xmlrole.h index e5f048ea..036aba64 100644 --- a/tools/sdk/include/expat/xmlrole.h +++ b/tools/sdk/include/expat/xmlrole.h @@ -36,7 +36,7 @@ #ifdef __VMS /* 0 1 2 3 0 1 2 3 1234567890123456789012345678901 1234567890123456789012345678901 */ -#define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt +# define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt #endif #include "xmltok.h" @@ -113,11 +113,8 @@ enum { }; typedef struct prolog_state { - int (PTRCALL *handler) (struct prolog_state *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc); + int(PTRCALL *handler)(struct prolog_state *state, int tok, const char *ptr, + const char *end, const ENCODING *enc); unsigned level; int role_none; #ifdef XML_DTD @@ -132,8 +129,8 @@ void XmlPrologStateInit(PROLOG_STATE *); void XmlPrologStateInitExternalEntity(PROLOG_STATE *); #endif /* XML_DTD */ -#define XmlTokenRole(state, tok, ptr, end, enc) \ - (((state)->handler)(state, tok, ptr, end, enc)) +#define XmlTokenRole(state, tok, ptr, end, enc) \ + (((state)->handler)(state, tok, ptr, end, enc)) #ifdef __cplusplus } diff --git a/tools/sdk/include/expat/xmltok.h b/tools/sdk/include/expat/xmltok.h index 50926f38..2adbf530 100644 --- a/tools/sdk/include/expat/xmltok.h +++ b/tools/sdk/include/expat/xmltok.h @@ -38,16 +38,18 @@ extern "C" { #endif /* The following token may be returned by XmlContentTok */ -#define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be - start of illegal ]]> sequence */ +#define XML_TOK_TRAILING_RSQB \ + -5 /* ] or ]] at the end of the scan; might be \ + start of illegal ]]> sequence */ /* The following tokens may be returned by both XmlPrologTok and XmlContentTok. */ -#define XML_TOK_NONE -4 /* The string to be scanned is empty */ -#define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan; - might be part of CRLF sequence */ -#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */ -#define XML_TOK_PARTIAL -1 /* only part of a token */ +#define XML_TOK_NONE -4 /* The string to be scanned is empty */ +#define XML_TOK_TRAILING_CR \ + -3 /* A CR at the end of the scan; \ + might be part of CRLF sequence */ +#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */ +#define XML_TOK_PARTIAL -1 /* only part of a token */ #define XML_TOK_INVALID 0 /* The following tokens are returned by XmlContentTok; some are also @@ -62,24 +64,24 @@ extern "C" { #define XML_TOK_DATA_NEWLINE 7 #define XML_TOK_CDATA_SECT_OPEN 8 #define XML_TOK_ENTITY_REF 9 -#define XML_TOK_CHAR_REF 10 /* numeric character reference */ +#define XML_TOK_CHAR_REF 10 /* numeric character reference */ /* The following tokens may be returned by both XmlPrologTok and XmlContentTok. */ -#define XML_TOK_PI 11 /* processing instruction */ -#define XML_TOK_XML_DECL 12 /* XML decl or text decl */ +#define XML_TOK_PI 11 /* processing instruction */ +#define XML_TOK_XML_DECL 12 /* XML decl or text decl */ #define XML_TOK_COMMENT 13 -#define XML_TOK_BOM 14 /* Byte order mark */ +#define XML_TOK_BOM 14 /* Byte order mark */ /* The following tokens are returned only by XmlPrologTok */ #define XML_TOK_PROLOG_S 15 -#define XML_TOK_DECL_OPEN 16 /* */ +#define XML_TOK_DECL_OPEN 16 /* */ #define XML_TOK_NAME 18 #define XML_TOK_NMTOKEN 19 -#define XML_TOK_POUND_NAME 20 /* #name */ -#define XML_TOK_OR 21 /* | */ +#define XML_TOK_POUND_NAME 20 /* #name */ +#define XML_TOK_OR 21 /* | */ #define XML_TOK_PERCENT 22 #define XML_TOK_OPEN_PAREN 23 #define XML_TOK_CLOSE_PAREN 24 @@ -90,14 +92,14 @@ extern "C" { #define XML_TOK_INSTANCE_START 29 /* The following occur only in element type declarations */ -#define XML_TOK_NAME_QUESTION 30 /* name? */ -#define XML_TOK_NAME_ASTERISK 31 /* name* */ -#define XML_TOK_NAME_PLUS 32 /* name+ */ -#define XML_TOK_COND_SECT_OPEN 33 /* */ -#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */ -#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */ -#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */ +#define XML_TOK_NAME_QUESTION 30 /* name? */ +#define XML_TOK_NAME_ASTERISK 31 /* name* */ +#define XML_TOK_NAME_PLUS 32 /* name+ */ +#define XML_TOK_COND_SECT_OPEN 33 /* */ +#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */ +#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */ +#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */ #define XML_TOK_COMMA 38 /* The following token is returned only by XmlAttributeValueTok */ @@ -112,20 +114,20 @@ extern "C" { #define XML_TOK_PREFIXED_NAME 41 #ifdef XML_DTD -#define XML_TOK_IGNORE_SECT 42 +# define XML_TOK_IGNORE_SECT 42 #endif /* XML_DTD */ #ifdef XML_DTD -#define XML_N_STATES 4 +# define XML_N_STATES 4 #else /* not XML_DTD */ -#define XML_N_STATES 3 +# define XML_N_STATES 3 #endif /* not XML_DTD */ #define XML_PROLOG_STATE 0 #define XML_CONTENT_STATE 1 #define XML_CDATA_SECTION_STATE 2 #ifdef XML_DTD -#define XML_IGNORE_SECTION_STATE 3 +# define XML_IGNORE_SECTION_STATE 3 #endif /* XML_DTD */ #define XML_N_LITERAL_TYPES 2 @@ -153,52 +155,41 @@ typedef struct { struct encoding; typedef struct encoding ENCODING; -typedef int (PTRCALL *SCANNER)(const ENCODING *, - const char *, - const char *, - const char **); +typedef int(PTRCALL *SCANNER)(const ENCODING *, const char *, const char *, + const char **); enum XML_Convert_Result { XML_CONVERT_COMPLETED = 0, XML_CONVERT_INPUT_INCOMPLETE = 1, - XML_CONVERT_OUTPUT_EXHAUSTED = 2 /* and therefore potentially input remaining as well */ + XML_CONVERT_OUTPUT_EXHAUSTED + = 2 /* and therefore potentially input remaining as well */ }; struct encoding { SCANNER scanners[XML_N_STATES]; SCANNER literalScanners[XML_N_LITERAL_TYPES]; - int (PTRCALL *nameMatchesAscii)(const ENCODING *, - const char *, - const char *, - const char *); - int (PTRFASTCALL *nameLength)(const ENCODING *, const char *); + int(PTRCALL *nameMatchesAscii)(const ENCODING *, const char *, const char *, + const char *); + int(PTRFASTCALL *nameLength)(const ENCODING *, const char *); const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *); - int (PTRCALL *getAtts)(const ENCODING *enc, - const char *ptr, - int attsMax, - ATTRIBUTE *atts); - int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr); - int (PTRCALL *predefinedEntityName)(const ENCODING *, - const char *, - const char *); - void (PTRCALL *updatePosition)(const ENCODING *, - const char *ptr, - const char *end, - POSITION *); - int (PTRCALL *isPublicId)(const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr); - enum XML_Convert_Result (PTRCALL *utf8Convert)(const ENCODING *enc, - const char **fromP, - const char *fromLim, - char **toP, - const char *toLim); - enum XML_Convert_Result (PTRCALL *utf16Convert)(const ENCODING *enc, - const char **fromP, - const char *fromLim, - unsigned short **toP, - const unsigned short *toLim); + int(PTRCALL *getAtts)(const ENCODING *enc, const char *ptr, int attsMax, + ATTRIBUTE *atts); + int(PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr); + int(PTRCALL *predefinedEntityName)(const ENCODING *, const char *, + const char *); + void(PTRCALL *updatePosition)(const ENCODING *, const char *ptr, + const char *end, POSITION *); + int(PTRCALL *isPublicId)(const ENCODING *enc, const char *ptr, + const char *end, const char **badPtr); + enum XML_Convert_Result(PTRCALL *utf8Convert)(const ENCODING *enc, + const char **fromP, + const char *fromLim, char **toP, + const char *toLim); + enum XML_Convert_Result(PTRCALL *utf16Convert)(const ENCODING *enc, + const char **fromP, + const char *fromLim, + unsigned short **toP, + const unsigned short *toLim); int minBytesPerChar; char isUtf8; char isUtf16; @@ -225,66 +216,62 @@ struct encoding { the prolog outside literals, comments and processing instructions. */ - -#define XmlTok(enc, state, ptr, end, nextTokPtr) \ +#define XmlTok(enc, state, ptr, end, nextTokPtr) \ (((enc)->scanners[state])(enc, ptr, end, nextTokPtr)) -#define XmlPrologTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr) +#define XmlPrologTok(enc, ptr, end, nextTokPtr) \ + XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr) -#define XmlContentTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr) +#define XmlContentTok(enc, ptr, end, nextTokPtr) \ + XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr) -#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr) +#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \ + XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr) #ifdef XML_DTD -#define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr) +# define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \ + XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr) #endif /* XML_DTD */ /* This is used for performing a 2nd-level tokenization on the content of a literal that has already been returned by XmlTok. */ -#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \ +#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \ (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr)) -#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \ - XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr) +#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \ + XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr) -#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \ - XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr) +#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \ + XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr) -#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \ +#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \ (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2)) -#define XmlNameLength(enc, ptr) \ - (((enc)->nameLength)(enc, ptr)) +#define XmlNameLength(enc, ptr) (((enc)->nameLength)(enc, ptr)) -#define XmlSkipS(enc, ptr) \ - (((enc)->skipS)(enc, ptr)) +#define XmlSkipS(enc, ptr) (((enc)->skipS)(enc, ptr)) -#define XmlGetAttributes(enc, ptr, attsMax, atts) \ +#define XmlGetAttributes(enc, ptr, attsMax, atts) \ (((enc)->getAtts)(enc, ptr, attsMax, atts)) -#define XmlCharRefNumber(enc, ptr) \ - (((enc)->charRefNumber)(enc, ptr)) +#define XmlCharRefNumber(enc, ptr) (((enc)->charRefNumber)(enc, ptr)) -#define XmlPredefinedEntityName(enc, ptr, end) \ +#define XmlPredefinedEntityName(enc, ptr, end) \ (((enc)->predefinedEntityName)(enc, ptr, end)) -#define XmlUpdatePosition(enc, ptr, end, pos) \ +#define XmlUpdatePosition(enc, ptr, end, pos) \ (((enc)->updatePosition)(enc, ptr, end, pos)) -#define XmlIsPublicId(enc, ptr, end, badPtr) \ +#define XmlIsPublicId(enc, ptr, end, badPtr) \ (((enc)->isPublicId)(enc, ptr, end, badPtr)) -#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \ +#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \ (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim)) -#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \ +#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \ (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim)) typedef struct { @@ -292,16 +279,11 @@ typedef struct { const ENCODING **encPtr; } INIT_ENCODING; -int XmlParseXmlDecl(int isGeneralTextEntity, - const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr, - const char **versionPtr, - const char **versionEndPtr, +int XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc, + const char *ptr, const char *end, const char **badPtr, + const char **versionPtr, const char **versionEndPtr, const char **encodingNamePtr, - const ENCODING **namedEncodingPtr, - int *standalonePtr); + const ENCODING **namedEncodingPtr, int *standalonePtr); int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); const ENCODING *XmlGetUtf8InternalEncoding(void); @@ -310,34 +292,22 @@ int FASTCALL XmlUtf8Encode(int charNumber, char *buf); int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf); int XmlSizeOfUnknownEncoding(void); +typedef int(XMLCALL *CONVERTER)(void *userData, const char *p); -typedef int (XMLCALL *CONVERTER) (void *userData, const char *p); +ENCODING *XmlInitUnknownEncoding(void *mem, int *table, CONVERTER convert, + void *userData); -ENCODING * -XmlInitUnknownEncoding(void *mem, - int *table, - CONVERTER convert, - void *userData); - -int XmlParseXmlDeclNS(int isGeneralTextEntity, - const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr, - const char **versionPtr, - const char **versionEndPtr, +int XmlParseXmlDeclNS(int isGeneralTextEntity, const ENCODING *enc, + const char *ptr, const char *end, const char **badPtr, + const char **versionPtr, const char **versionEndPtr, const char **encodingNamePtr, - const ENCODING **namedEncodingPtr, - int *standalonePtr); + const ENCODING **namedEncodingPtr, int *standalonePtr); int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name); const ENCODING *XmlGetUtf8InternalEncodingNS(void); const ENCODING *XmlGetUtf16InternalEncodingNS(void); -ENCODING * -XmlInitUnknownEncodingNS(void *mem, - int *table, - CONVERTER convert, - void *userData); +ENCODING *XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert, + void *userData); #ifdef __cplusplus } #endif diff --git a/tools/sdk/include/expat/xmltok_impl.h b/tools/sdk/include/expat/xmltok_impl.h index a6420f48..e925dbc7 100644 --- a/tools/sdk/include/expat/xmltok_impl.h +++ b/tools/sdk/include/expat/xmltok_impl.h @@ -31,43 +31,43 @@ */ enum { - BT_NONXML, - BT_MALFORM, - BT_LT, - BT_AMP, - BT_RSQB, - BT_LEAD2, - BT_LEAD3, - BT_LEAD4, - BT_TRAIL, - BT_CR, - BT_LF, - BT_GT, - BT_QUOT, - BT_APOS, - BT_EQUALS, - BT_QUEST, - BT_EXCL, - BT_SOL, - BT_SEMI, - BT_NUM, - BT_LSQB, - BT_S, - BT_NMSTRT, - BT_COLON, - BT_HEX, - BT_DIGIT, - BT_NAME, - BT_MINUS, - BT_OTHER, /* known not to be a name or name start character */ + BT_NONXML, /* e.g. noncharacter-FFFF */ + BT_MALFORM, /* illegal, with regard to encoding */ + BT_LT, /* less than = "<" */ + BT_AMP, /* ampersand = "&" */ + BT_RSQB, /* right square bracket = "[" */ + BT_LEAD2, /* lead byte of a 2-byte UTF-8 character */ + BT_LEAD3, /* lead byte of a 3-byte UTF-8 character */ + BT_LEAD4, /* lead byte of a 4-byte UTF-8 character */ + BT_TRAIL, /* trailing unit, e.g. second 16-bit unit of a 4-byte char. */ + BT_CR, /* carriage return = "\r" */ + BT_LF, /* line feed = "\n" */ + BT_GT, /* greater than = ">" */ + BT_QUOT, /* quotation character = "\"" */ + BT_APOS, /* aposthrophe = "'" */ + BT_EQUALS, /* equal sign = "=" */ + BT_QUEST, /* question mark = "?" */ + BT_EXCL, /* exclamation mark = "!" */ + BT_SOL, /* solidus, slash = "/" */ + BT_SEMI, /* semicolon = ";" */ + BT_NUM, /* number sign = "#" */ + BT_LSQB, /* left square bracket = "[" */ + BT_S, /* white space, e.g. "\t", " "[, "\r"] */ + BT_NMSTRT, /* non-hex name start letter = "G".."Z" + "g".."z" + "_" */ + BT_COLON, /* colon = ":" */ + BT_HEX, /* hex letter = "A".."F" + "a".."f" */ + BT_DIGIT, /* digit = "0".."9" */ + BT_NAME, /* dot and middle dot = "." + chr(0xb7) */ + BT_MINUS, /* minus = "-" */ + BT_OTHER, /* known not to be a name or name start character */ BT_NONASCII, /* might be a name or name start character */ - BT_PERCNT, - BT_LPAR, - BT_RPAR, - BT_AST, - BT_PLUS, - BT_COMMA, - BT_VERBAR + BT_PERCNT, /* percent sign = "%" */ + BT_LPAR, /* left parenthesis = "(" */ + BT_RPAR, /* right parenthesis = "(" */ + BT_AST, /* asterisk = "*" */ + BT_PLUS, /* plus sign = "+" */ + BT_COMMA, /* comma = "," */ + BT_VERBAR /* vertical bar = "|" */ }; #include diff --git a/tools/sdk/include/fatfs/ffconf.h b/tools/sdk/include/fatfs/ffconf.h index 1b1cf8c8..9513b516 100644 --- a/tools/sdk/include/fatfs/ffconf.h +++ b/tools/sdk/include/fatfs/ffconf.h @@ -52,7 +52,7 @@ /* This option switches f_expand function. (0:Disable or 1:Enable) */ -#define FF_USE_CHMOD 0 +#define FF_USE_CHMOD 1 /* This option switches attribute manipulation functions, f_chmod() and f_utime(). / (0:Disable or 1:Enable) Also FF_FS_READONLY needs to be 0 to enable this option. */ @@ -301,4 +301,11 @@ #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" +/* Some memory allocation functions are declared here in addition to ff.h, so that + they can be used also by external code when LFN feature is disabled. + */ +void* ff_memalloc (UINT msize); +void* ff_memcalloc (UINT num, UINT size); + + /*--- End of configuration options ---*/ diff --git a/tools/sdk/include/freemodbus/mbcontroller.h b/tools/sdk/include/freemodbus/mbcontroller.h index b6b206e2..267fa34a 100644 --- a/tools/sdk/include/freemodbus/mbcontroller.h +++ b/tools/sdk/include/freemodbus/mbcontroller.h @@ -26,7 +26,7 @@ /* ----------------------- Defines ------------------------------------------*/ #define MB_INST_MIN_SIZE (2) // The minimal size of Modbus registers area in bytes -#define MB_INST_MAX_SIZE (2048) // The maximum size of Modbus area in bytes +#define MB_INST_MAX_SIZE (65535 * 2) // The maximum size of Modbus area in bytes #define MB_CONTROLLER_STACK_SIZE (CONFIG_MB_CONTROLLER_STACK_SIZE) // Stack size for Modbus controller #define MB_CONTROLLER_PRIORITY (CONFIG_MB_SERIAL_TASK_PRIO - 1) // priority of MB controller task diff --git a/tools/sdk/include/freertos/freertos/FreeRTOSConfig.h b/tools/sdk/include/freertos/freertos/FreeRTOSConfig.h index aa33917e..80185f9e 100644 --- a/tools/sdk/include/freertos/freertos/FreeRTOSConfig.h +++ b/tools/sdk/include/freertos/freertos/FreeRTOSConfig.h @@ -300,7 +300,12 @@ extern void vPortCleanUpTCB ( void *pxTCB ); #define configXT_BOARD 1 /* Board mode */ #define configXT_SIMULATOR 0 -#define configENABLE_TASK_SNAPSHOT 1 +#if CONFIG_ESP32_ENABLE_COREDUMP +#define configENABLE_TASK_SNAPSHOT 1 +#endif +#ifndef configENABLE_TASK_SNAPSHOT +#define configENABLE_TASK_SNAPSHOT 1 +#endif #if CONFIG_SYSVIEW_ENABLE #ifndef __ASSEMBLER__ diff --git a/tools/sdk/include/freertos/freertos/portable.h b/tools/sdk/include/freertos/freertos/portable.h index ce189f31..61cee764 100644 --- a/tools/sdk/include/freertos/freertos/portable.h +++ b/tools/sdk/include/freertos/freertos/portable.h @@ -86,6 +86,8 @@ specific constants has been moved into the deprecated_definitions.h header file. */ #include "deprecated_definitions.h" +#include "soc/cpu.h" + /* If portENTER_CRITICAL is not defined then including deprecated_definitions.h did not result in a portmacro.h header file being included - and it should be included here. In this case the path to the correct portmacro.h header file @@ -215,6 +217,24 @@ static inline uint32_t IRAM_ATTR xPortGetCoreID() { /* Get tick rate per second */ uint32_t xPortGetTickRateHz(void); + +static inline bool IRAM_ATTR xPortCanYield(void) +{ + uint32_t ps_reg = 0; + + //Get the current value of PS (processor status) register + RSR(PS, ps_reg); + + /* + * intlevel = (ps_reg & 0xf); + * excm = (ps_reg >> 4) & 0x1; + * CINTLEVEL is max(excm * EXCMLEVEL, INTLEVEL), where EXCMLEVEL is 3. + * However, just return true, only intlevel is zero. + */ + + return ((ps_reg & PS_INTLEVEL_MASK) == 0); +} + #ifdef __cplusplus } #endif diff --git a/tools/sdk/include/freertos/freertos/portmacro.h b/tools/sdk/include/freertos/freertos/portmacro.h index adeb3bb0..7fd94d5a 100644 --- a/tools/sdk/include/freertos/freertos/portmacro.h +++ b/tools/sdk/include/freertos/freertos/portmacro.h @@ -209,8 +209,34 @@ void vPortCPUReleaseMutex(portMUX_TYPE *mux, const char *function, int line); void vTaskEnterCritical( portMUX_TYPE *mux, const char *function, int line ); void vTaskExitCritical( portMUX_TYPE *mux, const char *function, int line ); + +#ifdef CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE +/* Calling port*_CRITICAL from ISR context would cause an assert failure. + * If the parent function is called from both ISR and Non-ISR context then call port*_CRITICAL_SAFE + */ +#define portENTER_CRITICAL(mux) do { \ + if(!xPortInIsrContext()) { \ + vTaskEnterCritical(mux, __FUNCTION__, __LINE__); \ + } else { \ + ets_printf("%s:%d (%s)- port*_CRITICAL called from ISR context!\n", __FILE__, __LINE__, \ + __FUNCTION__); \ + abort(); \ + } \ + } while(0) + +#define portEXIT_CRITICAL(mux) do { \ + if(!xPortInIsrContext()) { \ + vTaskExitCritical(mux, __FUNCTION__, __LINE__); \ + } else { \ + ets_printf("%s:%d (%s)- port*_CRITICAL called from ISR context!\n", __FILE__, __LINE__, \ + __FUNCTION__); \ + abort(); \ + } \ + } while(0) +#else #define portENTER_CRITICAL(mux) vTaskEnterCritical(mux, __FUNCTION__, __LINE__) #define portEXIT_CRITICAL(mux) vTaskExitCritical(mux, __FUNCTION__, __LINE__) +#endif #define portENTER_CRITICAL_ISR(mux) vTaskEnterCritical(mux, __FUNCTION__, __LINE__) #define portEXIT_CRITICAL_ISR(mux) vTaskExitCritical(mux, __FUNCTION__, __LINE__) #else @@ -229,12 +255,54 @@ void vPortCPUAcquireMutex(portMUX_TYPE *mux); bool vPortCPUAcquireMutexTimeout(portMUX_TYPE *mux, int timeout_cycles); void vPortCPUReleaseMutex(portMUX_TYPE *mux); +#ifdef CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE +/* Calling port*_CRITICAL from ISR context would cause an assert failure. + * If the parent function is called from both ISR and Non-ISR context then call port*_CRITICAL_SAFE + */ +#define portENTER_CRITICAL(mux) do { \ + if(!xPortInIsrContext()) { \ + vTaskEnterCritical(mux); \ + } else { \ + ets_printf("%s:%d (%s)- port*_CRITICAL called from ISR context!\n", __FILE__, __LINE__, \ + __FUNCTION__); \ + abort(); \ + } \ + } while(0) + +#define portEXIT_CRITICAL(mux) do { \ + if(!xPortInIsrContext()) { \ + vTaskExitCritical(mux); \ + } else { \ + ets_printf("%s:%d (%s)- port*_CRITICAL called from ISR context!\n", __FILE__, __LINE__, \ + __FUNCTION__); \ + abort(); \ + } \ + } while(0) +#else #define portENTER_CRITICAL(mux) vTaskEnterCritical(mux) #define portEXIT_CRITICAL(mux) vTaskExitCritical(mux) +#endif #define portENTER_CRITICAL_ISR(mux) vTaskEnterCritical(mux) #define portEXIT_CRITICAL_ISR(mux) vTaskExitCritical(mux) #endif +#define portENTER_CRITICAL_SAFE(mux) do { \ + if (xPortInIsrContext()) { \ + portENTER_CRITICAL_ISR(mux); \ + } else { \ + portENTER_CRITICAL(mux); \ + } \ + } while(0) + +#define portEXIT_CRITICAL_SAFE(mux) do { \ + if (xPortInIsrContext()) { \ + portEXIT_CRITICAL_ISR(mux); \ + } else { \ + portEXIT_CRITICAL(mux); \ + } \ + } while(0) + + // Critical section management. NW-TODO: replace XTOS_SET_INTLEVEL with more efficient version, if any? // These cannot be nested. They should be used with a lot of care and cannot be called from interrupt level. // diff --git a/tools/sdk/include/freertos/freertos/task.h b/tools/sdk/include/freertos/freertos/task.h index 3fc06d9e..adefb3a8 100644 --- a/tools/sdk/include/freertos/freertos/task.h +++ b/tools/sdk/include/freertos/freertos/task.h @@ -1962,7 +1962,7 @@ BaseType_t xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClea * * \ingroup TaskNotifications */ -#define xTaskNotifyGive( xTaskToNotify ) xTaskNotify( ( xTaskToNotify ), 0, eIncrement ); +#define xTaskNotifyGive( xTaskToNotify ) xTaskNotify( ( xTaskToNotify ), 0, eIncrement ) /** * Simplified macro for sending task notification from ISR. diff --git a/tools/sdk/include/idf_test/idf_performance.h b/tools/sdk/include/idf_test/idf_performance.h index e864b293..ad60009f 100644 --- a/tools/sdk/include/idf_test/idf_performance.h +++ b/tools/sdk/include/idf_test/idf_performance.h @@ -1,12 +1,4 @@ - -/* @brief macro to print IDF performance - * @param mode : performance item name. a string pointer. - * @param value_fmt: print format and unit of the value, for example: "%02fms", "%dKB" - * @param value : the performance value. -*/ -#define IDF_LOG_PERFORMANCE(item, value_fmt, value) \ - printf("[Performance][%s]: "value_fmt"\n", item, value) - +#pragma once /* declare the performance here */ #define IDF_PERFORMANCE_MAX_HTTPS_REQUEST_BIN_SIZE 800 @@ -20,8 +12,8 @@ #define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_POLLING_NO_DMA 15 /* Due to code size & linker layout differences interacting with cache, VFS microbenchmark currently runs slower with PSRAM enabled. */ -#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME 50000 -#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME_PSRAM 40000 +#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME 20000 +#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME_PSRAM 25000 // throughput performance by iperf #define IDF_PERFORMANCE_MIN_TCP_RX_THROUGHPUT 50 #define IDF_PERFORMANCE_MIN_TCP_TX_THROUGHPUT 40 diff --git a/tools/sdk/include/lwip/apps/sntp/sntp.h b/tools/sdk/include/lwip/apps/sntp/sntp.h index 3db0fba1..7758cfa7 100644 --- a/tools/sdk/include/lwip/apps/sntp/sntp.h +++ b/tools/sdk/include/lwip/apps/sntp/sntp.h @@ -1,3 +1,3 @@ #pragma once -#warning "This header file is deprecated, please include lwip/apps/sntp.h instead." -#include "lwip/apps/sntp.h" +#warning "This header file is deprecated, please include esp_sntp.h instead." +#include "esp_sntp.h" diff --git a/tools/sdk/include/lwip/esp_sntp.h b/tools/sdk/include/lwip/esp_sntp.h new file mode 100644 index 00000000..020f0cf3 --- /dev/null +++ b/tools/sdk/include/lwip/esp_sntp.h @@ -0,0 +1,22 @@ +// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef __ESP_SNTP_H__ +#define __ESP_SNTP_H__ + +#include "lwip/err.h" +#include "lwip/apps/sntp.h" +#include "sntp.h" + +#endif // __ESP_SNTP_H__ diff --git a/tools/sdk/include/lwip/lwip/dhcp.h b/tools/sdk/include/lwip/lwip/dhcp.h index 23a36bb0..c90029b4 100644 --- a/tools/sdk/include/lwip/lwip/dhcp.h +++ b/tools/sdk/include/lwip/lwip/dhcp.h @@ -89,12 +89,21 @@ struct dhcp struct dhcp_msg *msg_out; /* outgoing msg */ u16_t options_out_len; /* outgoing msg options length */ u16_t request_timeout; /* #ticks with period DHCP_FINE_TIMER_SECS for request timeout */ +#if ESP_DHCP_TIMER + u32_t t1_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for renewal time */ + u32_t t2_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for rebind time */ + u32_t t1_renew_time; /* #ticks with period DHCP_COARSE_TIMER_SECS until next renew try */ + u32_t t2_rebind_time; /* #ticks with period DHCP_COARSE_TIMER_SECS until next rebind try */ + u32_t lease_used; /* #ticks with period DHCP_COARSE_TIMER_SECS since last received DHCP ack */ + u32_t t0_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for lease time */ +#else u16_t t1_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for renewal time */ u16_t t2_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for rebind time */ u16_t t1_renew_time; /* #ticks with period DHCP_COARSE_TIMER_SECS until next renew try */ u16_t t2_rebind_time; /* #ticks with period DHCP_COARSE_TIMER_SECS until next rebind try */ u16_t lease_used; /* #ticks with period DHCP_COARSE_TIMER_SECS since last received DHCP ack */ u16_t t0_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for lease time */ +#endif ip_addr_t server_ip_addr; /* dhcp server address that offered this lease (ip_addr_t because passed to UDP) */ ip4_addr_t offered_ip_addr; ip4_addr_t offered_sn_mask; diff --git a/tools/sdk/include/lwip/lwipopts.h b/tools/sdk/include/lwip/lwipopts.h index 13a3632d..6aa2253d 100644 --- a/tools/sdk/include/lwip/lwipopts.h +++ b/tools/sdk/include/lwip/lwipopts.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ @@ -43,7 +43,7 @@ #include "esp_task.h" #include "esp_system.h" #include "sdkconfig.h" - +#include "sntp.h" #include "netif/dhcp_state.h" /* Enable all Espressif-only options */ @@ -316,7 +316,7 @@ * scenario happens: 192.168.0.2 -> 0.0.0.0 -> 192.168.0.2 or 192.168.0.2 -> 0.0.0.0 */ -#define ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES +#define ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES /* * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all * events (accept, sent, etc) that happen in the system. @@ -525,6 +525,13 @@ */ #define LWIP_SO_SNDTIMEO 1 +/** + * LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS==1: randomize the local port for the first + * local TCP/UDP pcb (default==0). This can prevent creating predictable port + * numbers after booting a device. + */ +#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS CONFIG_LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS + /** * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and * SO_RCVTIMEO processing. @@ -589,6 +596,11 @@ #if PPP_SUPPORT +/** + * PPP_NOTIFY_PHASE==1: Support PPP notify phase. + */ +#define PPP_NOTIFY_PHASE CONFIG_PPP_NOTIFY_PHASE_SUPPORT + /** * PAP_SUPPORT==1: Support PAP. */ @@ -754,7 +766,6 @@ #define ESP_DNS 1 #define ESP_IPV6_AUTOCONFIG 1 #define ESP_PERF 0 -#define ESP_RANDOM_TCP_PORT 1 #define ESP_IP4_ATON 1 #define ESP_LIGHT_SLEEP 1 #define ESP_L2_TO_L3_COPY CONFIG_L2_TO_L3_COPY @@ -769,11 +780,10 @@ #define ESP_AUTO_RECV 1 #define ESP_GRATUITOUS_ARP CONFIG_ESP_GRATUITOUS_ARP -#if CONFIG_LWIP_IRAM_OPTIMIZATION -#define ESP_IRAM_ATTR IRAM_ATTR -#else -#define ESP_IRAM_ATTR +#ifdef ESP_IRAM_ATTR +#undef ESP_IRAM_ATTR #endif +#define ESP_IRAM_ATTR #if ESP_PERF #define DBG_PERF_PATH_SET(dir, point) @@ -795,7 +805,7 @@ enum { }; #else -#define DBG_PERF_PATH_SET(dir, point) +#define DBG_PERF_PATH_SET(dir, point) #define DBG_PERF_FILTER_LEN 1000 #endif @@ -829,10 +839,20 @@ enum { #define LWIP_DHCP_MAX_NTP_SERVERS CONFIG_LWIP_DHCP_MAX_NTP_SERVERS #define LWIP_TIMEVAL_PRIVATE 0 +/* + -------------------------------------- + ------------ SNTP options ------------ + -------------------------------------- +*/ +/* + * SNTP update delay - in milliseconds + */ +#define SNTP_UPDATE_DELAY CONFIG_LWIP_SNTP_UPDATE_DELAY + #define SNTP_SET_SYSTEM_TIME_US(sec, us) \ do { \ struct timeval tv = { .tv_sec = sec, .tv_usec = us }; \ - settimeofday(&tv, NULL); \ + sntp_sync_time(&tv); \ } while (0); #define SNTP_GET_SYSTEM_TIME(sec, us) \ @@ -841,6 +861,7 @@ enum { gettimeofday(&tv, NULL); \ (sec) = tv.tv_sec; \ (us) = tv.tv_usec; \ + sntp_set_sync_status(SNTP_SYNC_STATUS_RESET); \ } while (0); #define SOC_SEND_LOG //printf diff --git a/tools/sdk/include/lwip/sntp.h b/tools/sdk/include/lwip/sntp.h new file mode 100644 index 00000000..a94981b5 --- /dev/null +++ b/tools/sdk/include/lwip/sntp.h @@ -0,0 +1,127 @@ +// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef __SNTP_H__ +#define __SNTP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The time update takes place in the sntp_sync_time() function. + * The user has the ability to redefine this function in order + * to re-define its functionality. This function has two time update modes, + * which can be set via the sntp_set_sync_mode() function. + * Two modes are available: + * - the first is an immediate update when receiving time from the sntp server, + * - the second is a smooth time update (if the time error is no more than 35 minutes, + * and an immediate update if the error is more than 35 minutes). + * + * To receive notification of time synchronization, + * you can use the callback function or get the synchronization status + * via the sntp_get_sync_status() function. + * + * To determine the time synchronization time on the device, you can use: + * 1) sntp_set_time_sync_notification_cb() function to set the callback function, + * which is convenient to use to receive notification of the update time. + * 2) sntp_get_sync_status() function for getting time synchronization status. + * After the time synchronization is completed, the status will be + * SNTP_SYNC_STATUS_COMPLETED, after, it will be reseted to SNTP_SYNC_STATUS_RESET + * to wait for the next sync cycle. + */ + +/// SNTP time update mode +typedef enum { + SNTP_SYNC_MODE_IMMED, /*!< Update system time immediately when receiving a response from the SNTP server. */ + SNTP_SYNC_MODE_SMOOTH, /*!< Smooth time updating. Time error is gradually reduced using adjtime function. If the difference between SNTP response time and system time is large (more than 35 minutes) then update immediately. */ +} sntp_sync_mode_t; + +/// SNTP sync status +typedef enum { + SNTP_SYNC_STATUS_RESET, // Reset status. + SNTP_SYNC_STATUS_COMPLETED, // Time is synchronized. + SNTP_SYNC_STATUS_IN_PROGRESS, // Smooth time sync in progress. +} sntp_sync_status_t; + +/** + * @brief SNTP callback function for notifying about time sync event + * + * @param tv Time received from SNTP server. + */ +typedef void (*sntp_sync_time_cb_t) (struct timeval *tv); + +/** + * @brief This function updates the system time. + * + * This is a weak-linked function. It is possible to replace all SNTP update functionality + * by placing a sntp_sync_time() function in the app firmware source. + * If the default implementation is used, calling sntp_set_sync_mode() allows + * the time synchronization mode to be changed to instant or smooth. + * If a callback function is registered via sntp_set_time_sync_notification_cb(), + * it will be called following time synchronization. + * + * @param tv Time received from SNTP server. + */ +void sntp_sync_time(struct timeval *tv); + +/** + * @brief Set the sync mode + * + * Allowable two mode: SNTP_SYNC_MODE_IMMED and SNTP_SYNC_MODE_SMOOTH. + * @param sync_mode Sync mode. + */ +void sntp_set_sync_mode(sntp_sync_mode_t sync_mode); + +/** + * @brief Get set sync mode + * + * @return SNTP_SYNC_MODE_IMMED: Update time immediately. + * SNTP_SYNC_MODE_SMOOTH: Smooth time updating. + */ +sntp_sync_mode_t sntp_get_sync_mode(void); + +/** + * @brief Get status of time sync + * + * After the update is completed, the status will be returned as SNTP_SYNC_STATUS_COMPLETED. + * After that, the status will be reset to SNTP_SYNC_STATUS_RESET. + * If the update operation is not completed yet, the status will be SNTP_SYNC_STATUS_RESET. + * If a smooth mode was chosen and the synchronization is still continuing (adjtime works), then it will be SNTP_SYNC_STATUS_IN_PROGRESS. + * + * @return SNTP_SYNC_STATUS_RESET: Reset status. + * SNTP_SYNC_STATUS_COMPLETED: Time is synchronized. + * SNTP_SYNC_STATUS_IN_PROGRESS: Smooth time sync in progress. + */ +sntp_sync_status_t sntp_get_sync_status(void); + +/** + * @brief Set status of time sync + * + * @param sync_status status of time sync (see sntp_sync_status_t) + */ +void sntp_set_sync_status(sntp_sync_status_t sync_status); + +/** + * @brief Set a callback function for time synchronization notification + * + * @param callback a callback function + */ +void sntp_set_time_sync_notification_cb(sntp_sync_time_cb_t callback); + +#ifdef __cplusplus +} +#endif + +#endif // __SNTP_H__ diff --git a/tools/sdk/include/lwip/sntp/sntp.h b/tools/sdk/include/lwip/sntp/sntp.h new file mode 100644 index 00000000..a94981b5 --- /dev/null +++ b/tools/sdk/include/lwip/sntp/sntp.h @@ -0,0 +1,127 @@ +// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef __SNTP_H__ +#define __SNTP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The time update takes place in the sntp_sync_time() function. + * The user has the ability to redefine this function in order + * to re-define its functionality. This function has two time update modes, + * which can be set via the sntp_set_sync_mode() function. + * Two modes are available: + * - the first is an immediate update when receiving time from the sntp server, + * - the second is a smooth time update (if the time error is no more than 35 minutes, + * and an immediate update if the error is more than 35 minutes). + * + * To receive notification of time synchronization, + * you can use the callback function or get the synchronization status + * via the sntp_get_sync_status() function. + * + * To determine the time synchronization time on the device, you can use: + * 1) sntp_set_time_sync_notification_cb() function to set the callback function, + * which is convenient to use to receive notification of the update time. + * 2) sntp_get_sync_status() function for getting time synchronization status. + * After the time synchronization is completed, the status will be + * SNTP_SYNC_STATUS_COMPLETED, after, it will be reseted to SNTP_SYNC_STATUS_RESET + * to wait for the next sync cycle. + */ + +/// SNTP time update mode +typedef enum { + SNTP_SYNC_MODE_IMMED, /*!< Update system time immediately when receiving a response from the SNTP server. */ + SNTP_SYNC_MODE_SMOOTH, /*!< Smooth time updating. Time error is gradually reduced using adjtime function. If the difference between SNTP response time and system time is large (more than 35 minutes) then update immediately. */ +} sntp_sync_mode_t; + +/// SNTP sync status +typedef enum { + SNTP_SYNC_STATUS_RESET, // Reset status. + SNTP_SYNC_STATUS_COMPLETED, // Time is synchronized. + SNTP_SYNC_STATUS_IN_PROGRESS, // Smooth time sync in progress. +} sntp_sync_status_t; + +/** + * @brief SNTP callback function for notifying about time sync event + * + * @param tv Time received from SNTP server. + */ +typedef void (*sntp_sync_time_cb_t) (struct timeval *tv); + +/** + * @brief This function updates the system time. + * + * This is a weak-linked function. It is possible to replace all SNTP update functionality + * by placing a sntp_sync_time() function in the app firmware source. + * If the default implementation is used, calling sntp_set_sync_mode() allows + * the time synchronization mode to be changed to instant or smooth. + * If a callback function is registered via sntp_set_time_sync_notification_cb(), + * it will be called following time synchronization. + * + * @param tv Time received from SNTP server. + */ +void sntp_sync_time(struct timeval *tv); + +/** + * @brief Set the sync mode + * + * Allowable two mode: SNTP_SYNC_MODE_IMMED and SNTP_SYNC_MODE_SMOOTH. + * @param sync_mode Sync mode. + */ +void sntp_set_sync_mode(sntp_sync_mode_t sync_mode); + +/** + * @brief Get set sync mode + * + * @return SNTP_SYNC_MODE_IMMED: Update time immediately. + * SNTP_SYNC_MODE_SMOOTH: Smooth time updating. + */ +sntp_sync_mode_t sntp_get_sync_mode(void); + +/** + * @brief Get status of time sync + * + * After the update is completed, the status will be returned as SNTP_SYNC_STATUS_COMPLETED. + * After that, the status will be reset to SNTP_SYNC_STATUS_RESET. + * If the update operation is not completed yet, the status will be SNTP_SYNC_STATUS_RESET. + * If a smooth mode was chosen and the synchronization is still continuing (adjtime works), then it will be SNTP_SYNC_STATUS_IN_PROGRESS. + * + * @return SNTP_SYNC_STATUS_RESET: Reset status. + * SNTP_SYNC_STATUS_COMPLETED: Time is synchronized. + * SNTP_SYNC_STATUS_IN_PROGRESS: Smooth time sync in progress. + */ +sntp_sync_status_t sntp_get_sync_status(void); + +/** + * @brief Set status of time sync + * + * @param sync_status status of time sync (see sntp_sync_status_t) + */ +void sntp_set_sync_status(sntp_sync_status_t sync_status); + +/** + * @brief Set a callback function for time synchronization notification + * + * @param callback a callback function + */ +void sntp_set_time_sync_notification_cb(sntp_sync_time_cb_t callback); + +#ifdef __cplusplus +} +#endif + +#endif // __SNTP_H__ diff --git a/tools/sdk/include/mbedtls/mbedtls/aes.h b/tools/sdk/include/mbedtls/mbedtls/aes.h index 4c8dab31..94e7282d 100644 --- a/tools/sdk/include/mbedtls/mbedtls/aes.h +++ b/tools/sdk/include/mbedtls/mbedtls/aes.h @@ -60,7 +60,11 @@ /* Error codes in range 0x0021-0x0025 */ #define MBEDTLS_ERR_AES_BAD_INPUT_DATA -0x0021 /**< Invalid input data. */ + +/* MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE is deprecated and should not be used. */ #define MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE -0x0023 /**< Feature not available. For example, an unsupported AES key size. */ + +/* MBEDTLS_ERR_AES_HW_ACCEL_FAILED is deprecated and should not be used. */ #define MBEDTLS_ERR_AES_HW_ACCEL_FAILED -0x0025 /**< AES hardware accelerator failed. */ #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ @@ -117,7 +121,7 @@ typedef struct mbedtls_aes_xts_context * It must be the first API called before using * the context. * - * \param ctx The AES context to initialize. + * \param ctx The AES context to initialize. This must not be \c NULL. */ void mbedtls_aes_init( mbedtls_aes_context *ctx ); @@ -125,6 +129,8 @@ void mbedtls_aes_init( mbedtls_aes_context *ctx ); * \brief This function releases and clears the specified AES context. * * \param ctx The AES context to clear. + * If this is \c NULL, this function does nothing. + * Otherwise, the context must have been at least initialized. */ void mbedtls_aes_free( mbedtls_aes_context *ctx ); @@ -135,7 +141,7 @@ void mbedtls_aes_free( mbedtls_aes_context *ctx ); * It must be the first API called before using * the context. * - * \param ctx The AES XTS context to initialize. + * \param ctx The AES XTS context to initialize. This must not be \c NULL. */ void mbedtls_aes_xts_init( mbedtls_aes_xts_context *ctx ); @@ -143,6 +149,8 @@ void mbedtls_aes_xts_init( mbedtls_aes_xts_context *ctx ); * \brief This function releases and clears the specified AES XTS context. * * \param ctx The AES XTS context to clear. + * If this is \c NULL, this function does nothing. + * Otherwise, the context must have been at least initialized. */ void mbedtls_aes_xts_free( mbedtls_aes_xts_context *ctx ); #endif /* MBEDTLS_CIPHER_MODE_XTS */ @@ -151,7 +159,9 @@ void mbedtls_aes_xts_free( mbedtls_aes_xts_context *ctx ); * \brief This function sets the encryption key. * * \param ctx The AES context to which the key should be bound. + * It must be initialized. * \param key The encryption key. + * This must be a readable buffer of size \p keybits bits. * \param keybits The size of data passed in bits. Valid options are: *