ATSAMC21-XPRO interfaced with micro-SD Card.

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

I am working Microchip's SAM series ATSAMC21-XPRO microcontroller, have interfaced it with a micro-SD card module. I am using IDE Atmel Studio7 with ASF3. I referred to the ATSAMD21-XPRO's SD card example to write a code for SAMC21 but I am facing some errors with the FatFs files. I had added the SD/MMC and FatFs drivers from the list as given in the ASF Wizard of the IDE. Whatever functions/variables that are used in the main are declared, defined and linked in the files generated by the IDE, but still I am facing errors like " undefined reference to `disk_read' ".

 

Kindly, help me out please. I am attaching my main.c file and a screenshot of errors.
 

Attachment(s): 

Last Edited: Thu. Jul 4, 2019 - 01:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's not really possible to comment without looking at the project except it's strange you have lots of declarations in the main file that are supposed to be in include files (in the project), e.g., 

int assign_drives (int, int);
DSTATUS disk_initialize (BYTE);
DSTATUS disk_status (BYTE);
DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
#if	_READONLY == 0
DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
#endif
DRESULT disk_ioctl (BYTE, BYTE, void*);

is in diskio.h (src\ASF\thirdparty\fatfs\fatfs-r0.09\src\diskio.h)

/Lars

 

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

you can try to declare like this 'extern DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);'