I am looking to modify the receiving hardware serial buffer size for the Arduino Mega. To do so I need to redefine it in HardwareSerial.h in the core code. However, I can't seem to find a copy of the Arduino Mega core code. A search for HardwareSerial.h on my computer returns no results. I am using Windows 10.


1 Answer 1


Arduino Mega is part of the Arduino AVR Boards core. The location of that core depends on whether you are using the core version included with the Arduino IDE or have updated the core version using Boards Manager(in which case there will be multiple copies of the core installed on your computer but only the updated version will be used). The easiest way to find it is:

  1. Tools > Board > Arduino/Genuino Mega or Mega 2560
  2. File > Examples > EEPROM > eeprom_clear
  3. Sketch > Show Sketch Folder
  4. Move up folder levels until you reach the avr folder.
  5. If there is a version number folder in the avr folder then open that folder.
  6. HardwareSerial.h and the rest of the core files are located in cores/arduino.

Remember that you will need to redo any changes to the core after any Arduino IDE and/or Arduino AVR Boards updates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.