Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


NUCLEO-F429ZI - SDIO - FatFS - Stm32CubeMX

Dear All,
I’m new to this forum and to stm32 board. I’m trying to connect an SD Card to my board NUCLEO-F429ZI but I’m having some problems with it.
I use STM32CUBEMX to create the project using the standard peripherals settings.
I put SDIO in SD 4 bit interfacing mode. I do not change anything in clock configuration.
I connect the SD Card directly to SDIO PIN without any resistors as in picture SD Card   Nucleo F429ZI Connection
Board PIN SD Pin
PD2 2 (CMD)
PC8 7 (Dat0)
PC9 8 (Dat1)
PC10 9 (Dat2)
PC11 1 (Dat3)
PC12 5 (CLK)

this is the piece of code:

HAL_UART_Transmit(&huart3, “Start\r\n”, strlen(“Start\r\n”), 0xFFFF);
FRESULT res;
uint32_t wbytes;
uint8_t wtext[] = “text to write logical disk”;
FATFS_LinkDriver(&SD_Driver, SDPath);
if(f_mount(&SDFatFS, (TCHAR const*)SDPath, 0) == FR_OK)
{
HAL_UART_Transmit(&huart3, “Mounted\r\n”, strlen(“Mounted\r\n”), 0xFFFF);
res = f_open(&SDFile, “STM32.TXT”, FA_CREATE_ALWAYS | FA_WRITE);
if (res == FR_OK)
{
HAL_UART_Transmit(&huart3, “Opened\r\n”, strlen(“Opened\r\n”), 0xFFFF);
if(f_write(&SDFile, wtext, sizeof(wtext), (void *)&wbytes) == FR_OK)
{
HAL_UART_Transmit(&huart3, “Written\r\n”, strlen(“Written\r\n”), 0xFFFF);
f_close(&SDFile);
HAL_UART_Transmit(&huart3, “Closed\r\n”, strlen(“Closed\r\n”), 0xFFFF);
}
} else {
char msg15;
sprintf(msg, “Error open: %d\r\n”, res);
HAL_UART_Transmit(&huart3, (uint8_t *)msg, strlen(msg), 0xFFFF);
}
}
FATFS_UnLinkDriver(SDPath);

The function F_MOUNT return FR_OK but the program stops there. Sometimes the f_open function return Error 3: Device not ready. Any suggestion?
Thank you for your time.

M

 

Newest Forum Posts

  1. Монтаж камина с грилем в Москве - установка и барбекю by KpddomErorb, 2025-05-10 18:28
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs