PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

Initial support for IMXRT FMUM

Open davids5 opened this issue 3 years ago • 1 comments

This is not complete - but it builds :)

Todo:

  • [ ] test on real HW
  • [ ] add uavcan
  • [ ] test PX4IO
  • [ ] test Ethernet
  • [ ] Power sequencing, check backfeeding

davids5 avatar Mar 16 '22 20:03 davids5

Rebased on master and px4io FW installed to extras with px4io_update.

davids5 avatar Apr 06 '22 17:04 davids5

Log from real HW - https://logs.px4.io/plot_app?log=6b1553f3-734b-4800-a286-7f11eed45373

  • All 4 motors are spinning.
  • RC input can not be detected from FrSky R-XSR receiver connected to RC IN.

dk7xe avatar Oct 13 '22 19:10 dk7xe

Log from real HW - https://logs.px4.io/plot_app?log=6b1553f3-734b-4800-a286-7f11eed45373

  • All 4 motors are spinning.
  • RC input can not be detected from FrSky R-XSR receiver connected to RC IN.

@dk7xe Please retest the PR. RC is fixed and I freed up memory (had to removed gyro_fft ans esc_batt)

PX4 is growing faster the we can. We are going to have to have multiple configs at some point one for MC, FW, ROVER

@dagar the px4io_update is a landmine! Please fix it to build as needed.

davids5 avatar Oct 14 '22 12:10 davids5

@davids5 i faced a hardfault after updating the FW. 20221024_RT10602-v2_hardfault.txt

dk7xe avatar Oct 24 '22 08:10 dk7xe

@davids5 i faced a hardfault after updating the FW. 20221024_RT10602-v2_hardfault.txt

Did you power off and on again? Did you use the reset button after programing?

davids5 avatar Oct 24 '22 11:10 davids5

Hmm, can't recall But the FMU is rebooting now several times while connected via USB. Unfortunately my debug cable is already in one of the cases for traveling. Therefore i can only guess that it is a continuous hardfault.

dk7xe avatar Oct 24 '22 15:10 dk7xe

Hmm, can't recall But the FMU is rebooting now several times while connected via USB. Unfortunately my debug cable is already in one of the cases for traveling. Therefore i can only guess that it is a continuous hardfault.

Hi @davids5, i just checked again. there is no hardfault happening during this reboots. It occures only if the FMU is just powered from USB. Then i'm getting random reboots. If the RT1062 FMU is powered from Power input i don't have seen any random reboot yet.

dk7xe avatar Oct 25 '22 18:10 dk7xe

i did a clean build again resulting in crash when initializing GPS fmurt1062-v2_test_20221026.txt I can not get a console prompt on the debug port. so it seems really stalled.

dk7xe avatar Oct 26 '22 05:10 dk7xe

i did a clean build again resulting in crash when initializing GPS fmurt1062-v2_test_20221026.txt I can not get a console prompt on the debug port. so it seems really stalled.

@dk7xe You will need RC04 HW. Or Drop the last commit to test with RC01 HW

davids5 avatar Oct 26 '22 08:10 davids5

Hi @davids5 , i had a succesful maiden flight of the fmurt1062 RC03 HW. No tuning, just functional HW test. Unfortunately no logs are written. Therefore just the video -> https://youtu.be/0tX7gSzxELQ May you please look into the logging. i have enabled logging from boot. Files are created but not filled with any content.

dk7xe avatar Oct 27 '22 10:10 dk7xe

Hi @davids5 , i had a succesful maiden flight of the fmurt1062 RC03 HW. No tuning, just functional HW test. Unfortunately no logs are written. Therefore just the video -> https://youtu.be/0tX7gSzxELQ May you please look into the logging. i have enabled logging from boot. Files are created but not filled with any content.

I think you are going to have to wait to get working HW RC04.

davids5 avatar Oct 27 '22 11:10 davids5

Btw, Ethernet is working. I'm connecting my QGC Laptop via Ethernet at the moment.

dk7xe avatar Oct 27 '22 13:10 dk7xe

First test with RC04 HW and baseboard with T1 ethernet done. Flashing - OK GPS port - OK T1 ethernet port - OK, got IP via DHCP and mavlink connection established via UDP from QGC USB port - FAILED, not recogniced as device on windows and linux machine.

