Showing results for 
Search instead for 
Did you mean: 

Compilation error : internal segmentation fault with GNU Toolchain 11.3.Rel1 for STM32U5


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


ST Employee

Hello @SauravShandilya 

To reproduce the issue, I used the DMA_LinkedList example of the STM32U5CubeFW:


I'm using  C/C++ ARM GNU Toolchain version, 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'

  • Can you check with only keeping '-D' 'USE_FULL_LL_DRIVER'
  • Can you also add the following option to compilation:   -std=gnu11


Best Regards,


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