Blog 3: Testing the SD Card Driver
If you have read my first two blogs, I'm sure you are feeling bored by now. But don't you worry, today will be more hands-on. The goal of this third blog is to verify that the SD card driver is working. Materials needed?
- CMOD S7 FPGA Board
- Vivado
- MicroSD Card
- MicroSD Card Adapter
- Breadboard
Initial Steps
- Clone this repository:
git clone https://github.com/AngeloJacobo/SDCard_Driver_Test.git
- Run Vivado and open the project SDCARD_TEST.xpr from the directory where the repository above is cloned.
- Generate the bitstream file and download it to CMOD S7 FPGA.
- Format the SD card that you will use.
- Arrange the breadboard connection as seen below. You can check the pin constraints to get a clearer idea on how the connection for the FPGA and SD card adapter is done.
Very quick and easy, right? But how can this test verify that the SD card driver is really working? The verification is simple, press btn1 of the CMOD S7 to start the initialization process of the SD card. Subsequent presses of the btn1 will then write some predetermined data(512 bytes per press of the button) to the SD card. Take note that btn0 is for reset.
Verify Initialization Sequence
You can verify the initialization process by hooking up a logic analyzer. If you do not have a logic analyzer yet, I recommend you to buy one now. It will save you a lot of headaches when debugging your projects. But in case you do not have a logic analyzer, do not fret since I added a lot of testing procedures to this project like the RGB and UART.
Okay let's start! The first time you press the btn1, the RGB led will turn green just like my demo below. This means initialization is successful.
If it is glowing red, the driver is stuck at CMD0(the very first command) and is not getting a response from your SD card. I suggest checking the breadboard connections digilently. However, if the LED is is glowing blue, then your SD card responded to CMD0 but is still stuck on other commands. This happened to me when I connect the VCC of the adapter to 3.3V, but when I connect the VCC to 5V of the CMOD, it successfully got past the initialization sequence (make sure that your SD card adapter has a level shifter on it).
Verify Write Operation
Now that the SD card is initialized, let us now start writing data to it. As I stated earlier, I added a UART on this test for easy verification. Open your Serial Monitor(I used GTKTerm), connect the port to whatever port the CMOD FPGA is currently connected, and set baud rate to 9600. Set the display to hexadecimal. Now, if you reset the board using btn0 and press the btn1 again to start initialization, the following will appear.
Those are the commands we sent to the SD card for the initialization sequence and also the response we got from it. If you are curious on how the flow works, just check my earlier blog. Now, if you press the button multiple times again, you will see the following:
Those are the data we are sending to the SD card. The first 512 bytes is the ASCII code for letter "a", second 512 bytes is the ASCII code for "b", and so on. Very simple! Now, in order to verify that the data is really stored, simply connect the SD card to your computer (using an SD card reader). And ta-dah! You will see this:
Now, why is it empty? It is because our test simply writes to a specific address of the SD card(address 2050 if you try to read the code), this is very similar to writing data to a flash memory. This means that we are not implementing any file system and since our computer always uses a file system to view an internal or external memory, it won't be able to show to us what is really stored in the SD card. The solution is simple: access the sector address of the SD card.
Open your terminal and type this command: sudo dd bs=512 count=10 skip=2050 if=/dev/sdd of=sdcard.bin
I'm in a Linux environment but if you are on Windows, there is also the dd command. This dd command simply convert and copy files. For this context, we will copy bytes of data from a specific sector of our SD card to our computer. bs is the block size and count is the number of block sizes that we will copy. skip is the number of counts skipped. It is set to 2050 since that is also the starting address specified on the code (2050 seems to be always a safe sector according to my experiments). In my example, I set the count to 10 so you will be able to see 5120 bytes of data after the 2050th 512 blocks. if is the input file which is the directory where data will be coming from (directory of the SD card) and of is the output file where the files will be copied to (sdcard.bin).
Since binary files are not accessible and is hard to read, convert the binary numbers to its hex value first and save it to a text file. This can be done using the hexdump command: hexdump -C -v sdcard.bin > sdcard.txt
I pressed the btn1 5 times and this is my sdcard.txt:
00000000 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000010 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000020 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000030 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000040 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000050 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000060 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000070 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000080 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000090 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 000000a0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 000000b0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 000000c0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 000000d0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 000000e0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 000000f0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000100 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000110 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000120 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000130 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000140 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000150 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000160 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000170 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000180 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000190 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 000001a0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 000001b0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 000001c0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 000001d0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 000001e0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 000001f0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 |aaaaaaaaaaaaaaaa| 00000200 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000210 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000220 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000230 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000240 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000250 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000260 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000270 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000280 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000290 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 000002a0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 000002b0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 000002c0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 000002d0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 000002e0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 000002f0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000300 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000310 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000320 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000330 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000340 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000350 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000360 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000370 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000380 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000390 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 000003a0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 000003b0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 000003c0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 000003d0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 000003e0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 000003f0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 |bbbbbbbbbbbbbbbb| 00000400 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000410 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000420 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000430 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000440 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000450 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000460 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000470 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000480 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000490 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 000004a0 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 000004b0 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 000004c0 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 000004d0 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 000004e0 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 000004f0 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000500 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000510 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000520 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000530 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000540 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000550 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000560 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000570 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000580 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000590 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 000005a0 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 000005b0 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 000005c0 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 000005d0 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 000005e0 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 000005f0 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 |cccccccccccccccc| 00000600 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000610 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000620 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000630 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000640 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000650 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000660 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000670 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000680 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000690 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 000006a0 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 000006b0 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 000006c0 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 000006d0 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 000006e0 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 000006f0 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000700 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000710 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000720 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000730 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000740 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000750 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000760 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000770 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000780 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000790 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 000007a0 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 000007b0 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 000007c0 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 000007d0 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 000007e0 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 000007f0 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 |dddddddddddddddd| 00000800 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000810 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000820 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000830 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000840 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000850 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000860 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000870 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000880 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000890 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 000008a0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 000008b0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 000008c0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 000008d0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 000008e0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 000008f0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000900 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000910 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000920 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000930 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000940 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000950 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000960 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000970 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000980 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000990 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 000009a0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 000009b0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 000009c0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 000009d0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 000009e0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 000009f0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 |eeeeeeeeeeeeeeee| 00000a00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000a10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000a20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000a30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000a40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000a50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000a60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000a70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000a80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000a90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000aa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ab0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ac0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ad0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ae0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000af0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000b00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000b10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000b20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000b30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000b40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000b50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000b60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000b70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000b80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000b90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ba0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000bb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000bc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000bd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000be0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000bf0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000c00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000c10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000c20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000c30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000c40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000c50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000c60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000c70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000c80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000c90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ca0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000cb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000cc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000cd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ce0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000cf0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000d00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000d10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000d20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000d30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000d40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000d50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000d60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000d70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000d80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000d90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000da0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000db0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000dc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000dd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000de0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000df0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000e00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000e10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000e20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000e30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000e40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000e50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000e60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000e70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000e80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000e90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ea0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000eb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ec0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ed0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ee0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ef0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000f00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000f10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000f20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000f30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000f40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000f50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000f60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000f70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000f80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000f90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000fa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000fb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000fd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000fe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ff0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000010a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000010b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000010c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000010d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000010e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000010f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000011a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000011b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000011c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000011d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000011e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000011f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001240 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000012a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000012b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000012c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000012d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000012e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000012f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001310 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001330 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001340 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001350 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001360 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001370 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001380 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001390 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000013a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000013b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000013c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000013d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000013e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000013f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001400
Notice the first 512 bytes(up to line 32) is filled with a's. Then the next 512 bytes(up to line 64) is then filled with b's. This will go on up to letter "e" since I pressed the btn1 5 times. This verifies that the write operation succeeded.
Preview for the Next Blog
Now that the SD card driver is working, let us now proceed to the main event. Next stop: interfacing with OV7670 camera.
6-Part Blog Series
- Security Camera #1: Project Proposal
- Security Camera #2: SD Card Interfacing
- Security Camera #3: Testing the SD Card Driver
- Security Camera #4: Interfacing with OV7670 Camera
- Security Camera #5: Adding Peripheral Sensors
- Security Camera #6: Project Demonstration and Final Words
To see more of my FPGA projects, visit my GitHub account: https://github.com/AngeloJacobo