Firmware and Set-Up of SAM

You can find the location of the platforms code that implements the standard Arduino core library API for the currently selected board (note there are different platforms for different boards) by looking at the verbose compilation output:

  1. Select File > Preferences from the Arduino IDE's menus.
  2. Check the box next to "Show verbose output during: [] compilation".
  3. Click the OK button.
  4. Select Sketch > Verify/Compile from the Arduino IDE's menus.
  5. Wait for the compilation to finish.
  6. Click on the black console pane at the bottom of the Arduino IDE window.
  7. Scroll the pane all the way up to the top. There you will find a line that starts with "Using core...", something like this:
    Using core 'arduino' from platform in folder: 
    C:\Users\per\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3
    

An alternative technique:

  1. Select a board from the hardware package you want to find from the Arduino IDE's Tools > Board menu.
  2. File > Examples > SPI > BarometricPressureSensor (or any other SPI example sketch)
  3. Sketch > Show Sketch Folder
  4. Move up folder levels until you reach the one that contains boards.txt

Once you are there, check the folders mentioned by MartinL for lots of interesting code!

You can also find it online here: