On Wed, 2022-04-13 at 16:34 +0200, Seyed Abolfazl Mortazavizadeh wrote: > I have a problem in compiling code using STM32CubeIDE. The log is > as follows: > > [snip] > > cc1: error: bad value ('armv7e-m+fp.dp') for '-march=' switch > cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem [...] native > cc1: error: bad value ('cortex-m7') for '-mtune=' switch > cc1: note: valid arguments to '-mtune=' switch are: nocona core2 nehalem [...] native > > [snip] > > The code is working properly on another PC but I received these errors > using my laptop. How can I fix it? Any kind of information is appreciated. As you can see in the lines I quoted above, your compiler does not recognize the minimum-CPU-to-run-on (-march=<some ARMv7 flavour>) and best-CPU-to-run-on (-mtune=<Cortex-M7, i.e. what's inside your STM32>) values it's being passed, and the ones it says it will recognize are all x86 microarchitecture names. This means that you (or your IDE) is trying to compile your ARM code with an x86 compiler. You should see if your IDE came with a prebuilt ARM compiler (otherwise you'll need to download or build it), and once you're sure you have a compiler you should figure out why the IDE is not finding it and trying to use the x86 one instead. (Here by "an X compiler" I mean "a GCC compiler binary that runs on your development machine and generates binaries for X".) Because your problem is not with configuring GCC itself but with configuring your IDE to use GCC, you're unlikely to find help on this list; if you're unable to figure out the configuration yourself, try posting your question somewhere people actually talk about STM32CubeIDE---probably the ST forums? (Aside: Usually, when you're experiencing some sort of general build misconfiguration, *all* compilation will fail, so the length of the build log will be multiplied by the number of parallel build jobs you've allowed. If you're seeing that nothing compiles, like here, it's usually helpful to first retry with parallel building disabled, not because it will fix anything, but because you won't have to dig your way through a monster log like the one you posted.) -- Good luck, Alex