Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP Do not merge] NXP i.MXRT port of PX4 FMUv5 #11351

Closed
wants to merge 12 commits into from

Conversation

davids5
Copy link
Member

@davids5 davids5 commented Jan 31, 2019

This is the initial Work In Progress of a PX4 FMUv5 port to the NXP iMXRT 1062 SoC.

Current Code bringup is being done on the MIMXRT1060-EVK: i.MX RT1060 Evaluation Kit

Since the EVK hardware is application specific, full integration testing is not possible untile the real HW is ready.

Therefor there are some #ifdefs that ensure we do not create a contention on pins other then on J22 - J25.

This branch is subject to change via forced pushed!

Status:

  • PLL and Clock Tree 576Mhz
  • hrt - tested
    • PPM - Not tested.
  • Tone alarm - Not tested
  • PWM
    • PWM Source 16Mhz input clock derivation via TMR3:0 and XBAR - tested
    • PWM Output
  • Status LEDs
  • ADC
    • HW rev/ver
  • SPI
  • I2C
  • SDIO - preliminary tested
  • GPIO/XBAR/DAISY - tested
  • USB
    • USB VBUS detection
  • UARTS
  • DMA
  • Bootloader
  • UUID and CPU info

@davids5
Copy link
Member Author

davids5 commented Feb 1, 2019

Current defconfig is set up for running on MIMXRT1060-EVK

Since the pinout of the EVK is application specific, peripherals have to be tested in a piecemeal fashion.

The easiest to connect to pins are on the Arduino interface:
image

This is spi build (no SDIO) and no devices connected

sercon: Registering CDC/ACM serial driver
sercon: ERROR: Failed to create the CDC/ACM serial device: 1
HW arch: NXP_FMURT1062_V1
HW type: V5xx
HW version: 0x00000000
HW revision: 0x00000000
FW git-hash: 5460af211911f7fe46a74e0c53b1c4d33c7a6c35
FW version: 1.9.0 0 (17367040)
FW git-branch: master_nuttx_7.28+_rt
OS: NuttX
OS version: Release 7.28.0 (119275775)
OS git-hash: 2f18326c0936000b1d410ad5fc6ebe1e1d0de671
Build datetime: Feb  1 2019 03:20:37
Build uri: localhost
Toolchain: GNU GCC, 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
PX4GUID: 00050000000000000000202000000000e9ba
MCU: imxrt 10??, rev. 0
nsh: mount: mount failed: Block device required
INFO  [tune_control] Publishing standard tune 16
nsh: mkfatfs: mkfatfs failed: No such file or directory
INFO  [tune_control] Publishing standard tune 2
WARN  [mtd] MTD not enabled, skipping.
INFO  [param] selected parameter default file /fs/microsd/params
ERROR [param] open '/fs/microsd/params' failed (2)
WARN  [dataman] Could not open data manager file /fs/microsd/dataman
ERROR [dataman] dataman start failed
ERROR [parameters] failed to open param file: /fs/microsd/params
ERROR [parameters] param auto save failed (-1)
rgbled on I2C bus 1 at 0x55 (bus: 100 KHz, max: 100 KHz)
ERROR [param] Parameter SYS_USE_IO not found
MS5611_SPI on SPI bus 3 at 0 (20000 KHz)
WARN  [ms5611] no device on bus 3
WARN  [bst] no devices found
ERROR [adc] ADC init failed
nsh: icm20948: command not found
px4flow [46:100]
INFO  [px4flow] scanning I2C buses for device..
ERROR [sensors] no ADC found: /dev/adc0 (2)
ERROR [param] Parameter UAVCAN_ENABLE not found
INFO  [mavlink] mode: Config, data rate: 800000 B/s on /dev/ttyACM0 @ 57600B
Starting Main GPS on /dev/ttyS1
No autostart ID found
ERROR [param] Parameter UAVCAN_ENABLE not found
INFO  [logger] logger started (mode=all)
INFO  [logger] log root dir created: /fs/microsd/log

