2024-02-21 07:37 PM
Hello Community,
I am getting internal compiler error: Segmentation fault when optimization is set to O2 or O3. I am using GNU C17 (Arm GNU Toolchain 11.3.Rel1) version 11.3.1 20220712 toolchain.
I am compiling code for STM32U575ZI MCU. Compilation goes through without error when optimization is set to O0 or O1. As soon as Optimization is set to O2 and above, I see the compiler error: internal segmentation fault. Below is screenshot of error. Also attached is compilation log.
Can someone tell the reason for internal Segmentation fault and help to fix it?
Best Regards
Saurav
2024-02-23 02:34 PM - edited 2024-02-23 02:41 PM
Hello @SauravShandilya
To reproduce the issue, I used the DMA_LinkedList example of the STM32U5CubeFW:
(~\STM32Cube_FW_U5_V1.4.0\Projects\NUCLEO-U575ZI-Q\Examples\DMA\DMA_LinkedList)
I'm using C/C++ ARM GNU Toolchain version 11.3.0.202307110141, I tried all the optimization options and it is working on my side. By comparing the compilation flags versus the one you shared shared, I see that you enabled both '-D' 'USE_FULL_LL_DRIVER' '-D' 'USE_HAL_DRIVER'
Best Regards,
Younes
2024-02-27 10:57 PM
Hi @CMYL ,
Thank you for sharing a response.
I removed -DUSE_HAL_DRIVER and added -std=gnu11 in compilation flag. However, that did not resolve the issue on my side.
I can notice the difference in Toolchain version. You are using 11.3.0 whereas I am using 11.3.Rel1. As per Arm GNU Toolchain Downloads – Arm Developer 11.3.0 can not be download and I am using 11.3.Rel1 in production code which is difficult to change.
Can you check with same Toolchain which I am using, which is 11.3.Rel1. Below is link of toolchain:
Best Regards
Saurav
2024-05-07 09:05 AM
@SauravShandilya @CMYL Was there any resolution to this issue? I am having the same problem occur when using STM32CubeCLT 1.15.1 when building in Release. I see that my compiler version is also 11.3.1.Rel1. I'd like to get this resolved so that I can continue using STM32CubeCLT with the VS Code extension, and not have to move to an externally managed compiler version.
- Jacob