OK... so I have my prototype boards for my SDZL now. I have just built one up, but I am failing completely to boot.
It took me some time to try and even get a bootloader on there - there seems to be a problem using pic32prog with a pickit2 on a PIC32MZ2048ECG064. Once I switched to my PK3 the bootloader installed and worked perfectly.
So I made a config for it, and after a few corrections got it to give me the console. But it can't find the SD card, and I can't work out why.
Code:
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
4.4BSD-Lite build 5 compiled 2015-01-10
matt@dell:LiteBSD/sys/compile/SDZL.pic32
cpu: PIC32MZ2048ECG064 rev A5, 200 MHz
oscillator: system PLL div 1:6 mult x50
cache: 16/4 kbytes
real mem = 512 kbytes
avail mem = 348 kbytes
using 18 buffers containing 73728 bytes of memory
spi1 at pins sdi=D14/sdo=C1/sck=D1
spi2 at pins sdi=G7/sdo=G8/sck=G6
spi3 at pins sdi=B10/sdo=C4/sck=B14
spi4 at pins sdi=F5/sdo=G0/sck=D10
uart1 at pins rx=D2/tx=D3, interrupts 112/113/114
uart2 at pins rx=B7/tx=B6, interrupts 145/146/147, console
sd0 at port spi2, pin cs=G9
sd0: no SD card detected
sd0: no SD card detected
bpf: lo0 attached
sd0: no SD card detected
ufs_mountroot failed: 19
panic: cannot mount root
syncing disks... done
sd0: no SD card detected
dumping to dev 2, offset 8
dump device bad
The config for the SD is:
Code:
controller spi2 flags 0x7778 # pins sdi=RG7, sdo=RG8 - SD card
disk sd0 at spi2 drive 0 flags 0x79 # select pin RG9 - logical 27
options "SD_LED=0x57" # LED4 is RE7
options "SD_KHZ=10000" # 10MHz clock
As you can see I have tried slowing it down to 10MHz to try and get it to work. I just don't get it.
I'm seeing the SCK, SDO and SS coming out of the chip fine. I'm even seeing the SDI coming back from the SD card. But it's just not detecting the card at all. The whole layout of that portion of the board hasn't changed since the SDXL board it's based on. The same RG6/7/8/9 pins going to the same places in the same way.
Any clues...?
I guess my next step will be to shove loads of debugging into the SPI comms to see what's going on...