NuttShell (NSH)
nsh> ERROR [parameters] failed to open param file: /fs/microsd/params
ERROR [parameters] param auto save failed (-1)
nsh> ls
/:
 dev/
 etc/
 fs/
 obj/
 proc/
nsh> ls /dev
/dev:
 console
 led0
 null
 rgbled0
 tone_alarm0
 ttyACM0
 ttyS0
 ttyS1
 ttyS2
nsh> free
             total       used       free    largest
Umem:      1024848     112560     912288     903472
nsh>

FYI @igalloway

@davids5 davids5 force-pushed the master_nuttx_7.28+_rt branch from f8bdc87 to 37c8dc9 Compare February 1, 2019 17:12
@davids5
Copy link
Member Author

davids5 commented Feb 1, 2019

SDIO Config Pushed

NuttShell (NSH)
nsh> Successfully bound SDHC to the MMC/SD driver
sercon: Registering CDC/ACM serial driver
sercon: ERROR: Failed to create the CDC/ACM serial device: 1
HW arch: NXP_FMURT1062_V1
HW type: V5xx
HW version: 0x00000000
HW revision: 0x00000000
FW git-hash: f8bdc8774929e801d37803ffd4a5b200644dedca
FW version: 1.9.0 0 (17367040)
FW git-branch: master_nuttx_7.28+_rt
OS: NuttX
OS version: Release 7.28.0 (119275775)
OS git-hash: 2f18326c0936000b1d410ad5fc6ebe1e1d0de671
Build datetime: Feb  1 2019 08:59:59
Build uri: localhost
Toolchain: GNU GCC, 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
PX4GUID: 00050000000000000000202000000000e9ba
MCU: imxrt 10??, rev. 0
nsh: hardfault_log: command not found
INFO  [tune_control] Publishing standard tune 1
WARN  [mtd] MTD not enabled, skipping.
INFO  [param] selected parameter default file /fs/microsd/params
INFO  [dataman] Unknown restart, data manager file '/fs/microsd/dataman' size is 350216 bytes
WARN  [rgbled] no RGB led on bus #1
WARN  [rgbled_ncp5623c] no RGB led on bus #1
WARN  [blinkm] I2C init failed
WARN  [blinkm] init failed
ERROR [param] Parameter SYS_USE_IO not found
MS5611_SPI on SPI bus 3 at 0 (20000 KHz)
WARN  [ms5611] no device on bus 3
ERROR [adc] ADC init failed
nsh: icm20948: command not found
px4flow [48:100]
INFO  [px4flow] scanning I2C buses for device..
ERROR [sensors] no ADC found: /dev/adc0 (2)
ERROR [param] Parameter UAVCAN_ENABLE not found
INFO  [mavlink] mode: Config, data rate: 800000 B/s on /dev/ttyACM0 @ 57600B
Starting Main GPS on /dev/ttyS1
No autostart ID found
ERROR [param] Parameter UAVCAN_ENABLE not found
INFO  [logger] logger started (mode=all)

NuttShell (NSH)
nsh> sd_bench
INFO  [sd_bench] Using block size = 4096 bytes, sync=0
INFO  [sd_bench]
INFO  [sd_bench] Testing Sequential Write Speed...
INFO  [sd_bench]   Run  0:   352.81 KB/s, max write time: 317 ms (=  12.62 KB/s), fsync: 366 ms
INFO  [sd_bench]   Run  1:   710.43 KB/s, max write time: 315 ms (=  12.70 KB/s), fsync: 45 ms
INFO  [sd_bench]   Run  2:   692.92 KB/s, max write time: 273 ms (=  14.65 KB/s), fsync: 170 ms
INFO  [sd_bench]   Run  3:   621.45 KB/s, max write time: 342 ms (=  11.70 KB/s), fsync: 11 ms
INFO  [sd_bench]   Run  4:   655.91 KB/s, max write time: 313 ms (=  12.78 KB/s), fsync: 12 ms
INFO  [sd_bench]   Avg   :   594.79 KB/s

