Your method of generating delays through nop operations is complete nonsense, why are you doing this? You will not create any precise signal this way, not to mention the fact that this is blocking code - which means that while you are creating such a delay, nothing else in the program can be executed.
To generate precise pulses at a given frequency, regardless of the main code, hardware timers are used.
And besides, in this file there are again no lines that could give such an error. Can you provide the error message in full - with file and line number?