diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2015-08-13 13:03:42 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2015-08-13 13:03:42 +0000 |
commit | a2b33f23233a009759e3fad20b031b7cb9f92278 (patch) | |
tree | c246f08b1e8e28a0c59eef90e80fb7a9549ac907 /testhal | |
parent | d46360e613ac879b9564346d683592a26718ad9b (diff) | |
download | ChibiOS-a2b33f23233a009759e3fad20b031b7cb9f92278.tar.gz ChibiOS-a2b33f23233a009759e3fad20b031b7cb9f92278.tar.bz2 ChibiOS-a2b33f23233a009759e3fad20b031b7cb9f92278.zip |
Fixed a problem caused by STM32F7xx errata.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8213 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/debug/STM32F7xx-GPT-ADC-SPI-PWM-ICU (OpenOCD, Just Run).launch | 2 | ||||
-rw-r--r-- | testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/main.c | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/debug/STM32F7xx-GPT-ADC-SPI-PWM-ICU (OpenOCD, Just Run).launch b/testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/debug/STM32F7xx-GPT-ADC-SPI-PWM-ICU (OpenOCD, Just Run).launch index 15b9f9dcc..4a6e47225 100644 --- a/testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/debug/STM32F7xx-GPT-ADC-SPI-PWM-ICU (OpenOCD, Just Run).launch +++ b/testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/debug/STM32F7xx-GPT-ADC-SPI-PWM-ICU (OpenOCD, Just Run).launch @@ -33,7 +33,7 @@ <intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="0"/>
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
-<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="vt_delta-null-chVTDoSetI-(format)" val="4"/><content id="r3-(format)" val="4"/></contentList>"/>
+<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="r3-(format)" val="4"/><content id="vt_delta-null-chVTDoSetI-(format)" val="4"/></contentList>"/>
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/>
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList> <memoryBlockExpressionItem> <expression text="0x20010744"/> </memoryBlockExpressionItem> </memoryBlockExpressionList> "/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>
diff --git a/testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/main.c b/testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/main.c index 50b0948a7..009c9de1a 100644 --- a/testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/main.c +++ b/testhal/STM32/STM32F7xx/GPT-ADC-SPI-PWM-ICU/main.c @@ -48,9 +48,6 @@ static void adccallback(ADCDriver *adcp, adcsample_t *buffer, size_t n) { (void)adcp;
- /* DMA buffer invalidation because data cache.*/
- dmaBufferInvalidate(buffer, buffer + n * ADC_GRP1_NUM_CHANNELS);
-
/* Updating counters.*/
if (samples1 == buffer) {
nx += n;
@@ -76,12 +73,12 @@ static void adcerrorcallback(ADCDriver *adcp, adcerror_t err) { * Channels: Sensor, VRef.
*/
static const ADCConversionGroup adcgrpcfg1 = {
- TRUE,
+ true,
ADC_GRP1_NUM_CHANNELS,
adccallback,
adcerrorcallback,
0, /* CR1 */
- ADC_CR2_SWSTART, /* CR2 */
+ ADC_CR2_EXTEN_RISING | ADC_CR2_EXTSEL_SRC(12), /* CR2 */
ADC_SMPR1_SMP_SENSOR(ADC_SAMPLE_144) | ADC_SMPR1_SMP_VREF(ADC_SAMPLE_144),
0, /* SMPR2 */
ADC_SQR1_NUM_CH(ADC_GRP1_NUM_CHANNELS), /* SQR1 */
@@ -142,6 +139,12 @@ int main(void) { gptStart(&GPTD4, &gpt4cfg1);
/*
+ * Fixed an errata on the STM32F7xx, the DAC clock is required for ADC
+ * triggering.
+ */
+ rccEnableDAC1(false);
+
+ /*
* Activates the ADC1 driver and the temperature sensor.
*/
adcStart(&ADCD1, NULL);
|