cancel
Showing results for 
Search instead for 
Did you mean: 

Please Correct BUG with SD code generation

cavizzano9
Associate II
Posted on March 02, 2017 at 18:57

The new format of code generation makes a BUG in the file: bsp_driver_sd.h

The BUG prevent building FAT_FS modules

To solve the issue line 67 should be changed with the following ones:

&sharpifndef BSP_SD_CardInfo

  &sharpdefine BSP_SD_CardInfo HAL_SD_CardInfoTypedef

  &sharpdefine SD_CardInfo HAL_SD_CardInfoTypedef

&sharpendif?

DETAILS: there was a typo in the first define (capital vs small cap Typedef vs TypeDef)

The second define is the one required by sd_diskio.c

...Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c:161:3: error: unknown type name 'SD_CardInfo'

   SD_CardInfo CardInfo;

This is an error in code generation (e.g. cube program) and not the library files and there is no way to rollback after an update (very annoying).  Any help in solving this issue faster is appreciated.

C.Alberto Avizzano

#endif
15 REPLIES 15
Posted on April 11, 2017 at 08:56

Hey Richard,

Thank you for your reply. After 2 days, Finally I found the problem. For efficiency reasons, ST deleted the checking SD status after reading/writing data from/to SD by DMA, and leave that to us to implement our own checking code. So in my code, I waited for DMA transfer complete interrupt after read/write by DMA, and it worked!!! Now my code is more efficient while I'm using FreeRTOS and used OS signals to suspend the current task.

After all, I was expecting ST to write at least an example code or something like that (even not efficient) to give us an idea. It was really confusing.

Regards,

Misagh

Posted on May 05, 2017 at 09:02

Hello Misagh92,

Could you tell me where you added that code or it will be nice if you can send your code for DMA.

This is my email: j

mailto:ohnrray5@gmail.com

For a week I try to run DMA in my SD card and nothing work

:(

Regards,

John 

Posted on May 05, 2017 at 10:29

mailto:ohnrray5@gmail.com

Jeanne Joly
Senior III
Posted on May 09, 2017 at 17:24

Hello

Avizzano.Carlo_Alber

,

Thanks for highlighting this issue and sorry for the inconvenience it causes.

The fix for this issue will be available in CubeMX4.21 that will come very soon.

Please upgrade your CubeMX release as soon as CubeMX4.21 is available.

BR. Eric

Posted on November 14, 2017 at 12:23

Hello ST team

I'm working with 

I'm writing to you because I'm working on STM32F746ZGTx, but I have found the same BUG problem with the SD card in CubeMx version 4.23.0 library Firmware package STM32F7 v1.8.0.

Before I was working with CubeMX 4.21.0 and Firmware Package 1.7.0  and the problem with the SD card was solved, now I updated with the new version 4.23.0 and seems the .h and .c files have a lot of changes (for instance

stm32f7xx_hal_sd.c 

)

Please, could you fix the issues?

best 

Posted on November 14, 2017 at 15:06

Same request in

https://community.st.com/0D50X00009XkX2BSAV

. Please avoid re-opening old threads as issue isn't the same.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.