SD2.0 FATEngine on PropC3 slow SD-card wait until SPI-bus is free
StefanL38
Posts: 2,292
Hi,
I tried to run the KyeDOS SD2.0 FatEngine Demo on a C3-board.
I get a VGA-screen with a blinking cursor but if I type on the keyboard connected to the C3-board
nothing happens.
I've tried other VGA/Keyboard code on the C3 and this other code is running properly
C3_unit_test_010VGA all tests passed Flash, SRAM, SD-card mounted
As I get a VGA-screen with a blinking cursor the VGA-pin-assigment seems to be right.
I inserted debug-output to the VGA-screen to analyse how far the code executes
I get feedback on the screen until command-line
fat.mountPartition(0,0) ' mount the sd card
here the systems seems to hang
The C3 !SD_Card-Profiler runs succesfull and delivers this results
│
best regards
Stefan
I tried to run the KyeDOS SD2.0 FatEngine Demo on a C3-board.
I get a VGA-screen with a blinking cursor but if I type on the keyboard connected to the C3-board
nothing happens.
I've tried other VGA/Keyboard code on the C3 and this other code is running properly
C3_unit_test_010VGA all tests passed Flash, SRAM, SD-card mounted
As I get a VGA-screen with a blinking cursor the VGA-pin-assigment seems to be right.
I inserted debug-output to the VGA-screen to analyse how far the code executes
I get feedback on the screen until command-line
fat.mountPartition(0,0) ' mount the sd card
here the systems seems to hang
The C3 !SD_Card-Profiler runs succesfull and delivers this results
### SD Card Profile ### Disk Signature: 0x00000000 Partition 0 - 0x30656163 NO NAME FAT16 512 - Bytes Per Sector 64 - Sectors Per Cluster 3857984 - Total Sectors 60281 - Total Clusters 128 - Used Sectors 3857856 - Free Sectors 32 KB Stride Speed Test: writeByte - 3 KBs writeShort - 6 KBs writeLong - 12 KBs writeData - 91 KBs readByte - 3 KBs readShort - 6 KBs readLong - 12 KBs readData - 199 KBsWhat do I have to change to make SD2.0 FATEngine Demo run successfully on a C3-board?
│
best regards
Stefan
Comments
I never quite understood it but there is an explanation somewhere in the manual. The best way to describe the solution I think is via the schematic. However, the schematic in the manual does not zoom. Does anyone have a link to the zoomable schematics?
C3_Template is a program template that uses the modified start calls. It mounts an SD card and displays the flash directory using a PS/2 keyboard and TV display and here is simply meant to illustrate how the start calls have been changed.
Edited 2012-02-03 to correct Winbond_Driver_C3
thank you very much for uploading your code. Right now my son wants to take a walk with me and the dog.
So I'm gonna try it later.
best regards
Stefan
I added output to see if the mounting was successfully. SD-card mounted but I also get a message "no flash found".
Does this mean the Flash-memory of the C3-board is different from the winbond-flash?
I attach my project to this posting.
best regards
Stefan
first of all thank you for testing my code.
Did you test it with PropTerminal?
I made some tests and found out when I comment out the codelines that do test the SD-card,
the Flashtest is successfull and reports back result 255 (output inserted by me)
1020K flash free out of 1MB
If a copy & paste the flash-test-code below the SD-card-test it reports back no flash found
I took a very close look onto the flash-chip. The partnumber is Atmel 0710 26DF081A SSU.
The file UnleashingPropellerC3v1.0.pdf talks abouts So might it be that your C3 is from a pre-serial which has a microchip-flash?
Modified code is attached
best regards
Stefan
I didn't actually use PropTerminal. I used BST's built-in terminal emulator. It doesn't properly interpret some of the control codes for PropTerminal, but displayed the messages from the program in a very usable fashion.
I ran your new version and this is what I got:
this is really strange.
I get
The Sd-Card is a SanDisk 2GB micro.
I have nothing connected but the USB-cable.
best regards
Stefan
1) There's something wrong with your flash memory
2) The Sandisk SD card is slow to respond to something sent by the driver and doesn't release the SPI bus so the flash memory can use it.
You might try another SD card and see what happens.
you made my day. After inserting a repeat 500-statement now the second test of the flash is successfull.
Thank you very much.
This might happen with different SD-cards. So is there an easy way to check if the spi-bus is free?
Or is it possible to insert some code that does a second try after half a second?
best regards
Stefan
I'm not sure how to check if the SPI bus is free. I'll have to look at Kye's code to see where additional delays could be added.