Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Using SdFat with BluePill STM32 (Read 15108 times)
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Using SdFat with BluePill STM32
Oct 7th, 2017 at 7:49am
Print Post  
I cannot build the SD card example:
https://github.com/greiman/SdFat/tree/master/examples/SdInfo
for Stm32F103
https://github.com/rogerclarkmelbourne/Arduino_STM32
in Visual Studio.
It builds OK in the Arduino 1.8.4 environment but produces the attached verbose in VM:

I dont think its anything wrong with VM but any advice would be welcome.

Jim

« Last Edit: Oct 12th, 2017 at 8:55am by Trek19 »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Re: Using SdFat with BluePill STM32
Reply #1 - Oct 12th, 2017 at 8:56am
Print Post  
I had a reply from the Arduino for STM32 board as follows:
http://www.stm32duino.com/viewtopic.php?f=9&t=2674
It seems that your VM is missing a lot of include paths.
Compare the Arduino IDE verbose output with your path parameters and then you will find out what is missing...
A hint: look for core folders.

I will investigate this but I am not sure what or how to include the missing folders.
Arduino 1.8.4 verbose attached.

Jim
« Last Edit: Oct 13th, 2017 at 4:42pm by Trek19 »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Using SdFat with BluePill STM32
Reply #2 - Oct 13th, 2017 at 4:39pm
Print Post  
Okay thanks will look at it. That area has been expanding in the arduino world.
  
Back to top
WWW  
IP Logged
 
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Re: Using SdFat with BluePill STM32
Reply #3 - Nov 8th, 2017 at 2:29pm
Print Post  
I had another suggestion from stm32duino.
"You have to include {build.core.path} to the upload.pattern."
Unfortunately I dont know how to do that, any suggestions.

Jim
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Using SdFat with BluePill STM32
Reply #4 - Nov 18th, 2017 at 7:48pm
Print Post  
I've looked into this and need a bit more info.

1)

The output you provided from visual micro was a cached compile so does not show the compiling of core or libraries. Can you please click "Solution>Clean" then build and post the output again.

2)

Quote:
"You have to include {build.core.path} to the upload.pattern."


Visual Micro reads the patterns from the platform files same as arduino ide so that path should already be included during upload.
  
Back to top
WWW  
IP Logged
 
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Re: Using SdFat with BluePill STM32
Reply #5 - Nov 20th, 2017 at 7:58am
Print Post  
Quote:
The output you provided from visual micro was a cached compile so does not show the compiling of core or libraries. Can you please click "Solution>Clean" then build and post the output again.


All the verbose output doesn't fit in insert code so I inserted a file.

Regards 
Jim


  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Using SdFat with BluePill STM32
Reply #6 - Nov 22nd, 2017 at 12:25am
Print Post  
If you make another build in the arduino ide and keep it open, copy the line after "compiling sketch .." into a new .bat file and then run it from cmd.exe does it build?

This is an example from your verbose output of what to expect but arduino uses a different temp folder each time it opens so this command will no longer be valid (note the last two paths)

Code
Select All
\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -std=gnu++11 -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10804 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1  -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER -DMCU_STM32F103C8  -mthumb  -march=armv7-m -D__STM32F1__ -DMCU_STM32F103C8  -mthumb  -march=armv7-m -D__STM32F1__ /libmaple" /libmaple/include" /libmaple/stm32f1/include"                                                           /libmaple/usb/stm32f1" /libmaple/usb/usb_lib" maple" ts\generic_stm32f103c" ies\SPI\src" "-IC:\Users\james\Documents\Arduino\libraries\SdFat\src" p" -o p.o" 



« Last Edit: Nov 22nd, 2017 at 12:32am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Re: Using SdFat with BluePill STM32
Reply #7 - Nov 22nd, 2017 at 12:29pm
Print Post  
Not sure what the instructions do but I copied the line after  "compiling sketch .." into Jimmy.bat on my desktop and then in the command window I got output as below. 
The following files were updated but I am not sure if the build process was completed.
p" -o p.o"

Code
Select All
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\james>desktop\Jimmy.bat

m-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -std=gnu++11 -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10804 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1  -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER -DMCU_STM32F103C8  -mthumb  -march=armv7-m -D__STM32F1__ -DMCU_STM32F103C8  -mthumb  -march=armv7-m -D__STM32F1__ le" le/include" le/stm32f1/include"                                                           le/usb/stm32f1" le/usb/usb_lib" "-IC:\Users\james\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple" ric_stm32f103c" \src" "-IC:\Users\james\Documents\Arduino\libraries\SdFat\src" p" -o p.o"
C:\Users\james> 



« Last Edit: Nov 22nd, 2017 at 12:29pm by Trek19 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Using SdFat with BluePill STM32
Reply #8 - Nov 22nd, 2017 at 1:13pm
Print Post  
Thanks. Yes that runs the compiler command and recreates the .o output file.

I spent some time looking at this and all of the library paths are correct and as far as I can see the compiler line from the visual micro "building project code" verbose output has the same as the arduino version. So it's a strange one that is for sure.

I will try to compare again this weekend.
  
