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.
12408 Discussions

HPS-FPGA Communication using mSGDMAs in memory-mapped mode

Altera_Forum
Honored Contributor I
901 Views

Hello, 

 

I'm trying to write some data from HPS to an on-chip memory and to rewrite them in a memory in HPS (from the on-chip memory). 

I'm using a SoCKit board. 

As a first step, in both cases, I'm using a mSGDMA (in memory-mapped to memory-mapped mode) for each direction, in order to read data from HPS and to write them to FPGA, and to read data from FPGA and to write them to HPS. In addiction, I'm not considering the use of any further processor (as Nios II). 

Unfortunately, I didn't find any C code to use as a reference. 

To understand the flow and how I should write the related C code, I started by the code provided at this link (https://github.com/dwesterg/soc-workshop/blob/master/sw_src/msgdma_user_space/memtest.c), where a streaming to memory-mapped mode (and vice versa) is considered for the mSGDMA. 

But I didn't understand which addresses I should consider to read/write the CSR and descriptor register (some address is missed). 

 

Could you suggest to me any reference code to read/write using mSGDMA or what addresses should be : ALT_LWFPGASLVS_OFST, READ_MSGDMA_DISP_CSR_BASE, WRITE_MSGDMA_DISP_CSR_BASE, MEMTEST_MEMTEST_CONTROLLER_BASE?  

 

Thank you in advance!
0 Kudos
1 Reply
Altera_Forum
Honored Contributor I
129 Views

I would take a look at the baremetal code with this design example: https://www.altera.com/support/support-resources/design-examples/soc/fpga-to-hps-bridges-design-exam...

Reply