cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F412G-DISCO incorrectly configured by STM32CubeMX

edillere
Associate

I'm starting a project and need to use the STM32F412G-DISCO board for initial development.

I already had one board purchased in 2020.

I downloaded the latest STM32CubeMX and created a new project based on this board with all default options. STM32CubeMX includes, by default, SDcard support.

When I flash the generated code, the MCU enters the Error_Handler during initialization, right in the 

SD_WideBus_Enable(SD_HandleTypeDef *hsd) call.
I commented out the SD initialization in main.c and then the program runs ok.
So, for some reason the SDcard initialization crashes the code.
Looking for a possible cause for this problem I downloaded also the latest demo binary (ver. 1.3.0) from ST's website. Flashed it and... doesn't run, the board does nothing an, I suspect, the code is also crashing during initialization.
 
Looking on the web, I found a couple post from people indicating that the pinout generated by newer versions of STM32CubeMX for this board by default is incorrect.
 
So I looked for any information about different versions of this board or any erratas but nothing is posted.
Looking in an old PC, I found the old demo binary version 1.2.0 from 2020, flashed it an, voila! it works!!!
 
This seem to confirm that the board configuration is messed up in latest versions of STM32CubeMX and, hence, in the latest demo binary posted by ST (most likely generated using the same new version of the tool).
 
I wonder if ST is aware of these problems and if there's any documentation clarifying the changes and suggesting workarounds, since, I suspect the issue with the SDcard may not be the only difference.
 
Also, if there's a way I can get the old SW package that came with the old boards.
My board is STM32F412G-Disco with PCB MB1209 D-2.
The page for this board on ST's website seems to have been cleaned up and there's no way to get the support package of SW that, previously, was shipped with this board.
 
Thanks
E.
1 REPLY 1
KDJEM.1
ST Employee

Hello @edillere;

 

Which STM32CubeMx version are you using?

Did you get the same issue when working in 1 bit bus wide mode?

Could you try to use the latest STM32CubeMX version to generate your code.

I recommend you to look at SDIO interface not working in 4Bits with STM32F4 Firmware Package - STMicroelectronics Community and at How to create a file system on a SD card using STM32CubeIDE - STMicroelectronics Community

Also, I advise you to test LCD_PicturesFromSDCard example under STM32CubeF4.

This application has been tested with STMicroelectronics STM32412G-DISCOVERY evaluation boards

For the demo issue, thank you for bringing this issue to our attention, I reported internally for checking.

Internal ticket number: 214177 (This is an internal tracking number and is not accessible or usable by customers).

 

Thank you.

Kaouthar

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.