Back to top
WWW  
IP Logged
 
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Re: Using SdFat with BluePill STM32
Reply #9 - Nov 23rd, 2017 at 7:56am
Print Post  
A bit more information:
I installed the hardware using the Arduino environment rather than in VB.
https://github.com/rogerclarkmelbourne/Arduino_STM32

Regards
JIm
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Using SdFat with BluePill STM32
Reply #10 - Nov 23rd, 2017 at 6:45pm
Print Post  
Yes I noticed you had two copies of the STM below the hardware folder.

Visual Micro installs are the same as the arduino ide so it doesn;t matter. However having two copies installed does add to the confusion.

I replicated the issue with the line that builds the project.ino code. It's a line that as you know is isolated from the rest of the build and can be run standalone from a .bat. I  could not see a real difference between the command that visual micro produces and the command the arduino ide produces. Can you?

If not then next job is to review the differences between the .ino .cpp that is being built in the temp build folder.
  
Back to top
WWW  
IP Logged
 
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Re: Using SdFat with BluePill STM32
Reply #11 - Nov 25th, 2017 at 8:25am
Print Post  
Quote:
Yes I noticed you had two copies of the STM below the hardware folder.


I searched my computer and found only 1 instance of the C:\Users\james\Documents\Arduino\Hardware\Arduino_STM32\STM32F1

Quote:
I  could not see a real difference between the command that visual micro produces and the command the arduino ide produces. Can you?


I couldnt see an equivelant line in the VB verbose, its a bit beyond my understanding at the moment.

Regards

Jim
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Using SdFat with BluePill STM32
Reply #12 - Nov 27th, 2017 at 9:27pm
Print Post  
It's the line after "building project code"

Code
Select All
\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -flto -Wall -DDEBUG_LEVEL=DEBUG_NONE -std=gnu++11 -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10804 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ /libmaple" /libmaple/include" /libmaple/stm32f1/include" /libmaple/usb/stm32f1" /libmaple/usb/usb_lib" -I"C:\Users\james\Documents\Arduino\libraries\SdFat\src" ies\SPI\src" -I"C:\Program Files (x86)\Arduino\libraries" ies" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\stj04ghu.5oy\Micro Platforms\default\debuggers" -I"C:\Users\james\Documents\Arduino\libraries" maple" ts\generic_stm32f103c" ricSTM32F103C\Release\JimsSdInfo.cpp" -o ricSTM32F103C\Release\JimsSdInfo.cpp.o" 

  
Back to top
WWW  
IP Logged
 
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Re: Using SdFat with BluePill STM32
Reply #13 - Dec 15th, 2017 at 4:38pm
Print Post  
Thats all a bit beyond my understanding I am afraid.
Jim
  
Back to top
 
IP Logged
 
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Re: Using SdFat with BluePill STM32
Reply #14 - Jan 11th, 2018 at 6:20pm
Print Post  
I still have not solved this problem and I dont know where to go from here, any advice please.
  
Back to top
 
IP Logged
 
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Re: Using SdFat with BluePill STM32
Reply #15 - Jan 15th, 2018 at 8:59am
Print Post  
As a matter of interest I installed Atmel Studio with VM and still get the same error.

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Using SdFat with BluePill STM32
Reply #16 - Jan 15th, 2018 at 12:34pm
Print Post  
Yes it's the same build system in both IDE's.

I am sorry I have not been able to look at this up till now. I will do over the next week. I believe the issue is the order of the include paths that visual micro ommitts during build but have yet to look into it..
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Using SdFat with BluePill STM32
Reply #17 - Jan 28th, 2018 at 2:17am
Print Post  
Sorry for the delay. This is resolved in the next release. It was an interesting but annoying issue.

Visual Micro supports many arduino versions and in the past arduino used an automatic include "wprogram.h" from the old "wiring.org" days. Nowadays they use "Arduino.h" in the core folder but recently OEM hardware has included Arduino.h in deep sub folders below the core.

Visual Micro needed to determine if it should include wprogram.h or arduino.h in the temp compiler code. It looked for wprogram.h and if that file existed it used it otherwise it used arduino.h

The maple core of the STM32 you are using has both a wprogram.h and an arduino.h in "Hardware\Arduino_STM32GIT\STM32F1\cores\maple". 

So Visual Micro used the wprogram.h which does not define what is needed for arduino builds. The next release of visual micro uses the arduino.h if it exists, otherwise the wprogram.h if that exists otherwise defaults to the <arduino.h>. So now we can't use the wrong file.

Thanks for your patience and good reports. 
  
Back to top
WWW  
IP Logged
 
Trek19
Junior Member
**
Offline


Posts: 82
Location: UK
Joined: Dec 2nd, 2013
Re: Using SdFat with BluePill STM32
Reply #18 - Jan 28th, 2018 at 6:07pm
Print Post  
OK Tim,  that seems to work perfectly but with some warnings which I have not had time to check yet.
I have attached my verbose output for your information: jimsverbose.txt

Thanks for all the effort, I am glad it wasn't something silly I had done.

Jim

Smiley
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Using SdFat with BluePill STM32
Reply #19 - Jan 28th, 2018 at 6:09pm
Print Post  
Great. Yes the code has a lot of warnings, same in arduino ide if you have warnings enabled.

I think they can be ignored, we often see code that shows warnings.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint