Altera_Forum
Honored Contributor
20 years agoproblem using epcs.c in SDK library
Hello,
I have problem calling "nr_epcs_is_device_present()" function which I copied & pasted from epcs.c in SDK library. As far as I can see from the original source, The first thing it does in there is calling "nr_epcs_set_cs()" function to set chip select. After that, it is calling "nr_epcs_txchar(na_epcs_wren)" function to send WRITE ENABLE command. However, below loop in "nr_epcs_txchar(na_epcs_wren)" function continues forever. ---------------------- while (!(na_epcs_controller->np_epcsstatus & np_epcsstatus_rrdy_mask)); ---------------------- The base address of my epcs_controller is 0x00900000: typedef volatile struct{ int np_dummy[256]; // EPCS component fills lower 1k with code int np_epcsrxdata; // Read-only, 1-16 bit int np_epcstxdata; // Write-only, same width as rxdata int np_epcsstatus; // Read-only, 9-bit int np_epcscontrol; // Read/Write, 9-bit int np_epcsreserved; // reserved int np_epcsslaveselect; // Read/Write, 1-16 bit, master only int np_epcsendofpacket; // Read/write, same width as txdata, rxdata. } np_epcs; np_epcs* na_epcs_controller = (np_epcs*)(0x00900000); I am using NIOS II, and I heard that this legacy SDK is for NIOS. Is this the reason for my problem? If so, I would like to hear some hints as to modifying the above source.