A problem with '-fcyclomatic-complexity'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-29 9:46 AM
I'm using kali linux and the latest version of arm gcc available on arm website and the latest CubeIDE. When I first set everything up everything was working fine, but then I created an empty project for another MCU(STM32 G030F6P6) and got the following issue:
"arm-none-eabi-gcc: error: unrecognized command-line option '-fcyclomatic-complexity"
I've looked almost all available info up, I tried to turn off this flag in properties, but that didn't help at all.
Moreover, this log comes outta HAL dependencies
([Drivers/STM32G0xx_HAL_Driver/Src/subdir.mk:31: Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_gpio.o] Error 1)
but the thing is tho, I'm using LL, not HAL, so I'm completely confused why'd I get this.
Also, after I got this, i can't even run the previous projects that worked fine...
I've been searching information about this plugin or whatever that thing is for 2-3 hours, and i couldn't find even what this is, not saying about any ways of fixing this issue.
P.S: I tried re-installing CubeIDE, didn't help at all.
Thanks.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-29 10:41 AM
UPD: After a break I've decided to read the traceback properly. Turns out I only turned off fcyclomatic-complexity only for main.c, not for the whole project.
The problem is solved.
(for anyone else like me, you need to click on the project name and only then go to File, Properties, C/C++ build, Miscellaneous)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-29 10:41 AM
UPD: After a break I've decided to read the traceback properly. Turns out I only turned off fcyclomatic-complexity only for main.c, not for the whole project.
The problem is solved.
(for anyone else like me, you need to click on the project name and only then go to File, Properties, C/C++ build, Miscellaneous)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-24 12:21 PM
Hi rambo,
I got the same problem. Is there a setting within the STM32CubeIDE with which I can set the fcyclomatic complexity for the whole project or to disable it?
Best regards, Leon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-28 1:04 PM - edited ‎2025-05-28 1:24 PM
Nevermind, I think I've been able to answer my own question. The question LeonBoe asked is pretty simple in Cube 1.18.0. In the project explorer, right-click on top level project icon and click Properties (way down the bottom of the context menu) and expand C/C++ Build and click Settings. Then under the tool settings tab, expand MCU/MPU GCC Compiler, click Miscellaneous and the "Cyclomatic Complexity" option should appear. Since I started with the overall project instead of one of the component files, the setting applies to the entire project.
As far as the compiler is concerned, the location of the compiler appears in another place in the settings: In the Environment properties for C/C++ Build, the path to the custom version of arm-none-eabi-gcc appears there. I should be able to set the path at the command line when invoking the makefile and the option should be accepted by the version of compiler contained in the path.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-28 1:21 PM
> Is there an advantage to having "cyclomatic complexity" turned on?
If you want to see it: yes. If not: no.
Just maybe you should read about it...then you know, need or not want it.
-> https://www.ibm.com/docs/en/raa/6.1.0?topic=metrics-cyclomatic-complexity
+
>What about the version of arm-none-eabi-gcc?
Set it in IDE...if you know,what you do. Otherwise leave the installed version.
You can adjust a lot in : menu: -> project -> properties... settings..
Read the manual, see tutorial + videos....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-28 1:40 PM
Yep, that works! Here's a little script I made to make it easy:
#!/bin/bash
PATH=/opt/st/stm32cubeide_1.18.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.linux64_1.0.0.202410170706/tools/bin:/opt/st/stm32cubeide_1.18.0/plugins/com.st.stm32cube.ide.mcu.externaltools.make.linux64_2.2.0.202409170845/tools/bin:$PATH
make all
