I recently updated a project to a new version of a library and to arm-gcc 13, and my code began to Hard Fault when uploading to the device. Figuring it was an issue with the code, I extensively looked into the issue, and can currently only assume it is an Ozone issue. I have also tried this with multiple Ozone versions, different boards, multiple JLinks, and different computers.
Ozone versions used: 3.28 - 3.38c.
The attached image shows the disassembly for the code in question. The first breakpoint is at the main for my program. R2 has a value of 0 at this point. If I press play, jumping to the second breakpoint, R2 then has a value of 0x2000 BE00, which points to an invalid value. The value that is stored at R3 in memory is 0x2000 0C00, which I can see both in the watched data, and that if I step through each instruction, the correct value is loaded into R2. The hard fault is then caused by trying to move the program counter to a random location in memory, as these are tasks for a scheduler. I tried to reproduce this error using a different debugger, gdb, and was unable to do so.
I am also having a second issue, where Watched Data refreshing does not update unless I detach and then Attach to running program. This did not happen before updating to the new version. I believe it is related to the first issue, using "Reset and Break at Symbol" or uploading new code causes the Watched Data to not longer live update, regardless of hitting the hard fault.
I am uploading the project files, so that it could be tested. I use an STM32F427II, but I would be able to compile the code for another ST microcontroller. I have also linked a video of the issue to show it happening live:
Ozone versions used: 3.28 - 3.38c.
The attached image shows the disassembly for the code in question. The first breakpoint is at the main for my program. R2 has a value of 0 at this point. If I press play, jumping to the second breakpoint, R2 then has a value of 0x2000 BE00, which points to an invalid value. The value that is stored at R3 in memory is 0x2000 0C00, which I can see both in the watched data, and that if I step through each instruction, the correct value is loaded into R2. The hard fault is then caused by trying to move the program counter to a random location in memory, as these are tasks for a scheduler. I tried to reproduce this error using a different debugger, gdb, and was unable to do so.
I am also having a second issue, where Watched Data refreshing does not update unless I detach and then Attach to running program. This did not happen before updating to the new version. I believe it is related to the first issue, using "Reset and Break at Symbol" or uploading new code causes the Watched Data to not longer live update, regardless of hitting the hard fault.
I am uploading the project files, so that it could be tested. I use an STM32F427II, but I would be able to compile the code for another ST microcontroller. I have also linked a video of the issue to show it happening live: