Forum Discussion
Altera_Forum
Honored Contributor
12 years agoJTAG UART repeating characters on Cyclone IV Transciever Kit
I am not sure what is up ... I have tried JTAG_UART with interrupt and polling ( with small model ) and there doesn't seem much difference. If I fun printf("Hello\n"); ten times through a loop, ...
Altera_Forum
Honored Contributor
12 years agoThanks Dave,
I can check that in the debugger... Would you examine the stack pointer value as the printf progresses ? I am not familiar with all the debug hooks in Eclipse but for a JTAG debugger I would add a barrier or waypoint at the top of the stack to trap such a nasty event. However, if there was such a collision I would expect more to go off into the weeds unless all I did was a single printf. I added the printf to a loop with an count value that I would expect was on the heap and I got the printf called the expected number of times all with the similar but not identical signature of repeated characters. To isolate this I really need to redirect the stdio to something apart from the JTAG UART, like a real UART. If I get the same result then I would say it is something more pervasive. I have other variables on the heap that control the printf being called so I would expect them to be corrupted by a stack -> heap collision. I also have a recursion test to load up the stack and I can try running that to see if bad things happen without calling printf.