@bys1123
Copy link
Contributor

bys1123 commented Feb 3, 2019

Thanks for your work, Excited to see PX4 will port to iMX RT board. Do you think it maybe would be better call it nxp_fmu-rt1062 instead of nxp_fmurt1062-v1? Will rt1062 board have ver.2?

@davids5
Copy link
Member Author

davids5 commented Feb 15, 2019

PWW tested on J22-5 (channel 4)

NuttShell (NSH)
nsh> fmu test
INFO  [fmu] Not in a capture mode
INFO  [fmu] Testing 8 servos and 0 input captures
INFO  [fmu] Press CTRL-C or 'c' to abort.
INFO  [fmu] User abort
nsh> pwm info


channel 1: 900 us (alternative rate: 400 Hz failsafe: 0, disarmed: 900 us, min: 1000 us, max: 2000 us, trim:  0.00)
channel 2: 900 us (alternative rate: 400 Hz failsafe: 0, disarmed: 900 us, min: 1000 us, max: 2000 us, trim:  0.00)
channel 3: 900 us (alternative rate: 400 Hz failsafe: 0, disarmed: 900 us, min: 1000 us, max: 2000 us, trim:  0.00)
channel 4: 900 us (alternative rate: 400 Hz failsafe: 0, disarmed: 900 us, min: 1000 us, max: 2000 us, trim:  0.00)
channel 5: 1500 us (default rate: 50 Hz failsafe: 0, disarmed: 0 us, min: 1000 us, max: 2000 us, trim:  0.00)
channel 6: 1500 us (default rate: 50 Hz failsafe: 0, disarmed: 0 us, min: 1000 us, max: 2000 us, trim:  0.00)
channel 7: 1877 us (default rate: 50 Hz failsafe: 0, disarmed: 0 us, min: 1000 us, max: 2000 us, trim:  2.64)
channel 8: 1877 us (default rate: 50 Hz failsafe: 0, disarmed: 0 us, min: 1000 us, max: 2000 us, trim:  2.46)
channel group 0: channels 1
channel group 1: channels 2
channel group 2: channels 3
channel group 3: channels 4
channel group 4: channels 5
channel group 5: channels 6
channel group 6: channels 7
channel group 7: channels 8

@LorenzMeier
Copy link
Member

Nice!

@davids5 davids5 force-pushed the master_nuttx_7.28+_rt branch 4 times, most recently from ef01f79 to 99e14c5 Compare February 22, 2019 22:27
@davids5
Copy link
Member Author

davids5 commented Feb 22, 2019

ADC tested on EVK, Hardware Ver and Rev detections is now supported*.

