I am using WinAVR to compile and link my code.
Until today everything was working as expected. I then added a few lines of code to an existing C module (i.e. file) in my project and the hardware started resetting itself.
In order to verify whether the added code was the troublemaker, I simply removed the added code and things started to work again. The code that was added was never called during run time. Therefore, this failure is not due to a bug in the new code.
I looked a bit closer to the C file where I added the code and following is the picture I got, which made me suspicious a bit:
1 - It is the largest .c file in my project which is 322 kBytes in size.
2 - The object code generated by the same module is also the largest and its size is 154 Kbytes.
3 - The added new code does not introduce new RAM variables but simply uses the existing ones. So I don't think the problem is related to excessive RAM usage either.
I must also add that I am currently using the default Make file and have not modified anything there.
My questions are:
Q1 - Is there a C file size limitation when using WinAVR? I did search the web but did not come across such limitation.
Q2 - Is there an object code size limitation for each C file in a project?
Q3 - Is what I am seeing due to the fact that I am using the default WinAVR Make file? Do I need to modify something to allow large C files/modules to be compiled reliably?
If you have any other suggestions for the problem I am seeing, I will be grateful.