STM32 gets stuck in HardFault_Handler loop

I am working on developing a custom version of the hardware using the same STM32F405 but also using the DRV8323.

I had gotten everything working nicely using the V4 firmware. I’ve migrated to RC0.5.1 and managed to also get the system work with 2x drv boards and the stm32.

The problem is if I try to use just the STM32 with no drv boards attached (something that makes testing of the hardware easier).

If I flash, it succeeds, and then I try to access the odrivetool via the native usb interface. It locks up on simple commands like odrv0.

I’ve gone into the debugger in VSCode and the problem seems to be with the vTaskDelete() at the end of odrive_main().

Once this is called, the system seems to hard fault (it is getting stuck in the get_regs while(stay_looping).

Commenting this out showed an issue with uxTaskGetStackHighWaterMark().

I’m unable to decipher what is happening. I’ve also tried setting the axis_count to 0 without any effect.

I’m hoping you can help me figure out what is causing this to happen so I can continue my debugging.

Thanks in advance,
Matt