Skip to content

Conversation

Copy link

Copilot AI commented Nov 23, 2025

The v2m_musca_b1/musca_b1/ns board failed to build with TFM-enabled tests due to missing device tree partition definitions required by the TFM module at cmake configuration time.

Changes:

  • Added flash partition table to boards/arm/v2m_musca_b1/v2m_musca_b1_musca_b1_ns.dts:
    • slot0_partition (256KB) - Secure image primary
    • slot0_ns_partition (512KB) - Non-secure image primary
    • slot1_partition / slot1_ns_partition - Secondary slots for updates
    • scratch_partition (96KB) - MCUBoot scratch area
  • Set zephyr,code-partition to &slot0_ns_partition in chosen node
  • Added flash properties: compatible = "soc-nv-flash", erase-block-size = <4096>, write-block-size = <4>

Partition layout follows the standard TFM multi-image boot scheme used by mps2/an521 and other ARM TFM reference boards, fitting within the board's 1664KB available eFlash at 0xa070000.

Original prompt

fix this bug

Zephyr default modules (Zephyr base).
-- Application: /__w/zephyr/zephyr/tests/arch/arm/arm_thread_swap_tz
-- CMake version: 3.28.3
-- Found Python3: /opt/python/venv/bin/python3 (found suitable version "3.12.3", minimum required is "3.10") found components: Interpreter
-- Cache files will be written to: /root/.cache/zephyr
-- Zephyr version: 4.3.99 (/__w/zephyr/zephyr)
-- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
-- Board: v2m_musca_b1, qualifiers: musca_b1/ns
-- Found host-tools: zephyr 0.17.4 (/opt/toolchains/zephyr-sdk-0.17.4)
-- Found toolchain: zephyr 0.17.4 (/opt/toolchains/zephyr-sdk-0.17.4)
-- Found Dtc: /opt/toolchains/zephyr-sdk-0.17.4/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.7.0", minimum required is "1.4.6")
-- Found BOARD.dts: /__w/zephyr/zephyr/boards/arm/v2m_musca_b1/v2m_musca_b1_musca_b1_ns.dts
-- Generated zephyr.dts: /__w/zephyr/zephyr/twister-out/v2m_musca_b1_musca_b1_ns/zephyr/tests/arch/arm/arm_thread_swap_tz/arch.arm.swap.tz/zephyr/zephyr.dts
-- Generated pickled edt: /__w/zephyr/zephyr/twister-out/v2m_musca_b1_musca_b1_ns/zephyr/tests/arch/arm/arm_thread_swap_tz/arch.arm.swap.tz/zephyr/edt.pickle
-- Generated devicetree_generated.h: /__w/zephyr/zephyr/twister-out/v2m_musca_b1_musca_b1_ns/zephyr/tests/arch/arm/arm_thread_swap_tz/arch.arm.swap.tz/zephyr/include/generated/zephyr/devicetree_generated.h

