From b8dcfe0ba34c00f0f9c98ceceeb2c7e8ca01acf4 Mon Sep 17 00:00:00 2001 From: Kevin Townsend Date: Mon, 17 May 2021 16:25:43 +0200 Subject: [PATCH] apps: microtvm: Disable `CONFIG_FPU ` for Zephyr runtime `CONFIG_FPU` was being enabled by default for every platform, regardless of whether or not the platform using the sample app actually had a HW FPU unit. As a result, FPU instructions may be included on platforms that aren't able to support them, or in a best-case scenario we will get a warning about the conflict during builds, which pollutes the CI output, in a worst-case scenario a fault. This change removes the `CONFIG_FPU=y` setting from being set at the application level, since this flag should be set at the chip level for any platform that has an FPU. Signed-off-by: Kevin Townsend --- .../zephyr/aot_demo/boards/nrf5340dk_nrf5340_cpuapp.conf | 3 +++ apps/microtvm/zephyr/aot_demo/boards/qemu_x86.conf | 3 +++ apps/microtvm/zephyr/aot_demo/prj.conf | 3 --- .../zephyr/host_driven/boards/nrf5340dk_nrf5340_cpuapp.conf | 3 +++ apps/microtvm/zephyr/host_driven/boards/nucleo_f746zg.conf | 3 +++ apps/microtvm/zephyr/host_driven/boards/qemu_riscv32.conf | 3 +++ apps/microtvm/zephyr/host_driven/boards/qemu_riscv64.conf | 3 +++ apps/microtvm/zephyr/host_driven/boards/stm32f746g_disco.conf | 3 +++ apps/microtvm/zephyr/host_driven/prj.conf | 3 --- 9 files changed, 21 insertions(+), 6 deletions(-) diff --git a/apps/microtvm/zephyr/aot_demo/boards/nrf5340dk_nrf5340_cpuapp.conf b/apps/microtvm/zephyr/aot_demo/boards/nrf5340dk_nrf5340_cpuapp.conf index d298325eb4a4..6c588c86b0d5 100644 --- a/apps/microtvm/zephyr/aot_demo/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/apps/microtvm/zephyr/aot_demo/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -29,3 +29,6 @@ CONFIG_TEST_RANDOM_GENERATOR=y # For debugging. CONFIG_LED=y + +# For models with floating point. +CONFIG_FPU=y diff --git a/apps/microtvm/zephyr/aot_demo/boards/qemu_x86.conf b/apps/microtvm/zephyr/aot_demo/boards/qemu_x86.conf index 5f3c4a4bed36..4b0e494068fa 100644 --- a/apps/microtvm/zephyr/aot_demo/boards/qemu_x86.conf +++ b/apps/microtvm/zephyr/aot_demo/boards/qemu_x86.conf @@ -23,3 +23,6 @@ CONFIG_TIMER_RANDOM_GENERATOR=y # Default stack size is 1k, this is required for debug mode. CONFIG_MAIN_STACK_SIZE=2000 + +# For models with floating point. +CONFIG_FPU=y diff --git a/apps/microtvm/zephyr/aot_demo/prj.conf b/apps/microtvm/zephyr/aot_demo/prj.conf index 5f4d7a0689dc..c6ab10e9d86e 100644 --- a/apps/microtvm/zephyr/aot_demo/prj.conf +++ b/apps/microtvm/zephyr/aot_demo/prj.conf @@ -28,8 +28,5 @@ CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_CPLUSPLUS=y CONFIG_NEWLIB_LIBC=y -# For models with floating point. -CONFIG_FPU=y - # For TVMPlatformAbort(). CONFIG_REBOOT=y diff --git a/apps/microtvm/zephyr/host_driven/boards/nrf5340dk_nrf5340_cpuapp.conf b/apps/microtvm/zephyr/host_driven/boards/nrf5340dk_nrf5340_cpuapp.conf index 149a69ea3b5b..511ff0121d32 100644 --- a/apps/microtvm/zephyr/host_driven/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/apps/microtvm/zephyr/host_driven/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -29,3 +29,6 @@ CONFIG_TEST_RANDOM_GENERATOR=y # For debugging. CONFIG_LED=y + +# For models with floating point. +CONFIG_FPU=y diff --git a/apps/microtvm/zephyr/host_driven/boards/nucleo_f746zg.conf b/apps/microtvm/zephyr/host_driven/boards/nucleo_f746zg.conf index eba023294894..33b08032c32e 100644 --- a/apps/microtvm/zephyr/host_driven/boards/nucleo_f746zg.conf +++ b/apps/microtvm/zephyr/host_driven/boards/nucleo_f746zg.conf @@ -28,3 +28,6 @@ CONFIG_ENTROPY_GENERATOR=y # For debugging. CONFIG_LED=y + +# For models with floating point. +CONFIG_FPU=y diff --git a/apps/microtvm/zephyr/host_driven/boards/qemu_riscv32.conf b/apps/microtvm/zephyr/host_driven/boards/qemu_riscv32.conf index 3733568ed02f..b94d96b11fba 100644 --- a/apps/microtvm/zephyr/host_driven/boards/qemu_riscv32.conf +++ b/apps/microtvm/zephyr/host_driven/boards/qemu_riscv32.conf @@ -24,6 +24,9 @@ CONFIG_TIMER_RANDOM_GENERATOR=y # Default is 512, raised here for operations with large floating point data. CONFIG_MAIN_STACK_SIZE=2048 +# For models with floating point. +CONFIG_FPU=y + # For floating point operations. It has exception on floating point operations # without this flag. CONFIG_FPU_SHARING=y diff --git a/apps/microtvm/zephyr/host_driven/boards/qemu_riscv64.conf b/apps/microtvm/zephyr/host_driven/boards/qemu_riscv64.conf index a8a055bcc748..1da5f054da46 100644 --- a/apps/microtvm/zephyr/host_driven/boards/qemu_riscv64.conf +++ b/apps/microtvm/zephyr/host_driven/boards/qemu_riscv64.conf @@ -23,3 +23,6 @@ CONFIG_TIMER_RANDOM_GENERATOR=y # Default 512, for operations with large floating point data. CONFIG_MAIN_STACK_SIZE=2048 + +# For models with floating point. +CONFIG_FPU=y diff --git a/apps/microtvm/zephyr/host_driven/boards/stm32f746g_disco.conf b/apps/microtvm/zephyr/host_driven/boards/stm32f746g_disco.conf index 505f1babc3f4..542faf28cd67 100644 --- a/apps/microtvm/zephyr/host_driven/boards/stm32f746g_disco.conf +++ b/apps/microtvm/zephyr/host_driven/boards/stm32f746g_disco.conf @@ -26,3 +26,6 @@ CONFIG_TEST_RANDOM_GENERATOR=y # For debugging. CONFIG_LED=n + +# For models with floating point. +CONFIG_FPU=y diff --git a/apps/microtvm/zephyr/host_driven/prj.conf b/apps/microtvm/zephyr/host_driven/prj.conf index 5f4d7a0689dc..c6ab10e9d86e 100644 --- a/apps/microtvm/zephyr/host_driven/prj.conf +++ b/apps/microtvm/zephyr/host_driven/prj.conf @@ -28,8 +28,5 @@ CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_CPLUSPLUS=y CONFIG_NEWLIB_LIBC=y -# For models with floating point. -CONFIG_FPU=y - # For TVMPlatformAbort(). CONFIG_REBOOT=y