-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simulation freezes after completion of unity and next malloc #530
Comments
I find this hard to understand, perhaps because your configuration is complicated. For example, I have no idea what "unity" is here. Two suggestions: have you tried enabling the tracing feature of simavr? If the problem is an infinite loop in firmware, that will show it. If not, it will show what the simulator is trying to do when it hangs. Second: please post just the firmware that fails and any instructions needed to build it. If some input is needed that can be recorded as a VCD file that can be played back in the simavr/run_avr program. Then maybe someone will look at it. |
You could also try to attach gdb to the running process of simavr if it loops... and see what's going on. It's very likely the firmware is spinlooping somewhere, this leading simavr into 'freezing' as it continues emulating it... |
It is linked as a library in the CMakeLists? It is linked as a folder as github module? It is a lightweight testing library for c code.
Thank you for this advice. I will try this.
But i did this? The CMakeLists i linked contain every information to build the elf-file? It is the target with the separated test of the flash_helper? You can even watch the content of the whole flashmemory with a additional target? EDIT: You can just change the implementation and get rid of user interaction and just start the test without asking stdin. Just set int menu to 1 and delete the call to stdin. EDIT2: The output of the program is in the tx pin as normal string, serial communication. Frameformat is in setup of the actual sourcefiles of the DwarfOS library. Its set to 28kbaud, but i think this doesnt matter for a vcd file? |
You might be running out of stack. Try declaring half these variable 'static' and see if it helps |
This is with ELPM device, sry don't mentioned it, but I always name the run configurations recognizable, it's in the screen. it's a simulated atmega2560. This function getFreeMemory from my heaphelper that has the stack pointer gives me 7000 free memory between stack pointer and malloc heap. Edit: Little bit frustrating, pretty sure the functions are now fine and all tests should pass, if this calculation goes right for example.... I know there is a strong probability that the user, me, is the problem, but it's hard to debug. |
Ingmar Eckhart, Please read the first paragraph of the first comment on #531. G, |
Hey Community,
Maybe you want to look into the situation, I have troubles to debug it. When I run the test for the flash helper with unity in the simulator (simutron as wrapper) the simulation freezes at next malloc after unity finished, doesn't matter where I call malloc or if this is a simulated atmega2560 or a Atmega328p. I think malloc can't be the problem, I see no blocking things or loops there.
Can't let simavr run as embedded gdb server, or with other words I lack the skills to add the virtual port to uart by my self. So I can't step with breakpoints through the code.
It is in this branch, I linked the CMakeLists for the tests. It's happening in the isolated target for flash helper and the test runner too. After the tests for stdio(puts_pf) this don't happen.
Edit: I know I forgot to tell you which version simutron is wrapping here. Maybe this is simutron related and their windows build related. Sry. Will give this infos at the evening when sun dissappeared.
Would still love a command line option for a virtual serial port to uart0. But your project is really great. Thanx for the tool.
https://github.com/IngmarEckhardt/dwarfOS/blob/7-unit-tests-for-flash_helper/tests/CMakeLists.txt
EDIT: There is no versioning at all? It is the simutron-1.0.1-SR1-Win32 build.
The text was updated successfully, but these errors were encountered: