aboutsummaryrefslogtreecommitdiffstats
path: root/testhal
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2015-09-04 12:15:41 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2015-09-04 12:15:41 +0000
commit6274f1e25f189cf3e9792c96750261b7cdee8594 (patch)
tree61b83ed4864070fb3f2d58390985af8fb73d5d94 /testhal
parent8892a90de89b1cc135f5a0bda6988fc1f2e4411a (diff)
downloadChibiOS-6274f1e25f189cf3e9792c96750261b7cdee8594.tar.gz
ChibiOS-6274f1e25f189cf3e9792c96750261b7cdee8594.tar.bz2
ChibiOS-6274f1e25f189cf3e9792c96750261b7cdee8594.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8278 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal')
-rw-r--r--testhal/STM32/STM32F7xx/GPT-ADC/main.c7
-rw-r--r--testhal/STM32/STM32F7xx/GPT-ADC/mcuconf.h1
-rw-r--r--testhal/STM32/STM32F7xx/PWM-ICU/mcuconf.h1
-rw-r--r--testhal/STM32/STM32F7xx/SPI/main.c15
-rw-r--r--testhal/STM32/STM32F7xx/SPI/mcuconf.h1
-rw-r--r--testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h1
6 files changed, 10 insertions, 16 deletions
diff --git a/testhal/STM32/STM32F7xx/GPT-ADC/main.c b/testhal/STM32/STM32F7xx/GPT-ADC/main.c
index d0e810201..150a7d260 100644
--- a/testhal/STM32/STM32F7xx/GPT-ADC/main.c
+++ b/testhal/STM32/STM32F7xx/GPT-ADC/main.c
@@ -52,10 +52,15 @@ static adcsample_t samples1[ADC_GRP1_NUM_CHANNELS * ADC_GRP1_BUF_DEPTH];
size_t nx = 0, ny = 0;
static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
+#if 0
/* DMA buffer invalidation because data cache, only invalidating the
- half buffer just filled.*/
+ half buffer just filled.
+ Only required if the ADC buffer is placed in a cache-able area.*/
dmaBufferInvalidate(buffer,
n * adcp->grpp->num_channels * sizeof (adcsample_t));
+#else
+ (void)adcp;
+#endif
/* Updating counters.*/
if (samples1 == buffer) {
diff --git a/testhal/STM32/STM32F7xx/GPT-ADC/mcuconf.h b/testhal/STM32/STM32F7xx/GPT-ADC/mcuconf.h
index d691c84b6..dad6a515f 100644
--- a/testhal/STM32/STM32F7xx/GPT-ADC/mcuconf.h
+++ b/testhal/STM32/STM32F7xx/GPT-ADC/mcuconf.h
@@ -88,6 +88,7 @@
#define STM32_CECSEL STM32_CECSEL_LSE
#define STM32_CK48MSEL STM32_CK48MSEL_PLL
#define STM32_SDMMCSEL STM32_SDMMCSEL_PLL48CLK
+#define STM32_SRAM2_NOCACHE FALSE
/*
* ADC driver system settings.
diff --git a/testhal/STM32/STM32F7xx/PWM-ICU/mcuconf.h b/testhal/STM32/STM32F7xx/PWM-ICU/mcuconf.h
index 351e3eb80..5678eaca6 100644
--- a/testhal/STM32/STM32F7xx/PWM-ICU/mcuconf.h
+++ b/testhal/STM32/STM32F7xx/PWM-ICU/mcuconf.h
@@ -88,6 +88,7 @@
#define STM32_CECSEL STM32_CECSEL_LSE
#define STM32_CK48MSEL STM32_CK48MSEL_PLL
#define STM32_SDMMCSEL STM32_SDMMCSEL_PLL48CLK
+#define STM32_SRAM2_NOCACHE FALSE
/*
* ADC driver system settings.
diff --git a/testhal/STM32/STM32F7xx/SPI/main.c b/testhal/STM32/STM32F7xx/SPI/main.c
index 7632ca393..547e49501 100644
--- a/testhal/STM32/STM32F7xx/SPI/main.c
+++ b/testhal/STM32/STM32F7xx/SPI/main.c
@@ -55,14 +55,7 @@ static const SPIConfig ls_spicfg = {
*/
#define SPI_BUFFERS_SIZE 128U
-#if defined(__GNUC__)
-__attribute__((aligned (32)))
-#endif
static uint8_t txbuf[SPI_BUFFERS_SIZE];
-
-#if defined(__GNUC__)
-__attribute__((aligned (32)))
-#endif
static uint8_t rxbuf[SPI_BUFFERS_SIZE];
/*===========================================================================*/
@@ -87,7 +80,6 @@ static THD_FUNCTION(spi_thread_1, p) {
/* Preparing data buffer and flushing cache.*/
for (i = 0; i < SPI_BUFFERS_SIZE; i++)
txbuf[i] = (uint8_t)i;
- dmaBufferFlush(txbuf, SPI_BUFFERS_SIZE);
/* Slave selection and data exchange.*/
spiSelect(&SPID2);
@@ -95,9 +87,6 @@ static THD_FUNCTION(spi_thread_1, p) {
spiUnselect(&SPID2);
#if defined(SPI_LOOPBACK)
- /* Invalidating cache over the buffer then checking the
- loopback result.*/
- dmaBufferInvalidate(rxbuf, SPI_BUFFERS_SIZE);
if (memcmp(txbuf, rxbuf, SPI_BUFFERS_SIZE) != 0)
chSysHalt("loopback failure");
#endif
@@ -125,7 +114,6 @@ static THD_FUNCTION(spi_thread_2, p) {
/* Preparing data buffer and flushing cache.*/
for (i = 0; i < SPI_BUFFERS_SIZE; i++)
txbuf[i] = (uint8_t)(128U + i);
- dmaBufferFlush(txbuf, SPI_BUFFERS_SIZE);
/* Slave selection and data exchange.*/
spiSelect(&SPID2);
@@ -133,9 +121,6 @@ static THD_FUNCTION(spi_thread_2, p) {
spiUnselect(&SPID2);
#if defined(SPI_LOOPBACK)
- /* Invalidating cache over the buffer then checking the
- loopback result.*/
- dmaBufferInvalidate(rxbuf, SPI_BUFFERS_SIZE);
if (memcmp(txbuf, rxbuf, SPI_BUFFERS_SIZE) != 0)
chSysHalt("loopback failure");
#endif
diff --git a/testhal/STM32/STM32F7xx/SPI/mcuconf.h b/testhal/STM32/STM32F7xx/SPI/mcuconf.h
index d1452e162..9a7ac538a 100644
--- a/testhal/STM32/STM32F7xx/SPI/mcuconf.h
+++ b/testhal/STM32/STM32F7xx/SPI/mcuconf.h
@@ -88,6 +88,7 @@
#define STM32_CECSEL STM32_CECSEL_LSE
#define STM32_CK48MSEL STM32_CK48MSEL_PLL
#define STM32_SDMMCSEL STM32_SDMMCSEL_PLL48CLK
+#define STM32_SRAM2_NOCACHE FALSE
/*
* ADC driver system settings.
diff --git a/testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h b/testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h
index 8931b4ffe..5eae8dff9 100644
--- a/testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h
+++ b/testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h
@@ -88,6 +88,7 @@
#define STM32_CECSEL STM32_CECSEL_LSE
#define STM32_CK48MSEL STM32_CK48MSEL_PLL
#define STM32_SDMMCSEL STM32_SDMMCSEL_PLL48CLK
+#define STM32_SRAM2_NOCACHE FALSE
/*
* ADC driver system settings.