Commit Graph

93 Commits

Author SHA1 Message Date
Andrew Tridgell afbdd69165 AP_HAL_ChibiOS: adjust stack sizes 2021-01-10 08:28:55 +11:00
Andrew Tridgell 46976c4358 HAL_ChibiOS: fixed remapping of ioline_t with BRD_ALT_CONFIG
when a peripheral is made available via BRD_ALT_CONFIG we need to
remap the existing ioline_t in the UART and I2C drivers to use the new
pin.

This fixes an issue with half-duplex, inverted, swapped UART pins for
protocols like FPort and FPort2
2020-10-28 19:51:45 +11:00
Andrew Tridgell 989f8c5d41 HAL_ChibiOS: fixed a race condition in UART DMA transmit
this fixes an issue seen on one board which caused a watchdog on high
uart DMA load. We have reproduced the issue on another board by
forcing a very high DMA transfer rate on the same DMA channel while
also requesting very high transfer rates on the UART. The likely race
is in the DMA transmit timeout code, and the simplest fix is to lock
out interrupts during the DMA setup to ensure the tx timeout cannot
trigger during the setup
2020-10-12 13:25:48 +11:00
Siddharth Purohit a7d641c705 AP_HAL_ChibiOS: add available method for locked state 2020-08-19 17:31:09 +10:00
Peter Barker 931c77fa77 AP_HAL_ChibiOS: correct clearing of UART drivers 2020-06-03 17:00:44 +10:00
Peter Barker 6d9e563ede AP_HAL_ChibiOS: override read(buffer,count) method to be more efficient 2020-05-26 15:59:11 +10:00
Peter Barker 8f54de4184 AP_HAL_ChibiOS: add discard_input method on UARTDriver 2020-05-26 09:20:32 +10:00
Andrew Tridgell db8fdeebeb HAL_ChibiOS: fixed Hott telem half duplex handling
this fixes an issue with single byte writes with half duplex. It isn't
an elegent solution, but nicely separates the different types of half
duplex operation
2020-04-17 17:52:28 +10:00
Andrew Tridgell fc0b2ef920 HAL_ChibiOS: added half-duplex protection for non-inverted
to prevent output bytes being seen as input bytes we disable half
duplex during transmit. This was previously only done for non-inverted
UARTs. This patch enables it whether we are inverted or not. This
greatly reduces the number of bad input bytes.
2020-03-20 12:37:52 +11:00
Andrew Tridgell 8b93e0f57d HAL_ChibiOS: prevent double init of USB
this prevented init of USB CubeBlack on Windows. Thanks to Randy for
reporting
2020-02-12 17:44:09 +11:00
Andrew Tridgell e8ab35a192 HAL_ChibiOS: fixed stdout in early startup bug
this caused a failure to boot on some boards if they tried to print
messages in early startup code before hal was initialised

