Welcome! Log In Create A New Profile

Advanced

Error compiling .91 with SDCARD

Posted by LarryJ 
Error compiling .91 with SDCARD
January 17, 2014 09:47PM
This is the error:

SDCard.cpp: In constructor 'SDCard:confused smileyDCard()':
SDCard.cpp:44: error: 'DIOSDCARDDETECT_DDR' was not declared in this scope
SDCard.cpp:44: error: 'DIOSDCARDDETECT_PIN' was not declared in this scope
SDCard.cpp:45: error: 'DIOSDCARDDETECT_WPORT' was not declared in this scope
SDCard.cpp:45: error: 'DIOSDCARDDETECT_PIN' was not declared in this scope
SDCard.cpp:45: error: 'DIOSDCARDDETECT_WPORT' was not declared in this scope
SDCard.cpp:45: error: 'DIOSDCARDDETECT_PIN' was not declared in this scope
SDCard.cpp: In member function 'void SDCard::automount()':
SDCard.cpp:52: error: 'DIOSDCARDDETECT_RPORT' was not declared in this scope
SDCard.cpp:52: error: 'DIOSDCARDDETECT_PIN' was not declared in this scope

If I change:

#ifndef SDSUPPORT // Some boards have sd support on board. These define the values already in pins.h
#define SDSUPPORT 1
#define SDCARDDETECT SDCARDDETECT
#define SDCARDDETECTINVERTED 0
#endif

to:

#ifndef SDSUPPORT // Some boards have sd support on board. These define the values already in pins.h
#define SDSUPPORT 0
#define SDCARDDETECT SDCARDDETECT
#define SDCARDDETECTINVERTED 0
#endif

in configuration.h then the error goes away. But so does access to my SDCARD (as expected).

Any ideas?

I used the 'SD card detect pin if available' option when using the configurator - my guess is that this is not the correct answer.

I am using a RAMPS 1.4 with an attached SDRAMPS.

Edited 2 time(s). Last edit at 01/17/2014 09:57PM by LarryJ.
Attachments:
open | download - Configuration.h (19 KB)
Re: Error compiling .91 with SDCARD
January 18, 2014 05:36AM
Yes, SDRAMPS has no SDCARDDETECT so set it to -1 (not available)


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Error compiling .91 with SDCARD
January 19, 2014 05:24PM
This does get rid of the compile error, but has the same effect as disabling the SDCard all together.

Trying to solve heatbed thermistor problem ATM, will get back into this once I have that figured out.
Re: Error compiling .91 with SDCARD
July 10, 2014 09:59AM
I have the exact same error. I have RAMPS 1.4 with a SD module and using .91 firmware

'DIOSDCARDDETECT_DDR' was not declared in this scope

Printer.cpp: In static member function 'static void Printer::setup()':
Printer.cpp:550: error: 'DIOSDCARDDETECT_DDR' was not declared in this scope
Printer.cpp:550: error: 'DIOSDCARDDETECT_PIN' was not declared in this scope
Printer.cpp:551: error: 'DIOSDCARDDETECT_WPORT' was not declared in this scope
Printer.cpp:551: error: 'DIOSDCARDDETECT_PIN' was not declared in this scope
Printer.cpp:551: error: 'DIOSDCARDDETECT_WPORT' was not declared in this scope
Printer.cpp:551: error: 'DIOSDCARDDETECT_PIN' was not declared in this scope

How do I declare this pins?
Re: Error compiling .91 with SDCARD
July 10, 2014 10:05AM
SImply add in Configuration.h

#define SDCARDDETECT

or set it to -1 if you do not have that pin used.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Error compiling .91 with SDCARD
April 03, 2015 10:05AM
This problem still occurs when trying to compile development version 0.92.3.

The problem is the DIOSDCARDDETECT_DDR is not defined anywhere from what is generated from the Firmware web site, when GUI is not enabled but SD support is enabled. I think that's the combination which generates the bug here, so maybe this is a problem in the Firmware generation web site?
Re: Error compiling .91 with SDCARD
April 03, 2015 11:12AM
What is SDCARDDETECT set to. Your problem shoudl only happen if you set it empty like in my example where you had to add the pin. If in double set

#define SDCARDDETECT -1

Not sure how you managed to get it not defined or getting define as
#define SDCARDDETECT SDCARDDETECT
.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Error compiling .91 with SDCARD
April 04, 2015 09:51PM
Found the problem was indeed caused by the web site. There is a logic problem here on the features page. If you enable SD card support and set SD pin to "use SD card detect pin if available" which sounds like the best option, it generates code with the error. Selecting "disabled" fixes the problem.

This is in combination of display type set to "defined in UICONFIG.H". And there is another bug, the motherboard type is set to 33 instead of 999 so the USERPINS.H is no longer included. With Chrome at least each time you select motherboard type "own layout in USERPINS.H" it resets back to RAMPS.

I've got the Velleman VM8201 controller working now on my K9200, including SD card support and LCD panel. I'll write a little blog post about that and add the link back here and on the Velleman forum. It was a significant effort to reverse engineer the old Velleman headers across to the new v92.3 firmware! I'll try to recreate the scenario with the web site, or at least document the workaround...

Edited 1 time(s). Last edit at 04/04/2015 09:54PM by Code Chief.
Re: Error compiling .91 with SDCARD
April 06, 2015 11:53AM
You are right. C preprocessor does not like redefinition with the same macro. In 0.92.3 I have now renamed the version in pins.h ORIG_SDCARDDETECT and config tool now can use that option as it is a different macro name.

I also found the 999 motherboard problem.

So I hope everything works with 0.92.3 now.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Sorry, only registered users may post in this forum.

Click here to login