Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

EPCS processing - help please

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;

}

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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 !