Simulations steps if modifying code

Hi

I’m looking at a copter project with some friends. We are thinking of adding an external utility, with a uart communication. We would like to add some logic to control it from the pixhawk’s pilot. This means some modifications to the code. What we are not sure about is how we make sure the modifications to the pilot won’t crush it.
I see that there are SITL and HITL options, but these test mainly the pilot navigation and control. We are more worried of OS problems’ like what would happen if we cause an overflow in the uart driver, and that would crash the entire pilot program. Is there a way to fully simulate a flight, that would make the entire pixhawk be simulated, including the OS, drivers, etc?

PS
what actually happens if the main STM controller simply restarts during flight?

Hey, I’m new here, but currently working on a capstone project using the ArduCopter software, so I may be off base here but if you’re looking for a simulator to go with the SITL setup, they have a tutorial for linking to FlightGear, an open source flight simulator. The SITL simulates the flight fully, including OS, drivers, etc if I understand it correctly and the simulator will give you a visual. You can find the tutorial here: http://ardupilot.org/dev/docs/sitl-native-on-windows.html#sitl-native-on-windows

If you want to test the capabilites of the pixhawk hardware though, I would think you need to go the HITL route since your pc would probably be able to handle much more than the pixhawk hardware and so may not give an accurate result.

Again, I’m new here so I may be off but this seemed similar to what I’m working on so hopefully this helps.

Good Luck,
Chris