Connector FMU Usage GPIO GPIO1 Pin ADC Chan
J23-2 BATTERY1_VOLTAGE GPIO_AD_B1_11 27 0
J23-3 HW_VER_SENSE GPIO_AD_B1_04 20 9
J23-4 SCALED_V5 GPIO_AD_B1_05 21 10
J22-4 HW_REV_SENSE GPIO_AD_B1_08 24 13
J23-1 RSSI_IN GPIO_AD_B1_10 26 15
[boot] Rev 0x7 : Ver 0x8 V587
Successfully bound SDHC to the MMC/SD driver
sercon: Registering CDC/ACM serial driver
sercon: ERROR: Failed to create the CDC/ACM serial device: 1
HW arch: NXP_FMURT1062_V1
HW type: V587
HW version: 0x00000008
HW revision: 0x00000007
FW git-hash: cf46b836635c9e44af9f90dc71f01812b6f488fc
FW version: 1.9.0 0 (17367040)
FW git-branch: master_nuttx_7.28+_rt
OS: NuttX
OS version: Release 7.28.0 (119275775)
OS git-hash: 8de101ca18ce8975abbb4dc58f97a8f77f6d1ac6
Build datetime: Feb 22 2019 12:51:22
Build uri: localhost
Toolchain: GNU GCC, 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
PX4GUID: 0005000000000000000020200000000009bb
MCU: imxrt 10??, rev. 0
nsh: hardfault_log: command not found
INFO  [tune_control] Publishing standard tune 1
WARN  [mtd] MTD not enabled, skipping.
INFO  [param] selected parameter default file /fs/microsd/params
INFO  [dataman] Unknown restart, data manager file '/fs/microsd/dataman' size is 362560 bytes
WARN  [rgbled] no RGB led on bus #1
WARN  [rgbled_ncp5623c] no RGB led on bus #1
WARN  [blinkm] I2C init failed
WARN  [blinkm] init failed
ERROR [param] Parameter SYS_USE_IO not found
MS5611_SPI on SPI bus 3 at 0 (20000 KHz)
WARN  [ms5611] no device on bus 3
adc CDev::init
nsh: icm20948: command not found
px4flow [137:100]
INFO  [px4flow] scanning I2C buses for device..
ERROR [param] Parameter UAVCAN_ENABLE not found
INFO  [mavlink] mode: Config, data rate: 800000 B/s on /dev/ttyACM0 @ 57600B
Starting Main GPS on /dev/ttyS1
INFO  [init] Mixer: /etc/mixers/quad_x.main.mix on /dev/pwm_output0
ERROR [param] Parameter CAM_CAP_FBACK not found
ERROR [param] Parameter UAVCAN_ENABLE not found
INFO  [logger] logger started (mode=all)

nsh> adc test
0: 1188  9: 1930  10: 2135  13: 2148  15: 4
0: 1169  9: 1931  10: 2135  13: 2157  15: 2
0: 1190  9: 1931  10: 2136  13: 2156  15: 0
0: 1196  9: 1951  10: 2153  13: 2161  15: 0
0: 1357  9: 2219  10: 2447  13: 2178  15: 10
0: 1130  9: 1840  10: 2205  13: 2173  15: 5
0: 1498  9: 1900  10: 2152  13: 2165  15: 2030
0: 1614  9: 2082  10: 2201  13: 2157  15: 2127
0: 1694  9: 2114  10: 2232  13: 2153  15: 2168
0: 1657  9: 2114  10: 2218  13: 2152  15: 2162
0: 1656  9: 2121  10: 2228  13: 2154  15: 2163
0: 8  9: 1752  10: 2175  13: 2148  15: 2205
0: 3  9: 1719  10: 2140  13: 2146  15: 2180
0: 7  9: 1740  10: 2158  13: 2145  15: 2179
0: 0  9: 1821  10: 2546  13: 2179  15: 2544
0: 2  9: 1728  10: 2160  13: 2147  15: 2209
0: 5  9: 1752  10: 2171  13: 2144  15: 2214
0: 6  9: 1586  10: 2007  13: 2136  15: 2075
0: 1540  9: 1956  10: 2074  13: 2145  15: 2125
0: 1566  9: 3  10: 1794  13: 2125  15: 2101
0: 1520  9: 2  10: 1633  13: 2078  15: 2099
0: 1581  9: 0  10: 1638  13: 2035  15: 2112
0: 1508  9: 4  10: 1991  13: 2099  15: 2097
0: 1519  9: 7  10: 1648  13: 2087  15: 2070
0: 1536  9: 1931  10: 2030  13: 2136  15: 2084
0: 1534  9: 1963  10: 2082  13: 2150  15: 2113
0: 1570  9: 2055  10: 11  13: 1680  15: 2022
0: 1569  9: 1993  10: 5  13: 1665  15: 1995
0: 1583  9: 2000  10: 5  13: 1662  15: 2004
0: 1565  9: 1975  10: 8  13: 1658  15: 2010
0: 1574  9: 1995  10: 0  13: 1662  15: 2008
0: 1584  9: 1994  10: 6  13: 1660  15: 2006
0: 1571  9: 1994  10: 3  13: 1661  15: 2002
0: 1580  9: 2006  10: 2  13: 1667  15: 1999
0: 1527  9: 1988  10: 1696  13: 1952  15: 2027
0: 1609  9: 2009  10: 2115  13: 2141  15: 2137
0: 1609  9: 2006  10: 2133  13: 2144  15: 2135
0: 1611  9: 2013  10: 2137  13: 2136  15: 2139
0: 1618  9: 2009  10: 2142  13: 2153  15: 2141
0: 1609  9: 2006  10: 2145  13: 2190  15: 2142
0: 1618  9: 2009  10: 2146  13: 2153  15: 2140
0: 1611  9: 2007  10: 2141  13: 2117  15: 2136
0: 1614  9: 2006  10: 2141  13: 2228  15: 2140
0: 1494  9: 1986  10: 2142  13: 7  15: 1644
0: 1492  9: 1986  10: 2143  13: 10  15: 1646
0: 1484  9: 1989  10: 2144  13: 2  15: 1636
0: 1483  9: 1989  10: 2142  13: 2  15: 1638
0: 1485  9: 1981  10: 2139  13: 1  15: 1633
0: 1480  9: 1984  10: 2134  13: 0  15: 1634
0: 1480  9: 1980  10: 2138  13: 11  15: 1630

