diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-05-28 13:24:17 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-05-28 13:24:17 +0000 |
commit | dce45c502e691cc8ec98bc7c88a4922aedfcb76d (patch) | |
tree | 2c558718794bb5a27c8f54bec5d97f670d9bf66c | |
parent | 6f500a998692ede3a5a6a8a007dfc5e885bdd48c (diff) | |
download | ChibiOS-dce45c502e691cc8ec98bc7c88a4922aedfcb76d.tar.gz ChibiOS-dce45c502e691cc8ec98bc7c88a4922aedfcb76d.tar.bz2 ChibiOS-dce45c502e691cc8ec98bc7c88a4922aedfcb76d.zip |
Fixed bug #825.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10212 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.c | 8 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c | 8 | ||||
-rw-r--r-- | readme.txt | 2 |
3 files changed, 18 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.c b/os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.c index 8baf59717..4be8cedc1 100644 --- a/os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.c +++ b/os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.c @@ -513,6 +513,8 @@ void spi_lld_unselect(SPIDriver *spip) { */
void spi_lld_ignore(SPIDriver *spip, size_t n) {
+ osalDbgAssert(n < 65536, "unsupported DMA transfer size");
+
dmaStreamSetMemory0(spip->dmarx, &dummyrx);
dmaStreamSetTransactionSize(spip->dmarx, n);
dmaStreamSetMode(spip->dmarx, spip->rxdmamode);
@@ -543,6 +545,8 @@ void spi_lld_ignore(SPIDriver *spip, size_t n) { void spi_lld_exchange(SPIDriver *spip, size_t n,
const void *txbuf, void *rxbuf) {
+ osalDbgAssert(n < 65536, "unsupported DMA transfer size");
+
dmaStreamSetMemory0(spip->dmarx, rxbuf);
dmaStreamSetTransactionSize(spip->dmarx, n);
dmaStreamSetMode(spip->dmarx, spip->rxdmamode| STM32_DMA_CR_MINC);
@@ -570,6 +574,8 @@ void spi_lld_exchange(SPIDriver *spip, size_t n, */
void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
+ osalDbgAssert(n < 65536, "unsupported DMA transfer size");
+
dmaStreamSetMemory0(spip->dmarx, &dummyrx);
dmaStreamSetTransactionSize(spip->dmarx, n);
dmaStreamSetMode(spip->dmarx, spip->rxdmamode);
@@ -597,6 +603,8 @@ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { */
void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) {
+ osalDbgAssert(n < 65536, "unsupported DMA transfer size");
+
dmaStreamSetMemory0(spip->dmarx, rxbuf);
dmaStreamSetTransactionSize(spip->dmarx, n);
dmaStreamSetMode(spip->dmarx, spip->rxdmamode | STM32_DMA_CR_MINC);
diff --git a/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c b/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c index 4512dabe8..914249fe7 100644 --- a/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c +++ b/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c @@ -515,6 +515,8 @@ void spi_lld_unselect(SPIDriver *spip) { */
void spi_lld_ignore(SPIDriver *spip, size_t n) {
+ osalDbgAssert(n < 65536, "unsupported DMA transfer size");
+
dmaStreamSetMemory0(spip->dmarx, &dummyrx);
dmaStreamSetTransactionSize(spip->dmarx, n);
dmaStreamSetMode(spip->dmarx, spip->rxdmamode);
@@ -545,6 +547,8 @@ void spi_lld_ignore(SPIDriver *spip, size_t n) { void spi_lld_exchange(SPIDriver *spip, size_t n,
const void *txbuf, void *rxbuf) {
+ osalDbgAssert(n < 65536, "unsupported DMA transfer size");
+
dmaStreamSetMemory0(spip->dmarx, rxbuf);
dmaStreamSetTransactionSize(spip->dmarx, n);
dmaStreamSetMode(spip->dmarx, spip->rxdmamode | STM32_DMA_CR_MINC);
@@ -572,6 +576,8 @@ void spi_lld_exchange(SPIDriver *spip, size_t n, */
void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
+ osalDbgAssert(n < 65536, "unsupported DMA transfer size");
+
dmaStreamSetMemory0(spip->dmarx, &dummyrx);
dmaStreamSetTransactionSize(spip->dmarx, n);
dmaStreamSetMode(spip->dmarx, spip->rxdmamode);
@@ -599,6 +605,8 @@ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { */
void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) {
+ osalDbgAssert(n < 65536, "unsupported DMA transfer size");
+
dmaStreamSetMemory0(spip->dmarx, rxbuf);
dmaStreamSetTransactionSize(spip->dmarx, n);
dmaStreamSetMode(spip->dmarx, spip->rxdmamode | STM32_DMA_CR_MINC);
diff --git a/readme.txt b/readme.txt index 1b2a50eea..bf77f32f0 100644 --- a/readme.txt +++ b/readme.txt @@ -179,6 +179,8 @@ to 16.1.8).
- HAL: Fixed invalid SDC OCR initialization value (bug #826)(backported
to 16.1.8).
+- HAL: Fixed SPI operations silently drop length bits (bug #825)(backported
+ to 16.1.9).
- HAL: Fixed osThreadSetPriority() returns old priority instead of a status
code (bug #823)(backported to 16.1.8).
- HAL: Fixed problem in rtcSTM32SetPeriodicWakeup() (bug #821)(backported
|