cancel
Showing results for 
Search instead for 
Did you mean: 

Stm CubeMX, NucleoL152 and SD Card Shield

antonio23
Associate II
Posted on July 06, 2015 at 18:20

Hi to all, i'm a newbie of programming embedded, i have a Stm nucleo L152RE and i a sd card shiled v 4.1 of seeed studio this is the

http://www.seeedstudio.com/wiki/SD_Card_shield_V4.0

of shiled.

Now i want use cubemx for use this shield, i use this setting:

PERIPHERALS    MODES    FUNCTIONS    PINS

RCC    Crystal/Ceramic Resonator    RCC_OSC_IN    PH0-OSC_IN

RCC    Crystal/Ceramic Resonator    RCC_OSC_OUT    PH1-OSC_OUT

SPI1    Full-Duplex Master    SPI1_MISO    PA6

SPI1    Full-Duplex Master    SPI1_MOSI    PA7

SPI1    Full-Duplex Master    SPI1_SCK    PA5

SYS    Trace-Asynchronous_SW    SYS_JTMS-SWDIO    PA13

SYS    Trace-Asynchronous_SW    SYS_JTCK-SWCLK    PA14

SYS    Trace-Asynchronous_SW    SYS_JTDO-TRACESWO    PB3

USART2    Asynchronous    USART2_RX    PA3

USART2    Asynchronous    USART2_TX    PA2

Pin Nb    PINs    FUNCTIONs    LABELs

2    PC13-WKUP2    GPIO_Input    B1 [Blue PushButton]

3    PC14-OSC32_IN*    RCC_OSC32_IN    

4    PC15-OSC32_OUT*    RCC_OSC32_OUT    

5    PH0-OSC_IN    RCC_OSC_IN    

6    PH1-OSC_OUT    RCC_OSC_OUT    

16    PA2    USART2_TX    USART_TX

17    PA3    USART2_RX    USART_RX

21    PA5    SPI1_SCK    

22    PA6    SPI1_MISO    

23    PA7    SPI1_MOSI    

46    PA13    SYS_JTMS-SWDIO    TMS

49    PA14    SYS_JTCK-SWCLK    TCK

55    PB3    SYS_JTDO-TRACESWO    SWO

57    PB5    GPIO_Output   

I select FatFs to read and  write on SDcard

now i generete the code i don't see the file sd_diskio.c, can you give me example or how to, for setting and use it.

best regards

Antonio

  

#cubemx #nucleo #spi
6 REPLIES 6
chrif
Associate II
Posted on July 07, 2015 at 17:37

Hi Antonio,

Have a look at example under

STM32Cube_FW_L1_V1.2.0\Projects\STM32L152D_EVAL\Applications\FatFs\FatFs_uSD

Regards

tarzan2
Associate III
Posted on July 09, 2015 at 17:33

What Antonio said is that cubeMX don't generate all the necessary files. This bug has been discovered several times :

- [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/Is%20stm32cubemx%20v4.8%20a%20beta&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&currentviews=106]bug 1

- [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/cubemx%20v4.8%20-%20fatfs&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/AllItems.aspx&currentviews=40]bug 2

I can reproduce it with v4.8, STM32F4, new project from scratch. In other words,

- We are not able to update our existing projects with cubemx

- We are not able to create new projects with cubemx

- People that are not familiar with STM32 will switch to other equivalent processors

- People that are familiar with STM32 will certainly switch to other equivalent processors in a few months, after they loosed a lot of money, is ST don't fix the bug.

- Expressed as a simple manner for ST (in case they don't understand), *ST will loose money* (and there are already in a very poor economical state here in France).

Workaround for any people that don't want to wait: SD cards / fatfs works fine without effort on SAM processors.

FCR
Associate III
Posted on July 09, 2015 at 20:19

Hi Antonio,

Without knowing more about the configuration, quite hard to reproduce (in fact, not reproduced yet, works fine for me with Mx 4.8, IAR, Win OS7: files always generated).

Would it be possible to know:

- CubeMx version in use: 4.x (with x = ?) ; standalone executable installed or Eclipse plugin used?

- OS : Linux / Windows 7, 8 or 10 ?

- toolchain being used : IAR / Keil / Atollic / SW4STM32 / ... ?

Getting your project file (the one with .ioc extension) could help as well (unless it contains confidential data)

Something I have already said in a recent FreeRTOS discussion: we need to know tools and OS versions you use for a better support.

Regards,

Fred

What Antonio said is that cubeMX don't generate all the necessary files. This bug has been discovered several times :

- [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/Is%20stm32cubemx%20v4.8%20a%20beta&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&currentviews=106]bug 1

- [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/cubemx%20v4.8%20-%20fatfs&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&TopicsView=https%3a//my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/AllItems.aspx&currentviews=40]bug 2

I can reproduce it with v4.8, STM32F4, new project from scratch. In other words,

- We are not able to update our existing projects with cubemx

- We are not able to create new projects with cubemx

- People that are not familiar with STM32 will switch to other equivalent processors

- People that are familiar with STM32 will certainly switch to other equivalent processors in a few months, after they loosed a lot of money, is ST don't fix the bug.

- Expressed as a simple manner for ST (in case they don't understand), *ST will loose money* (and there are already in a very poor economical state here in France).

Workaround for any people that don't want to wait: SD cards / fatfs works fine without effort on SAM processors.

tarzan2
Associate III
Posted on July 10, 2015 at 14:25

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6qc&d=%2Fa%2F0X0000000bwf%2FRgWE6xFvbzOD6HwsXGwEUsgRWnLN.KugmYNNaq4wnBA&asPdf=false
antonio23
Associate II
Posted on July 14, 2015 at 09:58

hi to all, thanks for your help

CubeMx version in use: 4.8.0; standalone

O.S. windows 7 64 bit

toolchain being used : Keil

i am a newbie in embedded world and i am studying for understand to use it.

can you see a easy example for learn it?

best regards

A.

p.s. in Attachments you can see my ioc file.

________________

Attachments :

sd_card4.ioc : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzTO&d=%2Fa%2F0X0000000bMK%2F2sEkVwXR5.Jy_Ppi1tUj4e2ZbODcL47Cg4q.3z.y97U&asPdf=false
stm32cube-t
Senior III
Posted on July 17, 2015 at 16:09

Hello Antonio,

The file you are looking for is under : Middlewares\Third_Party\FatFs\src\drivers.

Depending on your choice of project settings to copy or to reference the library files, this directory may be copied under your project at project generation or only kept as reference to your cube repository (see in C:/users/<your username>/STM32Cube/Repository).

Best regards.