Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12453 Discussions

SD card ip core: read block error with SDHC

Altera_Forum
Honored Contributor II
908 Views

Hello all, my Project is as below: 

 

IP CORE SD CONTROLLER with SPI mode, 

work with 2G SD card but not with card >= 4G; 

 

The initialisation flow is all good, no problem. 

 

The problem is: 

With a card HC(4G), when I tell it to read a block beginning at 40 00 00h, it reads at 80 00 00 00h (512 times bigger); 

but with a card non HC(2G), there is no such problem. 

 

the API using is "sd_read_data_block( sd_card_info_struct* sd_card, char* data_buffer, alt_u32 read_address )

 

Can someone help me with this? It drives me crazy:cry: 

 

THX very much!
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
191 Views

Problem solved, the difference between the addr of sdhc and sdsc is 9bits (512 times), because sdhc requires more space for the addr. 

so before reading a block, we should determine either it is hc or sc.
Altera_Forum
Honored Contributor II
191 Views

Hi lylli007, 

I am having trouble when trying to read or writing data to a SanDisk Ultra 2GB class4 which is also an SDHC. Can you explain how you solve the addressing issue? 

Thanks.
Altera_Forum
Honored Contributor II
191 Views

Hi Lyllie007 

Did you use the Altera University Program IP Core?
Altera_Forum
Honored Contributor II
191 Views

Hello lylli. 

 

Can i get the source for detecting the SDHC card. University IP will detect only 2GB cards..I have struck from 1 month .It will be a great help.
Reply