Apply nRF52 flash completion fix to every build target

This commit is contained in:
mikecarper committed 2026-09-22 09:53:58 -07:00
1 parent 3ce499a700
commit 4c645b0d14
4 files changed
+18 -2

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@ def replace_driver(build_env, node):
def install(build_env):
build_env.AddBuildMiddleware(
replace_driver,
"*InternalFileSytem*src*flash*flash_nrf5x.c",
"*flash_nrf5x.c",
)
+13 -1
View File
@@ -28,7 +28,19 @@ class Nrf52InternalFlashFixTest(unittest.TestCase):
def test_all_nrf52_builds_load_fix(self):
ini = (ROOT / "platformio.ini").read_text(encoding="utf-8")
self.assertIn("pre:scripts/nrf52_internal_flash_fix.py", ini)
self.assertIn("*InternalFileSytem*src*flash*flash_nrf5x.c", SCRIPT.read_text())
self.assertIn('"*flash_nrf5x.c"', SCRIPT.read_text())
# The hardware-in-loop images intentionally bypass nrf52_base, but
# still use the same framework and must not regress to its unsafe SVC
# flash-completion wait.
for path in (ROOT / "tools/hil/profile_fixed_tx.ini",
ROOT / "tools/hil/profile_switch.ini"):
contents = path.read_text(encoding="utf-8")
self.assertEqual(contents.count("pre:scripts/nrf52_usb_power_fix.py"),
contents.count("pre:scripts/nrf52_internal_flash_fix.py"),
str(path))
for section in contents.split("[env:"):
if "pre:scripts/nrf52_usb_power_fix.py" in section:
self.assertIn("pre:scripts/nrf52_internal_flash_fix.py", section)
def test_application_softdevice_checks_use_compiler_safe_wrapper(self):
helper = ROOT / "src/helpers/nrf52/SoftDeviceState.h"
+1
View File
@@ -9,6 +9,7 @@ upload_protocol = nrfutil
extra_scripts =
create-uf2.py
pre:scripts/nrf52_usb_power_fix.py
pre:scripts/nrf52_internal_flash_fix.py
post:scripts/check_firmware_ram.py
lib_deps = ${env:profile_switch_xiao.lib_deps}
lib_ignore = PsychicMqttClient
+3
View File
@@ -129,6 +129,7 @@ upload_protocol = nrfutil
extra_scripts =
create-uf2.py
pre:scripts/nrf52_usb_power_fix.py
pre:scripts/nrf52_internal_flash_fix.py
post:scripts/check_firmware_ram.py
lib_deps = ${env:profile_switch_xiao.lib_deps}
lib_ignore = PsychicMqttClient
@@ -170,6 +171,7 @@ upload_protocol = nrfutil
extra_scripts =
create-uf2.py
pre:scripts/nrf52_usb_power_fix.py
pre:scripts/nrf52_internal_flash_fix.py
post:scripts/check_firmware_ram.py
lib_deps = ${env:profile_switch_xiao.lib_deps}
lib_ignore = PsychicMqttClient
@@ -213,6 +215,7 @@ upload_protocol = nrfutil
extra_scripts =
create-uf2.py
pre:scripts/nrf52_usb_power_fix.py
pre:scripts/nrf52_internal_flash_fix.py
post:scripts/check_firmware_ram.py
lib_deps = ${env:profile_switch_xiao.lib_deps}
lib_ignore = PsychicMqttClient