-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Continuation of Matek M9NF4 GPS Uavcannode Board Support #19061
Conversation
Thanks @davids5 - I just loaded the bootloader and updated the node firmware. A few tests: GPS device shows it is there with listener sensor_gps from console on the FC and when connecting directly to the module over USB and watching the console via screen but I cant get satellites. I put the ardupilot ap_periph bootloader and related on and I get sats so it's not hardware or specific location. Baro works but there is the temp error still (high number) Mag doesnt show up as publishing data (did a calibrate for good measure). Went to the device directly to do a rm3100 status and it's not started so started it but it isn't on any of the busses still (tried all). Tested against ap_periph and mag does show up (so not hardware - that was my big concern) Will go a few more checks on other things but great to see this continue. 👍 @dirksavage88 what do you see? |
This could be noise on our SPI - I will try some adjustments
My output on board looks ok temp is commensurate with other sensors - see below
My output on board looks ok - see below
Here is my whole context: Whole setup: V5 running uavcan, CanBreakout Console Output from MATEK - via debug console on TX1,RX1
|
So strange. I asked matek about if there were any revisions done to the board layout and there has not been since they came out with it so all hardware would (should) be the same. You mag works but mine doesn’t which is odd. I’ll try fresh again (I downloaded the ci artifacts and loaded them but I will build your pr and try that instead and I did a full chip erase for good measure). My gps looks the same as yours, it just doesn’t ever get sats unless I switch back to the other (ardu) setup. If yours and @dirksavage88 works then mine is an outlier and I’ll get a new board to test but let’s see his output. Also, strange about the Baro fc side. I’ll replicate the above. |
@ryanjAA @dirksavage88 - So on my MaTek board the sensors appear to be all working and publishing reasonable data. I will have a look at the datapath on the baro end-to-end. The GPS - node and FMU do not agree on the data. I believe the prams are working and now persist. |
Here is what I have: Everything seems to line up on the can node nuttx side. The GPS sat count is still low, but it's at least showing a few sats. On the uavcan side I do not see accel or gyro publisher messages but that does not look like it's set up in PX4 CANNODE yet, at least I do not see accel/gyro pub in src/drivers/uavcannode/Publishers/RawAirData.hpp or any other publisher file. Baro temp could also be some calculation on PX4 cannode because the nuttx side reads a valid temp. So the only thing that could be board (or GPS driver) related is the no GPS/low GPS sats....everything else could be addressed in PX4 CANNODE updates? |
And your mag works too. So my gps and mag are weird. I’ll get another and try. This is a brand new board but I bought it about a year ago. Just never used it. |
@davids5 with the board level stuff taken care of, I am not sure how much else we can do from this side. I'm pretty comfortable with what works on the board at this point. At a later time I can look at can node publishers to better integrate some of the features on this board. |
@ryanjAA @dirksavage88 - I will look at the potential for RFI jamming the GPS and if I can improve it. I will also check the baro conversion. |
Thanks @davids5. Hopefully the baro temp error is just a conversion (looks like it since it’s reporting correctly directly from the unit). I spoke with Matek and did some troubleshooting with them. My board works if you press (really hard) on the mag so the they think a dry solder joint. Makes sense so I have a new board already on the way. As for the gps, matek told me there is a bug in the latest ap_periph firmware that can lock the gps up and you need to reset it from u-center. Mine was running latest (ap_periph) although not sure how you can lock it from the firmware side tbh. That said, you need to load inav on there to do uart passthrough to get access to the gps in ucenter. Specifically in the inav application (with the inav firmware loaded), go to the cli and type serialpassthrough 3 115200 Then ucenter will connect to it. At that point you need to go to the CFG settings and revert to default the BBR and Flash. That fixes the gps (see attached image) and @dirksavage88 hopefully that clears up your gps issues). When the next couple of these boards arrive this week I’ll report back findings. |
@ryanjAA i couldn’t get the pass through to work. I am not sure if it’s my com port drivers or maybe I need an ftdi? I wonder if there is a way to do that revert method manually through the gps driver? That avoids having to flash inav, download ucenter, etc. good news on the mag! |
I will add a pass thru command.... |
Running u-center and doing a crtl-f9 will get you into passthru. |
@davids5 awesome and thanks! Will try this. |
@ryanjAA , @dirksavage88 Baro temp issue resolved.
|
I think the GPS is all better with the settings reset.
|
@dagar - I have upstreamed the NuttX changes. I will back port when they are ready. The passthru commits (Nuttx dependent) and the UAVCAN node Baro Temp fix commits could be moved to separate PR or this can all come in at once. Let me know you preference. |
@davids5 awesome! I have a new unit arriving tomorrow so I’ll give it a try on that. The reset is a great add. I wonder if this can be done at the driver level to reset if needed for people that may run into this and don’t have windows for Ucenter. Just a thought. Great on the temp/Baro fix. I was testing a pomegranate systems uavcan power module today and it was giving -400 degree constant (it monitors chip temp). I’ll take a look but I wonder if that is a similar thing to do the conversion error here. |
Yes that makes sense. I whish I knew exactly what to look for to detect the issue. If I reset the FLASH/RAM on every boot that could lead to degrading the FLASH. If anyone has some insight to the issue I would appreciate the input. |
9438f52
to
ef06175
Compare
@dagar - NuttX backports are merged to PX4 NuttX and this PR now points to the new tip. You and I should sort out the reason @PetervdPerk-NXP did not add boardconfig configs' to the build system. Once that is done we can re-distribute the board Kconfig for the passthru to the passthru Kconfig |
How about a slightly more specific name like |
Tested. Everything works as intended and tried the passthrough as well. All works. I believe the imu/accel is not on the node side (since if you enable it, it shows publishing data. I just don’t think it’s getting subscribed to) so that is px4 FC side. But overall this is good to go 👍 |
I will rename it |
Signed-off-by: dirksavage88 <dirksavage88@gmail.com> Added uavcan board identity Signed-off-by: dirksavage88 <dirksavage88@gmail.com> Added usb.c, LED rework may be needed Signed-off-by: dirksavage88 <dirksavage88@gmail.com> PX4 dates added to all files Signed-off-by: dirksavage88 <dirksavage88@gmail.com> Matek M9NF4 CAN Node initial board support Signed-off-by: dirksavage88 <dirksavage88@gmail.com> Changed GPS to ttyS3 in board sensors, led board on/off definitions Signed-off-by: dirksavage88 <dirksavage88@gmail.com> Added app descriptor section to canbootloader linker script Signed-off-by: dirksavage88 <dirksavage88@gmail.com> Changed board naming convention to match vendor Signed-off-by: dirksavage88 <dirksavage88@gmail.com> Changed canbootloader and nsh menuconfig Signed-off-by: dirksavage88 <dirksavage88@gmail.com> Test defconfig changes, IRQ hardfault in bootloader Signed-off-by: dirksavage88 <dirksavage88@gmail.com> Working canbootloader, App firmware stil WIP Working App firmware: changed romfsroot to 'cannode', TODO: verify GPS & IMU config Signed-off-by: dirksavage88 <dirksavage88@gmail.com> TODO: Debug GPS no sats/low sats issue, no magnetometer on some boards Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
SD is on SPI3 - correct pin mapping Fix DMA Mapping for all SPI and RX DMA on U[S]ART RX Fix Memory MAP SRAM size Removed unused GPIO Used proper I2C definitions Ensure Watchdog is configured for debugging Fixed FLASH param definitions Removed unedded SPI init matek_gnss-m9n-f4:Correct Board ID and Size Build order SJF Added Support for F40x
disable otg id cdcacm:support c_cflag in the termios structure and speed
This addes the command serial_passthru which will pass data from one device to another. This can be used to use u-center connected to USB with a GPS on a serial port. Usage: serial_passthru [arguments...] -e <val> External device path values: <file:dev> -d <val> Internal device path values: <file:dev> [-b <val>] Baudrate default: 115200 [-t] Track the External devices baudrate on internal device With the -t option baudrate changes made on the PC connected to the USB will be set to the intrenal device.
ef06175
to
9b36b85
Compare
@dagar - renamed and re-tested |
Continuation of #18621
Things to note:
@dirksavage88 @ryanjAA - please give this a shot.