Make sure you use the latest Arduboy2 library. You can do this as following :
go to Sketch > include library > Manage library then in the text box in the top type Arduboy2 select version 5.2.0 and click update.
You may also want to repeat that for the ATMlib library
corrected version number