|
34 | 34 | FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32")
|
35 | 35 | assert isdir(FRAMEWORK_DIR)
|
36 | 36 |
|
37 |
| -env.Prepend( |
38 |
| - CPPDEFINES=[ |
39 |
| - ("ARDUINO", 10805), |
40 |
| - "ARDUINO_ARCH_ESP32", |
41 |
| - ("ARDUINO_VARIANT", '\\"%s\\"' % env.BoardConfig().get("build.variant").replace('"', "")), |
42 |
| - ("ARDUINO_BOARD", '\\"%s\\"' % env.BoardConfig().get("name").replace('"', "")) |
43 |
| - ], |
| 37 | +env.Append( |
| 38 | + ASFLAGS=["-x", "assembler-with-cpp"], |
44 | 39 |
|
45 |
| - CFLAGS=["-Wno-old-style-declaration"], |
| 40 | + CFLAGS=[ |
| 41 | + "-std=gnu99", |
| 42 | + "-Wno-old-style-declaration" |
| 43 | + ], |
46 | 44 |
|
47 | 45 | CCFLAGS=[
|
| 46 | + "-Os", |
| 47 | + "-Wall", |
| 48 | + "-nostdlib", |
| 49 | + "-Wpointer-arith", |
| 50 | + "-Wno-error=unused-but-set-variable", |
| 51 | + "-Wno-error=unused-variable", |
| 52 | + "-mlongcalls", |
| 53 | + "-ffunction-sections", |
| 54 | + "-fdata-sections", |
| 55 | + "-fstrict-volatile-bitfields", |
48 | 56 | "-Wno-error=deprecated-declarations",
|
49 | 57 | "-Wno-error=unused-function",
|
50 | 58 | "-Wno-unused-parameter",
|
|
53 | 61 | "-fexceptions"
|
54 | 62 | ],
|
55 | 63 |
|
| 64 | + CXXFLAGS=[ |
| 65 | + "-fno-rtti", |
| 66 | + "-fno-exceptions", |
| 67 | + "-std=gnu++11" |
| 68 | + ], |
| 69 | + |
| 70 | + LINKFLAGS=[ |
| 71 | + "-nostdlib", |
| 72 | + "-Wl,-static", |
| 73 | + "-u", "call_user_start_cpu0", |
| 74 | + "-Wl,--undefined=uxTopUsedPriority", |
| 75 | + "-Wl,--gc-sections", |
| 76 | + "-Wl,-EL", |
| 77 | + "-T", "esp32.common.ld", |
| 78 | + "-T", "esp32.rom.ld", |
| 79 | + "-T", "esp32.peripherals.ld", |
| 80 | + "-T", "esp32.rom.spiram_incompatible_fns.ld", |
| 81 | + "-u", "ld_include_panic_highint_hdl", |
| 82 | + "-u", "__cxa_guard_dummy", |
| 83 | + "-u", "__cxx_fatal_exception" |
| 84 | + ], |
| 85 | + |
| 86 | + CPPDEFINES=[ |
| 87 | + "ESP32", |
| 88 | + "ESP_PLATFORM", |
| 89 | + ("F_CPU", "$BOARD_F_CPU"), |
| 90 | + "HAVE_CONFIG_H", |
| 91 | + ("MBEDTLS_CONFIG_FILE", '\\"mbedtls/esp_config.h\\"'), |
| 92 | + ("ARDUINO", 10805), |
| 93 | + "ARDUINO_ARCH_ESP32", |
| 94 | + ("ARDUINO_VARIANT", '\\"%s\\"' % env.BoardConfig().get("build.variant").replace('"', "")), |
| 95 | + ("ARDUINO_BOARD", '\\"%s\\"' % env.BoardConfig().get("name").replace('"', "")) |
| 96 | + ], |
| 97 | + |
56 | 98 | CPPPATH=[
|
57 | 99 | join(FRAMEWORK_DIR, "tools", "sdk", "include", "config"),
|
58 | 100 | join(FRAMEWORK_DIR, "tools", "sdk", "include", "bluedroid"),
|
|
98 | 140 | join(FRAMEWORK_DIR, "tools", "sdk", "include", "wpa_supplicant"),
|
99 | 141 | join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core"))
|
100 | 142 | ],
|
| 143 | + |
101 | 144 | LIBPATH=[
|
102 | 145 | join(FRAMEWORK_DIR, "tools", "sdk", "lib"),
|
103 | 146 | join(FRAMEWORK_DIR, "tools", "sdk", "ld")
|
104 | 147 | ],
|
| 148 | + |
105 | 149 | LIBS=[
|
106 | 150 | "gcc", "openssl", "btdm_app", "fatfs", "wps", "coexist", "wear_levelling", "esp_http_client", "hal", "newlib", "driver", "bootloader_support", "pp", "mesh", "smartconfig", "jsmn", "wpa", "ethernet", "phy", "app_trace", "console", "ulp", "wpa_supplicant", "freertos", "bt", "micro-ecc", "cxx", "xtensa-debug-module", "mdns", "vfs", "soc", "core", "sdmmc", "coap", "tcpip_adapter", "c_nano", "esp-tls", "rtc", "spi_flash", "wpa2", "esp32", "app_update", "nghttp", "spiffs", "espnow", "nvs_flash", "esp_adc_cal", "log", "smartconfig_ack", "expat", "m", "c", "heap", "mbedtls", "lwip", "net80211", "pthread", "json", "stdc++"
|
107 |
| - ] |
108 |
| -) |
109 |
| - |
| 151 | + ], |
110 | 152 |
|
111 |
| -env.Append( |
112 | 153 | LIBSOURCE_DIRS=[
|
113 | 154 | join(FRAMEWORK_DIR, "libraries")
|
114 | 155 | ],
|
115 | 156 |
|
116 |
| - LINKFLAGS=[ |
117 |
| - "-Wl,-EL", |
118 |
| - "-T", "esp32.common.ld", |
119 |
| - "-T", "esp32.rom.ld", |
120 |
| - "-T", "esp32.peripherals.ld", |
121 |
| - "-T", "esp32.rom.spiram_incompatible_fns.ld", |
122 |
| - "-u", "ld_include_panic_highint_hdl", |
123 |
| - "-u", "__cxa_guard_dummy", |
124 |
| - "-u", "__cxx_fatal_exception" |
125 |
| - ], |
126 |
| - |
127 | 157 | FLASH_EXTRA_IMAGES=[
|
128 | 158 | ("0x1000", join(FRAMEWORK_DIR, "tools", "sdk", "bin", "bootloader_${BOARD_FLASH_MODE}_${__get_board_f_flash(__env__)}.bin")),
|
129 | 159 | ("0x8000", join(env.subst("$BUILD_DIR"), "partitions.bin")),
|
|
0 commit comments