diff options
author | Pavel Kirienko <pavel.kirienko@gmail.com> | 2014-05-06 20:14:07 +0400 |
---|---|---|
committer | Pavel Kirienko <pavel.kirienko@gmail.com> | 2014-05-06 20:14:07 +0400 |
commit | 5716dad25db27315fa7cebf8183a71f864860f41 (patch) | |
tree | 0aba50a5ce503b53f95341d0156996a452c769c4 /src/modules/uavcan/uavcan_main.cpp | |
parent | 7d7a375dd1a69bd286f127de51b11e5ecd390640 (diff) | |
download | px4-firmware-5716dad25db27315fa7cebf8183a71f864860f41.tar.gz px4-firmware-5716dad25db27315fa7cebf8183a71f864860f41.tar.bz2 px4-firmware-5716dad25db27315fa7cebf8183a71f864860f41.zip |
Added workaround for hardware issue on Pixhawk v1
Diffstat (limited to 'src/modules/uavcan/uavcan_main.cpp')
-rw-r--r-- | src/modules/uavcan/uavcan_main.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules/uavcan/uavcan_main.cpp b/src/modules/uavcan/uavcan_main.cpp index fbb2e174b..474063aa6 100644 --- a/src/modules/uavcan/uavcan_main.cpp +++ b/src/modules/uavcan/uavcan_main.cpp @@ -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) |