but I still have the 500 lines limit which message "End program" when arriving at the line 500 and that with all G-code I tested.
There is no "End Program" message when the 500 line limit is reached. It sounds like that message is in the end of your g-code.
Are there any other errors?
Can you post the g-code?