/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Problems with fs.h, dosfs.h writing a file

Username:     
Password:     
             

Forum
  • Index
  •  » circleOS
  •  » Problems with fs.h, dosfs.h writing a file

# 1   2011-04-30 17:07:36 Problems with fs.h, dosfs.h writing a file

Fimbulvetr
New member
Registered: 2011-03-29
Posts: 7

Problems with fs.h, dosfs.h writing a file

Hi, im using a Primer2 and want to write a file to sd card using the functions implemented in fs.c.

but if i include every necessary header i got a lot of these errors, could somebody plese help?


../dosfs.h:18:14: error: nested redefinition of 'enum STORAGE_device' 
../dosfs.h:18:14: error: redeclaration of 'enum STORAGE_device' 
../circle_api.h:1085:14: note: originally defined here 
../dosfs.h:20:5: error: redeclaration of enumerator 'MMCSD_SDIO' 
../circle_api.h:1087:5: note: previous definition of 'MMCSD_SDIO' was here 
../dosfs.h:21:5: error: redeclaration of enumerator 'INTERNAL_FLASH' 
../circle_api.h:1088:5: note: previous definition of 'INTERNAL_FLASH' was here 
../dosfs.h:22:3: error: redefinition of typedef 'eSTORAGE_device' 


and also this:

../fs.h:43:5: error: expected declaration specifiers or '...' before '(' token 
../fs.h:43:5: error: expected declaration specifiers or '...' before '(' token 
../fs.h:43:5: error: 'u32' declared as function returning a function 
../fs.h:43:5: error: 'u32' redeclared as different kind of symbol 
../circle_types.h:38:18: note: previous declaration of 'u32' was here 

the error means for example this line in fs.h

u32 FS_Mount( enum STORAGE_device device );

Offline

 

# 2   2011-05-02 21:43:23 Problems with fs.h, dosfs.h writing a file

pfandler
Member
From: Hungary
Registered: 2011-02-16
Posts: 26

Re: Problems with fs.h, dosfs.h writing a file

Hi,

Try to include your files BEFORE the circleos related includes. For me this prevented all redefinition errors.

BR, Peter

Offline

 

# 3   2011-05-03 13:05:29 Problems with fs.h, dosfs.h writing a file

Fimbulvetr
New member
Registered: 2011-03-29
Posts: 7

Re: Problems with fs.h, dosfs.h writing a file

hi Peter,
thank, now the redefinition errors are no longer there, but unfortunately the others errors still occurs.

I mean this for example:

..\Application.c:319:5: error: expected declaration specifiers or '...' before '(' token 
..\Application.c:319:5: error: expected declaration specifiers or '...' before '(' token 
..\Application.c:319:5: error: 'u32' declared as function returning a function 
..\Application.c:319:5: error: 'u32' redeclared as different kind of symbol 
C:\Program Files (x86)\Raisonance\Ride\Lib\ARM\CircleOS/circle_types.h:38:18: note: previous declaration of 'u32' was here 
..\Application.c: In function 'u32': 
..\Application.c:324:22: error: 'device' undeclared (first use in this function) 


The error refers to this part of code:

u32 FS_Mount(enum STORAGE_device device )
{
#if SDCARD_SDIO
    NVIC_Config_SDIO();
#endif
   return DFS_Mount( device );
}


I guess the compiler doesn´t understand that Moun() is a function?

hope someone can help

Offline

 

# 4   2011-05-04 18:22:47 Problems with fs.h, dosfs.h writing a file

Fimbulvetr
New member
Registered: 2011-03-29
Posts: 7

Re: Problems with fs.h, dosfs.h writing a file

Hi, now I have every header in my project and even all functions, now i´ve got the problem that the compiler says this:

c:/program files (x86)/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Christian\Desktop\GTM Projekt\Apps\GTM_Projekt\objdebug\GTM_Projekt.elf section `.text' will not fit in region `FLASH' 
C:\Users\Christian\Desktop\GTM Projekt\Apps\GTM_Projekt\objdebug\GTM_Projekt.elf.ld:22: undefined symbol `!!!!!!!!! FLASH IS FULL !!!!!!!!!' referenced in expression 
collect2: ld returned 1 exit status 



anyone knows how to avoid this?
thanks smile

Last edited by Fimbulvetr (2011-05-05 10:32:01)

Offline

 

# 5   2011-05-09 09:48:21 Problems with fs.h, dosfs.h writing a file

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: Problems with fs.h, dosfs.h writing a file

Modify in the linker script (.ld), the line :

  FLASH    (rx) : ORIGIN = 0x08000000, LENGTH = 24K-256

Note : the file and the line are depending on your project. Are you modifying the CircleOS or developping a CircleOS application ?

Offline

 

  • Index
  •  » circleOS
  •  » Problems with fs.h, dosfs.h writing a file

Board footer