Forum Discussion
Altera_Forum
Honored Contributor
19 years agoUnexpected breakpoints
I have recently build up a section of my code, added a task to the system and now I am not able to run the software at all.
The debuger stops every moment on modules like alt_irq_handler and other library modules like there was a breakpoint there, but there is no breakpoint set. I opened the window with breakpoints and it is empty. I have the tools set to not stop at "main" function but run the code full speed. What could be the problem here ? I have tried to build the code with no debugging (option "release" in the compiler settings) and the code has problems running at all. Where to look for the causes ? I use nios II v6 with micro-C/OS II and latest Nios EDS tools.6 Replies
- Altera_Forum
Honored Contributor
Is there any "break" instruction near the breakpoint?
Altera's HAL API set many "break" instruction in the APIs in case of unexpected things happen. FYI. David - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by david_cai@Oct 8 2006, 11:46 PM is there any "break" instruction near the breakpoint?altera's hal api set many "break" instruction in the apis
in case of unexpected things happen. --- Quote End --- Does not look like there is any conditional break there... First time my program stops, it stops at the SIGTRAP Trace/Breakpoint at the first line (opening brace) of the function alt_irq_handler in the alt_irq_handler.c module. So I press green arrow RESUME button, and instantly program stops again, in the same task# 1 at the same line of the code: entry to alt_irq_handler(). So I press RESUME button again, and the code stps in the same task1 in the function alt_tick of the alt_tick.c module... Next time it stops is in the os_core.c module, line 532, and debugger does not find the source file but the function name indicated in the debugger window is OSTimeTick(). So I press RESUME to have more fun, and my code stops at the entry to alt_tick function again. And then at the OSTimeTick() again, then alt_tick() and so on... Looks like each and every system clock tick causes the breakpoint and the code is unusable. My "breakpoints" window is empty, no breakpoints set, even no defined & disabled ones... Please help! What can I do ? How to troubleshoot in such situation ?
- Altera_Forum
Honored Contributor
I have found the problem - looks like there was not enough stack size for the new task I have added in the micro-C/OS-II.
I have increased 1k to 4k and debugger started working fine... I had to increase the stack size even above 4k to get the task working as expected. - Altera_Forum
Honored Contributor
Yeah, I guess that you must have enable "Run Time Stack Checking" in the system library properties. So when stack overflow, it will stop at "{". If you wanna know the detailed info, pls look into the Disassembly View when system stop.
- Altera_Forum
Honored Contributor
Is there any way of checking peak stack usage (other than inspecting memory)?
- Altera_Forum
Honored Contributor
stack register is the best way...