-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
UAVCAN Does Not Work on Pixhawk4 Mini #14206
Comments
@DanielePettenuzzo @TSC21 @pavel-kirienko any pointers here? |
@dagar FYI |
Same behavior on 1.9.2 as well. |
@jinger26 It would be good if Holybro had a look. |
I have verified with Holybro that their schematic is correctly connected to CAN1. On the STM32. On the CAN Transceiver. |
|
@AlexKlimaj The other thing to check is if the silent pin is in the right state. |
Silent pin is low. Running
|
Do you know if this is pixhawk 4 mini specific? Have you tried the pixhawk 4 or another fmu-v5? Is it possible you're hitting a legitimate hardfault in the uavcan battery code? |
I've tested on my branch, 1.9.2, and 1.10.1. All exhibit the same behavior on the Pixhawk 4 Mini. Up until now, I have been doing all my testing on a Pixhawk 4 with no issues. |
I also just discovered that uavcan on the Pixhawk 4 doesn't work without an SD card inserted. |
yes the node server / fw use the SD card |
@hamishwillee Can you add a note in the UAVCAN documentation that it requires an SD card? |
Okay, now this is getting weird. I was just able to replicate the behavior on the Pixhawk 4. Deleting the uavcan folder on the sd card and resetting the uavcan parameters seemed to resolve it. |
Hi @AlexKlimaj
Can you confirm that you're saying UAVCAN itself requires an SD card be present to work:
Sounds like an unfortunate dependency - SD card dies and plane falls out of sky? How to fix depends a bit on above, but probably good to add notes to:
Seem reasonable? |
@hamishwillee Unless something has changed, it is only needed while the UAVCAN FW server and node ID allocation is done at boot up. The FW server is stopped after that and the memory is reclaimed. |
also cc @pavel-kirienko @TSC21 |
@davids5 Thank you. Is there any way for an end user to know or infer that this is a possible reason their (UAVCAN) motors won't start and power module doesn't supply info etc? i.e. this creates a dependency that every PX4 device must have an SD card (at boot) if it may have UAVCAN. That doesn't feel reasonable - but perhaps this is already a requirement somewhere? Based on your comment, do you think it reasonable I add the following note in various places:
|
I would go with, |
@davids5 Why omit the "on boot" clarification? I find it comforting to know that if my SD card dies in flight my UAVCAN motors won't :-) |
@hamishwillee because you will have to define the moment it is ok to not have it. When will that be? Use the HW to see how it works with current FW. Testing it on a unit will tell you how it really works, not how we think it works! Please take the initiative to do this sort of thing when questions arise. Card out of the system.
Reinsert card into the system (This will not work)
reboot - You have to boot with the SD in the system - and then finish FW upgrades and Node ID Allocation. BEFORE you remove the card.
Just tell the story as it is: "The SD card is required for UAVCAN Node allocation and firmware upgrade. It is not used during flight by UAVCAN" |
@davids5 - Thanks very much. I'll take your advice re the text.
I am unlikely to do this type of testing. While it is trivial for you, I don't have the knowledge, hardware, or understanding of how to interpret the results. Sorry if that is frustrating - but usually getting expert answers is a better use of everyone's time. |
@AlexKlimaj - My FMUv5 mini RC09 would not start UAVCAN I get
On investigating it, the board is built with # interfaces = 2, this is incorrect for the HW. But it is a shared bin file for the V5 and the Mini. So that is a problem that needs to be fixed. If I force the driver to return, with only on interface, I get no data on the one interface. I also get a hard fault on the accessing of that interface with Rebuilding the code with https://github.com/PX4/Firmware/blob/master/boards/px4/fmu-v5/default.cmake#L12 set to 1, works on a FMUv5, but there is not traffic on the mini. .... Looking at the data on the scope, I can see the the polarity of the CAN H and L are swapped on the mini. FMU V5 Correct Looking at the schematics I see there is an error on the Breakout board crossing CANH to CANL.
|
On the Mini hardware I have (which was purchased in December 2019), it is not swapped on the breakout board. I opened it up and verified the pinout from the pin of the CAN transceiver to the GH pin. I only get the hardfault if I start uavcan manually, then it hardfaults if I do |
@AlexKlimaj - We must have different HW. Are you using mavlink console? Try rebuilding with https://github.com/PX4/Firmware/blob/master/boards/px4/fmu-v5/default.cmake#L12 set to 1, then run it. |
I am using the debug port. dmesg shows the failed boot. Changing
BTW this is the output of ver all.
And the output of a
|
@AlexKlimaj - It was confirmed by the manufacture that the mini's prior to January 23,2019, has the swapped lines. This was mostly proto runs and should not have effected later production. But worth knowing. Would you please check today's master, compiled with UAVCAN_INTERFACES 2. I would expect it to still need to started manually, but not hardfault. I will work on the correct fix. |
@davids5 Looks like the hardfault is fixed.
If I start it manually with If I set |
I have a found the same as davids5 (post on Feb 29). The CAN bus high and low connections are physically swapped in the PH4-mini hardware I have. I have a PixHawk4 and a mini, and the 4 has always just worked, but the mini never. Finally got the scope out to look at the signals and they are definitely swapped. This hardware was only bought mid to late last year. I know this is not the main topic of this thread, but it is the only place I have found this pin swap mentioned. Be warned, not all problems are software. |
Thanks for the update. The firmware bug is fixed, so if UAVCAN is still not working on a Pixhawk 4 Mini, you likely have older hardware with the pins swapped. |
FYI, I decided to modify my PH4-mini. Procedure attached. Not a job for the faint hearted or inexperienced solderer. |
Nice looking rework! |
Describe the bug
The CAN port on the Pixhawk4 Mini is not working.
When checking the CAN High and CAN Low signals, there is no data being transmitted.
Tested on v1.10.1 Stable and current master.
To Reproduce
Expected behavior
Turn on UAVCAN through UAVCAN_ENABLE, reboot, connect UAVCAN device, and it will get a node ID. If no device is connected and you scope CAN High and Low, you will see data being transmitted.
Log Files and Screenshots
Pixhawk4 Mini with UAVCAN enabled. CAN High and CAN Low.
Expected behavior: Pixhawk4 Standard with UAVCAN enabled. CAN High and CAN Low.
TXD - Transmit Data input it idling high. Doesn't look like STM32 is sending any data.
The text was updated successfully, but these errors were encountered: