What is required in a G-code file?

I’m trying to write a custom gcode file to double check the leveling.
What is required to make it work?
I tried copying some of the header lines from a Luban created file but it constantly causes the TS to crash. What’s missing or what is it choking on?

I did a simple Preheat file that just heats up the bed and nozzle with only a single comment at the start and it worked fine. Interesting note on that file, you can’t pause or stop a file that is waiting for the bed or nozzle to heat up. When the heating completes the heating IS canceled even though there is nothing in the file to tell it to. @parachvte ? @whimsycwd ?

When you run M109 or M190, you can’t pause or stop.

I’m not sure what you’re referring to by “the heating is cancelled”.

I think it’s something wrong when parsing the header. Upload your test G-code here, it will help us to debug and fix it. cc @Alan

The short program just turns on the heating for nozzle and bed. When it completes it turns off the heating. No doubt its just a safety feature, I’m just making a note of it.

I see the same results when I try to run programs created under SM1. I’ll upload it when I get home.