Error: E31 Remote Failure Reply, when starting code in debug mode
Hello all, I am currently trying to get my STM32F411RE code working in Atollic TrueStudio. This project leverages the use of DMA and CMSIS-DSP which are all working in TrueStudio to find freqeuncy outcomes. The issues at hand is that I can upload my code to the STM32 board in the debug mode, but that this crashes once I attempt to resume the code and execute the main loop.
I upload the code to the board using the ST32 Cubeprogrammer CLI, which downloads and verifies the code without any hiccups. It then switches over to the ST-Link which executes the setup code and stops at the (auto inserted per GDB) breakpoint just before the main. Executing the code then yields:
TraceCaptureStart and SWV event set to APP_TRUE
ST-LINK device status: RUN_MODE
ST-LINK device status: Failed to get status, Target not responding, retrying...
Target is not responding, retrying....
ST-LINK device status: Failed to get status, Target not responding, retrying...
Target is not responding, retrying....
ST-LINK device status: Failed to get status, Target not responding, retrying...
Target is not responding, retrying....It then keeps repeating those 2 lines until it times out and kicks me back to the editor environment.
Then by using the GDB Trace option (inside the debug configurations) I was able to find that the resulting error is
Warning: remote failure reply: E31which by searching around (on this forum) yielded that this is an error with the GDB server. I tried to run the GDB server as a remote client, but this yielded the exact same issues. This link shows the GDB trace code up until the breakpoint (https://pastebin.com/9kygHtwD), whilst this link shows the code after proceeding past the breakpoint by resuming the code execution (https://pastebin.com/tHNwR7Hy).
I am now wondering if perhaps it has something to do with the code itself? I have included my total code here (https://pastebin.com/XWsS7urd), whilst the setup() and main() can be found here (https://pastebin.com/Lj24zvge).
Because of these errors I also have to erase my chip (ST-Link or STCubeProgrammer) after debugging before I can upload my code again; I presume this is because of the board not being shutdown correctly with the debugger crashing? Or would I need to do this always?
EDIT: as per my reaction in the comments, I have tried to upload a newly generated project (from CubeMX) onto the board and I still get the same issues. So it is either something to do with my toolchain or it is due to the STCubeMX standard code