Altera_Forum
Honored Contributor
14 years agoSystem hangs when c-code is smaller
Hello!
A friend and I have programmed a NIOS-System using the Altera WebServer example as SOPC-Design. In the uCos we create three Tasks and do some decoding and output of encrypted audio-data, that worked all quite well. The program was running as we wanted it. Then we cleaned our code and added comments after we finished development. Now while we remove some old functions that were still in the design from our development process, but they are not used by us anymore, the hole system hangs while running on the development board. By variation of the amount of c-code, that we remove from the project, the moment when the system hangs can be altered, so we believe it has to do with the stack and heap. The problem is, that this behavior is really bad to debug, because we have no experience with it. The problem must occur in the NicheStack while receiving an packet we think, but when we debug, the debugger steps over the moment where the error must occur and we land somewhere in the memory afterwards. What would you do in such a moment and how would you try to solve such a problem. We already dumped our elf, but got no clues from that. We tried to raise debuglevel and look into the code with debug, as mentioned above we just see that an error occur, but not what happens there. We activated stack check and OSTaskCheck tells us, that the stack is big enough. Where or how to pinpoint this behavior? Thanks for any advice, Peter.