Minimig Discussion Forum

Discussing the Open Source FPGA Amiga Project
It is currently Thu Feb 22, 2018 2:47 am

All times are UTC




Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: Pic firm. with SDHC, FAT16/32, Dir, HDD support for YQ091224
PostPosted: Fri Jan 08, 2010 7:51 pm 
Offline

Joined: Sat Jul 11, 2009 12:48 am
Posts: 48
Hi,

If it is not code than must be something on HW side. Could it be that PIC has contact problems e.g. ?

Anyway what I would try is:
1.) Check all resistors around SD/MMC slot
2.) Check all PIC pins for SD/MMC slot
SPI_DIN,SPI_DOUT,SPI_CLK,MMC_SEL,MMC_CLKEN

Could it be that SD/MMC card has issues reading/writing can you try another one...
I know it sounds stupid and you probably tried all of this..

A while a go I was building my Minimig and I had problems booting, my problem was in soldering RAM chips, I have managed to bridge two address lines but error was that I can't upload kickstart.

So It can really be anything, another idea I'm haveing that it might be possible to short something using card slot, so if you solder it using wires it might work?

To help you further here is SD card spec:
http://www.sdcard.org/developers/tech/sdcard/pls/Simplified_Physical_Layer_Spec.pdf
You can check on page 93 and futher more about SPI mode comunication.
There are errors that card is going to report in operation

Code that reports error is code that is waiting for data transfer from card to start MMC_Read function.
Code:
   timeout = 0;
   while(SPI(0xFF) != 0xFE)
   {
      if (timeout++ >= 50000)
      {
         #ifdef DEBUG_SDMMC
         printf("MMC CMD17: no data token\r\n");
         #endif
         DisableCard();
         return(FALSE);
      }
   }


If this code fails, this means that Card is accepted command to read data before start reading this code executed before:
Code:
   Command_R1(CMD17, upper_lba, lower_lba);

   /*exit if invalid response*/
   if (response_1 !=0)
   {
      #ifdef DEBUG_SDMMC
      printf("MMC CMD17: invalid response %02X\r\n",response_1);
      #endif
      DisableCard();
      return(FALSE);
   }


There could be possible that your SD card is not detected correctly but than wouldn't work in first place..
Anyway it looks like you don't get data start token 0xFE (page 111 of document) to start reading data.
You can try to increase wait timeout to see if it will work change this line of code in MMC_Read
Code:
if (timeout++ >= 50000)

Since Timeout is global unsigned int this means that you can max put it 65535 without changing variable type
Code:
if (timeout++ >= 65535)


Quille


Last edited by quille on Fri Jan 08, 2010 8:39 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Pic firm. with SDHC, FAT16/32, Dir, HDD support for YQ091224
PostPosted: Fri Jan 08, 2010 8:36 pm 
Offline

Joined: Mon Dec 01, 2008 10:11 am
Posts: 197
Zardoz wrote:
I have a bit of a problem with the latest firmware. Basically, after the core is loaded the SD card stops working and can't find the kickstart file to continue. Compiled from SVN with MMC and FAT debug and I'm getting CMD17: No data token.

Try to reformat your memory card or use another one. The CMD17 error occurs when the firmware tries to read blocks beyond the card capacity (e.g. corrupted FAT).


Top
 Profile  
 
 Post subject: Re: Pic firm. with SDHC, FAT16/32, Dir, HDD support for YQ091224
PostPosted: Fri Jan 08, 2010 8:49 pm 
Offline

Joined: Wed Jan 06, 2010 7:47 pm
Posts: 25
Yeah, that's what's worrying me, it has to be a hardware problem. However, it can't be the RAM, as it never starts uploading the kickstart, it fails to get a directory listing completely, which is the PIC's job. After the FPGA gets its core the SD card stops working. I'd be puzzled if it was the FPGA as well, as other cores work and I'm getting the boot screen and everything. I reflowed every component around the PIC to no avail, so I am not entirely sure what I should be looking for.

Edit: Yes, I did check that part of the code. I guess it's time to get the SD SPI spec out, it's been a good year since I last looked at it... The thing I don't understand, though, is why on earth does this only happen after a core is loaded? I'd suspect a short between one of the SPI pins and one of the data lines of the FPGA but I can't see one anywhere.


Last edited by Zardoz on Fri Jan 08, 2010 8:58 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Pic firm. with SDHC, FAT16/32, Dir, HDD support for YQ091224
PostPosted: Fri Jan 08, 2010 8:55 pm 
Offline

Joined: Wed Jan 06, 2010 7:47 pm
Posts: 25
yaqube wrote:
Zardoz wrote:
I have a bit of a problem with the latest firmware. Basically, after the core is loaded the SD card stops working and can't find the kickstart file to continue. Compiled from SVN with MMC and FAT debug and I'm getting CMD17: No data token.

