platform.txt 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. # ESP8266 platform
  2. # ------------------------------
  3. # For more info:
  4. # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
  5. name=ESP8266 Modules
  6. version=2.4.2
  7. compiler.warning_flags=-w
  8. compiler.warning_flags.none=-w
  9. compiler.warning_flags.default=
  10. compiler.warning_flags.more=-Wall
  11. compiler.warning_flags.all=-Wall -Wextra
  12. build.lwip_lib=-llwip_gcc
  13. build.lwip_include=lwip/include
  14. build.lwip_flags=-DLWIP_OPEN_SRC
  15. build.vtable_flags=-DVTABLES_IN_FLASH
  16. #build.float=-u _printf_float -u _scanf_float
  17. build.float=
  18. build.led=
  19. build.noextra4kheap=
  20. compiler.path={runtime.tools.xtensa-lx106-elf-gcc.path}/bin/
  21. compiler.sdk.path={runtime.platform.path}/tools/sdk
  22. compiler.libc.path={runtime.platform.path}/tools/sdk/libc/xtensa-lx106-elf
  23. compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I{compiler.sdk.path}/include" "-I{compiler.sdk.path}/{build.lwip_include}" "-I{compiler.libc.path}/include" "-I{build.path}/core"
  24. compiler.c.cmd=xtensa-lx106-elf-gcc
  25. compiler.c.flags=-c {compiler.warning_flags} {build.noextra4kheap} -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -std=gnu99 -ffunction-sections -fdata-sections
  26. compiler.S.cmd=xtensa-lx106-elf-gcc
  27. compiler.S.flags=-c -g -x assembler-with-cpp -MMD -mlongcalls
  28. compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u app_entry {build.float} -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read
  29. compiler.c.elf.cmd=xtensa-lx106-elf-gcc
  30. compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -lbearssl -laxtls -lespnow -lsmartconfig -lairkiss -lwpa2 -lstdc++ -lm -lc -lgcc
  31. compiler.cpp.cmd=xtensa-lx106-elf-g++
  32. compiler.cpp.flags=-c {compiler.warning_flags} {build.noextra4kheap} -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections
  33. compiler.as.cmd=xtensa-lx106-elf-as
  34. compiler.ar.cmd=xtensa-lx106-elf-ar
  35. compiler.ar.flags=cru
  36. compiler.elf2hex.cmd=esptool
  37. compiler.elf2hex.flags=
  38. compiler.size.cmd=xtensa-lx106-elf-size
  39. compiler.esptool.cmd=esptool
  40. compiler.esptool.cmd.windows=esptool.exe
  41. # This can be overriden in boards.txt
  42. build.extra_flags=-DESP8266
  43. # These can be overridden in platform.local.txt
  44. compiler.c.extra_flags=
  45. compiler.c.elf.extra_flags=
  46. compiler.S.extra_flags=
  47. compiler.cpp.extra_flags=
  48. compiler.ar.extra_flags=
  49. compiler.objcopy.eep.extra_flags=
  50. compiler.elf2hex.extra_flags=
  51. ## generate file with git version number
  52. ## needs bash, git, and echo
  53. ## windows-compatible version without git
  54. ## Build the app.ld linker file
  55. recipe.hooks.linking.prelink.1.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld"
  56. ## Compile c files
  57. recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
  58. ## Compile c++ files
  59. recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
  60. ## Compile S files
  61. recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
  62. ## Create archives
  63. recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/arduino.ar" "{object_file}"
  64. ## Combine gc-sections, archives, and objects
  65. recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" -Wl,-Map "-Wl,{build.path}/{build.project_name}.map" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{build.path}/arduino.ar" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}"
  66. ## Create eeprom
  67. recipe.objcopy.eep.pattern=
  68. ## Create hex
  69. #recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
  70. recipe.objcopy.hex.pattern="{runtime.tools.esptool.path}/{compiler.esptool.cmd}" -eo "{runtime.platform.path}/bootloaders/eboot/eboot.elf" -bo "{build.path}/{build.project_name}.bin" -bm {build.flash_mode} -bf {build.flash_freq} -bz {build.flash_size} -bs .text -bp 4096 -ec -eo "{build.path}/{build.project_name}.elf" -bs .irom0.text -bs .text -bs .data -bs .rodata -bc -ec
  71. ## Save hex
  72. recipe.output.tmp_file={build.project_name}.bin
  73. recipe.output.save_file={build.project_name}.{build.variant}.bin
  74. ## Compute size
  75. recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
  76. recipe.size.regex=^(?:\.irom0\.text|\.text|\.data|\.rodata|)\s+([0-9]+).*
  77. recipe.size.regex.data=^(?:\.data|\.rodata|\.bss)\s+([0-9]+).*
  78. #recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
  79. # ------------------------------
  80. tools.esptool.cmd=esptool
  81. tools.esptool.cmd.windows=esptool.exe
  82. tools.esptool.path={runtime.tools.esptool.path}
  83. tools.esptool.network_cmd=python
  84. tools.esptool.network_cmd.windows=python.exe
  85. tools.esptool.upload.protocol=esp
  86. tools.esptool.upload.params.verbose=-vv
  87. tools.esptool.upload.params.quiet=
  88. tools.esptool.upload.pattern="{path}/{cmd}" {upload.verbose} -cd {upload.resetmethod} -cb {upload.speed} -cp "{serial.port}" {upload.erase_cmd} -ca 0x00000 -cf "{build.path}/{build.project_name}.bin"
  89. tools.esptool.upload.network_pattern="{network_cmd}" "{runtime.platform.path}/tools/espota.py" -i "{serial.port}" -p "{network.port}" "--auth={network.password}" -f "{build.path}/{build.project_name}.bin"
  90. tools.mkspiffs.cmd=mkspiffs
  91. tools.mkspiffs.cmd.windows=mkspiffs.exe
  92. tools.mkspiffs.path={runtime.tools.mkspiffs.path}
  93. tools.espupload.cmd=python
  94. tools.espupload.cmd.windows=python.exe
  95. tools.espupload.path={runtime.platform.path}/tools
  96. tools.espupload.upload.protocol=espupload
  97. tools.espupload.upload.params.verbose=
  98. tools.espupload.upload.params.quiet=
  99. tools.espupload.upload.pattern="{cmd}" "{path}/espupload.py" -f "{build.path}/{build.project_name}.bin"