[boot] Rev 0x0 : Ver 0x0 V5X000000 WARN [drivers_board] reset done, 10 ms Successfully bound SDHC to the MMC/SD driver nsh: sysinit: fopen failed: No such file or directory HW arch: NXP_FMURT1062_V2 HW type: V5X000000 HW version: 0x000 HW revision: 0x000 PX4 git-hash: 3cf731faa8404e7db0af7bf23cd50d6c6974c3c1 PX4 version: 1.14.0 0 (17694720) PX4 git-branch: pr-fmu1062 OS: NuttX OS version: Release 11.0.0 (184549631) OS git-hash: fba2a48a7f745366cb16631fef843d38f2890f13 Build datetime: Dec 22 2022 07:51:44 Build uri: localhost Build variant: default Toolchain: GNU GCC, 9.3.1 20200408 (release) PX4GUID: 00050000000000000000082e99d75d7586ec MCU: i.MX RT1062 r1.1, rev. 1 nsh: hardfault_log: command not found INFO [param] selected parameter default file /fs/mtd_params INFO [param] importing from '/fs/mtd_params' ERROR [tinybson] killed: unsupported node type ERROR [parameters] param import failed (-1) attempt 1 ERROR [tinybson] killed: unsupported node type ERROR [parameters] param import failed (-1) attempt 2 ERROR [tinybson] killed: unsupported node type ERROR [parameters] param import failed (-1) attempt 3 ERROR [param] importing from '/fs/mtd_params' failed (-1) ERROR [init] param import failed [param] reading from /fs/mtd_params

BSON document size 539814648 ERROR [tinybson] killed: unsupported node type ERROR [parameters] param dump failed (-1) ERROR [param] reading from '/fs/mtd_params' failed (-1) [init] importing from parameter backup [param] reading from /fs/microsd/parameters_backup.bson

