diff options
author | edolomb <none@example.com> | 2018-01-17 13:16:06 +0000 |
---|---|---|
committer | edolomb <none@example.com> | 2018-01-17 13:16:06 +0000 |
commit | df330879bb5c5630e847e2e9eec471080b0d18a4 (patch) | |
tree | 317d101e8b2f9de4d537c753838798392457bf8b | |
parent | 9b222d8552c5a3a5272fd22e9bdaabfa5ece5678 (diff) | |
download | ChibiOS-df330879bb5c5630e847e2e9eec471080b0d18a4.tar.gz ChibiOS-df330879bb5c5630e847e2e9eec471080b0d18a4.tar.bz2 ChibiOS-df330879bb5c5630e847e2e9eec471080b0d18a4.zip |
Updated demo SPI
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11299 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | testhal/ATSAMA5D2/SPI/Makefile | 4 | ||||
-rw-r--r-- | testhal/ATSAMA5D2/SPI/debug/SAMA5D2-SPI (Load and Run).launch | 113 | ||||
-rw-r--r-- | testhal/ATSAMA5D2/SPI/debug/SAMA5D2-SPI (bootstrap).launch | 55 | ||||
-rw-r--r-- | testhal/ATSAMA5D2/SPI/main.c | 23 | ||||
-rw-r--r-- | testhal/ATSAMA5D2/SPI/mcuconf.h | 25 |
5 files changed, 152 insertions, 68 deletions
diff --git a/testhal/ATSAMA5D2/SPI/Makefile b/testhal/ATSAMA5D2/SPI/Makefile index 52802f056..75f0754e3 100644 --- a/testhal/ATSAMA5D2/SPI/Makefile +++ b/testhal/ATSAMA5D2/SPI/Makefile @@ -223,10 +223,10 @@ CPPWARN = -Wall -Wextra -Wundef #
# List all user C define here, like -D_DEBUG=1
-UDEFS =
+UDEFS = -DCH_CFG_USE_MMU
# Define ASM defines here
-UADEFS =
+UADEFS = -DCH_CFG_USE_MMU
# List all user directories here
UINCDIR =
diff --git a/testhal/ATSAMA5D2/SPI/debug/SAMA5D2-SPI (Load and Run).launch b/testhal/ATSAMA5D2/SPI/debug/SAMA5D2-SPI (Load and Run).launch index 8854c23ea..66e94cdbb 100644 --- a/testhal/ATSAMA5D2/SPI/debug/SAMA5D2-SPI (Load and Run).launch +++ b/testhal/ATSAMA5D2/SPI/debug/SAMA5D2-SPI (Load and Run).launch @@ -1,55 +1,58 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType"> -<stringAttribute key="bad_container_name" value="/SAMA5D2-SPI/debu"/> -<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="3"/> -<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="true"/> -<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/> -<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/> -<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/> -<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="mon reg cpsr = 0xd3 set *0xF8048000 = 0xA5000004 set *0x00A00100 = 0 set *0xF8048044 = 0x00008000 mon cp15 1 0 0 0 = 0x00C50078 set *0xF0014004 = 0x4 set *0xF0014014 = 1<<13"/> -<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/> -<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="Generic TCP/IP"/> -<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/> -<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/> -<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value="200000"/> -<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="2331"/> -<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/> -<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="true"/> -<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/> -<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/> -<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/> -<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/> -<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/> -<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/> -<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/> -<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/> -<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/> -<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/> -<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="arm-none-eabi-gdb"/> -<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard"/> -<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/> -<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/> -<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/> -<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/> -<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="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="null-sama_clock_init-(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/> "/> -<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/> -<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="SAMA5D2-SPI"/> -<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/> -<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> -<listEntry value="/SAMA5D2-SPI"/> -</listAttribute> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> -<listEntry value="4"/> -</listAttribute> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> -</listAttribute> -<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="reserved-for-future-use"> <gdbmemoryBlockExpression address="2294784" label="0x230400"/> </memoryBlockExpressionList> "/> -<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/> -</launchConfiguration> +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType">
+<stringAttribute key="bad_container_name" value="/SAMA5D2-SPI/debu"/>
+<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="3"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="mon reg cpsr = 0xd3 set *0xF8048000 = 0xA5000004 set *0x00A00100 = 0 set *0xF8048044 = 0x00008000 mon cp15 1 0 0 0 = 0x00C50078 set *0xF0014004 = 0x4 set *0xF0014014 = 1<<13"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="Generic TCP/IP"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value="200000"/>
+<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="2331"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="_start"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
+<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="arm-none-eabi-gdb"/>
+<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard"/>
+<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/>
+<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/>
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
+<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="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="mode-_pal_lld_setgroupmode-(format)" val="4"/><content id="null-boardInit-(format)" val="2"/><content id="null-sama_clock_init-(format)" val="4"/><content id="null-_pal_lld_setgroupmode-(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/> "/>
+<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="SAMA5D2-SPI"/>
+<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/SAMA5D2-SPI"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+<mapEntry key="[debug]" value="org.eclipse.cdt.debug.gdbjtag.core.dsfLaunchDelegate"/>
+</mapAttribute>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="reserved-for-future-use"/> "/>
+<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
+</launchConfiguration>
diff --git a/testhal/ATSAMA5D2/SPI/debug/SAMA5D2-SPI (bootstrap).launch b/testhal/ATSAMA5D2/SPI/debug/SAMA5D2-SPI (bootstrap).launch new file mode 100644 index 000000000..e73b49be3 --- /dev/null +++ b/testhal/ATSAMA5D2/SPI/debug/SAMA5D2-SPI (bootstrap).launch @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType"> +<stringAttribute key="bad_container_name" value="/SAMA5D2-SPI/debu"/> +<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="3"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="mon reg cpsr = 0xd3 set *0xF8048000 = 0xA5000004 set *0x00A00100 = 0 set *0xF8048044 = 0x00008000 mon cp15 1 0 0 0 = 0x00C50078 set *0xF0014004 = 0x4 set *0xF0014014 = 1<<13 load ~/bootstrap.elf mon reg pc = 0x00200000 continue"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="Generic TCP/IP"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value="200000"/> +<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="2331"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="_start"/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/> +<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/> +<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/> +<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="arm-none-eabi-gdb"/> +<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard"/> +<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/> +<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/> +<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/> +<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/> +<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="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="null-_pal_lld_setgroupmode-(format)" val="4"/><content id="null-sama_clock_init-(format)" val="4"/><content id="null-boardInit-(format)" val="2"/><content id="mode-_pal_lld_setgroupmode-(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/> "/> +<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/> +<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="SAMA5D2-SPI"/> +<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/> +<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/SAMA5D2-SPI"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="4"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> +<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> +</listAttribute> +<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="reserved-for-future-use"> <gdbmemoryBlockExpression address="4026531840" label="0xF0000000"/> </memoryBlockExpressionList> "/> +<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/> +</launchConfiguration> diff --git a/testhal/ATSAMA5D2/SPI/main.c b/testhal/ATSAMA5D2/SPI/main.c index f2c61f0d8..ed1fd8d89 100644 --- a/testhal/ATSAMA5D2/SPI/main.c +++ b/testhal/ATSAMA5D2/SPI/main.c @@ -25,6 +25,12 @@ static virtual_timer_t vt3; static char txbuf[BUFFER_SIZE] = "0123456789ABCDEF";
static char rxbuf[BUFFER_SIZE];
+static const SerialConfig sdcfg = {
+ 115200,
+ 0,
+ UART_MR_PAR_NO
+};
+
static void led3off(void *p) {
(void)p;
@@ -88,12 +94,12 @@ int main(void) { /*
* Activates the serial driver 0 using the driver default configuration.
*/
- sdStart(&SD0, NULL);
+ sdStart(&SD1, &sdcfg);
spiStart(&SPID1, &mst_spicfg); /* Setup transfer parameters. */
- /* Redirecting UART0 RX on PB26 and UART0 TX on PB 27. */
- palSetGroupMode(PIOB, PAL_PORT_BIT(26) | PAL_PORT_BIT(27), 0U,
- PAL_SAMA_FUNC_PERIPH_C | PAL_MODE_SECURE);
+ /* Redirecting UART1 RX on PD2 and UART1 TX on PD3. */
+ palSetGroupMode(PIOD, PAL_PORT_BIT(2) | PAL_PORT_BIT(3), 0U,
+ PAL_SAMA_FUNC_PERIPH_A | PAL_MODE_SECURE);
/* Redirecting SPI1 pins. */
palSetGroupMode(PIOD, PAL_PORT_BIT(25) | PAL_PORT_BIT(26) |
@@ -104,12 +110,17 @@ int main(void) { while (true) {
if(!palReadPad(PIOB, PIOB_USER_PB)) {
+ /* SPI operation in loopback*/
spiExchange(&SPID1, BUFFER_SIZE, &txbuf, &rxbuf);
+
+ /* D-Cache L1 is enabled */
+ cacheInvalidateRegion(&rxbuf, sizeof(rxbuf));
+
if (!memcmp(txbuf, rxbuf, BUFFER_SIZE)){
- chprintf((BaseSequentialStream*)&SD0, "Transfer complete\n\r");
+ chprintf((BaseSequentialStream*)&SD1, "Transfer complete\n\r");
}
else {
- chprintf((BaseSequentialStream*)&SD0, "ERROR: Buffers are not the same!\n\r");
+ chprintf((BaseSequentialStream*)&SD1, "ERROR: Buffers are not the same!\n\r");
}
}
chThdSleepMilliseconds(500);
diff --git a/testhal/ATSAMA5D2/SPI/mcuconf.h b/testhal/ATSAMA5D2/SPI/mcuconf.h index b59e031d7..80c78dbfd 100644 --- a/testhal/ATSAMA5D2/SPI/mcuconf.h +++ b/testhal/ATSAMA5D2/SPI/mcuconf.h @@ -53,16 +53,26 @@ #define SAMA_SPI_FLEXCOM3_DMA_IRQ_PRIORITY 4
#define SAMA_SPI_FLEXCOM4_DMA_IRQ_PRIORITY 4
#define SAMA_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
+#define SPI_SELECT_MODE SPI_SELECT_MODE_NONE
+
+/*
+ * SECUMOD driver system settings.
+ */
+#define HAL_USE_SECUMOD FALSE
+
+/*
+ * SDMMC driver system settings.
+ */
+#define HAL_USE_SDMMC FALSE
/*
* SERIAL driver system settings.
*/
-#define SAMA_SERIAL_USE_UART0 TRUE
-#define SAMA_SERIAL_USE_UART1 FALSE
+#define SAMA_SERIAL_USE_UART0 FALSE
+#define SAMA_SERIAL_USE_UART1 TRUE
#define SAMA_SERIAL_USE_UART2 FALSE
#define SAMA_SERIAL_USE_UART3 FALSE
#define SAMA_SERIAL_USE_UART4 FALSE
-#define SAMA_SERIAL_USE_UART5 FALSE
#define SAMA_SERIAL_USE_FLEXCOM0 FALSE
#define SAMA_SERIAL_USE_FLEXCOM1 FALSE
#define SAMA_SERIAL_USE_FLEXCOM2 FALSE
@@ -80,6 +90,13 @@ #define SAMA_SERIAL_FLEXCOM4_IRQ_PRIORITY 4
/*
+ * ST driver settings.
+ */
+#define SAMA_ST_USE_PIT TRUE
+#define SAMA_ST_USE_TC0 FALSE
+#define SAMA_ST_USE_TC1 FALSE
+
+/*
* TC driver system settings.
*/
#define HAL_USE_TC FALSE
@@ -123,6 +140,4 @@ #define SAMA_UART_FLEXCOM4_DMA_IRQ_PRIORITY 4
#define SAMA_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
-#define SPI_SELECT_MODE SPI_SELECT_MODE_NONE
-
#endif /* MCUCONF_H */
|