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

Using IOWR IOED on Cyclone 5 SoC with HPS

Altera_Forum
Honored Contributor II
811 Views

Hi, 

 

I have the standard ALTERA timer_core element in (Cyclone 5 SoC with HPS) FPGA. I try to access its registers using: 

# define IOWR(offset, x, data) (*((volatile UINT32*)(offset)) = data) // WR access 

# define IORD(offset, x) (*(volatile UINT32*)(offset)) // RD access 

 

However, I get exception. 

 

Using the same macros for HPS peripherals is fine, no problem... 

 

I wonder, what's wrong? What should I use instead? 

 

Thanks! 

Ran
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
103 Views

You need to add the base address of the peripheral. The reason this works for HPS is that the base offset is fixed and defined starting at 0 rather than the beginning of the device's register space.  

 

All of the standard Altera cores will have code generated for them in the BSP. You should use that rather than writing it yourself.
Reply