Try to reformat your memory card or use another one. The CMD17 error occurs when the firmware tries to read blocks beyond the card capacity (e.g. corrupted FAT).


I've reformatted the card and nothing changed. Also tried a different card to see if it helps.I can see with the debug info that when it scans the directory to find the bin file, all other files are found ok, then when the kickstart is to be loaded it brings up the CMD17 error before it even manages to get a directory listing. Now, the odd thing is that if I remove the card, insert a new one and reset, it cannot detect it, I have to power down completely.


Top
 Profile  
 
 Post subject: Re: Pic firm. with SDHC, FAT16/32, Dir, HDD support for YQ091224
PostPosted: Fri Jan 08, 2010 9:34 pm 
Offline

Joined: Sat Jul 11, 2009 12:48 am
Posts: 48
Hi,

Quote:
Now, the odd thing is that if I remove the card, insert a new one and reset, it cannot detect it, I have to power down completely.


It is same for my minimig too, but if I reset twice using button (not OSD) it works.

Quille


Top
 Profile  
 
 Post subject: Re: Pic firm. with SDHC, FAT16/32, Dir, HDD support for YQ091224
PostPosted: Sat Jan 09, 2010 12:18 am 
Offline

Joined: Wed Jan 06, 2010 7:47 pm
Posts: 25
Ok, now I'm truly drawing a blank. I desoldered the SD slot and put it on wires to make sure there was nothing dodgy underneath, I've reflowed the corresponding side of the Spartan and all resistors, nothing. As soon as ConfigChipset happens, the SD card just stops working. If I move the load above that, it loads the kickstart, but it's taking aaages. Does this behaviour ring any bells to anyone?


Top
 Profile  
 
 Post subject: Re: Pic firm. with SDHC, FAT16/32, Dir, HDD support for YQ091224
PostPosted: Sat Jan 09, 2010 12:45 am 
Offline

Joined: Sat Jul 11, 2009 12:48 am
Posts: 48
Hi,

So if you move loading kickstart before config chipset to tubo mode evertyhing works.
How about you comment all config chipset functions for switching to turbo mode and try?

Code:
   #if   defined(PYQ090405)
      ConfigChipset(config.chipset|CONFIG_CPU_28MHZ);         //force CPU turbo mode
   #elif   defined(PGL091207) || defined(PGL091230)
      ConfigChipset(config.chipset|CONFIG_CPU_TURBO);         //force CPU turbo mode
   #endif


Next to SD card slot is Clock generator for FPGA. Colud it be that this is not working correctly?
Can you check if this clock is working ok? Again I don't know anything about electronics I'm just guessing.

Quille


Top
 Profile  
 
 Post subject: Re: Pic firm. with SDHC, FAT16/32, Dir, HDD support for YQ091224
PostPosted: Sat Jan 09, 2010 12:43 pm 
Offline

Joined: Wed Jan 06, 2010 7:47 pm
Posts: 25
The clock is working all right, as there is no display without it, I had a problem with a busted crystal on it before. I just lifted and resoldered the FPGA SPI select lines and it hasn't helped. I think it will probably be something trivial I can't think of... just like the clock problem I mentioned above...


Top
 Profile  
 
 Post subject: Re: Pic firm. with SDHC, FAT16/32, Dir, HDD support for YQ091224
PostPosted: Sun Jan 10, 2010 10:33 pm 
Offline

Joined: Wed Jan 06, 2010 7:47 pm
Posts: 25
Gah, seems to be PCB damage... I should have known better than to put it in hold luggage... I forgot that that was the other thing that happened to the PCB other than me soldering a different SD socket and cleaning off excess flux. Seems like some vias around the FPGA might be damaged. If I heat the board up between the FPGA and the PIC, it boots. Same if I apply *A LOT* of pressure onto the FPGA but it's not a broken solder joint, I desoldered it, cleaned the board, put it back on and inspected each pin under the scope. Since it's 2 layers I can try to fix them, we'll see how it goes.

Otherwise... Has anyone got a rev 1.1 pcb to sell me? :-/


Top
 Profile  
 
 Post subject: Re: Pic firm. with SDHC, FAT16/32, Dir, HDD support for YQ091224
PostPosted: Mon Jan 11, 2010 12:13 am 
Offline

Joined: Sat Jul 11, 2009 12:48 am
Posts: 48
I'm really sorry to hear that :(
I hope you will resolve board issue I'm also interested if there are still boards left since I have only one Minimig and I would like to build another, just to improve my soldering skills while there are still parts available to buy :)

Quille


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Translated by Xaphos © 2007, 2008, 2009 phpBB.fr