mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 09:27:34 +08:00
Added workaround for hardware issue on Pixhawk v1
This commit is contained in:
@@ -61,7 +61,7 @@ include $(UAVCAN_DIR)/libuavcan_drivers/stm32/driver/include.mk
|
||||
SRCS += $(LIBUAVCAN_STM32_SRC)
|
||||
INCLUDE_DIRS += $(LIBUAVCAN_STM32_INC)
|
||||
EXTRADEFINES += -DUAVCAN_STM32_NUTTX \
|
||||
-DUAVCAN_STM32_NUM_IFACES=1
|
||||
-DUAVCAN_STM32_NUM_IFACES=2
|
||||
|
||||
#
|
||||
# Invoke DSDL compiler
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <systemlib/err.h>
|
||||
#include <systemlib/systemlib.h>
|
||||
#include <arch/board/board.h>
|
||||
#include <arch/chip/chip.h>
|
||||
#include "uavcan_main.hpp"
|
||||
|
||||
extern "C" __EXPORT int uavcan_main(int argc, char *argv[]);
|
||||
@@ -53,9 +54,14 @@ void print_usage()
|
||||
|
||||
int test_thread(int argc, char *argv[])
|
||||
{
|
||||
/*
|
||||
* Forced pull up on CAN2 is required for Pixhawk v1 where the second interface lacks a transceiver.
|
||||
* If no transceiver is connected, the RX pin will float, occasionally causing CAN controller to
|
||||
* fail during initialization.
|
||||
*/
|
||||
stm32_configgpio(GPIO_CAN1_RX);
|
||||
stm32_configgpio(GPIO_CAN1_TX);
|
||||
stm32_configgpio(GPIO_CAN2_RX);
|
||||
stm32_configgpio(GPIO_CAN2_RX | GPIO_PULLUP);
|
||||
stm32_configgpio(GPIO_CAN2_TX);
|
||||
int res = can_driver.init(1000000);
|
||||
if (res < 0)
|
||||
|
||||
Reference in New Issue
Block a user