build ArduCopter-3.2 failed

Hi guys

Here is the steps I build ArduCopter-3.2 version:

1. git clone 3 databases

https://github.com/diydrones/ardupilot.git

https://github.com/diydrones/PX4Firmware.git

https://github.com/diydrones/PX4Nuttx.git

2. each datebase checkout to ArduCopter-3.2 branch

#git checkout  ArduCopter-3.2

3. In scketch sources generare config.mk

#cd ArduCopter

#make configure

3. modify  config.mk with correct PX4Firmware PX4Nuttx path

4. cd ArduCopter

5. make px4

 

But build failed in nuttx source building with follow info(unknown type name '_LONG_LONG_TYPE'):

I belive 3.2 is a mature version, some problem with me?

In file included from /home/xuming/uav/ardupilot.3.2/PX4NuttX/nuttx/include/math.h:52:0,
                 from ./stdio/lib_libdtoa.c:47,
                 from stdio/lib_libvsprintf.c:230:
/home/xuming/uav/ardupilot.3.2/PX4NuttX/nuttx/include/arch/math.h:257:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
 extern _LONG_LONG_TYPE int llrint _PARAMS((double));
                        ^
/home/xuming/uav/ardupilot.3.2/PX4NuttX/nuttx/include/arch/math.h:327:8: error: unknown type name '_LONG_LONG_TYPE'
 extern _LONG_LONG_TYPE llrintf _PARAMS((float));
        ^
/home/xuming/uav/ardupilot.3.2/PX4NuttX/nuttx/include/arch/math.h:420:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
 extern _LONG_LONG_TYPE int llroundl _PARAMS((long double));
                        ^
In file included from stdio/lib_libvsprintf.c:230:0:
./stdio/lib_libdtoa.c: In function 'lib_dtoa':
./stdio/lib_libdtoa.c:207:13: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
   if (value == 0 || expt < -prec)
             ^
./stdio/lib_libdtoa.c:153:13: warning: variable 'digalloc' set but not used [-Wunused-but-set-variable]
   FAR char *digalloc;   /* Copy of digits to be freed after usage */
             ^
make[3]: *** [bin/lib_libvsprintf.o] Error 1
make[2]: *** [libc/libc.a] Error 2
make[1]: *** [/home/xuming/uav/ardupilot.3.2/PX4Firmware/Archives/px4fmu-v1.export] Error 2
make[1]: Leaving directory `/home/xuming/uav/ardupilot.3.2/PX4Firmware'
make: *** [../PX4Firmware/Archives/px4fmu-v1.export] Error 2
xuming@xuming-ubuntu:~/uav/ardupilot.3.2/ArduCopter$

read any object file elf info:

xuming@xuming-ubuntu:~/uav/ardupilot.3.2/PX4NuttX/nuttx$ readelf -Wa ./libc/bin/lib_printf.o

No version information found in this file.
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "Cortex-M4"
  Tag_CPU_arch: v7E-M
  Tag_CPU_arch_profile: Microcontroller
  Tag_THUMB_ISA_use: Thumb-2
  Tag_FP_arch: VFPv4-D16
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: small
  Tag_ABI_HardFP_use: SP only
  Tag_ABI_VFP_args: VFP registers
  Tag_ABI_optimization_goals: Aggressive Size
  Tag_CPU_unaligned_access: v6

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

    • Thanks Derek.

      The fix on master not on 3.2 branch.

      Can this fix be merged to 3.2?

  • When I comment off "*_LONG_LONG_TYPE", build succesfully.

    Is it correct with below changes?  comment off " /*_LONG_LONG_TYPE*/" and add "int" in 2 lines.

    where I can find defination  "_LONG_LONG_TYPE", how others build successfully without comment off _LONG_LONG_TYPE.

    diff --git a/nuttx/arch/arm/include/math.h b/nuttx/arch/arm/include/math.h
    index b9557ad..8088234 100644
    --- a/nuttx/arch/arm/include/math.h
    +++ b/nuttx/arch/arm/include/math.h
    @@ -254,7 +254,7 @@ extern double scalbln _PARAMS((double, long int));
     
    -extern _LONG_LONG_TYPE int llrint _PARAMS((double));
    +extern /*_LONG_LONG_TYPE*/ int llrint _PARAMS((double));

     extern long long int llround _PARAMS((double));
    @@ -324,7 +324,7 @@ extern float scalblnf _PARAMS((float, long int));
     
     extern long int lrintf _PARAMS((float));
    -extern _LONG_LONG_TYPE llrintf _PARAMS((float));
    +extern /*_LONG_LONG_TYPE*/ int llrintf _PARAMS((float));
     
     extern long long int llroundf _PARAMS((float));
    @@ -417,7 +417,7 @@ extern long int lrintl _PARAMS((long double));
     
     extern long lroundl _PARAMS((long double));
    -extern _LONG_LONG_TYPE int llroundl _PARAMS((long double));
    +extern /*_LONG_LONG_TYPE*/ int llroundl _PARAMS((long double));
     
     extern long double fdiml _PARAMS((long double, long double));
    @@ -437,7 +437,7 @@ extern long double erfcl _PARAMS((long double));
     /* Other long double precision functions.  */

     extern long int lrintl _PARAMS((_LONG_DOUBLE));
    -extern _LONG_LONG_TYPE llrintl _PARAMS((_LONG_DOUBLE));
    +extern /*_LONG_LONG_TYPE*/ int llrintl _PARAMS((_LONG_DOUBLE));
     #endif /* __i386__ */
     #endif /* !_LDBL_EQ_DBL */

This reply was deleted.

Activity