diff options
author | David Sidrane <david_s5@nscdg.com> | 2015-01-26 11:24:20 -1000 |
---|---|---|
committer | David Sidrane <david_s5@nscdg.com> | 2015-04-07 07:18:44 -1000 |
commit | 5cdd6b45f056d2009b3f8cb9e24b10af6115415d (patch) | |
tree | abafd8cbc8f96dc87f11fe04d2948ea1fe1e868c /src/drivers | |
parent | 5294c5b5e0727b6da023f7c52b2f5b627649201b (diff) | |
download | px4-firmware-5cdd6b45f056d2009b3f8cb9e24b10af6115415d.tar.gz px4-firmware-5cdd6b45f056d2009b3f8cb9e24b10af6115415d.tar.bz2 px4-firmware-5cdd6b45f056d2009b3f8cb9e24b10af6115415d.zip |
Bug fix:The CRC detection on px4io was failing with -1 result, do the the fact that the PX4IO_Uploader had closed the port and Nuttx (now) disabled the clock and PX4IO_serial did not managed the clock
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/px4io/px4io_serial.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/drivers/px4io/px4io_serial.cpp b/src/drivers/px4io/px4io_serial.cpp index 16d917ef5..752f22d01 100644 --- a/src/drivers/px4io/px4io_serial.cpp +++ b/src/drivers/px4io/px4io_serial.cpp @@ -217,6 +217,9 @@ PX4IO_serial::~PX4IO_serial() stm32_unconfiggpio(PX4IO_SERIAL_TX_GPIO); stm32_unconfiggpio(PX4IO_SERIAL_RX_GPIO); + /* Disable APB clock for the USART peripheral */ + modifyreg32(STM32_RCC_APB2ENR, RCC_APB2ENR_USART6EN, 0); + /* and kill our semaphores */ sem_destroy(&_completion_semaphore); sem_destroy(&_bus_semaphore); @@ -247,6 +250,10 @@ PX4IO_serial::init() return -1; } + + /* Enable the APB clock for the USART peripheral */ + modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_USART6EN); + /* configure pins for serial use */ stm32_configgpio(PX4IO_SERIAL_TX_GPIO); stm32_configgpio(PX4IO_SERIAL_RX_GPIO); |