I am using a Xilinx Zynq-7000 (ARM Cortex A9) with FreeRTOS. I recently had the problem that my interrupt service routine wrote into memory regions it was not supposed to due to a stack overflow. The problem was not solved by only increasing the IRQ stack size in the linker script. I found out that the ISR was using the supervisor stack. After increasing the size of the supervisor stack the stack overflow disappeared. Can you explain to me why the ISR uses the supervisor stack and why it was neccessary to increase the size of the supervisor stack?
The ARM architecture uses multiple stacks for different hardware levels of operation (traps, interrupts[fast, nested], system software interrupt, user programs), so you need to make room in the stack that will be used by that operation.On ARM architectures, FreeRTOS triggers a supervisor interrupt to do the context switch between tasks.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.