I have been fighting with a problem for the past few days as I port a board over from an STM32L433CC to an STM32L452CE. Code that runs fine on the L433CC causes a hard fault on the L452CE. After quite a bit of effort, I narrowed the problem down to code and data that I have in SRAM2. This fits in 16KB on the L433CC and works fine on that chip. Simply adding the code in blue is enough to make the part trigger a usage fault with an INVALID STATE sometime within 10-300 seconds of running.
const arm_fir_instance_f32 * S,
float32_t * pSrc,
float32_t * pDst,
uint32_t blockSize) __attribute__((section(".bss2")));
With the code running from either FLASH or from SRAM1, it works fine.
This would be acceptable if it failed immediately because my linker script was wrong or my startup code was not initializing SRAM2 properly. But that's not the case. The code works fine for a while, churning through many blocks of data. I have looked through the reference manual for both parts and I don't see any issues with the way I am using SRAM2.
While the FIR filter is executing in SRAM2 (against data held in SRAM1) there is data being moved from ADC1 to a circular buffer in SRAM1 via DMA (DMA 1, Channel 1), clocked by TIM6 at 26400 sps.
The SysClk is 80MHz via a 16MHz HSE.
I'm going to try to narrow this down to a very simple test case. In the meantime, is there anything I should look at with my usage of SRAM2 on the STM32L452CE?