Split from: SD card memory to USB stick

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jackxl wrote:

I solved it :D haha. It was only about settings as I thought. Problem with merge example USB Device and SD_MMC caused this

/* Enable ICache and DCache */
#define CONF_BOARD_ENABLE_CACHE

So:

1) Merge example SD_MMC_EXAMPLE and USB_DEVICE_EXAMPLE (virtual memory is mapped instead SD card) from ASF

2) Remove #define CONF_BOARD_ENABLE_CACHE

3) Set LUN_0 to DISABLED and LUN_2 to ENABLED

4) Remove VIRTUAL_MEMORY_ENABLED from Symbols in project settings


hello I have the same problem and i'm using same70Q21 processor
I can't find these 2 examples that you said I should merge at step 1

I found SD_MMC but 2 examples 1 for fatfs and raw access

also how do I merge 2 examples?

Can you help me with this ?

Last Edited: Tue. Feb 20, 2018 - 03:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

 

 


but for the last #4 step I can't find the virtual_memory_enabled sybol u're telling to remove

EDIT :  added FatFS so that Result and FATFS and FIL error to be gone in main.c

Last Edited: Tue. Feb 20, 2018 - 02:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

now after adding more from ASF wizard to the project to remove some error I get these errors

 

any idea what am I doing wrong?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now you're waking up a 6-month old thread!

 

https://www.avrfreaks.net/comment...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

worked after commenting this part

seems like there's something wrong with f_puts declaration and I have no idea what is it

Last Edited: Tue. Feb 20, 2018 - 03:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mostafa.aliaeldin wrote:
seems like there's something wrong with f_puts declaration (sic)

According to your screenshot in #3, the problem is with the definition - not the declaration.

 

Specifically, the definition is missing - so it is un-defined.

 

 

http://c-faq.com/decl/decldef.html

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

Mostafa.aliaeldin wrote:

seems like there's something wrong with f_puts declaration (sic)

 

According to your screenshot in #3, the problem is with the definition - not the declaration.

 

Specifically, the definition is missing - so it is un-defined.

 

 

http://c-faq.com/decl/decldef.html


i included the file that have this function "#include "ff.h"
and i defined the function header as an extern and still got error

and sorry to wake up the post but it's the only post describes my problem and i didn't want to re-post 

and also it seems like it has a solution and I need little help to implement it

thanks for help

Last Edited: Tue. Feb 20, 2018 - 06:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe it's just a language thing but what do you mean by "function header"? Also note that while a function declaration can have "extern" applied (like variables) it should not be needed as (for a function) a declaration is quite different to a definition. I suspect you simply didn't link ff.c.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But the header contains only a declaration - the function prototype.

 

You need a file - either source or pre-built library - which contains the definition; ie, the actual implementation.

 

EDIT

 

Cliff beat me to it.

 

Again, not that this is standard 'C' stuff - nothing specifically to do with AVR or ASF or Atmel Studio...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Feb 20, 2018 - 06:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Maybe it's just a language thing but what do you mean by "function header"? Also note that while a function declaration can have "extern" applied (like variables) it should not be needed as (for a function) a declaration is quite different to a definition. I suspect you simply didn't link ff.c.

I meant the "int functioName(argument); " --> function declaration   ( in the ff.h )

and yes the function itself --> function definition  ( in ff.c )

i included the ff.h file ( i know i can't include .c) in example.c (my main code)

and I also put the same function declaration with "extern" before it .

still gets me an error

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You need to add ff.c to your Project.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

You need to add ff.c to your Project.

this is weird but i just re-created the same project at my home pc (the old was work pc)

and it works without any errors :D
this is weird ...

and btw ff.c is added to the old project.

Last Edited: Tue. Feb 20, 2018 - 07:52 PM