You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Simon Filgis <si...@ingenieurbuero-filgis.de> on 2023/03/08 16:56:54 UTC

Manjaro Distro

Dear all,

I switched to Manjaro a few weeks ago. Now I'm trying to build NuttX - of
course.

This packages where necessary so far:

sudo pacman -S ncurses base-devel gmp mpfr libisl elfutils expat
lib32-gcc-libs uboot-tools unzip


# Install genromfs as per PX4

wget
https://sourceforge.net/projects/romfs/files/genromfs/0.5.2/genromfs-0.5.2.tar.gz
tar zxvf genromfs-0.5.2.tar.gz
cd genromfs-0.5.2 && make && make install && cd ..
rm genromfs-0.5.2.tar.gz genromfs-0.5.2 -r


--

I cannot resolve the following error:
fatal error: math.h: No such file or directory

NuttX documentation says:

The math library header file, `math.h`, is a then special case.  If you do
nothing, the standard math.h header file that is provided with your
toolchain will be used.


Can somebody please give me a hint for how to overcome this?

Best regards,

Simon

--
Hard- and Softwaredevelopment Consultant
Ingenieurbüro-Filgis
USt-IdNr.: DE305343278

Re: Manjaro Distro

Posted by Sebastien Lorquet <se...@lorquet.fr>.
Yes on this. Distribution provided bare metal arm toolchains have always 
been a disappointment for me.

Sebastien

Le 09/03/2023 à 12:03, Petro Karashchenko a écrit :
> I think the best way is to install GCC from the ARM website and not using
> OS package manager.

Re: Manjaro Distro

Posted by Petro Karashchenko <pe...@gmail.com>.
On the libm: some time ago I tried to install the RISCV toolchain on Ubuntu
with apt and the installed toolchain was built without libm :)

In other words, running compiler + arch flags with "--print-file-name=libm.a"
option gave me an empty output (also "find gcc_folder -name libm.a" gave me
an empty result).

I think the best way is to install GCC from the ARM website and not using
OS package manager.

For the romfs error, maybe you can try to track romfs generation path and
try running it manually from console instead of running it from make. I
think it would be easier to narrow down an issue by executing steps
manually from the console.

Best regards,
Petro

чт, 9 бер. 2023 р. о 12:01 Simon Filgis <si...@ingenieurbuero-filgis.de>
пише:

