Skip to main content
Visitor II
February 22, 2024
Question

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

  • February 22, 2024
  • 2 replies
  • 2463 views

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.

InternalSegmentationFault_O2.jpg

 

Can someone tell the reason for internal Segmentation fault and help to fix it?

 

Best Regards

Saurav

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    February 23, 2024

    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'

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

     

    Best Regards,

    Younes

    Visitor II
    February 28, 2024

    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: 

    https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi.zip?rev=82f0e95b5a7740d9899e6ce375df8106&hash=279E24D725F493C4E3B90C8B2A159813A91CD29C

     

    Best Regards

    Saurav

     

    Visitor II
    May 7, 2024

    @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