Forum Discussion
No that shouldn't have caused a problem. When the PIO is bidirectional with a single tristate bus that connects off-chip there is a direction register that you write to in order to switch between input and output. If you have it set to input but attempt to write data I forget what the behavior is (probably stores the data but continues being an input) but I wouldn't expect that to cause a lockup. I recommend simulating the design, that's what I typically do when debugging system deadlocks. You'll want to look at the Nios II masters, the PIO slave port, and if you have any bridges between the CPU and PIO look at those in the simulation as well. This will let you determine where in the system the lockup occurs. Sometimes I also include the slave port of the memory I'm executing code out of as well. To track what the CPU is doing during the simulation I often look at the objdump file for the executable and correlate the addresses that the instruction master issues to the addresses in the objdump to figure out approximately which instructions are being executed.
Also if you are using a small on-chip RAM to store your code, you might want to try temporarily increasing the size of the memory if you have room just in case you are running into a stack and heap collision.