diff options
-rwxr-xr-x | testhal/ATSAMA5D2/MATRIX/Makefile | 3 | ||||
-rw-r--r-- | testhal/ATSAMA5D2/MATRIX/debug/SAMA5D2-MATRIX (DDRAM).launch | 58 | ||||
-rwxr-xr-x | testhal/ATSAMA5D2/MATRIX/main.c | 12 | ||||
-rw-r--r-- | testhal/ATSAMA5D2/MATRIX/mcuconf.h | 53 | ||||
-rwxr-xr-x | testhal/ATSAMA5D2/MATRIX/readme.txt | 3 |
5 files changed, 103 insertions, 26 deletions
diff --git a/testhal/ATSAMA5D2/MATRIX/Makefile b/testhal/ATSAMA5D2/MATRIX/Makefile index 3f185becd..797a1585c 100755 --- a/testhal/ATSAMA5D2/MATRIX/Makefile +++ b/testhal/ATSAMA5D2/MATRIX/Makefile @@ -127,7 +127,8 @@ 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
+LDSCRIPT= $(STARTUPLD)/SAMA5D2ddr.ld
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
diff --git a/testhal/ATSAMA5D2/MATRIX/debug/SAMA5D2-MATRIX (DDRAM).launch b/testhal/ATSAMA5D2/MATRIX/debug/SAMA5D2-MATRIX (DDRAM).launch new file mode 100644 index 000000000..2bb54e349 --- /dev/null +++ b/testhal/ATSAMA5D2/MATRIX/debug/SAMA5D2-MATRIX (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-MATRIX/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="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-MATRIX"/>
+<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-MATRIX"/>
+</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="2294784" label="0x230400"/> <gdbmemoryBlockExpression address="2290688" label="0x22f400"/> <gdbmemoryBlockExpression address="2290688" label="0x22f400"/> <gdbmemoryBlockExpression address="2290688" label="0x22f400"/> <gdbmemoryBlockExpression address="2290688" label="0x22f400"/> <gdbmemoryBlockExpression address="2097249" label="0x200061"/> <gdbmemoryBlockExpression address="2097152" label="0x200000"/> <gdbmemoryBlockExpression address="2159616" label="0x20f400"/> <gdbmemoryBlockExpression address="2159616" label="0x20f400"/> <gdbmemoryBlockExpression address="2159616" label="0x20f400"/> <gdbmemoryBlockExpression address="2159616" label="0x20f400"/> <gdbmemoryBlockExpression address="2159616" label="0x20f400"/> <gdbmemoryBlockExpression address="2159616" label="0x20f400"/> <gdbmemoryBlockExpression address="2163712" label="0x210400"/> <gdbmemoryBlockExpression address="2163712" label="0x210400"/> </memoryBlockExpressionList> "/>
+<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
+</launchConfiguration>
diff --git a/testhal/ATSAMA5D2/MATRIX/main.c b/testhal/ATSAMA5D2/MATRIX/main.c index 4005a8705..ea2e59c67 100755 --- a/testhal/ATSAMA5D2/MATRIX/main.c +++ b/testhal/ATSAMA5D2/MATRIX/main.c @@ -8,8 +8,8 @@ void go2ns(void) { /* Configure SRAM0 as not secure Read and not secure write */
mtxConfigSlaveSec(MATRIX0,H64MX_SLAVE_SRAM, LOWER_AREA_SECURABLE,
NOT_SECURE_READ, NOT_SECURE_WRITE);
- /* Configure SRAM1 upper area as not secure Read and secure write */
- mtxConfigSlaveSec(MATRIX0, H64MX_SLAVE_L2C_SRAM, UPPER_AREA_SECURABLE,
+ /* Configure SRAM0 upper area as not secure Read and secure write */
+ mtxConfigSlaveSec(MATRIX0, H64MX_SLAVE_SRAM, UPPER_AREA_SECURABLE,
NOT_SECURE_READ, SECURE_WRITE);
asm(
"mrc p15, 0, r0, c1, c1, 0\n\t" /* Set NS bit into SCR register */
@@ -25,13 +25,13 @@ int main(void) { mtxSetSlaveSplitAddr(MATRIX0, H64MX_SLAVE_L2C_SRAM, MATRIX_AREA_SIZE_64K,
REGION_0);
- uint32_t *writeNotSecureSRAM1 = (uint32_t *)(0x220000 + 61 * 1024); /* Lower area region SRAM1 */
- uint32_t *writeSecureSRAM1 = (uint32_t *)(0x220000 + 65 * 1024); /* Upper area region SRAM1 */
+ uint32_t *writeNotSecureSRAM1 = (uint32_t *)(0x200000 + 61 * 1024); /* Lower area region SRAM0 */
+ uint32_t *writeSecureSRAM1 = (uint32_t *)(0x200000 + 65 * 1024); /* Upper area region SRAM0 */
/* Go into Not Secure Mode*/
go2ns();
- /* Writing in SRAM1 Lower Area */
+ /* Writing in SRAM0 Lower Area */
*writeNotSecureSRAM1 = 0xAA55AA55; /* writing succeeded*/
- /* Writing in SRAM1 Upper Area */
+ /* Writing in SRAM0 Upper Area */
*writeSecureSRAM1 = 0xAA55AA55; /* writing not succeeded*/
while (true) {
diff --git a/testhal/ATSAMA5D2/MATRIX/mcuconf.h b/testhal/ATSAMA5D2/MATRIX/mcuconf.h index fcdb66611..ac1b16235 100644 --- a/testhal/ATSAMA5D2/MATRIX/mcuconf.h +++ b/testhal/ATSAMA5D2/MATRIX/mcuconf.h @@ -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
@@ -36,23 +36,14 @@ #define SAMA_H64MX_H32MX_RATIO 2
/*
- * SPI driver system settings.
+ * SDMMC driver system settings.
*/
-#define SAMA_SPI_USE_SPI0 FALSE
-#define SAMA_SPI_USE_SPI1 FALSE
-#define SAMA_SPI_USE_FLEXCOM0 FALSE
-#define SAMA_SPI_USE_FLEXCOM1 FALSE
-#define SAMA_SPI_USE_FLEXCOM2 FALSE
-#define SAMA_SPI_USE_FLEXCOM3 FALSE
-#define SAMA_SPI_USE_FLEXCOM4 FALSE
-#define SAMA_SPI_SPI0_DMA_IRQ_PRIORITY 4
-#define SAMA_SPI_SPI1_DMA_IRQ_PRIORITY 4
-#define SAMA_SPI_FLEXCOM0_DMA_IRQ_PRIORITY 4
-#define SAMA_SPI_FLEXCOM1_DMA_IRQ_PRIORITY 4
-#define SAMA_SPI_FLEXCOM2_DMA_IRQ_PRIORITY 4
-#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 HAL_USE_SDMMC FALSE
+
+/*
+ * SECUMOD driver system settings.
+ */
+#define HAL_USE_SECUMOD FALSE
/*
* SERIAL driver system settings.
@@ -62,7 +53,6 @@ #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 +70,33 @@ #define SAMA_SERIAL_FLEXCOM4_IRQ_PRIORITY 4
/*
+ * SPI driver system settings.
+ */
+#define SAMA_SPI_USE_SPI0 FALSE
+#define SAMA_SPI_USE_SPI1 FALSE
+#define SAMA_SPI_USE_FLEXCOM0 FALSE
+#define SAMA_SPI_USE_FLEXCOM1 FALSE
+#define SAMA_SPI_USE_FLEXCOM2 FALSE
+#define SAMA_SPI_USE_FLEXCOM3 FALSE
+#define SAMA_SPI_USE_FLEXCOM4 FALSE
+#define SAMA_SPI_SPI0_DMA_IRQ_PRIORITY 4
+#define SAMA_SPI_SPI1_DMA_IRQ_PRIORITY 4
+#define SAMA_SPI_FLEXCOM0_DMA_IRQ_PRIORITY 4
+#define SAMA_SPI_FLEXCOM1_DMA_IRQ_PRIORITY 4
+#define SAMA_SPI_FLEXCOM2_DMA_IRQ_PRIORITY 4
+#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
+
+/*
+ * ST driver settings.
+ */
+#define SAMA_ST_USE_PIT FALSE
+#define SAMA_ST_USE_TC0 FALSE
+#define SAMA_ST_USE_TC1 TRUE
+
+/*
* TC driver system settings.
*/
#define HAL_USE_TC FALSE
diff --git a/testhal/ATSAMA5D2/MATRIX/readme.txt b/testhal/ATSAMA5D2/MATRIX/readme.txt index cc6e568f6..54fbf102d 100755 --- a/testhal/ATSAMA5D2/MATRIX/readme.txt +++ b/testhal/ATSAMA5D2/MATRIX/readme.txt @@ -7,7 +7,8 @@ The demo targets a generic ARM Cortex-A5 device without HAL support.
** The Demo **
-
+Demo configures security zone on SRAM0. Zones are tested with two writing
+tentatives.
** Build Procedure **
** Notes **
|