PX4 / PX4-Autopilot

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

Dual UAVCAN GPS and UAVCAN GPS on CAN2 #16208

Open js-motocrane opened 4 years ago

js-motocrane commented 4 years ago

Describe problem solved by the proposed feature At least one type of UAVCAN-enabled GPS unit (Here2) does not seem to be enumerating two GPS units, when they are plugged into CAN-1 and CAN-2 on the Pixhawk unit (Cube black 2.1 in my case). Furthermore, the GPS unit seems to only function on CAN when it is plugged into the CAN-1 port. CAN-2 port seems non-operational, at least based on my testing.

Describe your preferred solution The preferred solution is that both CAN ports work to utilize UAVCAN GPS units (at least Here2), and that two UAVCAN GPS units can be used simultaneously.

dagar commented 4 years ago

Just to understand the core issue, do they both work if connected to the same bus?

js-motocrane commented 4 years ago

Good point, I will check ASAP...I will have to make a Y-harness to get them on the same bus. I will report as soon as I have the outcome.

js-motocrane commented 3 years ago

I had time and access to the hardware today, so I checked this out. It turns out that when both GPS units are connected in parallel on CAN1, they both show up when I use uavcan status in the nsh shell. Neither (nor both) of them work when connected to CAN2.

astekachev commented 3 years ago

I think the problem is in the can.c file See the lines:

if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2)

warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1."

undef CONFIG_STM32_CAN2

endif

ifdef CONFIG_STM32_CAN1

define CAN_PORT 1

else

define CAN_PORT 2

endif

rizvanovic commented 3 years ago

Any further development on this issue? Experiencing the same problem with two NEO 3 pro gps.