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++
All support for Intel NUC 7 - 13 systems has transitioned to ASUS. Read latest update.

HPS2FPGA bridge, DMA

Honored Contributor II

Hello everybody, i'm trying to make some simple project on DE1-SoC and have problems with H2F bridge. I have a GHRD as a base and i try to read from Onchip RAM to HPS RAM. Problem is that i don't really sure that i work with OCRAM. I can write and read from 0xc0000000+, but when i initialize OCRAM with .hex file in QSYS and then read this data from bare-metal app, i read nulls. Looks like i read from other undefined place.  


I initialize bridges like that it was in my university labs: 


if (status == ALT_E_SUCCESS) { status = socfpga_bridge_setup(ALT_BRIDGE_LWH2F); } if (status == ALT_E_SUCCESS) { status = socfpga_bridge_setup(ALT_BRIDGE_H2F); } 


ALT_STATUS_CODE socfpga_bridge_setup(ALT_BRIDGE_t bridge){ printf("INFO: Setup Bridge ...\n", (int)bridge); ALT_STATUS_CODE status = ALT_E_SUCCESS; if (status == ALT_E_SUCCESS) { // STEP 12: status = alt_bridge_init(bridge, NULL, NULL);// Attempt to initialize the bridges } if (status == ALT_E_SUCCESS) { status = alt_addr_space_remap(ALT_ADDR_SPACE_MPU_ZERO_AT_BOOTROM, ALT_ADDR_SPACE_NONMPU_ZERO_AT_OCRAM, ALT_ADDR_SPACE_H2F_ACCESSIBLE, ALT_ADDR_SPACE_LWH2F_ACCESSIBLE); } if (status == ALT_E_SUCCESS) { printf("INFO: Setup of Bridge successful.\n\n", (int)bridge); } else { printf("ERROR: Setup of Bridge return non-SUCCESS %d.\n\n", (int)bridge, (int)status); } return status; }  


I dont know should it work with initialized in qsys ocram, or if i dont want to fill ocram myself, i need to something else? 


I read try to read like that: 

for (uint32_t i = 0; i < 128; ++i) { printf("FPGA_RAM= \n",(unsigned int)alt_read_word(ALT_H2F_BASE+ALT_H2F_RAM_OFFSET+offset)); temp++; offset=offset+4; }  


where ALT_H2F_BASE=0xc0000000, and ALT_H2F_RAM_OFFSET=0x00000000. 


And the second question for my future plan is how to make dma transfer fron fpga ram ro hps ocram? is there enough alt_dma_memory_to_memory() or i should do this another way? 


I've never worked with SoC and it difficult for me to understand some things and Altera manuals. 




P.S.: sorry for mistakes i'm bad in english, but i hope you understand and will help me. Thanks:rolleyes:
0 Kudos
0 Replies