5 years, 6 months ago.

Detection pin

Hi,

I'm trying to use this library but I have a problem with the SD detection pin, I have the same result even if the sd card is plug or not.

I try to use : bool card_present();

With the BSD_DISCO_F746NG library, it does work.

the thing is that I don't understand how to use the BSD_DISCO_F746NG library.

but since I don't solve the pin detectionI can't comunicate I'm using th STM32F746 discovery board

thx

Question relating to:

A re-written SDFileSystem library with improved compatibility, CRC support, and card removal/replacement support. fatfilesystem, MMC, SD, SD Card, SDHC, SDXC

Are you using the onboard SD slot? I thought the SDFileSystem only support SPI and that would be on the interface available on the sheild header. Do you have the file system working with the onboard SD card? Cheers ed

posted by Ed Waugh 25 Feb 2016

yes I'm using the onboard SD slot. The BSD_DISCO_F746NG library come from the example code whan creating a new programme with the STM32f7 platform. Maybe the onboard slot doesn't work on SPI, to be honest I can't find much information about it.

posted by KEVIN JOUAN 25 Feb 2016

It's connected as

SD D0 - PC8
SD D1 - PC9
SD D2 - PC10
SD D3 - PC11
SD CLK - PC12
SD detect - PC13
SD CMD - PD2

The only place that seems to be documented is page 9 of the board schematic.

posted by Andy A 25 Feb 2016

Do you have any Idea for the param of this fonction ?

uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumOfBlocks);

I french guy and I don't understand what to put,

- pData is to receive the data read ok, - but what adresse do I put in ReadAddr? "/sd/mydir/sdtest.txt" ? - Blocksize I put 512 like they said in the comment. - And number of block also I don't know.

this is the comment :

/**

  • @brief Reads block(s) from a specified address in an SD card, in DMA mode.
  • @param pData: Pointer to the buffer that will contain the data to transmit
  • @param ReadAddr: Address from where data is to be read
  • @param BlockSize: SD card data block size, that should be 512
  • @param NumOfBlocks: Number of SD blocks to read
  • @retval SD status
  • /
posted by KEVIN JOUAN 25 Feb 2016

the compiler doesn't reconize the pin:

Error: Identifier "PD2" is undefined in "main.cpp", Line: 7, Col: 18 Error: Identifier "PC8" is undefined in "main.cpp", Line: 7, Col: 23 Error: Identifier "PC12" is undefined in "main.cpp", Line: 7, Col: 28 Error: Identifier "PC11" is undefined in "main.cpp", Line: 7, Col: 34 Info: Unable to download. Fix the reported errors...

any idea to solve it ?

update: I put PD_2 etc.. solved

posted by KEVIN JOUAN 25 Feb 2016

1 Answer

5 years, 6 months ago.

That board is wired to use a dedicated SD card peripheral to talk to the built in SD card rather than communicating over SPI. This gives far faster SD card access but requires you to use to use SD driver code from STM rather than the generic SPI based mbed one. The only way Neil's library will work with that board is if you add an extra SD card socket connected to an SPI bus.

This is my understanding as well, do we know if there is any active development for the DISCO board? Are we expecting filesystem support to be added at some point? Seems like there are quite a few problems with mbed on this at the moment.

posted by Ed Waugh 25 Feb 2016

Not that I can see any mention of. That sort of thing is up to ST to implement since it's their board, if they don't then it's only going to happen is someone with enough free time and knowledge decides to creates it.

One of the issues with the mbed site is that they let a manufacturer list a product with the feature set that the hardware supports rather than the feature set supported under the mbed libraries and framework. ST did much the same thing before with the Nucleo boards, they listed them as supporting CAN but didn't implement the CAN portion of the mbed library resulting in compile errors if you tried to use it.

posted by Andy A 25 Feb 2016