- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am having a onchip memory on which i wish to write through input device like uart and futhur what ever i have written i want it to be looped back i.e then i want to read the contents from the memory.
i can capture what ever is coming to uart but not sure how to write into the memory . Do i need to treat onchip as a device file simillar to uart and using fopen(),fread() etc commands to read and write into the memory. please help me out over this.. regards , SankalpLink Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sankalp,
You can always read and write to memory using below: IOWR_32DIRECT(address, offset, pattern); // for write IORD_32DIRECT(address, pattern); // for read -Baycool- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by baycool@Sep 30 2005, 03:12 PM hi sankalp,
you can always read and write to memory using below:
iowr_32direct(address, offset, pattern); // for write
iord_32direct(address, pattern); // for read
-baycool
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10075)
--- quote end ---
--- Quote End --- hi , Could i know more about these functions? I am able to capture character through Uart using fget(ch) into a char variable, now how to use the above funtions to write into an onchip memory.i.e what will be the address,offset? Could you please help me out ? Regards, Sankalp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To put it another way:
IOWR_32DIRECT(base address, offset from base address, data you want to write); // for write IORD_32DIRECT(base address, offset from base address); // for read If you want to see their definitions take a look at components\altera_nios2\HAL\inc\io.h (they boil down to a data cache bypassing read or write instruction)- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by sankalp.singhal@Oct 4 2005, 01:56 AM how to use the above funtions to write into an onchip memory.i.e what will be the address,offset?<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10119)
--- quote end ---
--- Quote End --- Create the onchip memory peripheral in SOPC Builder, and give it an appropriate name. Regenerate your system. In the IDE, regenerate your project's system library. Open the system.h file in there and somewhere in there is the base address of the memory peripheral. For example, if I created an "On-chip memory (RAM or ROM)" device and named it "UART_cache", then regenerate SOPC, then regenerate system library, somewhere in the system library's system.h file will be a# define setting UART_CACHE_BASE to the base address of the on-chip memory. I don't remember if there is also a symbol generated for the memory's size.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
Kindly, I have Terasic DE2-70 board with Nios 2 IDE v11.0 to develop some application on it, but I have a problem it is: how can I (store/read) data (to/from) my host computer(Hard Disk for example) on running time by using ANSII C library function such as (fopen() , fget(), fput(), .....); Could somebody please assist me on that. Thanks.....................- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can do that only if you run your application with the debugger and use the host filesystem software component.
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