View previous topic :: View next topic |
Author |
Message |
Blob
Joined: 02 Jan 2006 Posts: 75 Location: Neeroeteren, Limburg, Belgium
|
unable to compile ex_fat |
Posted: Thu Nov 19, 2009 9:16 am |
|
|
Hi guys,
I am trying to run a SD card and FAT on my pic 18f2620.
I made a new project within MPLAB v8.36.
I use the CCS compiler 4.093
And get this error message:
*** Error 90 "FAT_SD.c" Line 155(28,29): Attempt to create a pointer to a constant
it refers to this section of the code
Code: | FILE stream;
printf("\r\nAppending '%s' to '%s': ", appendString, fileName);
if(fatopen(fileName, "a", &stream) != GOODEC)
{
printf("Error opening file");
return;
} |
Has anyone a clue what this can be?
FILE is not a constant, in the fat.c it is:
Code: | typedef struct iobuf FILE; |
Thanks in advance,
Blob |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Nov 19, 2009 1:50 pm |
|
|
I installed vs. 4.093, edited Ex_Fat.c so it uses the 18F2620, and
compiled it. I don't get that error. I just get two warnings:
Quote: |
Executing: "C:\Program Files\PICC\Ccsc.exe" +FH "ex_fat.c" +DF +LN +T +A +M +Z +Y=9 +EA
>>> Warning 215 "C:\PROGRAM FILES\PICC\drivers\mmcsd.c" Line 128(1,1): Undefined identifier USE_SW_ONLY
>>> Warning 202 "ex_fat.c" Line 26(5,8): Variable never used: rs232_errors
Memory usage: ROM=43% RAM=35% - 46%
0 Errors, 2 Warnings.
Loaded C:\Program Files\PICC\Examples\ex_fat.cof.
BUILD SUCCEEDED: Thu Nov 19 11:33:32 2009 |
Quote: |
And get this error message:
*** Error 90 "FAT_SD.c" Line 155(28,29): Attempt to create a pointer to a constant
|
However, I just noticed you referred to a file called "FAT_SD.c".
There is no such file in the CCS directories. Therefore, you are not
really compiling the CCS Ex_Fat.c example. You're doing something else. |
|
|
Blob
Joined: 02 Jan 2006 Posts: 75 Location: Neeroeteren, Limburg, Belgium
|
|
Posted: Fri Nov 20, 2009 1:44 am |
|
|
The name is different because I copied the ex_fat file to my working directory, to provide messing up my original file...
I recopied the original code from ex_fat.
And I see my error now, I deleted
#device PASS_STRINGS = IN_RAM
when I was changing the settings for the 2620
Thanks,
Blob
Last edited by Blob on Fri Nov 20, 2009 1:53 am; edited 1 time in total |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Fri Nov 20, 2009 1:50 am |
|
|
The problem can be caused by adding or removing global settings related to string processing. The original ex_fat.c has e.g. this setting in effect:
Code: | #device PASS_STRINGS = IN_RAM |
|
|
|
Blob
Joined: 02 Jan 2006 Posts: 75 Location: Neeroeteren, Limburg, Belgium
|
|
Posted: Fri Nov 20, 2009 1:54 am |
|
|
Thanks FvM,
Found it at the same moment....
Best regards,
Blob |
|
|
|