Its been about 6 months since I ran up code in this corner. Its probably just not getting flushed back to the file system. A lot of this stuff gets done in memory and written later.
I will take a look at this later this afternoon.
Has any user created a SD memory shield/library from the Arduino to the Maple?
(149 posts) (39 voices)-
Posted 2 years ago #
-
Hi guys, first of all many thanks for the effort on this project. Your job is really appreciated here in Italy too.
I've just a couple of questions. I've downloaded your libraries for maple from:http://crennsmind.com/Code/Maple/SDFat/SdFat-12-08-11.zip
but I've found a lot of compile errors.
1)
For example uint8_t, uint16_t, etc... I have manually changed header and cpp files removing "_t" because the compiler doesn't recognize the type with "_t". Is it correct?2)
how can i fix this:SdFatUtil.h:66: error: variable or field 'SerialPrintln_P' declared void
SdFatUtil.h:57: error: 'PGM_P' was not declared in this scope
SdFat.h:535: error: 'FAT32EOC_MIN' was not declared in this scope
FatStructs.h:411: error: expected constructor, destructor, or type conversion before 'const'
Maybe I missing some #include files? Or is it important the order of include files?
Thanks in advance.Posted 2 years ago # -
ok.. I've seen that a lot of compile errors have been removed if I put the include files in this order:
#include <SdFat.h> #include <SdFatmainpage.h> #include <SdInfo.h> #include <Sd2Card.h> #include <FatStructs.h> #include <SdFatmainpage.h> #include <Sd2PinMap.h> #include <SdFatUtil.h>
I've only some error when I include <SdFatUtil.h>. Here:
SdFat/SdFatUtil.h:57: error: variable or field 'SerialPrint_P' declared void
SdFat/SdFatUtil.h:57: error: 'PGM_P' was not declared in this scope
SdFat/SdFatUtil.h:66: error: variable or field 'SerialPrintln_P' declared void
SdFat/SdFatUtil.h:66: error: 'PGM_P' was not declared in this scope
how can I fix that?
Posted 2 years ago # -
Ok guys, sorry for all these posts, however I've commented the lines in SdFatUtil.h.
What I've understood is that the functions that I've commented need for Arduino (store in flash instead of RAM.. Maple does not have this kind of problem... because it has 20Kb of RAM).I'have commented these lines:
//------------------------------------------------------------------------------
/**
* %Print a string in flash memory to the serial port.
*
* \param[in] str Pointer to string stored in flash memory.
*/
/*
static NOINLINE void SerialPrint_P(PGM_P str) {
for (uint8_t c; (c = pgm_read_byte(str)); str++) Serial.print(c);
}
*/
//------------------------------------------------------------------------------
/**
* %Print a string in flash memory followed by a CR/LF.
*
* \param[in] str Pointer to string stored in flash memory.
*/
/*
static NOINLINE void SerialPrintln_P(PGM_P str) {
SerialPrint_P(str);
Serial.println();
}
*/In this case I don't have any compile errors.... I try to write a little sketch
Posted 2 years ago # -
ventosardegna - "I've found a lot of compile errors.
1)
For example uint8_t, uint16_t, etc... I have manually changed header and cpp files removing "_t" because the compiler doesn't recognize the type with "_t". Is it correct?"No that isn't correct.
A good approach would be to find where uint8_t is declarared, and try '#include'ing that file.
It is in stdint.h along with uint16_t.I'd recommend starting from the original source, and add
#include <stdint.h>
Here's an approach which I hope you and others will find useful.
When I get lots of errors from the compiler about one or two names that aren't declared, I start by assuming the names are probably correct. I assume the source code in libraries probably works, and it is the file which is using those libraries which contains an error.
Statistically, this assumption seems plausible. Otherwise it is likely that others would have mentioned the error, or the error would have been fixed (and I wouldn't see the error).
Then I do some of these things:
a) if I don't really understand the error message, I paste the whole error message into a search engine, and see what it finds.
Very often it'll give a match with an explanation. If the error message explanation seems to be too general put a '+' in front of the words that are the biggest problem. In this case '+unint8_t'.b) if I think I understand the message and so only want to find information about the specific name, I'd put the name into the search engine, along with a word to narrow the search, like "header" or "declare" or "define", for example 'unint8_t declare'
This usually gives lots of clues in the snippet of text presented by the search engine, and enough information is printed in the results page that there is only a need to look at a few pages.c) Try to find a declaration in a source code file for the name in the error message.
On *NIX (e.g. OS X, Linux, BSD, etc.) use grep or find+grep to locate files which may contain the name. These systems have things like "Spotlight" which find a specific word, but that type of search may be far too wide and imprecise.With C/C++ (which is the underlying stuff used for Arduino and Maple), I'd focus my initial search on header files. These should contain all declarations of names which are being shared. So I'd locate the files ending in '.h' within the MapleIDE's set of files.
find . -name '*.h' -print
will find all of the files ending in .h located in the current directory and in subdirectories. There will be a lot.
Then to finduint8_t
in each file, use grep.
There are two ways (I know of) but the forum software will eat the special back-quote characters that one uses, so here is the other one:
find . -name '*.h' -print | xargs grep 'uint8_t'
This can be improved by using the '-w' flag, which tells grep to only match complete 'words', i.e. only uint8_t and not __uint8_t
find . -name '*.h' -print | xargs grep -w 'uint8_t'
This will print all of the lines which contain the word 'uint8_t'.
There are still quite a lot.
So reduce that to lines which contain a definition of uint8_t, and not just the word.
There are two ways to introduce the name in C/C++. One is with a macro, which would say '#define uint8_t
' the other is atypedef
So try both:
find . -name '*.h' -print | xargs grep -w 'uint8_t' | grep '#define'
find . -name '*.h' -print | xargs grep -w 'uint8_t' | grep 'typedef'
This locates:
./hardware/tools/arm/arm-none-eabi/include/stdint.h:typedef unsigned char uint8_t ;
So the typeuint8_t
is declared in stdint.h
I'd try putting
#include <stdint.h>
Into the source file, and see if that reduces or increases the number of errors.I hope that helps.
(NB: this could be done with a smarter regular expression, but this is good enough)
(Edit: I added '-print' to thefind
commands just in case some OS has a wacky oldfind
, but I expect it is not needed)Posted 2 years ago # -
@gbulmer many thanks for the explanation. it's really understandable and useful. I will give you a feedback next days about this work!
Posted 2 years ago # -
@gbulmer I wish there was a 'kudos' or similar function in this forum for that post.
Posted 2 years ago # -
The errors in that copy were know I believe. Have you tried using the library from here:
http://code.google.com/p/maple-sdfat/That library is more upto date and should compile with no issues
Posted 2 years ago # -
Hi,
currently I'm trying to get some sd-card lib example code running - without any success at all.
What I'm using:
- library: http://code.google.com/p/maple-sdfat/downloads/detail?name=maple-sdfat.zip&can=2&q= (Jul 2012)
- Olimexino-STM32 Rev.B
- Maple IDE v0.0.12
- Ubuntu 12.04 LTS (if this Info matters...)What I tried:
I copied the library files with the example codes into my maple directory. My sd-card is empty and formatted in FAT. I plugged my Olimexino with sd-card (4GB class 10) included in my laptop. Started maple and opened file example file "SdFatInfo". I tried to compile the code...
What I get:
Pastebin link: http://pastebin.com/jbUVGXrx
I don't get it...
I appreciate any advice and help I could get.
Thanks in advance. :)
Kind regards,
YogybearPosted 2 years ago # -
[Solved]
Hi,
my problem got solved by using this library: https://www.olimex.com/Products/Duino/STM32/OLIMEXINO-STM32/resources/SDCARD_Lib+Examples_MapleIDE_from_leaflabs_forum.zip
Thank you.
Cheers,
Yogybear[SOLVED]
Posted 2 years ago # -
Yogybear - Thank you for following up by posting the solution. It all helps!
Posted 2 years ago # -
We should have pulled the "Arduino Style" examples out of the library. They really have been a PITA with no tziki sauce.
Posted 2 years ago # -
feurig - apropos PITA, my favourite is hummus with grilled bacon and tomatoes - yum :-)
Would a committer please try to find time to remove the "Arduino style" examples, or at least post a warning on the source?
(Full disclosure: I am not a member of LeafLabs staff.)
Posted 2 years ago # -
Yeah I will try to get that done in the next few days
Posted 2 years ago #
Reply
You must log in to post.