platformio.ini 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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 MQTT_PROTOCOL_311
  56. -D MQTT_ENABLE_SSL
  57. ;-D MQTT_ENABLE_WS
  58. ;-D MQTT_ENABLE_WSS
  59. -D MQTT_SUPPORTED_FEATURE_SKIP_CRT_CMN_NAME_CHECK
  60. ;-D MQTT_SUPPORTED_FEATURE_CRT_CMN_NAME
  61. ;-D MQTT_SUPPORTED_FEATURE_CLIENT_KEY_PASSWORD
  62. -D ENABLE_INFLUXDB
  63. -D ENABLE_WEBHOOK
  64. -D ENABLE_SOFTAP
  65. board_build.partitions = partitions.csv
  66. monitor_speed = 115200
  67. ; full standalone dev mode
  68. ; As sample, the board is nod32s instead of esp32cam (do not change nothing in fact :)
  69. ; You can test newer platform_packages
  70. ; or flash mode (board_build.flash_mode = qio)
  71. [env:esp32cam-dev]
  72. extends = common:esp32-idf
  73. board = esp32cam ; node32s
  74. ;board_build.flash_mode = qio ;generate SPI_FAST_FLASH_BOOT boot loop
  75. build_flags =
  76. ; ### common imported :
  77. ${common:esp32-idf.build_flags}
  78. ${flags:clangtidy.build_flags}
  79. ; ### Sofware options : (can be set in defines.h)
  80. -D BOARD_ESP32CAM_AITHINKER
  81. -D ENABLE_MQTT
  82. -D ENABLE_INFLUXDB
  83. -D ENABLE_WEBHOOK
  84. ;-D ENABLE_SOFTAP
  85. ; ### Debug options :
  86. ;-D DEBUG_DETAIL_ON
  87. ;-D DEBUG_DISABLE_BROWNOUT_DETECTOR
  88. ;-D DEBUG_ENABLE_SYSINFO
  89. ;-D DEBUG_ENABLE_PERFMON
  90. ;-D DEBUG_HIMEM_MEMORY_CHECK
  91. ;### test options
  92. -D CONFIG_ESP_TASK_WDT
  93. ;-D CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL
  94. -D CONFIG_ESP_TASK_WDT_TIMEOUT_S ; fix for CONFIG_ESP_INT_WDT_TIMEOUT_MS
  95. ;-D USE_HIMEM_IF_AVAILABLE
  96. framework = espidf
  97. lib_ldf_mode = deep+
  98. platform = platformio/espressif32 @ 5.2.0
  99. platform_packages =
  100. ;platformio/framework-espidf @ 3.40402.0 (4.4.2)
  101. ;platformio/framework-espidf@^3.50000.0
  102. ;platformio/tool-cmake @ 3.16.4
  103. ;platformio/tool-cmake@^3.21.3
  104. ;platformio/tool-esptoolpy @ 1.40201.0 (4.2.1)
  105. ;platformio/tool-esptoolpy@^1.40400.0
  106. ;platformio/tool-idf @ 1.0.1
  107. ;platformio/tool-mconf @ 1.4060000.20190628 (406.0.0)
  108. ;platformio/tool-ninja @ 1.9.0
  109. ;platformio/tool-ninja @ 1.10.2
  110. ;platformio/toolchain-esp32ulp @ 1.22851.191205 (2.28.51)
  111. ;espressif/toolchain-esp32ulp @ 2.35.0-20220830
  112. ;platformio/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
  113. ;platformio/toolchain-xtensa-esp32 @ 11.2.0+2022r1
  114. ; platformio/espressif32 @ 5.3.0 dependencies :
  115. ;platformio/framework-espidf @ 3.40403.0
  116. ;platformio/tool-cmake @ 3.16.4
  117. ;platformio/tool-esptoolpy@^1.40400.0
  118. ;platformio/tool-idf @ 1.0.1
  119. ;platformio/tool-mconf @ 1.4060000.20190628
  120. ;platformio/tool-ninja @ 1.9.0
  121. ;espressif/toolchain-esp32ulp @ 2.35.0-20220830
  122. ;;;;espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
  123. board_build.partitions = partitions.csv
  124. monitor_speed = 115200
  125. ; Activate all debug mode
  126. ; Cannot be used alone, but must be added at the end of extends = env:esp32cam-dev, esp32cam-debug
  127. ;If multiple items specified in the extends field then only values from the latter one will be used in the final configuration
  128. ;https://docs.platformio.org/en/stable/projectconf/section_env_advanced.html
  129. [env:esp32cam-debug] ; activate all debug
  130. ;extends nothing, only apply sdkconfig.esp32-debug.defaults, enable debug options and clangtidy
  131. build_flags =
  132. ; ### clangtidy build flags:
  133. ${flags:clangtidy.build_flags}
  134. ; ### Debug options :
  135. -D DEBUG_DETAIL_ON
  136. ;-D DEBUG_DISABLE_BROWNOUT_DETECTOR
  137. -D DEBUG_ENABLE_SYSINFO
  138. -D DEBUG_ENABLE_PERFMON
  139. ;-D DEBUG_HIMEM_MEMORY_CHECK
  140. ;-D USE_HIMEM_IF_AVAILABLE
  141. lib_ldf_mode = deep+
  142. ; Power management enabled
  143. ;https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/power_management.html
  144. ;https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig.html#config-pm-enable
  145. [env:esp32cam-power-management]
  146. build_flags =
  147. -D TCONFIG_PM_ENABLE
  148. -D CONFIG_PM_DFS_INIT_AUTO
  149. -D CONFIG_FREERTOS_USE_TICKLESS_IDLE
  150. ;-D FREERTOS_IDLE_TIME_BEFORE_SLEEP=3
  151. ;**********************
  152. ; next section use modified version CMakeLists.txt of to use sdkconfig.<pioenv>.defaults + sdkconfig.defaults
  153. ; https://github.com/platformio/platform-espressif32/issues/638
  154. ; set board to rev3
  155. [env:esp32cam-board-rev3]
  156. extends = env:esp32cam-dev, esp32cam-debug
  157. ; set CPU frequency to 240 instead of 160 default
  158. [env:esp32cam-cpu-freq-240]
  159. extends = env:esp32cam-dev, esp32cam-debug
  160. ; sdkconfig.esp32cam-board-rev3.defaults override some sdkconfig.defaults
  161. ; set board to rev3 + CPU frequency to 240
  162. ; look at the extends : it takes esp32cam-dev and add env:esp32cam-board-rev3, env:esp32cam-cpu-freq-240 , esp32cam-debug parameters
  163. [env:esp32cam-board-rev3-cpu-freq-240]
  164. extends = env:esp32cam-dev, env:esp32cam-board-rev3, env:esp32cam-cpu-freq-240 , esp32cam-debug
  165. ; set board to rev3 + CPU frequency to 240 + power management
  166. [env:esp32cam-board-rev3-cpu-freq-240-pow]
  167. extends = env:esp32cam-dev, env:esp32cam-board-rev3, env:esp32cam-cpu-freq-240 , env:esp32cam-power-management, esp32cam-debug
  168. ; Enable use of 8 MB PSRAM boards
  169. ;https://github.com/espressif/esp-idf/blob/master/examples/system/himem/README.md
  170. [env:esp32cam-dev-himem]
  171. extends = env:esp32cam-dev, esp32cam-debug
  172. ; sdkconfig.esp32cam-dev-himem.defaults override some sdkconfig.defaults
  173. build_flags =
  174. -DBOARD_HAS_PSRAM
  175. ;-D DEBUG_HIMEM_MEMORY_CHECK
  176. ;-D USE_HIMEM_IF_AVAILABLE
  177. ; set options for task analysis (PR #1751)
  178. [env:esp32cam-dev-task-analysis]
  179. extends = env:esp32cam-dev, esp32cam-debug
  180. ; sdkconfig.esp32cam-dev-task-analysis.defaults override some sdkconfig.defaults
  181. build_flags =
  182. ;-D DEBUG_DETAIL_ON ; if esp32cam-debug not in extends
  183. -D TASK_ANALYSIS_ON
  184. ;please use only one HEAP tracing at time.
  185. -D HEAP_TRACING_MAIN_WIFI
  186. ;-D HEAP_TRACING_MAIN_START
  187. ;-D HEAP_TRACING_CLASS_FLOW_CNN_GENERAL_DO_ALING_AND_CUT
  188. ; Overwrite espcam build_flags to not include ENABLE_SOFTAP
  189. ; Nor the -U ENABLE_SOFTAP nor -D ENABLE_SOFTAP=0 works to unset defines actually
  190. ; Set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n in sdkconfig.esp32cam-no-softap.defaults to disable softap in the esp-idf compilation
  191. [env:esp32cam-no-softap] ;CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n saves 28k of flash
  192. extends = env:esp32cam
  193. build_flags =
  194. ; ### common imported :
  195. ${common:esp32-idf.build_flags}
  196. ${flags:clangtidy.build_flags}
  197. ; ### Sofware options :
  198. -D ENABLE_MQTT
  199. -D ENABLE_INFLUXDB
  200. -D ENABLE_WEBHOOK
  201. ;-D ENABLE_SOFTAP ; disabled