SD tutorial - Resetting microcontroller - Lack of defines
Discussion in "8051 Discussion Forum" started by andrefrejat Apr 4, 2014.
Fri Apr 04 2014, 03:22 am
Hello
I've been following the tutorial on how to use Elm Chan's tutorial to communicate with a SD card. I'm actually using CC1110, from TI, on IAR Workbench for the program.
Inside the disk_initialize function, exactly on "CardType = 0" my microcontroller resets, it starts the program all over again. Does anybody have any guesses about the reason?
Another thing, I don't know what I did wrong, but there are 4 #define missing in my program:
#define IDLE_STATE
#define SD_TIME_OUT
#define SD_ERROR
#define SD_DATA_SIZE
The only one that I thought I had a more or less accurate answer was the IDLE_STAT (0x01) but I have no idea if that's right.
Thanks in advance,
André
I've been following the tutorial on how to use Elm Chan's tutorial to communicate with a SD card. I'm actually using CC1110, from TI, on IAR Workbench for the program.
Inside the disk_initialize function, exactly on "CardType = 0" my microcontroller resets, it starts the program all over again. Does anybody have any guesses about the reason?
Another thing, I don't know what I did wrong, but there are 4 #define missing in my program:
#define IDLE_STATE
#define SD_TIME_OUT
#define SD_ERROR
#define SD_DATA_SIZE
The only one that I thought I had a more or less accurate answer was the IDLE_STAT (0x01) but I have no idea if that's right.
Thanks in advance,
André
Fri Apr 04 2014, 12:26 pm
Can you tell me what version of FATfs library are you using?
It is hard to say why CPU is getting reset. wild guess... do you have any watchdog running?
For missing defines.. I need to check the code first. Let me know what version are you using.
It is hard to say why CPU is getting reset. wild guess... do you have any watchdog running?
For missing defines.. I need to check the code first. Let me know what version are you using.
Tue Apr 08 2014, 09:24 pm
Ajay Bhargav,
Sorry about the delay, I thought I had replied before.
I'm using the Generic FatFs V0.06 (the one I think the tutorial used as well).
Is a wild guess I'm looking for, so I appreciate that!
I'm not running any watchdog, it was one of the first things I've tried.
The problem I'm having now is that it's restarting actually inside the "do" loop in SD_init() function. I've "discovered" that send via UART messages to the PC.
Did you get the defines?
Kind regards,
André
Sorry about the delay, I thought I had replied before.
I'm using the Generic FatFs V0.06 (the one I think the tutorial used as well).
Is a wild guess I'm looking for, so I appreciate that!
I'm not running any watchdog, it was one of the first things I've tried.
The problem I'm having now is that it's restarting actually inside the "do" loop in SD_init() function. I've "discovered" that send via UART messages to the PC.
Did you get the defines?
Kind regards,
André
Wed Apr 09 2014, 03:57 pm
the do-while loop has nothing which can reset your controller. Its a simple SPI send and read. Most probably it has something to do with your SPI functions. Did you create your SPI library yourself or downloaded it from TI?
I would also suggest you to update your source to 0.10a latest version.
I would also suggest you to update your source to 0.10a latest version.
Mon Jun 16 2014, 02:07 am
Hello again,
I started working on the project again and managed to get rid of the resetting problem. But I still wasn't able to find the definitions for:
IDLE_STATE
SD_TIME_OUT
SD_ERROR
SD_DATA_SIZE
Did you find it on your code?
Thanks in advance,
Andre
I started working on the project again and managed to get rid of the resetting problem. But I still wasn't able to find the definitions for:
IDLE_STATE
SD_TIME_OUT
SD_ERROR
SD_DATA_SIZE
Did you find it on your code?
Thanks in advance,
Andre
Mon Jun 16 2014, 12:34 pm
those are SD specific routines which might be different for everyone. However I will ask Dave to provide those missing defines. Meanwhile you can take reference from FatFs sample projects and use SD init routines from one of the project you can understand well. Let me know if you need any suggestions.
Tue Jan 05 2016, 10:25 pm
Hi,
I'm also not able to find those defines. Any luck? I know that we have to define it in SDcard.h file, the question is whats the value for each define?
I'm also not able to find those defines. Any luck? I know that we have to define it in SDcard.h file, the question is whats the value for each define?
Powered by e107 Forum System