avrdude: stk500v2_ReceiveMessage(): timeout

My program, nor any of the test programmes will upload to my arduino mega wifi 2560 however it appears to compile. It is connected to the same port COM4 as 'USB-SERIAL CH340 (COM4)' with default 9600 bits per second, under ports in device manager. I have tried updating from boards manager to no avail.

Error message:

Arduino: 1.8.10 (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

(lots of lines of it compiling that exceed the 9000 character forum upload limit)

"C:\Users\JACKFR~1\AppData\Local\Temp\arduino_build_522832/sketch_jan08b.ino.elf"
Sketch uses 1602 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 11 bytes (0%) of dynamic memory, leaving 8181 bytes for local variables. Maximum is 8192 bytes.
C:\Users\Jack Freeth\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\Jack Freeth\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega2560 -cwiring -PCOM4 -b115200 -D -Uflash:w:C:\Users\JACKFR~1\AppData\Local\Temp\arduino_build_522832/sketch_jan08b.ino.hex:i

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Users\Jack Freeth\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

Using Port : COM4
Using Programmer : wiring
Overriding Baud Rate : 115200
avrdude: stk500v2_ReceiveMessage(): timeout
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

avrdude done. Thank you.

An error occurred while uploading the sketch