Forum Discussion
Altera_Forum
Honored Contributor
19 years agoNios behaving erratically?
I was wondering if anyone has encountered this strange problem... I have a scenario where I have a working code build for my particular product. however, when I add some simple code, it breaks other ...
Altera_Forum
Honored Contributor
19 years agoIt's not plain as day to me what could be the problem except for that "got_out_data". I don't see anything but an assignment of 0 to it.
Also this line: data[0] = IORD(USB_SX2_BASE, 0x00); Since it's a hard coded access you may want to declare "data" as volatile. The compiler may see that and say "why should I keep stuffing data into "data[0]" it should have it from the first time". If this is indeed the problem I bet this will work (not pretty but the compiler can't break it): IOWR(USB_SX2_BASE, 0x02,IORD(USB_SX2_BASE, 0x00));