Bad Timing error on ODrive based motor controller

Hi, we are Embedded Systems Engineers at Project MARCH. Every year we make an exoskeleton with 27 students and last year we have switched from the ODrive to the “MDrive”. This is basically an ODrive but with some changes made to it, such as adding a LAN chip to allow us to communicate over EtherCAT. This year we decided to introduce a more powerful chip on the motor controller, we switched to the STM32F745ZGT6.

This of course resulted in us having to change a lot about the code. All old chip backend files had to be updated to the new chip’s files. We used STM32CubeIDE to set everything up the same way as the ODrive, but once we wanted to test the new motor controller, we got the BAD_TIMING_ERROR. For some reason, the ADCs are not ready in time for the control loop to read them out. We configured the clocks exactly the same way, as far as we can see.

So our question is, does anybody have an idea what the reason behind this could be? We could provide code if needed or you can go to our gitlab repository.

Please feel free to ask for more information if it helps!