platformio.ini 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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.7.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 ENABLE_MQTT
  54. -D ENABLE_INFLUXDB
  55. -D ENABLE_WEBHOOK
  56. -D ENABLE_SOFTAP
  57. board_build.partitions = partitions.csv
  58. monitor_speed = 115200
  59. monitor_rts = 0
  60. monitor_dtr = 0
  61. ; full standalone dev mode
  62. ; As sample, the board is nod32s instead of esp32cam (do not change nothing in fact :)
  63. ; You can test newer platform_packages
  64. ; or flash mode (board_build.flash_mode = qio)
  65. [env:esp32cam-dev]
  66. extends = common:esp32-idf
  67. board = esp32cam ; node32s
  68. ;board_build.flash_mode = qio ;generate SPI_FAST_FLASH_BOOT boot loop
  69. build_flags =
  70. ; ### common imported :
  71. ${common:esp32-idf.build_flags}
  72. ${flags:clangtidy.build_flags}
  73. ; ### Sofware options : (can be set in defines.h)
  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. monitor_rts = 0
  119. monitor_dtr = 0
  120. ; Activate all debug mode
  121. ; Cannot be used alone, but must be added at the end of extends = env:esp32cam-dev, esp32cam-debug
  122. ;If multiple items specified in the extends field then only values from the latter one will be used in the final configuration
  123. ;https://docs.platformio.org/en/stable/projectconf/section_env_advanced.html
  124. [env:esp32cam-debug] ; activate all debug
  125. ;extends nothing, only apply sdkconfig.esp32-debug.defaults, enable debug options and clangtidy
  126. build_flags =
  127. ; ### clangtidy build flags:
  128. ${flags:clangtidy.build_flags}
  129. ; ### Debug options :
  130. -D DEBUG_DETAIL_ON
  131. ;-D DEBUG_DISABLE_BROWNOUT_DETECTOR
  132. -D DEBUG_ENABLE_SYSINFO
  133. -D DEBUG_ENABLE_PERFMON
  134. ;-D DEBUG_HIMEM_MEMORY_CHECK
  135. ;-D USE_HIMEM_IF_AVAILABLE
  136. lib_ldf_mode = deep+
  137. ; Power management enabled
  138. ;https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/power_management.html
  139. ;https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig.html#config-pm-enable
  140. [env:esp32cam-power-management]
  141. build_flags =
  142. -D TCONFIG_PM_ENABLE
  143. -D CONFIG_PM_DFS_INIT_AUTO
  144. -D CONFIG_FREERTOS_USE_TICKLESS_IDLE
  145. ;-D FREERTOS_IDLE_TIME_BEFORE_SLEEP=3
  146. ;**********************
  147. ; next section use modified version CMakeLists.txt of to use sdkconfig.<pioenv>.defaults + sdkconfig.defaults
  148. ; https://github.com/platformio/platform-espressif32/issues/638
  149. ; set board to rev3
  150. [env:esp32cam-board-rev3]
  151. extends = env:esp32cam-dev, esp32cam-debug
  152. ; set CPU frequency to 240 instead of 160 default
  153. [env:esp32cam-cpu-freq-240]
  154. extends = env:esp32cam-dev, esp32cam-debug
  155. ; sdkconfig.esp32cam-board-rev3.defaults override some sdkconfig.defaults
  156. ; set board to rev3 + CPU frequency to 240
  157. ; look at the extends : it takes esp32cam-dev and add env:esp32cam-board-rev3, env:esp32cam-cpu-freq-240 , esp32cam-debug parameters
  158. [env:esp32cam-board-rev3-cpu-freq-240]
  159. extends = env:esp32cam-dev, env:esp32cam-board-rev3, env:esp32cam-cpu-freq-240 , esp32cam-debug
  160. ; set board to rev3 + CPU frequency to 240 + power management
  161. [env:esp32cam-board-rev3-cpu-freq-240-pow]
  162. extends = env:esp32cam-dev, env:esp32cam-board-rev3, env:esp32cam-cpu-freq-240 , env:esp32cam-power-management, esp32cam-debug
  163. ; Enable use of 8 MB PSRAM boards
  164. ;https://github.com/espressif/esp-idf/blob/master/examples/system/himem/README.md
  165. [env:esp32cam-dev-himem]
  166. extends = env:esp32cam-dev, esp32cam-debug
  167. ; sdkconfig.esp32cam-dev-himem.defaults override some sdkconfig.defaults
  168. build_flags =
  169. -DBOARD_HAS_PSRAM
  170. ;-D DEBUG_HIMEM_MEMORY_CHECK
  171. ;-D USE_HIMEM_IF_AVAILABLE
  172. ; set options for task analysis (PR #1751)
  173. [env:esp32cam-dev-task-analysis]
  174. extends = env:esp32cam-dev, esp32cam-debug
  175. ; sdkconfig.esp32cam-dev-task-analysis.defaults override some sdkconfig.defaults
  176. build_flags =
  177. ;-D DEBUG_DETAIL_ON ; if esp32cam-debug not in extends
  178. -D TASK_ANALYSIS_ON
  179. ;please use only one HEAP tracing at time.
  180. -D HEAP_TRACING_MAIN_WIFI
  181. ;-D HEAP_TRACING_MAIN_START
  182. ;-D HEAP_TRACING_CLASS_FLOW_CNN_GENERAL_DO_ALING_AND_CUT
  183. ; Overwrite espcam build_flags to not include ENABLE_SOFTAP
  184. ; Nor the -U ENABLE_SOFTAP nor -D ENABLE_SOFTAP=0 works to unset defines actually
  185. ; Set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n in sdkconfig.esp32cam-no-softap.defaults to disable softap in the esp-idf compilation
  186. [env:esp32cam-no-softap] ;CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n saves 28k of flash
  187. extends = env:esp32cam
  188. build_flags =
  189. ; ### common imported :
  190. ${common:esp32-idf.build_flags}
  191. ${flags:clangtidy.build_flags}
  192. ; ### Sofware options :
  193. -D ENABLE_MQTT
  194. -D ENABLE_INFLUXDB
  195. -D ENABLE_WEBHOOK
  196. ;-D ENABLE_SOFTAP ; disabled