diff options
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/ATSAMA5D2/UART/debug/SAMA5D2-UART (DDRAM).launch | 58 | ||||
-rw-r--r-- | testhal/ATSAMA5D2/UART/main.c | 18 | ||||
-rw-r--r-- | testhal/ATSAMA5D2/UART/readme.txt | 2 |
3 files changed, 69 insertions, 9 deletions
diff --git a/testhal/ATSAMA5D2/UART/debug/SAMA5D2-UART (DDRAM).launch b/testhal/ATSAMA5D2/UART/debug/SAMA5D2-UART (DDRAM).launch new file mode 100644 index 000000000..4cfd21840 --- /dev/null +++ b/testhal/ATSAMA5D2/UART/debug/SAMA5D2-UART (DDRAM).launch @@ -0,0 +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-FLEX-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="20100000"/>
+<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-UART"/>
+<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-UART"/>
+</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"> <gdbmemoryBlockExpression address="4026531840" label="0xF0000000"/> </memoryBlockExpressionList> "/>
+<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
+</launchConfiguration>
diff --git a/testhal/ATSAMA5D2/UART/main.c b/testhal/ATSAMA5D2/UART/main.c index 12bf9b55d..8cd5aa714 100644 --- a/testhal/ATSAMA5D2/UART/main.c +++ b/testhal/ATSAMA5D2/UART/main.c @@ -114,9 +114,9 @@ static UARTConfig uart_cfg_1 = { rxerr,
NULL,
0,
- 38400,
- 0,
- US_MR_CHRL_8_BIT | US_MR_PAR_NO
+ 38400, /* Baud rate */
+ 0, /* CR register */
+ US_MR_CHRL_8_BIT | US_MR_PAR_NO /* MR register */
};
/*
@@ -136,7 +136,8 @@ int main(void) { chSysInit();
/*
- * Activates the flexcom uart driver 0, PB28(RX) and PB29(RX) are routed to FLEXCOM0.
+ * Activates the flexcom uart driver 0.
+ * PB28 and PB29 are routed to FLEXCOM0.
*/
uartStart(&FUARTD0, &uart_cfg_1);
@@ -150,16 +151,15 @@ int main(void) { */
while (true) {
if (!palReadPad(PIOB, PIOB_USER_PB)) {
- /*
- * Starts both a transmission and a receive operations, both will be
- * handled entirely in background.
- */
+ /*
+ * Starts both a transmission and a receive operations, both will be
+ * handled entirely in background.
+ */
uartStopReceive(&FUARTD0);
uartStopSend(&FUARTD0);
uartStartReceive(&FUARTD0, BUFFER, buffer);
uartStartSend(&FUARTD0, BUFFER+1, message);
}
-
chThdSleepMilliseconds(500);
}
}
diff --git a/testhal/ATSAMA5D2/UART/readme.txt b/testhal/ATSAMA5D2/UART/readme.txt index cc6e568f6..65cd69a56 100644 --- a/testhal/ATSAMA5D2/UART/readme.txt +++ b/testhal/ATSAMA5D2/UART/readme.txt @@ -8,6 +8,8 @@ The demo targets a generic ARM Cortex-A5 device without HAL support. ** The Demo **
+Pressing user button, Uart sends and receives packets in loopback.
+
** Build Procedure **
** Notes **
|