- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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! RanLink Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page