2015-07-12 08:32 AM
2015-07-12 09:40 AM
Can't help you with HAL stuff, but consider waiting for TXE to assert *before* jamming data out the DR.
2015-07-12 10:10 AM
Can you give
me an idea
or
example
code
2015-07-12 10:43 AM
If you're going to post plots from a logic analyzer, label the signals, and for SPI show MOSI, MISO, CLK and CS pins.
Not a HAL user, but this should be a more thoughtful implementationGPIOC->BSRRL = GPIO_BSRR_BS_13; // Inverted #CS, Set HIGH?
while((SPI3->SR & SPI_SR_TXE) != SPI_SR_TXE); // Wait for TXE to indicate empty
ms_data = SPI3->DR; // Dummy Read to clear any stale RXNE
ms_data = 0xAA; // Data you want to send
SPI3->DR = ms_data; // Write data into EMPTY register
while((SPI3->SR & SPI_SR_RXNE) != SPI_SR_RXNE); // Wait for RXNE, last bit sent already
ms_data = SPI3->DR; // Could skip this, clears *this* RXNE
GPIOC->BSRRH = GPIO_BSRR_BS_13; // Inverted #CS, Set LOW?
2015-07-12 02:29 PM
I did
use the
SD card
I
use
the program in
PIC processors
I've used
before
is now
trying to
adapt
STM32
.
I tried to
adapt
the
links below
, but came
very confused
me
so
I could
adapt
.
http://stm32f4-discovery.com/2014/07/library-21-read-sd-card-fatfs-stm32f4xx-devices/
2015-07-12 02:53 PM
This
bug
STM32
series
of
mistakes
by me
or
HAL
library.