- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
im trying to use a SOPC-generated On-Chip-Memory (RAM) as a general purpose Data-Memory in my NIOS-System. What C-Functions can i use tio access the Memory? Is there a .h-File for the On-Chip-Memory? I did not find any documentation about using the Memory in C. PaddyLink Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use C pointers. The address of your memory block will be in system.h (ON_CHIP_MEMORY_BASE if your on-chip RAM is called on_chip_memory)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, i found the address (BASE-Address) in my system.h. But how can i access the memory? Is there a function like IOWR and IOREAD? Which parameters do this functions use?
Paddy- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do you access RAM in a standard micro controller? With a function? No. You just define some variables and the linker "places" these into the RAM. Since NIOS *is* a standard micro controller it's the same method here. Tell the linker to use your RAM as for the rwdata or the stack or the heap...
In case you already have a RAM for your variables and want to use an additional RAM you have to use pointers for reading and writing to the additional RAM, as Daixiwen said. Harald- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, i think now i understand what you wrote about the pointers. I will try it out!
Thanks, Paddy
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