Connecting arduino mega

so i purchased an arduino mega that has modified circuit with esp8266 integrated. it uses ch340 chip for communication with computer. when i connect it to the computer it recieves power but when i upload some code it does not upload and gives error:

avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
Failed uploading: uploading error: exit status 1

plz help
thank you

Which board have you got selected in the IDE ?

arduino mega

Is the board properly recognised by your operating system? Which operating system?

Does the port in tools → ports disappear when you disconnect the board?

Did you set the dip switches on the board correctly? If you want to program the 2560 processor, they must be in a certain position; if you want to program the ESP8266, some of them need to be in another position.

ok thanks i rechecked the dip switches according to datasheet and one of them was in off state, whereas it should be otherwise