- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Everyone!
I have a problems. Please help me: I have a SOPC (Nios CPU + SRAM +JTAG UART + SW[7:0] +LEDG[7:0]+Timer) on DE2 board. The C code: // This code display the value of SW on LEDG# include <stdio.h># include <stdlib.h># define SW (volatile char *) 0x00011000 # define LEDG (char *) 0x00011010 void main() { while (1) *LEDG = *SW; } When I run this code, nothing happen (LEDG do not display the value of SW). But when debug this code (step by step), It work correctly. Please tell me why? Thanks.Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You probably need to bypass the data cache
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would recommend to use the PIO IOWR macros instead of pointers.
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