Pages: [1]   Go Down
Author Topic: Bitlashsd error  (Read 967 times)
0 Members and 1 Guest are viewing this topic.
Buena Vista, CO
Offline Offline
Full Member
***
Karma: 0
Posts: 180
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

8000ft above the average

0
Offline Offline
God Member
*****
Karma: 39
Posts: 986
Get Bitlash: http://bitlash.net
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello:

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

Code:

- 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:
#define SDFILE
« Last Edit: October 14, 2012, 04:44:07 pm by billroy » Logged

Buena Vista, CO
Offline Offline
Full Member
***
Karma: 0
Posts: 180
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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
Logged

8000ft above the average

Buena Vista, CO
Offline Offline
Full Member
***
Karma: 0
Posts: 180
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

8000ft above the average

0
Offline Offline
God Member
*****
Karma: 39
Posts: 986
Get Bitlash: http://bitlash.net
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Does that help?

-br
Logged

Pages: [1]   Go Up
Jump to: