mirror of
https://github.com/esphome/esphome.git
synced 2026-05-23 03:06:05 +08:00
[nrf52] add reserve area for bootloader (#16204)
This commit is contained in:
@@ -31,12 +31,15 @@ BOARDS_ZEPHYR = {
|
||||
# https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather?view=all#hathach-memory-map
|
||||
BOOTLOADER_CONFIG = {
|
||||
BOOTLOADER_ADAFRUIT_NRF52_SD132: [
|
||||
Section("empty_app_offset", 0x0, 0x26000, "flash_primary"),
|
||||
Section("SoftDevice", 0x0, 0x26000, "flash_primary"),
|
||||
Section("Adafruit_nRF52_Bootloader", 0xF4000, 0xC000, "flash_primary"),
|
||||
],
|
||||
BOOTLOADER_ADAFRUIT_NRF52_SD140_V6: [
|
||||
Section("empty_app_offset", 0x0, 0x26000, "flash_primary"),
|
||||
Section("SoftDevice", 0x0, 0x26000, "flash_primary"),
|
||||
Section("Adafruit_nRF52_Bootloader", 0xF4000, 0xC000, "flash_primary"),
|
||||
],
|
||||
BOOTLOADER_ADAFRUIT_NRF52_SD140_V7: [
|
||||
Section("empty_app_offset", 0x0, 0x27000, "flash_primary"),
|
||||
Section("SoftDevice", 0x0, 0x27000, "flash_primary"),
|
||||
Section("Adafruit_nRF52_Bootloader", 0xF4000, 0xC000, "flash_primary"),
|
||||
],
|
||||
}
|
||||
|
||||
@@ -9,9 +9,6 @@ from esphome.components.esp32.const import (
|
||||
VARIANT_ESP32C6,
|
||||
VARIANT_ESP32H2,
|
||||
)
|
||||
from esphome.components.nrf52.boards import BOOTLOADER_CONFIG, Section
|
||||
from esphome.components.zephyr import zephyr_add_pm_static, zephyr_data
|
||||
from esphome.components.zephyr.const import KEY_BOOTLOADER
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_INTERNAL, CONF_MODEL, CONF_NAME
|
||||
from esphome.core import CORE, CoroPriority, coroutine_with_priority
|
||||
@@ -53,15 +50,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||
CODEOWNERS = ["@luar123", "@tomaszduda23"]
|
||||
|
||||
|
||||
def zigbee_set_core_data(config: ConfigType) -> ConfigType:
|
||||
if CORE.is_nrf52 and zephyr_data()[KEY_BOOTLOADER] in BOOTLOADER_CONFIG:
|
||||
zephyr_add_pm_static(
|
||||
[Section("empty_after_zboss_offset", 0xF4000, 0xC000, "flash_primary")]
|
||||
)
|
||||
|
||||
return config
|
||||
|
||||
|
||||
BINARY_SENSOR_SCHEMA = cv.Schema(
|
||||
{
|
||||
cv.Optional(CONF_REPORT): cv.All(
|
||||
@@ -119,7 +107,6 @@ CONFIG_SCHEMA = cv.All(
|
||||
).extend(cv.COMPONENT_SCHEMA),
|
||||
_validate_router_sleepy,
|
||||
zigbee_require_vfs_select,
|
||||
zigbee_set_core_data,
|
||||
cv.Any(
|
||||
cv.All(
|
||||
cv.only_on_esp32,
|
||||
|
||||
Reference in New Issue
Block a user