mirror of
https://github.com/esphome/esphome.git
synced 2025-04-05 18:30:28 +01:00
move debug setting to another component
This commit is contained in:
parent
c128822381
commit
9c8b5ee933
@ -85,9 +85,16 @@ async def to_code(config):
|
||||
cg.add_build_flag("-DUSE_NRF52")
|
||||
cg.add_define("ESPHOME_BOARD", config[CONF_BOARD])
|
||||
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("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:
|
||||
# make sure that firmware.zip is created
|
||||
|
@ -77,13 +77,6 @@ def add_extra_script(stage: str, filename: str, path: str):
|
||||
def zephyr_to_code(conf):
|
||||
cg.add(zephyr_ns.setup_preferences())
|
||||
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
|
||||
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)
|
||||
# TODO disable when no OTA USB CDC
|
||||
# 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(
|
||||
"pre",
|
||||
|
16
esphome/components/zephyr_debug/__init__.py
Normal file
16
esphome/components/zephyr_debug/__init__.py
Normal 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)
|
@ -74,3 +74,5 @@ zephyr_ble_server:
|
||||
|
||||
zephyr_ble_nus:
|
||||
log: true
|
||||
|
||||
zephyr_debug:
|
||||
|
@ -40,3 +40,5 @@ zephyr_ble_server:
|
||||
|
||||
zephyr_ble_nus:
|
||||
log: true
|
||||
|
||||
zephyr_debug:
|
||||
|
Loading…
x
Reference in New Issue
Block a user