mirror of https://github.com/rusefi/ChibiOS.git
SAMA5D2-SERIAL now runs in DDR using FLEXCOM0 as serial
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11487 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
0b5d6d6f77
commit
2b9c2a3ad5
|
@ -127,7 +127,9 @@ include $(CHIBIOS)/os/common/ports/ARMCAx-TZ/compilers/GCC/mk/port_generic.mk
|
|||
#include $(CHIBIOS)/test/oslib/oslib_test.mk
|
||||
|
||||
# Define linker script file here
|
||||
LDSCRIPT= $(STARTUPLD)/SAMA5D2.ld
|
||||
#LDSCRIPT= $(STARTUPLD)/SAMA5D2.ld
|
||||
# Only if SAMA_NO_INIT is TRUE
|
||||
LDSCRIPT= $(STARTUPLD)/SAMA5D2ddr.ld
|
||||
|
||||
# C sources that can be compiled in ARM or THUMB mode depending on the global
|
||||
# setting.
|
||||
|
|
|
@ -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-SERIAL/debug"/>
|
||||
<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-SERIAL"/>
|
||||
<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-SERIAL"/>
|
||||
</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>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType">
|
||||
<stringAttribute key="bad_container_name" value="/SAMA5D2-SERIAL/debu"/>
|
||||
<stringAttribute key="bad_container_name" value="/SAMA5D2-SERIAL/debug"/>
|
||||
<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"/>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType">
|
||||
<stringAttribute key="bad_container_name" value="/SAMA5D2-SERIAL/debu"/>
|
||||
<stringAttribute key="bad_container_name" value="/SAMA5D2-SERIAL/debug"/>
|
||||
<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.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"/>
|
||||
|
@ -34,7 +34,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="<?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.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"/>
|
||||
|
@ -47,9 +47,12 @@
|
|||
<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="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>
|
||||
|
|
|
@ -74,7 +74,7 @@ static THD_FUNCTION(Thread1, arg) {
|
|||
static const SerialConfig sdcfg = {
|
||||
115200,
|
||||
0,
|
||||
UART_MR_PAR_NO
|
||||
US_MR_CHRL_8_BIT | US_MR_PAR_NO
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -95,11 +95,12 @@ int main(void) {
|
|||
/*
|
||||
* Activates the serial driver 1 using the driver default configuration.
|
||||
*/
|
||||
sdStart(&SD1, &sdcfg);
|
||||
sdStart(&FSD0, &sdcfg);
|
||||
|
||||
/* Redirecting FLEX0 RX on PB29 and FLEX0 TX on PB28. */
|
||||
palSetGroupMode(PIOB, PAL_PORT_BIT(28) | PAL_PORT_BIT(29), 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);
|
||||
/*
|
||||
* Creates the blinker thread.
|
||||
*/
|
||||
|
@ -109,9 +110,9 @@ int main(void) {
|
|||
* Normal main() thread activity.
|
||||
*/
|
||||
while (true) {
|
||||
getInputString((BaseSequentialStream *)&SD1, lineBuffer, BUFFER_SIZE);
|
||||
chprintf((BaseSequentialStream *)&SD1, lineBuffer);
|
||||
chprintf((BaseSequentialStream *)&SD1, "\n\r");
|
||||
getInputString((BaseSequentialStream *)&FSD0, lineBuffer, BUFFER_SIZE);
|
||||
chprintf((BaseSequentialStream *)&FSD0, lineBuffer);
|
||||
chprintf((BaseSequentialStream *)&FSD0, "\n\r");
|
||||
chThdSleepMilliseconds(500);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
* HAL driver system settings.
|
||||
*/
|
||||
#define SAMA_HAL_IS_SECURE TRUE
|
||||
#define SAMA_NO_INIT FALSE
|
||||
#define SAMA_NO_INIT TRUE
|
||||
#define SAMA_MOSCRC_ENABLED FALSE
|
||||
#define SAMA_MOSCXT_ENABLED TRUE
|
||||
#define SAMA_MOSC_SEL SAMA_MOSC_MOSCXT
|
||||
|
@ -35,6 +35,40 @@
|
|||
#define SAMA_PLLADIV2_EN TRUE
|
||||
#define SAMA_H64MX_H32MX_RATIO 2
|
||||
|
||||
/*
|
||||
* SDMMC driver system settings.
|
||||
*/
|
||||
#define HAL_USE_SDMMC FALSE
|
||||
|
||||
/*
|
||||
* SECUMOD driver system settings.
|
||||
*/
|
||||
#define HAL_USE_SECUMOD FALSE
|
||||
|
||||
/*
|
||||
* SERIAL driver system settings.
|
||||
*/
|
||||
#define SAMA_SERIAL_USE_UART0 FALSE
|
||||
#define SAMA_SERIAL_USE_UART1 FALSE
|
||||
#define SAMA_SERIAL_USE_UART2 FALSE
|
||||
#define SAMA_SERIAL_USE_UART3 FALSE
|
||||
#define SAMA_SERIAL_USE_UART4 FALSE
|
||||
#define SAMA_SERIAL_USE_FLEXCOM0 TRUE
|
||||
#define SAMA_SERIAL_USE_FLEXCOM1 FALSE
|
||||
#define SAMA_SERIAL_USE_FLEXCOM2 FALSE
|
||||
#define SAMA_SERIAL_USE_FLEXCOM3 FALSE
|
||||
#define SAMA_SERIAL_USE_FLEXCOM4 FALSE
|
||||
#define SAMA_SERIAL_UART0_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_UART1_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_UART2_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_UART3_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_UART4_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_FLEXCOM0_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_FLEXCOM1_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_FLEXCOM2_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_FLEXCOM3_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_FLEXCOM4_IRQ_PRIORITY 4
|
||||
|
||||
/*
|
||||
* SPI driver system settings.
|
||||
*/
|
||||
|
@ -55,46 +89,12 @@
|
|||
#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 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_FLEXCOM0 FALSE
|
||||
#define SAMA_SERIAL_USE_FLEXCOM1 FALSE
|
||||
#define SAMA_SERIAL_USE_FLEXCOM2 FALSE
|
||||
#define SAMA_SERIAL_USE_FLEXCOM3 FALSE
|
||||
#define SAMA_SERIAL_USE_FLEXCOM4 FALSE
|
||||
#define SAMA_SERIAL_UART0_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_UART1_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_UART2_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_UART3_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_UART4_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_FLEXCOM0_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_FLEXCOM1_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_FLEXCOM2_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_FLEXCOM3_IRQ_PRIORITY 4
|
||||
#define SAMA_SERIAL_FLEXCOM4_IRQ_PRIORITY 4
|
||||
|
||||
/*
|
||||
* ST driver settings.
|
||||
*/
|
||||
#define SAMA_ST_USE_PIT TRUE
|
||||
#define SAMA_ST_USE_PIT FALSE
|
||||
#define SAMA_ST_USE_TC0 FALSE
|
||||
#define SAMA_ST_USE_TC1 FALSE
|
||||
#define SAMA_ST_USE_TC1 TRUE
|
||||
|
||||
/*
|
||||
* TC driver system settings.
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
The demo targets a generic ARM Cortex-A5 device without HAL support.
|
||||
|
||||
** The Demo **
|
||||
Simple echo from terminal
|
||||
|
||||
Simple echo from terminal using FLEXCOM0 as serial
|
||||
|
||||
** Build Procedure **
|
||||
|
||||
|
|
Loading…
Reference in New Issue