1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-06 19:00:29 +01:00

move debug setting to another component

This commit is contained in:
Tomasz Duda 2024-05-09 21:42:09 +02:00
parent c128822381
commit 9c8b5ee933
5 changed files with 28 additions and 20 deletions

View File

@ -85,9 +85,16 @@ async def to_code(config):
cg.add_build_flag("-DUSE_NRF52") cg.add_build_flag("-DUSE_NRF52")
cg.add_define("ESPHOME_BOARD", config[CONF_BOARD]) cg.add_define("ESPHOME_BOARD", config[CONF_BOARD])
cg.add_define("ESPHOME_VARIANT", "NRF52") cg.add_define("ESPHOME_VARIANT", "NRF52")
conf = {"platform_version": "platformio/nordicnrf52@10.3.0"} conf = {CONF_PLATFORM_VERSION: "platformio/nordicnrf52@10.3.0"}
cg.add_platformio_option(CONF_FRAMEWORK, CORE.data[KEY_CORE][KEY_TARGET_FRAMEWORK]) cg.add_platformio_option(CONF_FRAMEWORK, CORE.data[KEY_CORE][KEY_TARGET_FRAMEWORK])
cg.add_platformio_option("platform", conf[CONF_PLATFORM_VERSION]) cg.add_platformio_option("platform", conf[CONF_PLATFORM_VERSION])
cg.add_platformio_option(
"platform_packages",
[
"platformio/framework-zephyr@https://github.com/tomaszduda23/framework-sdk-nrf",
"platformio/toolchain-gccarmnoneeabi@https://github.com/tomaszduda23/toolchain-sdk-ng",
],
)
if config[KEY_BOOTLOADER] == BOOTLOADER_ADAFRUIT: if config[KEY_BOOTLOADER] == BOOTLOADER_ADAFRUIT:
# make sure that firmware.zip is created # make sure that firmware.zip is created

View File

@ -77,13 +77,6 @@ def add_extra_script(stage: str, filename: str, path: str):
def zephyr_to_code(conf): def zephyr_to_code(conf):
cg.add(zephyr_ns.setup_preferences()) cg.add(zephyr_ns.setup_preferences())
cg.add_build_flag("-DUSE_ZEPHYR") cg.add_build_flag("-DUSE_ZEPHYR")
cg.add_platformio_option(
"platform_packages",
[
"platformio/framework-zephyr@https://github.com/tomaszduda23/framework-sdk-nrf",
"platformio/toolchain-gccarmnoneeabi@https://github.com/tomaszduda23/toolchain-sdk-ng",
],
)
# build is done by west so bypass board checking in platformio # build is done by west so bypass board checking in platformio
cg.add_platformio_option("boards_dir", CORE.relative_build_path("boards")) cg.add_platformio_option("boards_dir", CORE.relative_build_path("boards"))
@ -105,18 +98,6 @@ def zephyr_to_code(conf):
zephyr_add_prj_conf("UART_CONSOLE", False) zephyr_add_prj_conf("UART_CONSOLE", False)
# TODO disable when no OTA USB CDC # TODO disable when no OTA USB CDC
# zephyr_add_prj_conf("CONSOLE", False) # zephyr_add_prj_conf("CONSOLE", False)
# TODO debug only
zephyr_add_prj_conf("DEBUG_THREAD_INFO", True)
# zephyr_add_prj_conf("DEBUG", True)
###
zephyr_add_prj_conf("USE_SEGGER_RTT", True)
zephyr_add_prj_conf("RTT_CONSOLE", True)
zephyr_add_prj_conf("LOG", True)
zephyr_add_prj_conf("LOG_BLOCK_IN_THREAD", True)
zephyr_add_prj_conf("LOG_BUFFER_SIZE", 4096)
zephyr_add_prj_conf("SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL", True)
zephyr_add_prj_conf("USB_CDC_ACM_LOG_LEVEL_WRN", True)
add_extra_script( add_extra_script(
"pre", "pre",

View File

@ -0,0 +1,16 @@
import esphome.config_validation as cv
from esphome.components.zephyr import zephyr_add_prj_conf
CONFIG_SCHEMA = cv.Schema({})
async def to_code(config):
# gdb thread support
zephyr_add_prj_conf("DEBUG_THREAD_INFO", True)
# RTT
zephyr_add_prj_conf("USE_SEGGER_RTT", True)
zephyr_add_prj_conf("RTT_CONSOLE", True)
zephyr_add_prj_conf("LOG", True)
zephyr_add_prj_conf("LOG_BLOCK_IN_THREAD", True)
zephyr_add_prj_conf("LOG_BUFFER_SIZE", 4096)
zephyr_add_prj_conf("SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL", True)

View File

@ -74,3 +74,5 @@ zephyr_ble_server:
zephyr_ble_nus: zephyr_ble_nus:
log: true log: true
zephyr_debug:

View File

@ -40,3 +40,5 @@ zephyr_ble_server:
zephyr_ble_nus: zephyr_ble_nus:
log: true log: true
zephyr_debug: