Upload hangs if LCD display is connected to Reset pin

1nvisible:
Looks like the problem might be connected with the keypad and constants reassignment. Whenever I disconnect the keypad completely I can't reproduce the hang. Connecting pins 36 and 37 of the keypad still produces no problem (I tried multiple re-uploads). But after connecting ping 38 along with 36 and 37 I got a hang. So there must be something else I need to change in GLCD in order to use reassigned pins...

I'm not sure why the glcd library pins need to be changed, but what you have seems to be ok and should work.
There is nothing else to change for the glcd library to change the pins used.

Do you have a schematic of everything that is hooked up to the mega?

I'm still guessing that there is a loading issue of either the power supply or an AVR pin(s).

Perhaps the column/row lines on the keypad are mixed up or not hooked up correctly to the mega pins which is creating a short
either during scanning or when a button is pressed.
(I've seen this before)

What library is the keypad using?
Does it scan the keypad using interrupts?

Can you attached the keypad and read the keys properly without the glcd attached?
(as a test maybe do something like read the keys and send output to the serial port)

--- bill