Failed to compile the Odrive firmware on Ubuntu

Hi,

I’m using Ubuntu to compile the Odrive firmware and below are my ubuntu environment to compile the firmware.

arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20150529 (release)
GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
Open On-Chip Debugger 0.5.0 (2011-12-03-10:15)
tup 0.7.2-12-ga582fee

I ran into whole bunch of errors below.
Your help is really appreciated to help me to move on to next steps.

Thanks in Advance.
Phi

    1. arm-none-eabi-g++ -std=c++14 -c MotorControl/low_level.cpp -DHW_VERSION_MAJOR=3 -DHW_VERSION_MINOR=5 -DHW_VERSION_VOLTAGE=24 -DUSB_PROTOCOL_NATIVE -DUART_PROTOCOL_ASCII -D__weak=“attribute((weak))” -D__packed=“attribute((packed))” -DUSE_HAL_DRIVER -DSTM32F405xx -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -Wall -Wdouble-promotion -Wfloat-conversion -fdata-sections -ffunction-sections -O2 -ffast-math -fno-finite-math-only -IDrivers/DRV8301 -IMotorControl -Ifibre/cpp/include -I. -IBoard/v3/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -IBoard/v3/Middlewares/Third_Party/FreeRTOS/Source/include -IBoard/v3/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -IBoard/v3/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -IBoard/v3/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc -IBoard/v3/Drivers/STM32F4xx_HAL_Driver/Inc -IBoard/v3/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -IBoard/v3/Drivers/CMSIS/Device/ST/STM32F4xx/Include -IBoard/v3/Drivers/CMSIS/Include -IBoard/v3/Inc -I. -IDrivers/DRV8301 -o build/obj/MotorControl_low_level.cpp.o
      In file included from MotorControl/odrive_main.h:12:0,
      from MotorControl/low_level.cpp:22:
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of 'ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<Tail …> >::ProtocolFunction(const ProtocolFunction<TObj, std::tuple<Elements …>, std::tuple<Tail …> >&) [with TObj = Encoder; TInputs = {long int}; TOutputs = {}]’:
      fibre/cpp/include/fibre/protocol.hpp:625:8: required from here
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: cannot convert ‘const std::array<const char*, 1u>’ to ‘const char*’ in initialization
      output_properties
      (PropertyListFactory<TOutputs…>::template make_property_list<0>(output_names
      , out_args
      ))
      ^
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >&) [with TObj = Controller; TInputs = {float, float, float}; TOutputs = {}]’:
      fibre/cpp/include/fibre/protocol.hpp:625:8: required from here
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: cannot convert ‘const std::array<const char*, 3u>’ to ‘const char*’ in initialization
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >&) [with TObj = Controller; TInputs = {float, float}; TOutputs = {}]’:
      fibre/cpp/include/fibre/protocol.hpp:625:8: required from here
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: cannot convert ‘const std::array<const char*, 2u>’ to ‘const char*’ in initialization
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >&) [with TObj = Controller; TInputs = {float}; TOutputs = {}]’:
      fibre/cpp/include/fibre/protocol.hpp:625:8: required from here
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: cannot convert ‘const std::array<const char*, 1u>’ to ‘const char*’ in initialization
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >&) [with TObj = Controller; TInputs = {float, bool}; TOutputs = {}]’:
      fibre/cpp/include/fibre/protocol.hpp:625:8: required from here
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: cannot convert ‘const std::array<const char*, 2u>’ to ‘const char*’ in initialization
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >&) [with TObj = Controller; TInputs = {}; TOutputs = {}]’:
      fibre/cpp/include/fibre/protocol.hpp:625:8: required from here
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >&) [with TObj = Motor; TInputs = {}; TOutputs = {float}]’:
      fibre/cpp/include/fibre/protocol.hpp:625:8: required from here
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: cannot convert ‘const std::array<const char*, 1u>’ to ‘const char*’ in initialization
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >&) [with TObj = Axis; TInputs = {}; TOutputs = {}]’:
      fibre/cpp/include/fibre/protocol.hpp:625:8: required from here
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp:943:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of 'ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const char*, TObj&, ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet (TObj::)(TInputs …), std::array<const char, sizeof… (TAllProperties)>, std::array<const char*, sizeof… (TOutputs)>) [with TObj = Encoder; TInputs = {long int}; TOutputs = {}; ProtocolFunction<TObj, std::tuple<Elements …>, std::tuple<Tail …> >::TRet = void]’:
      fibre/cpp/include/fibre/protocol.hpp:1017:106: required from 'ProtocolFunction<TObj, std::tuple<Elements …>, std::tuple<> > make_protocol_function(const char*, TObj&, void (TObj::)(TArgs …), TNames …) [with TObj = Encoder; TArgs = {long int}; TNames = {const char}; = void]’
      MotorControl/encoder.hpp:134:98: required from here
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: cannot convert ‘std::array<const char*, 1u>’ to ‘const char*’ in initialization
      output_properties
      (PropertyListFactory<TOutputs…>::template make_property_list<0>(output_names
      , out_args
      ))
      ^
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const char*, TObj&, ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet (TObj::)(TInputs …), std::array<const char, sizeof… (TAllProperties)>, std::array<const char*, sizeof… (TOutputs)>) [with TObj = Controller; TInputs = {float, float, float}; TOutputs = {}; ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet = void]’:
      fibre/cpp/include/fibre/protocol.hpp:1017:106: required from ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<> > make_protocol_function(const char*, TObj&, void (TObj::)(TArgs …), TNames …) [with TObj = Controller; TArgs = {float, float, float}; TNames = {const char, const char*, const char*}; = void]’
      MotorControl/controller.hpp:116:75: required from here
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: cannot convert ‘std::array<const char*, 3u>’ to ‘const char*’ in initialization
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const char*, TObj&, ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet (TObj::)(TInputs …), std::array<const char, sizeof… (TAllProperties)>, std::array<const char*, sizeof… (TOutputs)>) [with TObj = Controller; TInputs = {float, float}; TOutputs = {}; ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet = void]’:
      fibre/cpp/include/fibre/protocol.hpp:1017:106: required from ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<> > make_protocol_function(const char*, TObj&, void (TObj::)(TArgs …), TNames …) [with TObj = Controller; TArgs = {float, float}; TNames = {const char, const char*}; = void]’
      MotorControl/controller.hpp:118:55: required from here
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: cannot convert ‘std::array<const char*, 2u>’ to ‘const char*’ in initialization
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const char*, TObj&, ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet (TObj::)(TInputs …), std::array<const char, sizeof… (TAllProperties)>, std::array<const char*, sizeof… (TOutputs)>) [with TObj = Controller; TInputs = {float}; TOutputs = {}; ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet = void]’:
      fibre/cpp/include/fibre/protocol.hpp:1017:106: required from ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<> > make_protocol_function(const char*, TObj&, void (TObj::)(TArgs …), TNames …) [with TObj = Controller; TArgs = {float}; TNames = {const char}; = void]’
      MotorControl/controller.hpp:120:54: required from here
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: cannot convert ‘std::array<const char*, 1u>’ to ‘const char*’ in initialization
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const char*, TObj&, ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet (TObj::)(TInputs …), std::array<const char, sizeof… (TAllProperties)>, std::array<const char*, sizeof… (TOutputs)>) [with TObj = Controller; TInputs = {float, bool}; TOutputs = {}; ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet = void]’:
      fibre/cpp/include/fibre/protocol.hpp:1017:106: required from ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<> > make_protocol_function(const char*, TObj&, void (TObj::)(TArgs …), TNames …) [with TObj = Controller; TArgs = {float, bool}; TNames = {const char, const char*}; = void]’
      MotorControl/controller.hpp:122:127: required from here
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: cannot convert ‘std::array<const char*, 2u>’ to ‘const char*’ in initialization
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const char*, TObj&, ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet (TObj::)(TInputs …), std::array<const char, sizeof… (TAllProperties)>, std::array<const char*, sizeof… (TOutputs)>) [with TObj = Controller; TInputs = {}; TOutputs = {}; ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet = void]’:
      fibre/cpp/include/fibre/protocol.hpp:1017:106: required from ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<> > make_protocol_function(const char*, TObj&, void (TObj::)(TArgs …), TNames …) [with TObj = Controller; TArgs = {}; TNames = {}; = void]’
      MotorControl/controller.hpp:123:118: required from here
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: initializer for 'std::__array_traits<const char
      , 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const char*, TObj&, ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet (TObj::)(TInputs …), std::array<const char, sizeof… (TAllProperties)>, std::array<const char*, sizeof… (TOutputs)>) [with TObj = Motor; TInputs = {}; TOutputs = {float}; ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet = float]’:
      fibre/cpp/include/fibre/protocol.hpp:1023:118: required from ‘ProtocolFunction<TObj, std::tuple<_Tail …>, std::tuple > make_protocol_function(const char*, TObj&, TRet (TObj::)(TArgs …), TNames …) [with TObj = Motor; TRet = float; TArgs = {}; TNames = {}; = void]’
      MotorControl/motor.hpp:188:89: required from here
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: initializer for 'std::__array_traits<const char
      , 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: cannot convert ‘std::array<const char*, 1u>’ to ‘const char*’ in initialization
      fibre/cpp/include/fibre/protocol.hpp: In instantiation of ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::ProtocolFunction(const char*, TObj&, ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet (TObj::)(TInputs …), std::array<const char, sizeof… (TAllProperties)>, std::array<const char*, sizeof… (TOutputs)>) [with TObj = Axis; TInputs = {}; TOutputs = {}; ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<_Tail …> >::TRet = void]’:
      fibre/cpp/include/fibre/protocol.hpp:1017:106: required from ‘ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<> > make_protocol_function(const char*, TObj&, void (TObj::)(TArgs …), TNames …) [with TObj = Axis; TArgs = {}; TNames = {}; = void]’
      MotorControl/axis.hpp:284:80: required from here
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: initializer for 'std::__array_traits<const char
      , 0u>::_Type’ must be brace-enclosed
      fibre/cpp/include/fibre/protocol.hpp:931:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed
      *** tup errors ***
      *** Command ID=471 failed with return value 1
      tup error: Expected to write to file ‘build/obj/MotorControl_low_level.cpp.o’ from cmd 471 but didn’t
      *** Additionally, command 471 failed to process input dependencies. These should probably be fixed before addressing the command failure.
      [ETA~=27s Remaining=21 ] 4%
      *** tup: 1 job failed.

4.9.3? That’s a really old version. You should be using v7.x at minimum

Thanks for quick response.

I just updated my arm from 4.9.3 to
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2018-q2-update).

But I’m still get this compiler errros.

In file included from MotorControl/odrive_main.h:12:0,
from MotorControl/low_level.cpp:22:
fibre/cpp/include/fibre/protocol.hpp: In instantiation of 'ProtocolFunction<TObj, std::tuple<_Elements …>, std::tuple<Tail …> >::ProtocolFunction(const ProtocolFunction<TObj, std::tuple<Elements …>, std::tuple<Tail …> >&) [with TObj = Encoder; TInputs = {long int}; TOutputs = {}]’:
fibre/cpp/include/fibre/protocol.hpp:625:8: required from here
fibre/cpp/include/fibre/protocol.hpp:943:118: error: cannot convert ‘const std::array<const char*, 1u>’ to ‘const char*’ in initialization
output_properties
(PropertyListFactory<TOutputs…>::template make_property_list<0>(output_names
, out_args
))
^
fibre/cpp/include/fibre/protocol.hpp:943:118: error: initializer for ‘std::__array_traits<const char*, 0u>::_Type’ must be brace-enclosed

Thanks,
Phi