Go Down

Topic: Bitlashsd error (Read 1 time) previous topic - next topic

alfiesty

I trying to learn Bitlash to make a websever, storing pages on a SD card. Currently I am working on bitlashsd at the moment to understand SD using bitlash. I'm getting the following errors:

bitlash\bitlash.cpp.o: In function `scriptfileexists':
C:\arduino-1.0.1\libraries\bitlash\/src/bitlash-instream.c:50: multiple definition of `scriptfileexists(char*)'
bitlashsd.cpp.o:C:\Users\jim\AppData\Local\Temp\build8548542757815330962.tmp/bitlashsd.cpp:142: first defined here
bitlashsd.cpp.o: In function `setup':
bitlashsd.cpp:(.text.setup+0x40): undefined reference to `sdcat()'
bitlashsd.cpp:(.text.setup+0x42): undefined reference to `sdcat()'
bitlashsd.cpp:(.text.setup+0x64): undefined reference to `func_fprintf()'
bitlashsd.cpp:(.text.setup+0x66): undefined reference to `func_fprintf()'
bitlashsd.cpp.o: In function `sdappend()':
bitlashsd.cpp:(.text._Z8sdappendv+0x40): undefined reference to `sdwrite(char*, char*, unsigned char)'

I'm using the SDFat library referred in the documentation and the Sd card on an ethernet shield with a Mega 2560.

Jim
8000ft above the average

billroy

#1
Oct 14, 2012, 11:38 pm Last Edit: Oct 14, 2012, 11:44 pm by billroy Reason: 1
Hello:

I wonder if you did this little necessary surgery described at the top of the bitlashsd sketch:

Code: [Select]


- Edit bitlash/src/bitlash.h to turn on the SDFILE define: at or near line 340, make this:
//#define SDFILE
look like this:
#define SDFILE

- If you are using a Mega2560, edit SdFat/SdFatConfig.h @ line 85, make this change:
#define MEGA_SOFT_SPI 1


If you haven't already, try that and report back on whether your compile works better...

Best luck with your project!

-br

PS: Update. OOPS: The define needs to be enabled, not disabled.  I've fixed fix the doc bug and have amended the text above.  For avoidance of doubt, please make line 340 look like:

Code: [Select]

#define SDFILE


alfiesty



PS: Update. OOPS: The define needs to be enabled, not disabled.  I've fixed fix the doc bug and have amended the text above.  For avoidance of doubt, please make line 340 look like:
/quote]
The OOPS did the trick! Thanks!  Great Language, but for a old dummy like probably a steep learning curve.

Jim
8000ft above the average

alfiesty

The program runs and it will display the directory. I have a file called sdtest.txt on the sd, but type sd.test.txt or exists sdtest.txt both return a dashed line then missing arg.

Jim
8000ft above the average

billroy

Let's check the syntax.  Bear in mind that the SD card functions are proper functions that require parentheses for their arguments:

Code: [Select]

> dir()
> dir        // you can omit the parens if there are no args
> type("sdtest.txt")
> exists("sdtest.txt")


Does that help?

-br

Go Up