git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7961 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
3922b69fc1
commit
e48520b2ab
|
@ -5,7 +5,7 @@
|
|||
|
||||
# Compiler options here.
|
||||
ifeq ($(USE_OPT),)
|
||||
USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
|
||||
USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
|
||||
endif
|
||||
|
||||
# C specific options here (added to USE_OPT).
|
||||
|
@ -43,6 +43,8 @@ ifeq ($(USE_VERBOSE_COMPILE),)
|
|||
USE_VERBOSE_COMPILE = no
|
||||
endif
|
||||
|
||||
USE_SMART_BUILD = yes
|
||||
|
||||
#
|
||||
# Build global options
|
||||
##############################################################################
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<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="CR2-adc-adcp-adc_lld_start_conversion-(format)" val="4"/><content id="CR2-adc-null-port_wait_for_interrupt-(format)" val="4"/><content id="cr2-adc_lld_start_conversion-(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.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList> <memoryBlockExpressionItem> <expression text="0x200014e8"/> </memoryBlockExpressionItem> </memoryBlockExpressionList> "/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="STM32F4xx-SDC"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
|
||||
|
|
|
@ -59,9 +59,10 @@ static THD_FUNCTION(Thread1, arg) {
|
|||
|
||||
#define SDC_BURST_SIZE 16
|
||||
|
||||
/* Buffer for block read/write operations, note that an extra byte is
|
||||
/* Buffer for block read/write operations, note that extra bytes are
|
||||
allocated in order to support unaligned operations.*/
|
||||
static uint8_t buf[MMCSD_BLOCK_SIZE * SDC_BURST_SIZE + 1];
|
||||
static uint8_t buf[MMCSD_BLOCK_SIZE * SDC_BURST_SIZE + 4];
|
||||
|
||||
/* Additional buffer for sdcErase() test */
|
||||
static uint8_t buf2[MMCSD_BLOCK_SIZE * SDC_BURST_SIZE ];
|
||||
|
||||
|
@ -93,7 +94,7 @@ void cmd_sdc(BaseSequentialStream *chp, int argc, char *argv[]) {
|
|||
SDCD1.csd[3], SDCD1.csd[2], SDCD1.csd[1], SDCD1.csd[0]);
|
||||
chprintf(chp, "CID : %08X %8X %08X %08X \r\n",
|
||||
SDCD1.cid[3], SDCD1.cid[2], SDCD1.cid[1], SDCD1.cid[0]);
|
||||
chprintf(chp, "Mode : %s\r\n", mode[SDCD1.cardmode]);
|
||||
chprintf(chp, "Mode : %s\r\n", mode[SDCD1.cardmode & 3U]);
|
||||
chprintf(chp, "Capacity : %DMB\r\n", SDCD1.capacity / 2048);
|
||||
|
||||
/* The test is performed in the middle of the flash area.*/
|
||||
|
@ -161,6 +162,43 @@ void cmd_sdc(BaseSequentialStream *chp, int argc, char *argv[]) {
|
|||
#endif /* STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
||||
}
|
||||
|
||||
if ((strcmp(argv[0], "write") == 0) ||
|
||||
(strcmp(argv[0], "all") == 0)) {
|
||||
unsigned i;
|
||||
|
||||
memset(buf, 0xAA, MMCSD_BLOCK_SIZE * 2);
|
||||
chprintf(chp, "Writing...");
|
||||
if(sdcWrite(&SDCD1, startblk, buf, 2)) {
|
||||
chprintf(chp, "failed\r\n");
|
||||
goto exittest;
|
||||
}
|
||||
chprintf(chp, "OK\r\n");
|
||||
|
||||
memset(buf, 0x55, MMCSD_BLOCK_SIZE * 2);
|
||||
chprintf(chp, "Reading...");
|
||||
if (blkRead(&SDCD1, startblk, buf, 1)) {
|
||||
chprintf(chp, "failed\r\n");
|
||||
goto exittest;
|
||||
}
|
||||
chprintf(chp, "OK\r\n");
|
||||
|
||||
for (i = 0; i < MMCSD_BLOCK_SIZE; i++)
|
||||
buf[i] = i + 8;
|
||||
chprintf(chp, "Writing...");
|
||||
if(sdcWrite(&SDCD1, startblk, buf, 2)) {
|
||||
chprintf(chp, "failed\r\n");
|
||||
goto exittest;
|
||||
}
|
||||
chprintf(chp, "OK\r\n");
|
||||
|
||||
memset(buf, 0, MMCSD_BLOCK_SIZE * 2);
|
||||
chprintf(chp, "Reading...");
|
||||
if (blkRead(&SDCD1, startblk, buf, 1)) {
|
||||
chprintf(chp, "failed\r\n");
|
||||
goto exittest;
|
||||
}
|
||||
chprintf(chp, "OK\r\n");
|
||||
}
|
||||
|
||||
if ((strcmp(argv[0], "erase") == 0) ||
|
||||
(strcmp(argv[0], "all") == 0)) {
|
||||
|
@ -235,12 +273,6 @@ void cmd_sdc(BaseSequentialStream *chp, int argc, char *argv[]) {
|
|||
/* END of sdcErase() test */
|
||||
}
|
||||
|
||||
|
||||
if ((strcmp(argv[0], "write") == 0) ||
|
||||
(strcmp(argv[0], "all") == 0)) {
|
||||
|
||||
}
|
||||
|
||||
/* Card disconnect and command end.*/
|
||||
exittest:
|
||||
sdcDisconnect(&SDCD1);
|
||||
|
|
Loading…
Reference in New Issue