> Hi all,
>
> thanks for answering.
>
> I'm still in build-phase. No runtime hard-fault. I'm using my fork on
> github https://github.com/SimonFilgis/incubator-nuttx
>
> Mr. Xiao nailed it. It choose to use the NuttX internal libm for the
> moment.
>
> But still something seems to miss, please have a look at the attached log.
>
> LD: nuttx
>> arm-none-eabi-ld --entry=__start -nostdlib --gc-sections --cref
>> -Map=/home/simon/projects/autococo2/temp/autococo2fw/nuttx/nuttx.map -g
>> -T/home/simon/projects/autococo2/temp/autococo2fw/nuttx/../autococo2-board/scripts/flash.ld
>>  -L /home/simon/projects/autococo2/temp/autococo2fw/nuttx/staging -L
>> /home/simon/projects/autococo2/temp/autococo2fw/nuttx/arch/arm/src/board  \
>>         -o /home/simon/projects/autococo2/temp/autococo2fw/nuttx/nuttx   \
>>         --start-group -lsched -ldrivers -lboards -lc -lmm -larch -lapps
>> -lnet -lfs -lbinfmt -lboard
>> /usr/lib/gcc/arm-none-eabi/12.2.0/thumb/v7e-m+dp/hard/libgcc.a --end-group
>> arm-none-eabi-ld: warning:
>> /home/simon/projects/autococo2/temp/autococo2fw/nuttx/nuttx has a LOAD
>> segment with RWX permissions
>> arm-none-eabi-ld:
>> /home/simon/projects/autococo2/temp/autococo2fw/nuttx/staging/libapps.a(nsh_romfsetc.c.home.simon.projects.autococo2.temp.autococo2fw.apps.nshlib.o):
>> in function `nsh_romfsetc':
>> /home/simon/projects/autococo2/temp/autococo2fw/apps/nshlib/nsh_romfsetc.c:97:
>> undefined reference to `romfs_img_len'
>> arm-none-eabi-ld:
>> /home/simon/projects/autococo2/temp/autococo2fw/apps/nshlib/nsh_romfsetc.c:97:
>> undefined reference to `romfs_img'
>> make[1]: *** [Makefile:159: nuttx] Error 1
>> make[1]: Leaving directory
>> '/home/simon/projects/autococo2/temp/autococo2fw/nuttx/arch/arm/src'
>> make: *** [tools/Unix.mk:509: nuttx] Error 2
>>
>
> Again romfs_img, I had this with the bitbucket pipeline a few days ago,
> xxd was missing. I cannot identify root cause with make V=1 (attached).
>
> Has anybody an idea?
>
> Simon
>
> --
> Hard- and Softwaredevelopment Consultant
> Ingenieurbüro-Filgis
> USt-IdNr.: DE305343278
>
>
> On Wed, Mar 8, 2023 at 7:43 PM Gregory Nutt <sp...@gmail.com> wrote:
>
>>
>> > Hi,
>> >
>> > I think that some key information is missing like what is the NuttX
>> version
>> > used. Is it mainline or some release or custom.
>> >
>> > Best regards,
>> > Petro
>>
>> It would be helpful to understand where and why the crash occurs too.
>> You can get that information by analyzing the stack.  See
>>
>> https://cwiki.apache.org/confluence/display/NUTTX/Analyzing+Cortex-M+Hardfaults
>> for an example.
>>
>> Without know why the hard fault occurs that is nothing anyone can really
>> do or say to be helpful (unless the problem can be replicated).
>>
>>

Re: Manjaro Distro

Posted by Simon Filgis <si...@ingenieurbuero-filgis.de>.
Hi all,

thanks for answering.

I'm still in build-phase. No runtime hard-fault. I'm using my fork on
github https://github.com/SimonFilgis/incubator-nuttx

Mr. Xiao nailed it. It choose to use the NuttX internal libm for the moment.

But still something seems to miss, please have a look at the attached log.

LD: nuttx
> arm-none-eabi-ld --entry=__start -nostdlib --gc-sections --cref
> -Map=/home/simon/projects/autococo2/temp/autococo2fw/nuttx/nuttx.map -g
> -T/home/simon/projects/autococo2/temp/autococo2fw/nuttx/../autococo2-board/scripts/flash.ld
>  -L /home/simon/projects/autococo2/temp/autococo2fw/nuttx/staging -L
> /home/simon/projects/autococo2/temp/autococo2fw/nuttx/arch/arm/src/board  \
>         -o /home/simon/projects/autococo2/temp/autococo2fw/nuttx/nuttx   \
>         --start-group -lsched -ldrivers -lboards -lc -lmm -larch -lapps
> -lnet -lfs -lbinfmt -lboard
> /usr/lib/gcc/arm-none-eabi/12.2.0/thumb/v7e-m+dp/hard/libgcc.a --end-group
> arm-none-eabi-ld: warning:
> /home/simon/projects/autococo2/temp/autococo2fw/nuttx/nuttx has a LOAD
> segment with RWX permissions
> arm-none-eabi-ld:
> /home/simon/projects/autococo2/temp/autococo2fw/nuttx/staging/libapps.a(nsh_romfsetc.c.home.simon.projects.autococo2.temp.autococo2fw.apps.nshlib.o):
> in function `nsh_romfsetc':
> /home/simon/projects/autococo2/temp/autococo2fw/apps/nshlib/nsh_romfsetc.c:97:
> undefined reference to `romfs_img_len'
> arm-none-eabi-ld:
> /home/simon/projects/autococo2/temp/autococo2fw/apps/nshlib/nsh_romfsetc.c:97:
> undefined reference to `romfs_img'
> make[1]: *** [Makefile:159: nuttx] Error 1
> make[1]: Leaving directory
> '/home/simon/projects/autococo2/temp/autococo2fw/nuttx/arch/arm/src'
> make: *** [tools/Unix.mk:509: nuttx] Error 2
>

Again romfs_img, I had this with the bitbucket pipeline a few days ago, xxd
was missing. I cannot identify root cause with make V=1 (attached).

Has anybody an idea?

Simon

--
Hard- and Softwaredevelopment Consultant
Ingenieurbüro-Filgis
USt-IdNr.: DE305343278


On Wed, Mar 8, 2023 at 7:43 PM Gregory Nutt <sp...@gmail.com> wrote:

>
> > Hi,
> >
> > I think that some key information is missing like what is the NuttX
> version
> > used. Is it mainline or some release or custom.
> >
> > Best regards,
> > Petro
>
> It would be helpful to understand where and why the crash occurs too.
> You can get that information by analyzing the stack.  See
>
> https://cwiki.apache.org/confluence/display/NUTTX/Analyzing+Cortex-M+Hardfaults
> for an example.
>
> Without know why the hard fault occurs that is nothing anyone can really
> do or say to be helpful (unless the problem can be replicated).
>
>

Re: Manjaro Distro

