platformio.ini 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. ; PlatformIO Project Configuration File
  2. ;
  3. ; Build options: build flags, source filter
  4. ; Upload options: custom upload port, speed and extra flags
  5. ; Library options: dependencies, extra library storages
  6. ; Advanced options: extra scripting
  7. ;
  8. ; Please visit documentation for the other options and examples
  9. ; https://docs.platformio.org/page/projectconf.html
  10. [platformio]
  11. src_dir = main
  12. default_envs = esp32cam
  13. [common:idf]
  14. build_flags =
  15. -DUSE_ESP_IDF
  16. lib_deps =
  17. [common:esp32-idf]
  18. extends = common:idf
  19. ; PlatformIO releases, see https://github.com/platformio/platform-espressif32/releases
  20. platform = platformio/espressif32 @ 6.9.0
  21. framework = espidf
  22. lib_deps =
  23. ${common:idf.lib_deps}
  24. build_flags =
  25. ${common:idf.build_flags}
  26. -Wno-nonnull-compare
  27. -DUSE_ESP32
  28. -DUSE_ESP32_FRAMEWORK_ESP_IDF
  29. [flags:runtime]
  30. build_flags =
  31. -Wno-nonnull-compare
  32. -Wno-sign-compare
  33. -Wno-unused-but-set-variable
  34. -Wno-unused-variable
  35. -fno-exceptions
  36. [flags:clangtidy]
  37. build_flags =
  38. -Wall
  39. -Wextra
  40. -Wunreachable-code
  41. ;-Wshadow-compatible-local
  42. -fno-exceptions
  43. ; The main env - default
  44. [env:esp32cam]
  45. extends = common:esp32-idf
  46. board = esp32cam
  47. framework = espidf
  48. build_flags =
  49. ; ### common imported :
  50. ${common:esp32-idf.build_flags}
  51. ${flags:runtime.build_flags}
  52. ; ### Sofware options : (can be set in defines.h)
  53. -D BOARD_ESP32CAM_AITHINKER
  54. -D ENABLE_MQTT
  55. -D ENABLE_INFLUXDB
  56. -D ENABLE_WEBHOOK
  57. -D ENABLE_SOFTAP
  58. board_build.partitions = partitions.csv
  59. monitor_speed = 115200
  60. ; full standalone dev mode
  61. ; As sample, the board is nod32s instead of esp32cam (do not change nothing in fact :)
  62. ; You can test newer platform_packages
  63. ; or flash mode (board_build.flash_mode = qio)
  64. [env:esp32cam-dev]
  65. extends = common:esp32-idf
  66. board = esp32cam ; node32s
  67. ;board_build.flash_mode = qio ;generate SPI_FAST_FLASH_BOOT boot loop
  68. build_flags =
  69. ; ### common imported :
  70. ${common:esp32-idf.build_flags}
  71. ${flags:clangtidy.build_flags}
  72. ; ### Sofware options : (can be set in defines.h)
  73. -D BOARD_ESP32CAM_AITHINKER
  74. -D ENABLE_MQTT
  75. -D ENABLE_INFLUXDB
  76. -D ENABLE_WEBHOOK
  77. ;-D ENABLE_SOFTAP
  78. ; ### Debug options :
  79. ;-D DEBUG_DETAIL_ON
  80. ;-D DEBUG_DISABLE_BROWNOUT_DETECTOR
  81. ;-D DEBUG_ENABLE_SYSINFO
  82. ;-D DEBUG_ENABLE_PERFMON
  83. ;-D DEBUG_HIMEM_MEMORY_CHECK
  84. ;### test options
  85. -D CONFIG_ESP_TASK_WDT
  86. ;-D CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL
  87. -D CONFIG_ESP_TASK_WDT_TIMEOUT_S ; fix for CONFIG_ESP_INT_WDT_TIMEOUT_MS
  88. ;-D USE_HIMEM_IF_AVAILABLE
  89. framework = espidf
  90. lib_ldf_mode = deep+
  91. platform = platformio/espressif32 @ 5.2.0
  92. platform_packages =
  93. ;platformio/framework-espidf @ 3.40402.0 (4.4.2)
  94. ;platformio/framework-espidf@^3.50000.0
  95. ;platformio/tool-cmake @ 3.16.4
  96. ;platformio/tool-cmake@^3.21.3
  97. ;platformio/tool-esptoolpy @ 1.40201.0 (4.2.1)
  98. ;platformio/tool-esptoolpy@^1.40400.0
  99. ;platformio/tool-idf @ 1.0.1
  100. ;platformio/tool-mconf @ 1.4060000.20190628 (406.0.0)
  101. ;platformio/tool-ninja @ 1.9.0
  102. ;platformio/tool-ninja @ 1.10.2
  103. ;platformio/toolchain-esp32ulp @ 1.22851.191205 (2.28.51)
  104. ;espressif/toolchain-esp32ulp @ 2.35.0-20220830
  105. ;platformio/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
  106. ;platformio/toolchain-xtensa-esp32 @ 11.2.0+2022r1
  107. ; platformio/espressif32 @ 5.3.0 dependencies :
  108. ;platformio/framework-espidf @ 3.40403.0
  109. ;platformio/tool-cmake @ 3.16.4
  110. ;platformio/tool-esptoolpy@^1.40400.0
  111. ;platformio/tool-idf @ 1.0.1
  112. ;platformio/tool-mconf @ 1.4060000.20190628
  113. ;platformio/tool-ninja @ 1.9.0
  114. ;espressif/toolchain-esp32ulp @ 2.35.0-20220830
  115. ;;;;espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
  116. board_build.partitions = partitions.csv
  117. monitor_speed = 115200
  118. ; Activate all debug mode
  119. ; Cannot be used alone, but must be added at the end of extends = env:esp32cam-dev, esp32cam-debug
  120. ;If multiple items specified in the extends field then only values from the latter one will be used in the final configuration
  121. ;https://docs.platformio.org/en/stable/projectconf/section_env_advanced.html
  122. [env:esp32cam-debug] ; activate all debug
  123. ;extends nothing, only apply sdkconfig.esp32-debug.defaults, enable debug options and clangtidy
  124. build_flags =
  125. ; ### clangtidy build flags:
  126. ${flags:clangtidy.build_flags}
  127. ; ### Debug options :
  128. -D DEBUG_DETAIL_ON
  129. ;-D DEBUG_DISABLE_BROWNOUT_DETECTOR
  130. -D DEBUG_ENABLE_SYSINFO
  131. -D DEBUG_ENABLE_PERFMON
  132. ;-D DEBUG_HIMEM_MEMORY_CHECK
  133. ;-D USE_HIMEM_IF_AVAILABLE
  134. lib_ldf_mode = deep+
  135. ; Power management enabled
  136. ;https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/power_management.html
  137. ;https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig.html#config-pm-enable
  138. [env:esp32cam-power-management]
  139. build_flags =
  140. -D TCONFIG_PM_ENABLE
  141. -D CONFIG_PM_DFS_INIT_AUTO
  142. -D CONFIG_FREERTOS_USE_TICKLESS_IDLE
  143. ;-D FREERTOS_IDLE_TIME_BEFORE_SLEEP=3
  144. ;**********************
  145. ; next section use modified version CMakeLists.txt of to use sdkconfig.<pioenv>.defaults + sdkconfig.defaults
  146. ; https://github.com/platformio/platform-espressif32/issues/638
  147. ; set board to rev3
  148. [env:esp32cam-board-rev3]
  149. extends = env:esp32cam-dev, esp32cam-debug
  150. ; set CPU frequency to 240 instead of 160 default
  151. [env:esp32cam-cpu-freq-240]
  152. extends = env:esp32cam-dev, esp32cam-debug
  153. ; sdkconfig.esp32cam-board-rev3.defaults override some sdkconfig.defaults
  154. ; set board to rev3 + CPU frequency to 240
  155. ; look at the extends : it takes esp32cam-dev and add env:esp32cam-board-rev3, env:esp32cam-cpu-freq-240 , esp32cam-debug parameters
  156. [env:esp32cam-board-rev3-cpu-freq-240]
  157. extends = env:esp32cam-dev, env:esp32cam-board-rev3, env:esp32cam-cpu-freq-240 , esp32cam-debug
  158. ; set board to rev3 + CPU frequency to 240 + power management
  159. [env:esp32cam-board-rev3-cpu-freq-240-pow]
  160. extends = env:esp32cam-dev, env:esp32cam-board-rev3, env:esp32cam-cpu-freq-240 , env:esp32cam-power-management, esp32cam-debug
  161. ; Enable use of 8 MB PSRAM boards
  162. ;https://github.com/espressif/esp-idf/blob/master/examples/system/himem/README.md
  163. [env:esp32cam-dev-himem]
  164. extends = env:esp32cam-dev, esp32cam-debug
  165. ; sdkconfig.esp32cam-dev-himem.defaults override some sdkconfig.defaults
  166. build_flags =
  167. -DBOARD_HAS_PSRAM
  168. ;-D DEBUG_HIMEM_MEMORY_CHECK
  169. ;-D USE_HIMEM_IF_AVAILABLE
  170. ; set options for task analysis (PR #1751)
  171. [env:esp32cam-dev-task-analysis]
  172. extends = env:esp32cam-dev, esp32cam-debug
  173. ; sdkconfig.esp32cam-dev-task-analysis.defaults override some sdkconfig.defaults
  174. build_flags =
  175. ;-D DEBUG_DETAIL_ON ; if esp32cam-debug not in extends
  176. -D TASK_ANALYSIS_ON
  177. ;please use only one HEAP tracing at time.
  178. -D HEAP_TRACING_MAIN_WIFI
  179. ;-D HEAP_TRACING_MAIN_START
  180. ;-D HEAP_TRACING_CLASS_FLOW_CNN_GENERAL_DO_ALING_AND_CUT
  181. ; Overwrite espcam build_flags to not include ENABLE_SOFTAP
  182. ; Nor the -U ENABLE_SOFTAP nor -D ENABLE_SOFTAP=0 works to unset defines actually
  183. ; Set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n in sdkconfig.esp32cam-no-softap.defaults to disable softap in the esp-idf compilation
  184. [env:esp32cam-no-softap] ;CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n saves 28k of flash
  185. extends = env:esp32cam
  186. build_flags =
  187. ; ### common imported :
  188. ${common:esp32-idf.build_flags}
  189. ${flags:clangtidy.build_flags}
  190. ; ### Sofware options :
  191. -D ENABLE_MQTT
  192. -D ENABLE_INFLUXDB
  193. -D ENABLE_WEBHOOK
  194. ;-D ENABLE_SOFTAP ; disabled