SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32

Creating new Project for STM32F407 Discovery board and HAL driver with FatFs


I created a new project and selected to use the HAL drivers and also the third party FatFs (which shows twice on the list).

After trying to Build, I got the following message:

../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c:78:6: warning: implicit declaration of function ‘BSP_SD_Init’ -Wimplicit-function-declaration
if(BSP_SD_Init() == MSD_OK)

../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c:78:23: error: ‘MSD_OK’ undeclared (first use in this function)
if(BSP_SD_Init() == MSD_OK)

../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c:78:23: note: each undeclared identifier is reported only once for each function it appears in
../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c: In function ‘SD_status’:
../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c:95:6: warning: implicit declaration of function ‘BSP_SD_GetStatus’ -Wimplicit-function-declaration
if(BSP_SD_GetStatus() == MSD_OK)

../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c:95:28: error: ‘MSD_OK’ undeclared (first use in this function)
if(BSP_SD_GetStatus() == MSD_OK)

../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c: In function ‘SD_read’:
../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c:115:6: warning: implicit declaration of function ‘BSP_SD_ReadBlocks’ -Wimplicit-function-declaration

../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c:118:34: error: ‘MSD_OK’ undeclared (first use in this function)
count) != MSD_OK)

../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c: In function ‘SD_write’:
../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c:139:6: warning: implicit declaration of function ‘BSP_SD_WriteBlocks’ -Wimplicit-function-declaration

../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c:141:47: error: ‘MSD_OK’ undeclared (first use in this function)
BLOCK_SIZE, count) != MSD_OK)

../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c: In function ‘SD_ioctl’:
../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c:161:3: error: unknown type name ‘SD_CardInfo’
SD_CardInfo CardInfo;

../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c:174:5: warning: implicit declaration of function ‘BSP_SD_GetCardInfo’ -Wimplicit-function-declaration

../Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c:175:29: error: request for member ‘CardCapacity’ in something not a structure or union
*(DWORD*)buff = CardInfo.CardCapacity / BLOCK_SIZE;
make: *** Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.o Error 1

Any idea which src/inc files I am missing?

i have a dicovrey f4 fattfs + usb msc + micro-sd ( +free rtos) running
i started from an old cubemx generated project (more than a year ago)
I remenber i had look at the cubef4 exemples to undertand a few things
and make it works in dma mode
but it was builing and almost working straigth away.

look like your are missing the BSP side that is “your wrapper arround sd and fatfts”
on my project source are in \Src\bsp_driver_sd.c
proto in “bsp_driver_sd.h”
this header is inlcude on “ffconf.h” that is referecne from fatfts middleware

few stuff in the header related to errors you’r getting

/* Includes ----------------------*/

  1. include “stm32f4xx_hal.h”

/* Exported constants --------------------*/

* @brief SD status structure definition

  1. define MSD_OK 0x00
  2. define MSD_ERROR 0x01

  1. ifndef SD_CardInfo

#define SD_CardInfo HAL_SD_CardInfoTypedef

  1. endif

/** @defgroup STM324x9I_EVAL_SD_Exported_Constants
* @{

  1. define SD_DATATIMEOUT ((uint32_t)0xFFFFFFFF)

  1. define SD_PRESENT ((uint8_t)0x01)
  2. define SD_NOT_PRESENT ((uint8_t)0x00)


Newest Forum Posts

  1. SW4STM32 installation on Ubuntu 20.04 LTS by mahnac72, 2022-01-17 09:12
  2. STM32G0B1 support by Nevada, 2022-01-14 18:47
  3. compiling date/time by yang@omniverter.com, 2022-01-13 20:07
  4. compiling date/time by tang, 2022-01-13 10:51
  5. compiling date/time by yang@omniverter.com, 2022-01-12 19:19
  6. STM32429 Discovery board Linux problem by llcheng, 2022-01-10 10:38
  7. STM32F030K6T6 Pa7 Question by jobhunter, 2022-01-07 10:20
  8. System workbench how to configure openocd debug by gxz, 2022-01-03 15:49
  9. Auto generate build/version number by katarcza, 2022-01-01 11:00
  10. Charger firmware by kacio, 2021-12-30 09:04

Last-Modified Blogs