PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.15k stars 13.35k forks source link

Metadata doesn't transfer correctly using uart(FTDI)/telem [Bug] #22963

Open dirksavage88 opened 5 months ago

dirksavage88 commented 5 months ago

Describe the bug

Metadata doesn't transfer correctly over low speed UART/TELEM links. Specifically using the CANHUBK3 FMU target with no USB port, when I try to enable the motor sliders QGC reports that the command is not supported (MAV_CMD_DO_MOTOR_TEST).

I can check the status of the control_allocator driver and it does appear to be running. The actuators tab does not populate, instead the old motors tab shows which is also symptomatic of the metadata transfer fail.

To Reproduce

  1. Clone repo and build target 'nxp_mr-canhubk3_fmu'
  2. upload to target
  3. Open QGC and try to access the motors/actuators tab
  4. actuators does not show dynamic control allocator tab, but old motor sliders
  5. old motor sliders tab errors out
  6. Inspect ROMFS in the build of the FMU and the metadata *.json.xz files in /etc/extras on the build target. Metadata files exist on the FMU but are not transferred correctly over slow uart through FTDI or Telem module links.
  7. Reset all params to firmware defaults and connect the canhubk3 over T1 converter (if DHCP fails, "netman update -i eth0" and run an ifconfig on the canhub to set the IP as a last resort)
  8. Set the canhubk3 IP and port in QGC comm links
  9. Boot and observe over the UDP mavlink connection the actuators tab populates correctly, metadata transfer succeeds.

Expected behavior

After choosing an airframe the actuators tab screen should populate in QGC and testing the motors should work, but does not due to metadata transfer failing to transfer events and actuator metadata.

Screenshot / Media

No response

Flight Log

none

Software Version

main

Flight controller

nxp canhubk3 (with adap board)

Vehicle type

Multicopter

How are the different components wired up (including port information)

No response

Additional context

No response

dirksavage88 commented 5 months ago

allocator

dirksavage88 commented 4 months ago

ERROR [PX4_MTD] failed to initialize EEPROM driver ERROR [PX4_MTD] mtd failure: -5 bus 1 address 80 class 3 HW arch: NXP_MR_CANHUBK3 HW type: MR-CANHUBK3-ADAP HW version: 0x000 HW revision: 0x000 PX4 git-hash: f9c65cd4c6e5badeeafca90aa1ced27feace71bf PX4 version: 1.15.0 0 (17760256) PX4 git-branch: main OS: NuttX OS version: Release 11.0.0 (184549631) OS git-hash: 61958c53056b5c3fb828f18a097de57d9bed0fda Build datetime: Apr 10 2024 14:28:40 Build uri: localhost Build variant: fmu Toolchain: GNU GCC, 9.3.1 20200408 (release) PX4GUID: 00086125211322051365ffffffffffffffff MCU: S32K344, rev. 0 INFO [param] selected parameter default file /fs/microsd/params ERROR [param] open '/fs/microsd/params' failed (2) ERROR [init] param import failed INFO [parameters] summary: 0/1916 (used/total) INFO [parameters] file: /fs/microsd/params INFO [parameters] storage array: 0/1916 elements (256 bytes total) INFO [parameters] storage array (custom defaults): 0/1916 elements (256 bytes total) INFO [parameters] auto save: on param: export: 0 events, 0us elapsed, 0.00us avg, min 0us max 0us 0.000us rms param: find: 0 events param: get: 0 events param: set: 0 events, 0us elapsed, 0.00us avg, min 0us max 0us 0.000us rms dmesg [24:100] INFO [param] selected parameter backup file /fs/microsd/parameters_backup.bson Board defaults: /etc/init.d/rc.board_defaults

dirksavage88 commented 3 months ago

This partially fixed by https://github.com/PX4/PX4-Autopilot/pull/23003 , but also with uart buffer size increases the telem links are improved with https://github.com/PX4/PX4-Autopilot/pull/22970 so the metadata is able to transfer correctly