Welcome! Log In Create A New Profile

Advanced

compilation error if define SDSUPPORT

Posted by slitwan 
compilation error if define SDSUPPORT
September 29, 2012 05:04PM
hi all

i use repetier-firmware with the printrboard. when i try to use the sdcard by #define SDSUPPORT 0
i've got following error when building.

Sd2PinMap.h:232: error: expected unqualified-id before numeric constant
Sd2PinMap.h:233: error: expected unqualified-id before numeric constant
Sd2PinMap.h:234: error: expected unqualified-id before numeric constant

any help would be appreciated.

cheers
simon
Re: compilation error if define SDSUPPORT
September 30, 2012 05:36AM
That is a fixed error you get if you are using Arduino 1.0.
You need to get the latest Sd2PinMap.h from the Firmware github repository. Then it should compile normally.


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: compilation error if define SDSUPPORT
October 01, 2012 07:54AM
hi repetier

thanks for your fast answer. but i already use arduino 1.0.1 and i also updated my git repo before i posted to the forum. could there be another reason?

cheers
simon
Re: compilation error if define SDSUPPORT
October 01, 2012 08:04AM
Looks like you are not using a RAMPS. What board type do you use?

The sd card library is not fully compatible with Arduino version higher then 023, which is your problem. I need to find a fix for your problem with the new Arduino. For RAMPS it works already, but I guess for your board I need to make another one:-)

For a quick solution use Arduino 023.


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: compilation error if define SDSUPPORT
October 01, 2012 02:41PM
i'm using printrboard.

will try to use arduino023.
Re: compilation error if define SDSUPPORT
October 01, 2012 03:00PM
if i use arduino023 i've got

Repetier.cpp:750:2: error: narrowing conversion of ‘500000l’ from ‘long int’ to ‘const uint16_t’ inside { }
Repetier.cpp:750:2: error: narrowing conversion of ‘250000l’ from ‘long int’ to ‘const uint16_t’ inside { }
Repetier.cpp:750:2: error: narrowing conversion of ‘166666l’ from ‘long int’ to ‘const uint16_t’ inside { }
Repetier.cpp:750:2: error: narrowing conversion of ‘125000l’ from ‘long int’ to ‘const uint16_t’ inside { }
Repetier.cpp:750:2: error: narrowing conversion of ‘100000l’ from ‘long int’ to ‘const uint16_t’ inside { }
Repetier.cpp:750:2: error: narrowing conversion of ‘83333l’ from ‘long int’ to ‘const uint16_t’ inside { }
Repetier.cpp:750:2: error: narrowing conversion of ‘71428l’ from ‘long int’ to ‘const uint16_t’ inside { }

thanks very much for your effort!

cheers
simon
Re: compilation error if define SDSUPPORT
October 01, 2012 04:28PM
Sometimes I hate Arduino. Every board/os/arduino combination seems to have it's own problems. I have attached a new Sd2PinMap.h which should work with your Arduino 1.0.1. Unfortunately my Arduino 1.0.1 didn't cause the same errors, but I think it should fix the problem.


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!
Attachments:
open | download - Sd2PinMap.h (12.5 KB)
printrboard and sd card Was: compilation error if define SDSUPPORT
October 01, 2012 06:14PM
now it compiles, thanks.

but i still don't get the sd card working.
now if i uncomment #define SDSUPPORT 0 the firmware doesn't seem to work anymore. repetier host will connect but manual command are just queued not executed.

cheers
simon
Re: printrboard and sd card Was: compilation error if define SDSUPPORT
October 02, 2012 11:35AM
It is fully possible to connect with the wrong baudrate settings. Then you see a connected and waiting commands. Please check them and make sure to use the one defined in eeprom if activated. To overwrite the eeprom with fresh values change the eeprom mode.


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: printrboard and sd card Was: compilation error if define SDSUPPORT
October 03, 2012 03:49AM
i do not change any othher settings then uncommenting #define SDSUPPORT 0

if i commenting #define SDSUPPORT 0 everything works fine. as soon as i remove the slashes it is like i described above.

thanks in advance :-)
Re: compilation error if define SDSUPPORT
October 03, 2012 04:58AM
Your problems come most probably from wrong pin ids. I have no printrboard to test, so you have to test yourself.

In Sd2PinMap.h line 238 you had problems with the const assignment.