*N.B. On the EVK Hardware VER and REV drive signals are not supported (if def-ed out) and are read as floating ADC pins which may result in values that are not defined in the manifest table. You will know if this is happening if it scrolls ERROR [drivers_board] Board VVRR is not supported! down the screen. Add VVRR to your test build's manifest.

@davids5
Copy link
Member Author

davids5 commented Feb 25, 2019

Minor update VBUS Valid and Connected detection added.

Note: ON EVK HW VBUS Valid can be tested via SW6-4 pads. So the signal appears valid until the pads are shorted. The micro USB closest to the Ethernet can be used to test VBUS connected.

@davids5 davids5 force-pushed the master_nuttx_7.28+_rt branch from 76ecfe2 to ed9b9b2 Compare February 27, 2019 22:41
@davids5
Copy link
Member Author

davids5 commented Feb 27, 2019

PX4GUID and MCU info working

nsh> ver all
HW arch: NXP_FMURT1062_V1
HW type: V587
HW version: 0x00000008
HW revision: 0x00000007
FW git-hash: 72345e05fa1bdaf93ffd85e7a08805eaa92a85a3
FW version: 1.9.0 0 (17367040)
FW git-branch: master_nuttx_7.28+_rt
OS: NuttX
OS version: Release 7.28.0 (119275775)
OS git-hash: 6d0d712b9c4239223d8f142a072ba8160d237c32
Build datetime: Feb 27 2019 14:30:11
Build uri: localhost
Toolchain: GNU GCC, 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
PX4GUID: 00050000000000000000bc6dfa5ab96fe9ba
MCU: i.MX RT1062 r1.0, rev. 0
nsh>

@davids5
Copy link
Member Author

davids5 commented Mar 5, 2019

rebased on Firmware master and nuttx/apps master

@davids5 davids5 force-pushed the master_nuttx_7.28+_rt branch from 3996e99 to ef75acf Compare July 13, 2019 18:07
@stale stale bot added the stale label Oct 11, 2019
@PX4 PX4 deleted a comment from stale bot Oct 11, 2019
@stale stale bot removed the stale label Oct 11, 2019
@davids5 davids5 mentioned this pull request Dec 4, 2019
20 tasks
@davids5
Copy link
Member Author

davids5 commented Dec 4, 2019

continued here

@davids5 davids5 closed this Dec 4, 2019
@julianoes julianoes deleted the master_nuttx_7.28+_rt branch December 6, 2019 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants