cancel
Showing results for 
Search instead for 
Did you mean: 

SPI PIN Configuration for STM32F0

pic_micro
Associate II
Posted on January 10, 2015 at 10:14

Dear All,

I would be grate if any one could advice me that in which page the SPI pin configuration is showing in the ''RM0091Reference manual'' STM32F0

I mean,

What are the proper  Configure GPIO for MOSI, MISO and SCK pins.

What is the exact pin configuration 

in which page is showing above configuration

Thanks in advance

24 REPLIES 24
Posted on January 11, 2015 at 17:56

Look, it's a block access memory device, not a direct access memory (SRAM, NOR). Think of it like a hard drive.

You need a driver to read/write to it using the command defined in the SD/MMC card specifications.

STM32F0xx_StdPeriph_Lib_V1.4.0\Utilities\STM32_EVAL\STM320518_EVAL\stm320518_eval_spi_sd.c

STM32F0xx_StdPeriph_Lib_V1.4.0\Utilities\STM32_EVAL\STM32072B_EVAL\stm32072b_eval_spi_sd.c

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pic_micro
Associate II
Posted on January 12, 2015 at 17:56

Dear Sir,

Thanks for the reply and advice

I decided to read more about SD card protocol

After reading I will come back

Thanks  

pic_micro
Associate II
Posted on January 18, 2015 at 12:30

Dear Sir,

Can you advice me how should I include ''stm320518_eval_spi_sd.c and '' stm320518_eval_spi_sd.h'' files to my project. I am using STM320518-EVAL_FW_V1.0.1 ''

I tried several manner but it is giving errors

0690X00000602zeQAA.jpg

Posted on January 18, 2015 at 14:40

You can't right click or float on things until the editor has browsing information generated by a compiler pass.

Focus on the errors generated during the build process, starting with the first ones.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pic_micro
Associate II
Posted on January 18, 2015 at 15:29

Dear Sir

Only one Error is showing, which is

..\STM320518-EVAL_FW_V1.0.1\Utilities\STM32_EVAL\STM320518_EVAL\stm320518_eval.h(39): error:  #5: cannot open source input file ''stm32_eval_legacy.h'': No such file or directory

Posted on January 18, 2015 at 15:58

Only one Error is showing, which is

 

..\STM320518-EVAL_FW_V1.0.1\Utilities\STM32_EVAL\STM320518_EVAL\stm320518_eval.h(39): error:  #5: cannot open source input file ''stm32_eval_legacy.h'': No such file or directory

Which would seem to be indicative that you haven't set up the compiler's include paths sufficiently to capture the needed files, or copied/ported the files to your own project directory(s).
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pic_micro
Associate II
Posted on January 18, 2015 at 16:13

Dear Sir,

What I did is copy the following two files from STM320518EVAL_FW_V1.0.1\Utilities\STM32_EVAL\Common

1.stm320518_eval_spi_sd.c

2.stm320518_eval_spi_sd.h

to following folder

STM320518-EVAL_FW_V1.0.1\Libraries\STM32F0xx_StdPeriph_Driver\src

then I inserted this two file to the project

When I removed the above two files from the project then, it is compiled without errors 

Posted on January 18, 2015 at 18:17

But it's complaining about another file, stm32_eval_legacy.h, which you evidently didn't copy, or suitably path.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pic_micro
Associate II
Posted on January 19, 2015 at 16:18

Dear Sir,

You are correct, the issue with the path, Now it is compiling without errors

I have few more questions

1. Should I use more than 4GB SD cards to read and write with this driver?

2. Since the MCU have it internal pull-up, Is it necessary to use external pull-up for MOSI , MISO , SCK pins.

Please advice

Thanks in advance

 

Posted on January 19, 2015 at 21:38

I haven't done a code review, a lot of ST's existing code has problems with memory >2GB due to the insistence on using 32-bit byte offsets instead of block offsets used by the memory.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..