SD card initialization causing AVR(1284) to reset

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

Hi,
I have used fatfs loads before, and am now coming back to it. I have attached a simple program that initializes an sd card, mounts the disk then tries to play a .raw file out of OCR1A. Then it tries to write to the sd card a text file. Trouble is it cant get passeed initializing - it doesnt even seem to fail - it just resets.

Any chance for someone to have a look at this?

Thanks
I dont know why this is occuring now, when this project was always meant to be a test project to see whether everything was working correctly. I've had it working before...
If you get audio out of your speakers, then there is something very odd going on!

Alex

Attachment(s): 

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

Not going to read that now but usual reasons for unexpected reset:

1) enabled interrupt source without handler in GCC

2) stack crash or otherwise over-written

3) electronics sourcing too much current from PSU often after LED with no current limiting is enabled

4) BOD enabled and trigger conditions inadvertently present (maybe (3))

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

Hi Cliff,
Thanks for responding.
I got rid of the uses of printf and removed libm.a scanf_a from the linker libraries.
Im using a slimmed down version of printf just to see whats coming up on my terminal.
MY BOD is disabled.
I havent got an unused interrupt.
It could be a stack crash I suppose
I dont think anything has ever changed in the electronics, and Im not using any LED.

Please could you try it, you dont need an sd card - you'll quickly know if its not restarting on yours, and I can put it down to hardware. This is the same program that I was using when you helped me yonks ago get fatfs working, so by rights you've seen it all before!

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

The sd cards bigger than 4G have a different init sequence. This messed me up for a week or so. Try it with a smaller sd card?

Imagecraft compiler user