public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexander Shpilkin <ashpilkin@gmail.com>
To: Seyed Abolfazl Mortazavizadeh <mortazavi1369@gmail.com>,
	 gcc-help@gcc.gnu.org
Subject: Re: Nucleo F767ZI, STM32CubeIDE problem, CC1 error
Date: Wed, 13 Apr 2022 23:49:21 +0300	[thread overview]
Message-ID: <f83e3a242867e77fdd6d679aaaa830c0784acc6d.camel@gmail.com> (raw)
In-Reply-To: <CAAG=NiG29EC6vTQ0F8gmZnAfeW7i=egZYuc2q-4wfhfy7YWpgQ@mail.gmail.com>

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

      reply	other threads:[~2022-04-13 20:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13 13:44 Gcc problem Seyed Abolfazl Mortazavizadeh
2022-04-13 13:57 ` Jonathan Wakely
2022-04-13 14:34 ` Nucleo F767ZI, STM32CubeIDE problem, CC1 error Seyed Abolfazl Mortazavizadeh
2022-04-13 20:49   ` Alexander Shpilkin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f83e3a242867e77fdd6d679aaaa830c0784acc6d.camel@gmail.com \
    --to=ashpilkin@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=mortazavi1369@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).