Compiling example code of nuttx rtos from terminal

92 views
Skip to first unread message

anupam mishra

unread,
Jun 22, 2020, 8:30:20 AM6/22/20
to NuttX
I am trying to these step for compiling the code through the terminal, entering in that code section compiling the code but it is showing:-
endo@endo:~/nuttxspace/nuttx/boards/arm/stm32f7/nucleo-144$ ls
configs  include  Kconfig  README.txt  scripts  src
endo@endo:~/nuttxspace/nuttx/boards/arm/stm32f7/nucleo-144$

error

endo@endo:~/nuttxspace/nuttx/boards/arm/stm32f7/nucleo-144/src$ gcc stm32_userleds.c -o stm32_userleds
stm32_userleds.c:42:10: fatal error: nuttx/config.h: No such file or directory
 #include <nuttx/config.h>
          ^~~~~~~~~~~~~~~~
compilation terminated.

Please give solution for that problem.

Alan Carvalho de Assis

unread,
Jun 22, 2020, 8:59:18 AM6/22/20
to nu...@googlegroups.com
Hi Anupam,

You cannot do it this way. Please search a little bit more about
cross-compiling to understand more about it.

Just a quick explanation: your "gcc" is prepared to compile only for
your host processor family (i.e. AMD64). So it will not compile for
ARM. Also, even if your host was ARM it could not compile correctly
for ARM Cortex-M7 in your case.

You should use the arm-none-eabi-gcc for this purpose, but even using
it you will face many issues because you need to setup the right
CFLAGS, LDFLAGS, etc.

People spent much time developing the building system to simplify the
compilation, so I suggest you to use it.

BR,

Alan
> --
> You received this message because you are subscribed to the Google Groups
> "NuttX" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nuttx+un...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nuttx/f53a8508-f126-4a92-8564-ae1cb9944b4bo%40googlegroups.com.
>
Reply all
Reply to author
Forward
0 new messages