warning: FPU (defined at boards/shields/nxp_m2_wifi_bt/Kconfig.defconfig:142,
soc/st/stm32/stm32wbax/Kconfig.defconfig:42, soc/st/stm32/stm32wbax/Kconfig.defconfig:58,
soc/sifive/sifive_freedom/fu500/Kconfig.defconfig:25,
soc/sifive/sifive_freedom/fu700/Kconfig.defconfig:25, soc/renesas/rz/rzn2l/Kconfig.defconfig:12,
soc/renesas/rz/rzt2l/Kconfig.defconfig:12, soc/renesas/rz/rzt2m/Kconfig.defconfig:13,
soc/renesas/rz/rzv2h/Kconfig.defconfig.rzv2h_cr8:9, soc/nxp/s32/s32k1/Kconfig.defconfig:15,
soc/nxp/s32/s32k3/Kconfig.defconfig:15, soc/nxp/s32/s32ze/Kconfig.defconfig:12,
soc/nxp/mcx/mcxw/mcxw2xx/Kconfig.defconfig:25, soc/nxp/imx/imx6sx/Kconfig.defconfig.mcimx6x_m4:8,
arch/Kconfig:1031) was assigned the value 'y' but got the value 'n'. Check these unsatisfied
dependencies: ((BT_STM32WBA && SOC_SERIES_STM32WBAX && SOC_FAMILY_STM32) || (IEEE802154_STM32WBA &&
SOC_SERIES_STM32WBAX && SOC_FAMILY_STM32) || (SOC_SERIES_SIFIVE_FREEDOM_FU500 &&
SOC_FAMILY_SIFIVE_FREEDOM) || (SOC_SERIES_SIFIVE_FREEDOM_FU700 && SOC_FAMILY_SIFIVE_FREEDOM) ||
(SOC_SERIES_RZN2L && SOC_FAMILY_RENESAS_RZ) || (SOC_SERIES_RZT2L && SOC_FAMILY_RENESAS_RZ) ||
(SOC_SERIES_RZT2M && SOC_FAMILY_RENESAS_RZ) || (SOC_R9A09G057H44GBG_CR8 && SOC_SERIES_RZV2H &&
SOC_FAMILY_RENESAS_RZ) || (SOC_SERIES_S32K1 && SOC_FAMILY_NXP_S32) || (SOC_SERIES_S32K3 &&
SOC_FAMILY_NXP_S32) || (SOC_SERIES_S32ZE && SOC_FAMILY_NXP_S32) || (BT && SOC_SERIES_MCXW2XX) ||
(SOC_MCIMX6X_M4 && SOC_SERIES_IMX6SX && SOC_FAMILY_NXP_IMX) || CPU_HAS_FPU) (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_FPU and/or look up FPU in the
menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values,
and Kconfig - Tips and Best Practices sections of the manual might be helpful too.

warning: QEMU_ICOUNT_SHIFT (defined at boards/Kconfig:74) was assigned the value '8' but got the
value ''. Check these unsatisfied dependencies: QEMU_ICOUNT (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_QEMU_ICOUNT_SHIFT and/or look up
QEMU_ICOUNT_SHIFT in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.

warning: FPU_SHARING (defined at arch/Kconfig:1051) was assigned the value 'y' but got the value
'n'. Check these unsatisfied dependencies: FPU (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_FPU_SHARING and/or look up FPU_SHARING in
the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration
Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.

Parsing /__w/zephyr/zephyr/tests/arch/arm/arm_thread_swap_tz/Kconfig
Loaded configuration '/__w/zephyr/zephyr/boards/arm/v2m_musca_b1/v2m_musca_b1_musca_b1_ns_defconfig'
Merged configuration '/__w/zephyr/zephyr/tests/arch/arm/arm_thread_swap_tz/prj.conf'
Merged configuration '/__w/zephyr/zephyr/twister-out/v2m_musca_b1_musca_b1_ns/zephyr/tests/arch/arm/arm_thread_swap_tz/arch.arm.swap.tz/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to '/__w/zephyr/zephyr/twister-out/v2m_musca_b1_musca_b1_ns/zephyr/tests/arch/arm/arm_thread_swap_tz/arch.arm.swap.tz/zephyr/.config'
Kconfig header saved to '/__w/zephyr/zephyr/twister-out/v2m_musca_b1_musca_b1_ns/zephyr/tests/arch/arm/arm_thread_swap_tz/arch.arm.swap.tz/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /opt/toolchains/zephyr-sdk-0.17.4/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38...


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix bug in Zephyr thread swap test Add TFM flash partitions to v2m_musca_b1_musca_b1_ns board Nov 23, 2025
Copilot AI requested a review from kartben November 23, 2025 17:24
@kartben kartben closed this Dec 6, 2025
@kartben kartben deleted the copilot/fix-zephyr-thread-swap-bug branch December 6, 2025 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants