diff --git a/scripts/nrf52_internal_flash_fix.py b/scripts/nrf52_internal_flash_fix.py index cac9db4b..8d498b90 100644 --- a/scripts/nrf52_internal_flash_fix.py +++ b/scripts/nrf52_internal_flash_fix.py @@ -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", ) diff --git a/test/test_nrf52_internal_flash_fix.py b/test/test_nrf52_internal_flash_fix.py index b2d30910..d8059998 100644 --- a/test/test_nrf52_internal_flash_fix.py +++ b/test/test_nrf52_internal_flash_fix.py @@ -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" diff --git a/tools/hil/profile_fixed_tx.ini b/tools/hil/profile_fixed_tx.ini index d0a62b92..c1eab59f 100644 --- a/tools/hil/profile_fixed_tx.ini +++ b/tools/hil/profile_fixed_tx.ini @@ -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 diff --git a/tools/hil/profile_switch.ini b/tools/hil/profile_switch.ini index bcf86d28..b1226a6f 100644 --- a/tools/hil/profile_switch.ini +++ b/tools/hil/profile_switch.ini @@ -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