Posted by Gregory Nutt <sp...@gmail.com>.
> Hi,
>
> I think that some key information is missing like what is the NuttX version
> used. Is it mainline or some release or custom.
>
> Best regards,
> Petro

It would be helpful to understand where and why the crash occurs too.  
You can get that information by analyzing the stack.  See 
https://cwiki.apache.org/confluence/display/NUTTX/Analyzing+Cortex-M+Hardfaults 
for an example.

Without know why the hard fault occurs that is nothing anyone can really 
do or say to be helpful (unless the problem can be replicated).


Re: Manjaro Distro

Posted by Petro Karashchenko <pe...@gmail.com>.
Hi,

I think that some key information is missing like what is the NuttX version
used. Is it mainline or some release or custom.

Best regards,
Petro

On Wed, Mar 8, 2023, 7:24 PM Xiang Xiao <xi...@gmail.com> wrote:

> On Thu, Mar 9, 2023 at 12:57 AM Simon Filgis <
> simon@ingenieurbuero-filgis.de>
> wrote:
>
> > Dear all,
> >
> > I switched to Manjaro a few weeks ago. Now I'm trying to build NuttX - of
> > course.
> >
> > This packages where necessary so far:
> >
> > sudo pacman -S ncurses base-devel gmp mpfr libisl elfutils expat
> > lib32-gcc-libs uboot-tools unzip
> >
> >
> > # Install genromfs as per PX4
> >
> > wget
> >
> >
> https://sourceforge.net/projects/romfs/files/genromfs/0.5.2/genromfs-0.5.2.tar.gz
> > tar zxvf genromfs-0.5.2.tar.gz
> > cd genromfs-0.5.2 && make && make install && cd ..
> > rm genromfs-0.5.2.tar.gz genromfs-0.5.2 -r
> >
> >
> > --
> >
> > I cannot resolve the following error:
> > fatal error: math.h: No such file or directory
> >
> > NuttX documentation says:
> >
> > The math library header file, `math.h`, is a then special case.  If you
> do
> > nothing, the standard math.h header file that is provided with your
> > toolchain will be used.
> >
>
> > Can somebody please give me a hint for how to overcome this?
> >
> >
> Which toolchain do you use? You have two choices now:
>
>    - CONFIG_LIBM=y which enable libm provided by nuttx
>    - CONFIG_LIBM_TOOLCHAIN=y which select libm provided by toolchain
>
> New selection will come soon, e.g.:
> https://github.com/JuliaMath/openlibm
> https://gitlab.com/gtd-gmbh/libmcs
>
> For more info, please reference this PR:
> https://github.com/apache/nuttx/pull/8584
>
> Best regards,
> >
> > Simon
> >
> > --
> > Hard- and Softwaredevelopment Consultant
> > Ingenieurbüro-Filgis
> > USt-IdNr.: DE305343278
> >
>

Re: Manjaro Distro

Posted by Xiang Xiao <xi...@gmail.com>.
On Thu, Mar 9, 2023 at 12:57 AM Simon Filgis <si...@ingenieurbuero-filgis.de>
wrote:

> Dear all,
>
> I switched to Manjaro a few weeks ago. Now I'm trying to build NuttX - of
> course.
>
> This packages where necessary so far:
>
> sudo pacman -S ncurses base-devel gmp mpfr libisl elfutils expat
> lib32-gcc-libs uboot-tools unzip
>
>
> # Install genromfs as per PX4
>
> wget
>
> https://sourceforge.net/projects/romfs/files/genromfs/0.5.2/genromfs-0.5.2.tar.gz
> tar zxvf genromfs-0.5.2.tar.gz
> cd genromfs-0.5.2 && make && make install && cd ..
> rm genromfs-0.5.2.tar.gz genromfs-0.5.2 -r
>
>
> --
>
> I cannot resolve the following error:
> fatal error: math.h: No such file or directory
>
> NuttX documentation says:
>
> The math library header file, `math.h`, is a then special case.  If you do
> nothing, the standard math.h header file that is provided with your
> toolchain will be used.
>

> Can somebody please give me a hint for how to overcome this?
>
>
Which toolchain do you use? You have two choices now:

   - CONFIG_LIBM=y which enable libm provided by nuttx
   - CONFIG_LIBM_TOOLCHAIN=y which select libm provided by toolchain

New selection will come soon, e.g.:
https://github.com/JuliaMath/openlibm
https://gitlab.com/gtd-gmbh/libmcs

For more info, please reference this PR:
https://github.com/apache/nuttx/pull/8584

Best regards,
>
> Simon
>
> --
> Hard- and Softwaredevelopment Consultant
> Ingenieurbüro-Filgis
> USt-IdNr.: DE305343278
>