Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

EPCS processing - help please

Altera_Forum
Honored Contributor II
1,200 Views

I have a system where epcs save HW+SW so my nios is working fine (programm stars - no problem) 

but i can't get access to epcs - because alt_avalon_spi_comman hangs during processing  

I use HAL  

Give me please working example for it or correct my code.  

I don't understand what i do wrong.  

 

switch(getchar()) 

case 's': case 'S': 

fram(); 

break; 

case 'e' : case 'E': 

printf("n\reading status of epcs"); 

printf("n\nstatus: %x",epcs_read_status_register(EPCS_CONTROLLER_BASE)); 

default: 

continue; 

}
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
514 Views

Hi, 

i've used EPCS1 and EPCS4 in a design, reading and writing it in software. Have u first call the fuction alt_flash_open_dev? Can u post all your code? 

bye
0 Kudos
Altera_Forum
Honored Contributor II
514 Views

I solve all problems . 

 

I have in my board  

SPI real time clock  

2x SPI FRAM  

All of them i connect to EPCS SPI bus  

And i work with all devices using epcs controller core  

 

I find in sources of EPCS controller that EPCS controller use standart SPI routines  

but all of them where not work  

after this  

if look into epcs_controller.v and find this strings  

assign epcs_select = chipselect && (address[8] ); // activation of epcs data  

assign readdata = epcs_select ? data_to_cpu : rom_readdata; \\ switch between BOOT ROM data and epcs data  

 

sofware for SPI was next # define IORD_ALTERA_AVALON_SPI_RXDATA(base) IORD(base, 0x00)  

address[8] - is zero !!!!!!!!!! 

and i fix it in all strings like this # define IORD_ALTERA_AVALON_SPI_RXDATA(base) IORD(base, 0x100)  

 

And now all work just fine !
0 Kudos
Reply