Firmware built locally and led B/E (FMU) blinking red

Because I cannot stop on target on modified the code of the rover. To do so I setup the toolchain, then entered ./waf configure --board Pixhawk4 and then ./waf rover. Here is an excerpt of the compilation and looks like everything was ok;

[610/637] Compiling Rover/mode_simple.cpp
[611/637] Compiling Rover/AP_Rally.cpp
[612/637] Compiling Rover/failsafe.cpp
[613/637] Compiling Rover/mode_steering.cpp
[614/637] Compiling Rover/GCS_Rover.cpp
[615/637] Compiling Rover/sailboat.cpp
[616/637] Compiling Rover/version.cpp
[617/637] Compiling Rover/motor_test.cpp
[618/637] Compiling Rover/Log.cpp
[619/637] Compiling Rover/mode_loiter.cpp
[620/637] Compiling Rover/sensors.cpp
[621/637] Compiling Rover/fence.cpp
[622/637] Compiling Rover/radio.cpp
[623/637] Compiling Rover/afs_rover.cpp
[624/637] Compiling Rover/compat.cpp
[625/637] Compiling Rover/Steering.cpp
[626/637] Compiling Rover/mode_manual.cpp
[627/637] Compiling Rover/mode_acro.cpp
[628/637] Compiling Rover/mode.cpp
[629/637] Compiling Rover/mode_hold.cpp
[630/637] Compiling Rover/mode_smart_rtl.cpp
[631/637] Compiling Rover/system.cpp
[632/637] Compiling Rover/RC_Channel.cpp
[633/637] Linking build/Pixhawk4/bin/ardurover
[634/637] apj_tool build/Pixhawk4/bin/ardurover
Loaded binary file of length 3254764
Setting defaults from /home/fabrice/ardupilot/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk4/defaults.parm
Saved binary of length 3254764
[635/637] Generating bin/ardurover.bin
[636/637] Generating bin/ardurover.hex
[637/637] apj_gen build/Pixhawk4/bin/ardurover.bin
Waf: Leaving directory `/home/fabrice/ardupilot/build/Pixhawk4’

BUILD SUMMARY
Build directory: /home/fabrice/ardupilot/build/Pixhawk4
Target Text Data BSS Total

bin/ardurover 1266000 1712 391720 1659432

Build commands will be stored in build/Pixhawk4/compile_commands.json
‘rover’ finished successfully (2m34.464s)

Then if I correctly understood, the file being downloaded by missionplanner on the pixhawk4 is ardurover.apj

fabrice@fabrice-desktop:~/ardupilot/build/Pixhawk4/bin$ ls -l *
-rwxrwxr-x 1 fabrice fabrice 3254764 août 9 17:48 ardurover
-rw-rw-r-- 1 fabrice fabrice 1144026 août 9 17:48 ardurover.apj
-rwxrwxr-x 1 fabrice fabrice 1267720 août 9 17:48 ardurover.bin
-rw-rw-r-- 1 fabrice fabrice 3486568 août 9 17:48 ardurover.hex
-rw-rw-r-- 1 fabrice fabrice 3576680 août 9 17:48 ardurover_with_bl.hex

The problem I have now is that I have a red led blinking which is B/E (FMU). It looks like it is a firmware issue, but as I am really a newbie here, can you tell me where is my mistake?

Thank you very much

After more investigations here, is what I noticed:

The behavior of the custom-made, referred to as ardurover-dev, behaves differently from the standard version. I am connected to the FMU via Mavros and with the standard version, we have the following messages which are displayed - Please note the messages EKF IMU0/IMU1 tilt alignment complete and finally the EKF2 IMU0 initial pos NED when the “set EKF origin” mavros message is sent (we are using the guided mode).

[ INFO] [1597139350.699479435]: MAVROS started. MY ID 1.240, TARGET ID 1.1
[ INFO] [1597139351.023691729]: CON: Got HEARTBEAT, connected. FCU: ArduPilot
[ INFO] [1597139351.757916573]: FCU: Ready to drive
[ WARN] [1597139352.039515184]: CMD: Unexpected command 520, result 0
[ INFO] [1597139352.040510931]: VER: 1.1: Capabilities 0x000000000000d1ef
[ INFO] [1597139352.040592572]: VER: 1.1: Flight software: 040000ff ( 0e52baf)
[ INFO] [1597139352.040668780]: VER: 1.1: Middleware software: 00000000 ( )
[ INFO] [1597139352.040736812]: VER: 1.1: OS software: 00000000 ( 0997003)
[ INFO] [1597139352.040810026]: VER: 1.1: Board hardware: 00000000
[ INFO] [1597139352.041174580]: VER: 1.1: VID/PID: 0000:0000
[ INFO] [1597139352.041237537]: VER: 1.1: UID: 0000000000000000
[ INFO] [1597139352.044161881]: RC_CHANNELS message detected!
[ INFO] [1597139352.044702136]: IMU: Raw IMU message used.
[ WARN] [1597139352.046287383]: GP: No GPS fix
[ INFO] [1597139358.299363016]: FCU: EKF2 IMU0 tilt alignment complete
[ INFO] [1597139358.339481059]: FCU: EKF2 IMU1 tilt alignment complete
[ INFO] [1597139361.024468978]: HP: requesting home position
[ INFO] [1597139361.040059403]: FCU: ArduRover V4.0.0 (0e52bafa)
[ INFO] [1597139361.040960725]: FCU: ChibiOS: 0997003f

[ WARN] [1597139397.297046067]: TM : RTT too high for timesync: 31.70 ms.
[ INFO] [1597139397.319072638]: FCU: EKF2 IMU0 is using external nav data
[ INFO] [1597139397.319225231]: FCU: EKF2 IMU0 initial pos NED = 0.0,0.0,-0.0 (m)
[ INFO] [1597139397.319372714]: FCU: EKF2 IMU0 ext nav yaw alignment complete
[ INFO] [1597139397.320033678]: FCU: EKF2 IMU1 is using external nav data
[ INFO] [1597139397.321042374]: FCU: EKF2 IMU1 initial pos NED = 0.0,0.0,-0.0 (m)
[ INFO] [1597139397.321980725]: FCU: EKF2 IMU1 ext nav yaw alignment complete
[ WARN] [1597139397.876760478]: TM : RTT too high for timesync: 10.50 ms.

But with the ardurover-dev version, the story is different. There are no messages EKF IMU0/IMU1 tilt alignment BUT just FCU: IMU0: fast sampling enabled 8.0kHz/2.0kHz (looks like there is only one IMU) and the when the “set EKF origin” mavros message is sent, there is no response from the FMU…

[ INFO] [1597138999.013692050]: IMU: Raw IMU message used.
[ WARN] [1597138999.014188937]: IMU: linear acceleration on RAW_IMU known on APM only.
[ WARN] [1597138999.014315108]: IMU: ~imu/data_raw stores unscaled raw acceleration report.
[ WARN] [1597138999.030738009]: GP: No GPS fix
[ INFO] [1597138999.531205734]: CON: Got HEARTBEAT, connected. FCU: ArduPilot
[ INFO] [1597138999.534681944]: RC_CHANNELS message detected!
[ WARN] [1597139000.549629373]: CMD: Unexpected command 520, result 0
[ INFO] [1597139000.572705587]: VER: 1.1: Capabilities 0x000000000000d1ef
[ INFO] [1597139000.572748324]: VER: 1.1: Flight software: 04010000 (b66eaa0d)
[ INFO] [1597139000.572798694]: VER: 1.1: Middleware software: 00000000 ( )
[ INFO] [1597139000.572862141]: VER: 1.1: OS software: 00000000 (331fe75d)
[ INFO] [1597139000.572895816]: VER: 1.1: Board hardware: 00000000
[ INFO] [1597139000.572935685]: VER: 1.1: VID/PID: 0000:0000
[ INFO] [1597139000.573007557]: VER: 1.1: UID: 0000000000000000
[ INFO] [1597139009.532422899]: HP: requesting home position
[ INFO] [1597139009.550864572]: FCU: ArduRover V4.1.0-dev (b66eaa0d)
[ INFO] [1597139009.551649373]: FCU: ChibiOS: 331fe75d
[ INFO] [1597139009.552630000]: FCU: Pixhawk4 0018002F 30385115 34323338
[ INFO] [1597139009.553638795]: FCU: RCOut: PWM:1-16
[ INFO] [1597139009.555673814]: FCU: IMU0: fast sampling enabled 8.0kHz/2.0kHz

Finally I observed that many parameters available in the ardurover standard version are not in the ardurover-dev version.

Can someone can tell me why it is like this?

Thank you very much

Hello,

Yes it is normal that you see major difference between stable release and the current master branch. The master branch is always in development so things are moving frequently in it.

The B/E led is normally a bootloader error … but that shouldn’t be the case for you as you can connect with MAVROS.

What toolchain are you using ? (arm-none-eabi-gcc -v)
Beside set EKF origin, what other issue you have ?

1 Like

@khancyr Hello
When I enter ./waf configure --board Pixhawk4 - to be sure the environment has been setup properly:

Setting top to : /home/fabrice/ardupilot
Setting out to : /home/fabrice/ardupilot/build
Autoconfiguration : enabled
Setting board to : Pixhawk4
Using toolchain : arm-none-eabi
Checking for ‘g++’ (C++ compiler) : /usr/lib/ccache/arm-none-eabi-g++
Checking for ‘gcc’ (C compiler) : /usr/lib/ccache/arm-none-eabi-gcc
Checking for c flags ‘-MMD’ : yes
Checking for cxx flags ‘-MMD’ : yes
Checking for program ‘make’ : /usr/bin/make
Checking for program ‘arm-none-eabi-objcopy’ : /opt/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-objcopy
Including /home/fabrice/ardupilot/libraries/AP_HAL_ChibiOS/hwdef/fmuv5/hwdef.dat
Adding environment OPTIMIZE -O2
Removing HAL_BATT_VOLT_SCALE
Removing HAL_BATT_CURR_SCALE
Setup for MCU STM32F767xx
Writing hwdef setup in /home/fabrice/ardupilot/build/Pixhawk4/hwdef.h
MCU Flags: cortex-m7 [‘-mcpu=cortex-m7’, ‘-mfpu=fpv5-d16’, ‘-mfloat-abi=hard’]
Writing DMA map
Generating ldscript.ld
Default parameters path from hwdef: /home/fabrice/ardupilot/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk4/defaults.parm
Checking for env.py
env set DEFAULT_PARAMETERS=/home/fabrice/ardupilot/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk4/defaults.parm
env set BOARD_FLASH_SIZE=2048
env set APJ_BOARD_TYPE=STM32F767xx
env set OPTIMIZE=-O2
env set USBID=0x1209/0x5740
env set MAIN_STACK=0x400
env set APJ_BOARD_ID=50
env set HAL_WITH_UAVCAN=1
env set CORTEX=cortex-m7
env set FLASH_RESERVE_START_KB=32
env set CHIBIOS_BUILD_FLAGS=USE_FATFS=yes MCU=cortex-m7 ENV_UDEFS=-DCHPRINTF_USE_FLOAT=1 CHIBIOS_PLATFORM_MK=os/hal/ports/STM32/STM32F7xx/platform.mk CHIBIOS_STARTUP_MK=os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk
env set IOMCU_FW=0
env set CPU_FLAGS=[‘-mcpu=cortex-m7’, ‘-mfpu=fpv5-d16’, ‘-mfloat-abi=hard’, ‘-DARM_MATH_CM7’, ‘-u_printf_float’]
env set PERIPH_FW=0
env set PROCESS_STACK=0x2000
Enabling ChibiOS asserts : no
Checking for intelhex module: : OK
Checking for HAVE_CMATH_ISFINITE : yes
Checking for HAVE_CMATH_ISINF : yes
Checking for HAVE_CMATH_ISNAN : yes
Checking for NEED_CMATH_ISFINITE_STD_NAMESPACE : yes
Checking for NEED_CMATH_ISINF_STD_NAMESPACE : yes
Checking for NEED_CMATH_ISNAN_STD_NAMESPACE : yes
Checking for header endian.h : not found
Checking for header byteswap.h : not found
Checking for HAVE_MEMRCHR : no
Checking for program ‘python’ : /usr/bin/python
Checking for python version >= 2.7.0 : 2.7.12
Checking for program ‘python’ : /usr/bin/python
Checking for python version >= 2.7.0 : 2

Yes I can connect with Mavros and access to the topics I am looking for. However as we want to be in guided mode, we need to set EKF origin so that the EKF is using the data provided in the topic /mavros/vision_pose/pose (at least this is my understanding) - from ROS and Hector SLAM for Non-GPS Navigation — Dev documentation. But for unknown reason, with my dev version, it does not work (parameters are identical between the stable version and the dev version). Do you have any idea why it does not work?

Thank you for your support

P.S. The reason why I am trying to build a custom rover version is because our rover does not stop on the waypoint. Indeed it is still moving very slowly 20 to 40 cm away until it stops. I discussed this issue here: Ardurover overshoot with mavros/setpoint_position/local - #8 by jimovonz