Edit linker script and fix read function in SDIO

This commit is contained in:
Mario Hüttel 2020-02-22 19:30:13 +01:00
parent 4b07178f3d
commit cd986ff984
2 changed files with 10 additions and 6 deletions

View File

@ -246,15 +246,19 @@ DRESULT SDIO_disk_read(BYTE *buff, DWORD sector, UINT count){
SDIO->DLEN = (1 << BLOCKSIZE);
/* Init Transfer */
if (SDIO_send_read_block_CMD17(addr)) {
return RES_ERROR;
}
SDIO->ICR = SDIO_ICR_CCRCFAILC | SDIO_ICR_DCRCFAILC | SDIO_ICR_CTIMEOUTC | SDIO_ICR_DTIMEOUTC |
SDIO_ICR_TXUNDERRC | SDIO_ICR_RXOVERRC | SDIO_ICR_CMDRENDC | SDIO_ICR_CMDSENTC | SDIO_ICR_DATAENDC |
SDIO_ICR_STBITERRC | SDIO_ICR_DBCKENDC | SDIO_ICR_SDIOITC | SDIO_ICR_CEATAENDC;
SDIO->DCTRL = (BLOCKSIZE<<4) | SDIO_DCTRL_DTDIR | /*SDIO_DCTRL_DMAEN |*/ SDIO_DCTRL_DTEN;
/* Init Transfer */
if (SDIO_send_read_block_CMD17(addr)) {
SDIO->DCTRL = 0;
return RES_ERROR;
}
debug=0;
counter = 0;
while (counter < (1<<(BLOCKSIZE-2)) || !(SDIO->STA & (SDIO_STA_DBCKEND | SDIO_STA_DATAEND))) { // TODO: Handle errors

View File

@ -152,7 +152,7 @@ SECTIONS
/* Uninitialized data section */
. = ALIGN(4);
.bss :
.bss (NOLOAD):
{
/* This is used by the startup in order to initialize the .bss secion */
_sbss = .; /* define a global symbol at bss start */
@ -167,7 +167,7 @@ SECTIONS
} >RAM
/* User_heap_stack section, used to check that there is enough RAM left */
._user_heap_stack :
._user_heap_stack (NOLOAD):
{
. = ALIGN(4);
PROVIDE (heap_low = .); /* for _sbrk */