Skip to main content
FHESS
Associate
September 11, 2018
Question

uSDCard on STM32F746G-DISCO

  • September 11, 2018
  • 3 replies
  • 954 views

I am working with STM32CubeMX 4.26.1 and uVision V5.25.2.0 on card STM32F746G-DISCO

First, I use the program given in example “en.stm32cubef7\STM32Cube_FW_F7_V1.12.0\Projects\STM32746G-Discovery\Applications\FatFs\FatFs_uSD�?

This example works but I can’t integrate it in my code.

There is no ‘*.ioc’ file attached (from STM32CubeMX)

So I can’t include this file in my code.

Second, I try with internet tutorial named “12 SD card Programming on STM32F7 Discovery Board using Keil uVision�? , “13 SD card …�? , “14 SD card …�?

Address : https://www.youtube.com/watch?v=kRhF44v2ezM

But, at the begin, 2 declarations are invalid because already declared in another file.

Already declared in “fatfs.c�?

char SDPath[4];  /* SD logical drive path */

FATFS SDFatFS;   /* File system object for SD logical drive */

When I comment on these lines, the program can run but it does not realize the f_mount.

I have been working on this program for a week and I am at the end of my abilities.

Does anyone have an idea, a * .ioc file and the * .uvprojx project or something to help me?

Sorry for my English,

    This topic has been closed for replies.

    3 replies

    FHESS
    FHESSAuthor
    Associate
    September 27, 2018

    Well the solution is found .

    In STM32CubeMX, the Minimum Stack Size must be set 0x800 in Project Setting / Linker Setting

    So, the problem is solved

    Tesla DeLorean
    Guru
    September 27, 2018

    Yes, the 0x400 frequently used by Keil is to small for a lot of things, it would make sense for CubeMX (and .s in CMSIS trees) to have larger sizes, something commensurate with size of SRAM in the device, and code expectations in 2018 rather than 1998

    GNU/GCC usually uses the top of SRAM for the STACK, and the end of statics for the HEAP, and they can fight over available memory. ST shouldn't use the 0x2001FFFF unaligned values, but rather 8-byte aligned ones.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    AvaTar
    Senior III
    September 27, 2018

    I'd wonder if the Keil toolchain does not allow one to define the stacksize in the project setup phase (Wizard), like other toolchains.

    But that would put the onus back to CubeMX and ST ...