From 384a1dcf66b11dd3b64ef927c433e274d188ac63 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 25 Sep 2018 08:43:54 -0700 Subject: [PATCH] px4cannode-v1 nsh: Disable ARCH_IRQPRIO & ARCH_HIPRI_INTERRUP This insures the common exception handler will not be re-entered. The handler does not support nested interrupts and the interrupt stack pointer and context will be overwritten resulting in hard to debug hardfaults. If all the priorities are equal the NVIC prevents the preemption. The startup code defaults all the priorities to the same value 128. This change safeguards in 2 ways 1) By disabling CONFIG_ ARCH_IRQPRIO: up_prioritize_irq cannot be called. This will insure that all HW interrupts are at the same priority. 2) By disabling CONFIG_ARCH_HIPRI_INTERRUP, the common exception will disable any interrupts during interrupt processing. --- .../nuttx/nuttx-configs/px4cannode-v1/nsh/defconfig.nonsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/nuttx/nuttx-configs/px4cannode-v1/nsh/defconfig.nonsh b/platforms/nuttx/nuttx-configs/px4cannode-v1/nsh/defconfig.nonsh index 496afb488d..d35f797bf2 100644 --- a/platforms/nuttx/nuttx-configs/px4cannode-v1/nsh/defconfig.nonsh +++ b/platforms/nuttx/nuttx-configs/px4cannode-v1/nsh/defconfig.nonsh @@ -414,7 +414,7 @@ CONFIG_ARCH_HAVE_MPU=y # CONFIG_ARCH_NAND_HWECC is not set # CONFIG_ARCH_HAVE_EXTCLK is not set # CONFIG_ARCH_USE_MPU is not set -CONFIG_ARCH_IRQPRIO=y +# CONFIG_ARCH_IRQPRIO is not set CONFIG_ARCH_STACKDUMP=y # CONFIG_ENDIAN_BIG is not set # CONFIG_ARCH_IDLE_CUSTOM is not set @@ -434,7 +434,7 @@ CONFIG_BOARD_LOOPSPERMSEC=5483 CONFIG_ARCH_HAVE_INTERRUPTSTACK=y CONFIG_ARCH_INTERRUPTSTACK=360 CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y -CONFIG_ARCH_HIPRI_INTERRUPT=y +# CONFIG_ARCH_HIPRI_INTERRUPT is not set # # Boot options