aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-08-25 08:43:06 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-08-25 08:43:06 +0000
commitaa5b03d54d50e12fef3d0734d9afd2ff3a13c967 (patch)
tree5245730a051dabbbf560f6d4d4c42d2daae1bec8 /testhal/STM32
parent78b0e26049801b6b843bfb8355e26e26809494f4 (diff)
downloadChibiOS-aa5b03d54d50e12fef3d0734d9afd2ff3a13c967.tar.gz
ChibiOS-aa5b03d54d50e12fef3d0734d9afd2ff3a13c967.tar.bz2
ChibiOS-aa5b03d54d50e12fef3d0734d9afd2ff3a13c967.zip
Fixed bug #879.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10483 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32')
-rw-r--r--testhal/STM32/STM32F4xx/SPI/debug/STM32F4xx-SPI (OpenOCD, Flash and Run).launch2
-rw-r--r--testhal/STM32/STM32F7xx/SPI/main.c20
2 files changed, 16 insertions, 6 deletions
diff --git a/testhal/STM32/STM32F4xx/SPI/debug/STM32F4xx-SPI (OpenOCD, Flash and Run).launch b/testhal/STM32/STM32F4xx/SPI/debug/STM32F4xx-SPI (OpenOCD, Flash and Run).launch
index 03aa07db2..7d1aebba0 100644
--- a/testhal/STM32/STM32F4xx/SPI/debug/STM32F4xx-SPI (OpenOCD, Flash and Run).launch
+++ b/testhal/STM32/STM32F4xx/SPI/debug/STM32F4xx-SPI (OpenOCD, Flash and Run).launch
@@ -33,7 +33,7 @@
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
<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="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;contentList&gt;&lt;content id=&quot;cr2-adc_lld_start_conversion-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;CR2-adc-null-port_wait_for_interrupt-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;CR2-adc-adcp-adc_lld_start_conversion-(format)&quot; val=&quot;4&quot;/&gt;&lt;/contentList&gt;"/>
+<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;contentList&gt;&lt;content id=&quot;CR2-adc-adcp-adc_lld_start_conversion-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;CR2-adc-null-port_wait_for_interrupt-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;cr2-adc_lld_start_conversion-(format)&quot; val=&quot;4&quot;/&gt;&lt;/contentList&gt;"/>
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;globalVariableList/&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList/&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>
diff --git a/testhal/STM32/STM32F7xx/SPI/main.c b/testhal/STM32/STM32F7xx/SPI/main.c
index 2b0c1744b..c9bc3696e 100644
--- a/testhal/STM32/STM32F7xx/SPI/main.c
+++ b/testhal/STM32/STM32F7xx/SPI/main.c
@@ -32,7 +32,7 @@ static const SPIConfig hs_spicfg = {
NULL,
GPIOB,
GPIOB_ARD_D15,
- SPI_CR1_BR_0,
+ SPI_CR1_CPOL | SPI_CR1_BR_0,
SPI_CR2_DS_2 | SPI_CR2_DS_1 | SPI_CR2_DS_0
};
@@ -167,15 +167,25 @@ int main(void) {
/*
* Starting the transmitter and receiver threads.
*/
- chThdCreateStatic(spi_thread_1_wa, sizeof(spi_thread_1_wa),
- NORMALPRIO + 1, spi_thread_1, NULL);
- chThdCreateStatic(spi_thread_2_wa, sizeof(spi_thread_2_wa),
- NORMALPRIO + 1, spi_thread_2, NULL);
+// chThdCreateStatic(spi_thread_1_wa, sizeof(spi_thread_1_wa),
+// NORMALPRIO + 1, spi_thread_1, NULL);
+// chThdCreateStatic(spi_thread_2_wa, sizeof(spi_thread_2_wa),
+// NORMALPRIO + 1, spi_thread_2, NULL);
/*
* Normal main() thread activity, in this demo it does nothing.
*/
+ uint8_t byte = 0x55;
while (true) {
chThdSleepMilliseconds(500);
+ spiStart(&SPID2, &hs_spicfg);
+
+ spiSelect(&SPID2);
+ spiSend(&SPID2, 1, &byte);
+ spiUnselect(&SPID2);
+
+ spiSelect(&SPID2);
+ spiSend(&SPID2, 1, &byte);
+ spiUnselect(&SPID2);
}
}