Keil Logo

MCBSTM32F400: File System Demo hard faults on call to fmount()


Information in this knowledgebase article applies to:

  • MCBSTM32F400(Vers: 1.1): Device Revision A
  • STM32F4xx Device Family Pack(DFP): v2.11.0

SYMPTOM

File System Demo fails on fmount() for the SD Card, resulting in a hard fault. I see the following output in the Debug(printf) Viewer:

//...
Initializing and mounting enabled drives...

Drive F0 ready!

Normal output is:

//...
Initializing and mounting enabled drives...

Drive F0 ready!
Drive M0 ready!
Drive N0 ready!

Done!

Cmd>

CAUSE

The STM32F4's HAL DMA driver was updated with a new requirement, which affects device revision A. This requirement is documented in the file, "stm32f4xx_hal_dma.c" v1.6.0.

RESOLUTION

There are at least two ways to resolve the issue.

  1. For a broad solution, read the following KB article, MCBSTM32F400: Examples do not work with MDK-ARM Version 5. View the most recent instructions under "STATUS", or
  2. For a workaround, redefine the function, HAL_MspInit(), to include the following:
    //Note: The new function definition will override the weak definition in the HAL software layer
    void HAL_MspInit(void) {
    //...
            __HAL_RCC_DMA2_CLK_ENABLE();
    //...
    }
    

Build project, again, and run. Now, the example will successfully mount the SD Card.

SEE ALSO

Last Reviewed: Thursday, June 29, 2017


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.