BSON document size 687 BSON_INT32: CAL_ACC2_ID = 3670026 BSON_INT32: CAL_ACC2_PRIO = 50 BSON_DOUBLE: CAL_ACC2_XOFF = 0.006501 BSON_DOUBLE: CAL_ACC2_YOFF = -0.002560 BSON_DOUBLE: CAL_ACC2_ZOFF = -0.077060 BSON_INT32: CAL_GYRO0_ID = 6684698 BSON_INT32: CAL_GYRO0_PRIO = 50 BSON_DOUBLE: CAL_GYRO0_XOFF = 0.002922 BSON_DOUBLE: CAL_GYRO0_YOFF = 0.000177 BSON_DOUBLE: CAL_GYRO0_ZOFF = 0.000035 BSON_INT32: CAL_GYRO1_ID = 2490386 BSON_INT32: CAL_GYRO1_PRIO = 50 BSON_DOUBLE: CAL_GYRO1_XOFF = -0.017792 BSON_DOUBLE: CAL_GYRO1_YOFF = -0.021495 BSON_DOUBLE: CAL_GYRO1_ZOFF = -0.006250 BSON_INT32: CAL_GYRO2_ID = 3670026 BSON_INT32: CAL_GYRO2_PRIO = 50 BSON_DOUBLE: CAL_GYRO2_XOFF = -0.010826 BSON_DOUBLE: CAL_GYRO2_YOFF = -0.002685 BSON_DOUBLE: CAL_GYRO2_ZOFF = -0.003396 BSON_INT32: CAL_MAG0_ID = 4395041 BSON_INT32: CAL_MAG0_PRIO = 50 BSON_DOUBLE: CAL_MAG0_XOFF = -0.011309 BSON_DOUBLE: CAL_MAG0_YOFF = 0.254842 BSON_DOUBLE: CAL_MAG0_ZOFF = -0.130266 BSON_INT32: CAL_MAG1_ID = 396809 BSON_INT32: CAL_MAG1_PRIO = 75 BSON_INT32: CAL_MAG1_ROT = 0 BSON_DOUBLE: CAL_MAG1_XOFF = -0.028799 BSON_DOUBLE: CAL_MAG1_YOFF = -0.151358 BSON_DOUBLE: CAL_MAG1_ZOFF = -0.183945 BSON_INT32: SYS_AUTOSTART = 50000 BSON_EOO BSON decoded 687 bytes (double:18, string:0, bin:0, bool:0, int32:14, int64:0) INFO [param] importing from '/fs/microsd/parameters_backup.bson' INFO [parameters] BSON document size 687 bytes, decoded 687 bytes (INT32:14, FLOAT:18) INFO [parameters] summary: 0/1582 (used/total) INFO [parameters] file: /fs/mtd_params INFO [parameters] storage array: 32/32 elements (512 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: 32 events param: get: 0 events param: set: 32 events, 139us elapsed, 4.34us avg, min 1us max 9us 1.877us rms dmesg [88:100] INFO [param] selected parameter backup file /fs/microsd/parameters_backup.bson Board architecture defaults: /etc/init.d/rc.board_arch_defaults Board defaults: /etc/init.d/rc.board_defaults Loading airframe: /etc/init.d/airframes/50000_generic_ground_vehicle INFO [dataman] data manager file '/fs/microsd/dataman' size is 62560 bytes rgbled_ncp5623c #0 on I2C bus 1 (external) address 0x39 INFO [px4io] IO FW CRC match Board sensors: /etc/init.d/rc.board_sensors ina226 #0 on I2C bus 1 (external) address 0x41 INFO [ina226] Failed to init INA226 on bus 2, but will try again periodically. ina226 #1 on I2C bus 2 (external) address 0x41 bmi088_accel #0 on SPI bus 3 rotation 4 bmi088_gyro #0 on SPI bus 3 rotation 4 icm42688p #0 on SPI bus 2 rotation 6 icm20602 #0 on SPI bus 1 rotation 8 bmm150 #0 on I2C bus 4 (external) address 0x10 ist8310 #0 on I2C bus 1 (external) address 0xE rotation 10 bmp388 #0 on I2C bus 4 (external) address 0x77 bmp388 #1 on I2C bus 2 (external) address 0x76 nsh: icm20948_i2c_passthrough: command not found nsh: ist8308: command not found WARN [SPI_I2C] Already running on bus 1 nsh: lis2mdl: command not found nsh: lis3mdl: command not found nsh: lis3mdl: command not found nsh: qmc5883l: command not found nsh: rm3100: command not found nsh: ak09916: command not found nsh: dshot: command not found ekf2 [539:237] Board mavlink: /etc/init.d/rc.board_mavlink WARN [mavlink] offboard mission init failed (-1) INFO [mavlink] mode: OnboardLowBandwidth, data rate: 290000 B/s on /dev/ttyS3 @ 3000000B Starting Main GPS on /dev/ttyS1 Starting MAVLink on /dev/ttyS2 INFO [mavlink] mode: Normal, data rate: 1200 B/s on /dev/ttyS2 @ 57600B Starting MAVLink on ethernet INFO [mavlink] mode: Normal, data rate: 100000 B/s on udp port 14550 remote port 14550 INFO [rc_input] valid device required ERROR [rc_input] Task start failed (-1) INFO [logger] logger started (mode=all)

NuttShell (NSH) NuttX-11.0.0

dk7xe avatar Dec 22 '22 21:12 dk7xe

@dk7xe Do you get the same results on Every boot?

davids5 avatar Dec 23 '22 11:12 davids5

Yes and also Iain is facing this USB issue

dk7xe avatar Dec 23 '22 13:12 dk7xe

For me USB seemss to be working but it's a bit delayed, it's empty when opening tty and then on debug tty I see the following

nsh> /dev/ttyACM0: launching nshterm

Furthermore memory is super tight

NuttShell (NSH) NuttX-10.4.0
nsh> ver all
nsh: ver: command not found
nsh> eth0: devup=1 PHY address=12 MSR=0082

nsh>
nsh> free
                   total       used       free    largest  nused  nfree
        Umem:     251104     249680       1424        464    990     57
nsh> ver all
HW arch: NXP_FMURT1062_V2
HW type: V5X000000
HW version: 0x000
HW revision: 0x000
PX4 git-hash: 3cf731faa8404e7db0af7bf23cd50d6c6974c3c1
PX4 version: 1.14.0 0 (17694720)
PX4 git-branch: pr-fmu1062
OS: NuttX
OS version: Release 12.0.0 (201326847)
OS git-hash: fba2a48a7f745366cb16631fef843d38f2890f13
Build datetime: Dec 27 2022 10:54:21
Build uri: localhost
Build variant: default
Toolchain: GNU GCC, 9.3.1 20200408 (release)
PX4GUID: 00050000000000000000062d99d75d7586ec
MCU: i.MX RT1062 r1.1, rev. 1
nsh>

PetervdPerk-NXP avatar Dec 27 '22 10:12 PetervdPerk-NXP

We are out of memory. If the air frame is set and USB is plugged in you will see the out of memory message on the debug console. Time to optimism the config and memory usage....

davids5 avatar Dec 27 '22 10:12 davids5

When setting the Airframe to "NXP HoverGames" i'm getting this hardfault

20230201_rt1060_hardfault.txt

dk7xe avatar Jan 02 '23 15:01 dk7xe

I have made a specific boardfile for rover and tested that on a Buggy3 frame driving around manually. 20230106_101758.jpg 20230106_101526.jpg Logfile driving indoors - https://logs.px4.io/plot_app?log=194820f5-9794-444e-add0-905aebb96f53 Logfile driving outdoors - https://logs.px4.io/plot_app?log=0b365d4a-390c-4998-a69f-e4e1943fc270

Boardfile related

rover.zip

dk7xe avatar Jan 06 '23 15:01 dk7xe

continued here

  • https://github.com/PX4/PX4-Autopilot/pull/21321

davids5 avatar Mar 16 '23 17:03 davids5

@davids5 i have switched my build system to the new branch now and will test drone and rover in the coming days.

dk7xe avatar Mar 17 '23 08:03 dk7xe