Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F411 SPI5 Tx/Rx Not Triggered #16

Open
djsg opened this issue Apr 13, 2023 · 1 comment
Open

F411 SPI5 Tx/Rx Not Triggered #16

djsg opened this issue Apr 13, 2023 · 1 comment

Comments

@djsg
Copy link

djsg commented Apr 13, 2023

Hi,

Following your blog, I have created a project for my F411 PCB board, where SPI5 is used for MCU to talk to SD card module.
I run my code and even cannot do the mounting, always getting error code 3.
So I did something like this: continuously trying f_mount
while(1) { fres = f_mount(&FatFs, "", 1); //1=mount now if (fres == FR_OK) { break; } sprintf(log_str, "f_mount error (%i)\r\n", fres); HAL_UART_Transmit(&huart2, (uint8_t *)log_str, strlen(log_str), 0xFFFF); }
After first error code 3, subsequently I got error code 1.
I used scope to monitor SPI5 SCK signal when running that infinite loop, it was flat.
However, if I just continuously call HAL_SPI_Transmit(&hspi5, tx_data, 4, 200);, I can see SCK signal.

In my main.h, I do have #define SD_SPI_HANDLE hspi5
Can anyone shed some light on what I have missed?

@kiwih
Copy link
Owner

kiwih commented May 17, 2023

Perhaps start with a simpler application of the SPI - talk to a basic component or just send random packets and measure them with the scope?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants