-2

I am working with a STM32 eval2 board and trying to debug it. It used to work fine, and I haven´t changed anything, but for the last week or so I am always getting stuck in this loop while I am in debugger mode, but when I am not, the program runs fine.

while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND | SDIO_FLAG_STBITERR))
{
if(__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXDAVL))
{
  *(tempscr + index) = SDIO_ReadFIFO(hsd->Instance);
  index++;
}
}

I even tried running the sample project code provided for the board by ST, did not change anything about it, and I am stuck in the same while loop in their code as well.

Does anybody know what I am doing wrong here? It doesn´t make sense because nothing changed.

The errors that are defined by the variables in the while loop are (respectively):

Received FIFO overrun error

Data block sent/received (CRC check failed)

Data timeout

Data block sent/received (CRC check passed)

Start bit not detected on all data signals in wide bus mode

and it looks like in this while loop it is getting stuck in the if statement for a "Data available in receive FIFO" flag, if that makes sense. I cannot step over that if statement.

I am using keil v5 and programming in c++

Well, I have been struggling with this for a week and almost right after I posted this I figured it out.

I had the SD card in, and for some reason taking it out fixed it. So I will leave this in case anyone else ever has this stupid problem.

Dude
  • 261
  • 2
  • 5
  • 14
  • You're going to have to show us what all those macros are... – Joe Jul 21 '14 at 07:49
  • Did you initialize the SDIO controller before trying to use it? Are you using hardware flow control or bypass mode (48 MHz)? Those are both broken and have errata. – rjp Jul 21 '14 at 19:11
  • Tell us what the chip is, not the board. STM32 is a *range* of parts, not a chip. Is it possible that the SDIO lines are multiplexed with the JTAG lines? – Clifford Jul 21 '14 at 21:38
  • If you read the whole "question", you'll note the problem as already been solved. "Taking out the SD card fixed it." – Ross Jul 21 '14 at 21:59

1 Answers1

0

Well, I have been struggling with this for a week and almost right after I posted this I figured it out.

I had the SD card in, and for some reason taking it out fixed it. So I will leave this in case somebody else has this stupid problem.

Dude
  • 261
  • 2
  • 5
  • 14