thanks to @Shadowru for reporting the issue
2020-02-12 13:51:10 +11:00
Andrew Tridgell a8501a91c7 HAL_ChibiOS: fixed handling of write mutex
this fixes an issue with log download on USB and mavlink throughput
caused lock contention. The issue was introduced with the changes for
unbuffered writes recently (does not affect stable releases)
2020-01-21 08:37:25 +11:00
Andrew Tridgell a935b764f4 HAL_ChibiOS: fixed UART DMA issue on F4
disabling in rx irq callback should only be done on F3
2020-01-18 07:13:11 +11:00
Andrew Tridgell 9554103418 HAL_ChibiOS: don't extend alloc of iomcu uart 2020-01-18 07:13:11 +11:00
Andrew Tridgell a7b83b1e26 HAL_ChibiOS: allow for unbuffered writes without DMA 2020-01-16 20:36:54 +11:00
Andrew Tridgell bb5c1d07e1 HAL_ChibiOS: implement new UART option bits 2020-01-03 17:32:23 +11:00
Andrew Tridgell b1ca7380be HAL_ChibiOS: re-implement half-duplex using HDSEL switching
this makes half-duplex more reliable on UARTs with pullups or level
shifters
2020-01-02 09:52:57 +11:00
Andrew Tridgell faf34970e1 HAL_ChibiOS: automatically control pullup/pulldown on inverted UARTs
this makes setup of sport telemetry much easier
2020-01-02 09:52:57 +11:00
Andrew Tridgell 4b4642dd4d HAL_ChibiOS: allow handling of much higher receiver baudrates with DMA
this uses two DMA RX bouncebuffers to minimise the time with DMA
disabled so that we can handle much higher baudrates
2019-12-26 10:42:48 +11:00
Andrew Tridgell 58292821b3 HAL_ChibiOS: fix DMA on UARTs for F303 2019-12-26 10:42:48 +11:00
Andrew Tridgell ccd1ce406c HAL_ChibiOS: scale uart rx buffer size with baudrate
this ensures we have enough buffer space for a RTK GPS, as well as for
high speed comms with a companion computer
2019-12-23 09:54:36 +11:00
Andrew Tridgell bc1de7a208 HAL_ChibiOS: support STM32F3xx MCUs 2019-11-01 10:53:53 +11:00
Mirko Denecke b84dcd483d AP_HAL_ChibiOS: remove unnecessary tabs and whitespaces 2019-10-21 08:01:56 +11:00
Andrew Tridgell bf2cf7834d HAL_ChibiOS: fixed a bug in parity/stop-bit setting on STM32F7 and H7
and add get_options() method
2019-09-06 08:51:45 +10:00
Andrew Tridgell d1565a96c5 HAL_ChibiOS: wrap cacheBuffer functions
needed to avoid problem with end() method in UARTDriver shadowing with
F7 implementation of cache macros
2019-08-27 15:40:43 +10:00
Andrew Tridgell 16bdaaa1af HAL_ChibiOS: added support for STM31F10x for AP_Periph 2019-08-27 10:29:56 +10:00
Andrew Tridgell 8080efbc6a HAL_ChibiOS: allow for blocking unbuffered uarts
this is used by AP_IOMCU to avoid a race condition where the mutex is
busy on write() causing a zero-length write and delayed output
2019-08-17 17:36:41 +10:00
Andrew Tridgell afc8a70ce4 HAL_ChibiOS: fixed a bug in wait_timeout() on UARTs
wait_timeout() could return true on a read of less bytes than are
expected.
2019-08-17 17:36:41 +10:00
Siddharth Purohit 2f0d1336e6 HAL_ChibiOS: add support for dual usd cdc 2019-07-12 17:01:21 +10:00
Andrew Tridgell 7e1048c89b HAL_ChibiOS: enable UART inversion on H7 2019-03-01 11:39:27 +11:00
Andrew Tridgell 64681cb05c HAL_ChibiOS: allocate threads from any heap
this fixes a failure on MatekF405-Wing where it fails to allocate the
SPI thread for the IMU
2019-02-27 11:54:28 +11:00
Andrew Tridgell dad1774330 HAL_ChibiOS: fixed channel selection for F4/F7 uart driver 2019-02-26 16:18:26 +11:00
Andrew Tridgell 9647a68c9e HAL_ChibiOS: fixed UART RX DMA for H7 2019-02-26 16:18:26 +11:00
Andrew Tridgell 231117e9b1 HAL_ChibiOS: invalidate before read on rx, not on DMA setup
more efficient, as we only invalidate what was used
2019-02-26 16:18:26 +11:00
Andrew Tridgell 071d5e01af HAL_ChibiOS: added DMAMUX channel assignment calls 2019-02-26 16:18:26 +11:00
Andrew Tridgell f4e31ce65b HAL_ChibiOS: added more cache flush ops 2019-02-26 16:18:26 +11:00
Andrew Tridgell dd8115c9b4 HAL_ChibiOS: check for already allocated TX dma in UART driver 2019-02-26 16:18:26 +11:00
Andrew Tridgell d9c888ab45 HAL_ChibiOS: port SPI, I2C and UART drivers to H7 2019-02-26 16:18:26 +11:00
Andrew Tridgell bbd25350eb HAL_ChibiOS: support ChibiOS kernel major 6
preparing for STM32H7 support
2019-02-26 16:18:26 +11:00
Siddharth Purohit b5fbdc9888 HAL_ChibiOS: invoke serial data event signal for non dma ports as well 2019-01-23 15:57:05 +11:00
Andrew Tridgell 8c43db1a00 HAL_ChibiOS: implement half-duplex delay and read locking 2018-12-29 15:58:22 +11:00
Andrew Tridgell 013f1d55e8 HAL_ChibiOS: added support for swapping UART pins 2018-11-20 18:25:35 +11:00
Andrew Tridgell d84bc9f556 HAL_ChibiOS: fixed STM32F7 RXINV flag 2018-11-16 15:48:21 +11:00
Andrew Tridgell 85243ad522 HAL_ChibiOS: enable support for half-duplex uart config 2018-11-14 19:05:09 +11:00
Andrew Tridgell acf03980ca HAL_ChibiOS: added UART inversion options
support GPIO pins or STM32F7
2018-11-14 19:05:09 +11:00
Andrew Tridgell 8c962e6f0f HAL_ChibiOS: use a larger TX buffer on USB
this is needed for fast log download on vehicles with 50Hz main loop
2018-08-28 08:50:50 +10:00
Francisco Ferreira 1b46104a98 AP_HAL_ChibiOS: fix warning when STDOUT is defined
../../libraries/AP_HAL_ChibiOS/UARTDriver.cpp:118:12: warning: 'int hal_console_vprintf(const char*, va_list)' defined but not used [-Wunused-function]
 static int hal_console_vprintf(const char *fmt, va_list arg)
            ^
2018-08-14 10:17:38 +10:00
Andrew Tridgell 7aba99e229 HAL_ChibiOS: fixes for ChibiOS version update 2018-08-03 13:44:59 +10:00
Siddharth Purohit 395c48933c HAL_ChibiOS: move tto using updated time conversion API 2018-08-03 13:44:59 +10:00
Andrew Tridgell 44fd85ff29 HAL_ChibiOS: reduce memory used by serial buffers
this does not appear to affect log download speed. It saves about 27k
of memory
2018-08-01 13:11:16 +10:00