// SPI port
#if MOTHERBOARD == 9 //printrboard
uint8_t const SS_PIN = 26;
#else
uint8_t const SS_PIN = 20;
#endif
#ifndef MOSI_PIN
uint8_t const MOSI_PIN = 22;
#endif
#ifndef MISO_PIN
uint8_t const MISO_PIN = 23;
#endif
#ifndef SCK_PIN
uint8_t const SCK_PIN = 21;
#endif

That means the values are already defined as Macro values with unknown pin numbers. Change this block into

// SPI port
#if MOTHERBOARD == 9 //printrboard
#undef MOSI_PIN
#undef MISO_PIN
#undef SCK_PIN
#undef
uint8_t const SS_PIN = 26;
#else
uint8_t const SS_PIN = 20;
#endif
#ifndef MOSI_PIN
uint8_t const MOSI_PIN = 22;
#endif
#ifndef MISO_PIN
uint8_t const MISO_PIN = 23;
#endif
#ifndef SCK_PIN
uint8_t const SCK_PIN = 21;
#endif

and see if it works better. That way you force the pin number 22/23/21 to be used regardless of earlier definitions.


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: compilation error if define SDSUPPORT
October 03, 2012 05:31AM
i had to add SS_PIN to #undef otherwise it wouldn't compile. but the it still did show the same symptoms.
BTW i noticed that firmware eeprom config is not active within the host and the x y z values are red.

do you have another idea what to try?

thanks very much.

cheers
simon
Re: compilation error if define SDSUPPORT
October 03, 2012 05:37AM
i just noticed that the x y z values mean the it was not homed yet. right?
Re: compilation error if define SDSUPPORT
October 03, 2012 05:51AM
slitwan Wrote:
-------------------------------------------------------
> i just noticed that the x y z values mean the it
> was not homed yet. right?

Red = not homed or print area left after homing.

With the sd card problems it becomes difficult. Do you start with sd card inserted? You could try uncommenting parts of this function in Repetier.pde which does the sd card initalization. It will not work without but you could get the spot, where the firmware hangs:

void initsd(){
sdactive = false;
#if SDSS >- 1
if(root.isOpen())
root.close();
if (!card.init(SPI_FULL_SPEED,SDSS)){
//if (!card.init(SPI_HALF_SPEED,SDSS))
OUT_P_LN("SD init fail");
}
else if (!volume.init(&card)) {
OUT_P_LN("volume.init failed");
} else if (!root.openRoot(&volume))
OUT_P_LN("openRoot failed");
else
sdactive = true;
#endif
}

In a first try I would start with card.init only:

void initsd(){
sdactive = false;
#if SDSS >- 1
if(root.isOpen())
root.close();
if (!card.init(SPI_FULL_SPEED,SDSS)){
//if (!card.init(SPI_HALF_SPEED,SDSS))
OUT_P_LN("SD init fail");
}
/* else if (!volume.init(&card)) {
OUT_P_LN("volume.init failed");
} else if (!root.openRoot(&volume))
OUT_P_LN("openRoot failed");
else
sdactive = true;
*/
#endif
}

or even with the complete content removed. Then you can add parts until the firmware doesn't start. If initialization work it could be a problem with the sd card itself. Try starting without it. Press reset when connected and see how far you come. You should at least see a "start" message in the log.


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: compilation error if define SDSUPPORT
October 03, 2012 06:05AM
my sd card is inserted when i start. it's a 512 mb fat 16 formated card. maybe i should first see if it works withanother printr. the printrboard is the only one i have which is using mini sd.

i think i will try this first ;-)
Re: compilation error if define SDSUPPORT
October 04, 2012 06:18AM
it hangs at this line:
if (!card.init(SPI_FULL_SPEED,SDSS)){

i will try to look into this furhter. since these guys seems to have the solution somewhere.
[github.com] (printrbot marlin)
i may ask you for help if i don't understand.

cheers
simon
Re: compilation error if define SDSUPPORT
October 04, 2012 08:34AM
to me it seems to be related to this:
[my3dprinterbuild.wordpress.com]
will try this soon
Re: compilation error if define SDSUPPORT
October 04, 2012 08:47AM
after inserting following line
#define Y_MIN_PIN 37
and swaped y-stop into e-stop it doesn't hang anymore.

but M20; still returns an empty list.

any idea?

cheers
simon
Re: compilation error if define SDSUPPORT
October 04, 2012 11:23AM
Have you removed the comments inserted while testing?


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: compilation error if define SDSUPPORT
October 04, 2012 04:48PM
you're clairvoyant.

now it works! :-)
yippie.

thanks very much.
Sorry, only registered users may post in this forum.

Click here to login