How to change the default path of Arduino core

Hi,

The default path of Arduino core is :C:\Users\myUser\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.20 I would like to change this path in order to use a custom git repository. Depending on the project I use I also need to modify the files in the directory : "C:\Users\myUser\AppData\Local\Arduino15\packages\arduino\variants\mkrgsm1400" (to change pins assignment).

Thanks

alexduch: Hi,

The default path of Arduino core is :C:\Users\myUser\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.20 I would like to change this path

You can cause it to be installed to {Arduino IDE installation folder}\portable\packages\arduino\hardware\samd\1.6.20 if you run the Arduino IDE in portable mode: https://www.arduino.cc/en/Guide/PortableIDE

alexduch: in order to use a custom git repository.

It's not clear what you mean by that. Please provide more details about what you're trying to accomplish.

alexduch: Depending on the project I use I also need to modify the files in the directory : "C:\Users\myUser\AppData\Local\Arduino15\packages\arduino\variants\mkrgsm1400" (to change pins assignment).

You can do that, but your changes will be lost every time you update to a new version of Arduino SAMD Boards. The better solution would be to create your own custom hardware package in the {sketchbook folder}/hardware folder. That way, your work will persist through package updates. You can reference all the resources from the Arduino SAMD Boards package so all this hardware would need to be is a boards.txt file to provide a board definition for your custom board and the modified variant file. More information here: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification

Hi,

What I tried to accomplish is to have one git repository to manage all the Arduino code I use. It is accompished thanks to the portable mode.

Here is my architecture : portable folder is my main git repository. {Arduino}\portable\project => my Arduino projects {Arduino}\portable\sketchbook\hardware => my custom board {Arduino}\portable\sketchbook\libraries => various git repositories of Arduino libraries {Arduino}\portable\packages\arduino\hardware\samd => Arduino core git repository

The better solution would be to create your own custom hardware package in the {sketchbook folder}/hardware folder.

I have copied the mkr1400 folder from {Arduino}\portable\packages\arduino\hardware\samd\1.6.20\variants\mkrgsm1400 to {Arduino}\portable\sketchbook\hardware\sam\Arduino\mkrgsm1400_custom

I have also copied the files platform.txt, programmers.txt, boards.txt to {Arduino}\portable\sketchbook\hardware\sam\Arduino

And I modified boards.txt :

# Arduino MKR GSM 1400 custom
# --------------------
mkrgsm1400_custom.name=Arduino MKR GSM 1400 Custom
mkrgsm1400_custom.vid.0=0x2341
mkrgsm1400_custom.pid.0=0x8052
mkrgsm1400_custom.vid.1=0x2341
mkrgsm1400_custom.pid.1=0x0052

mkrgsm1400_custom.upload.tool=bossac
mkrgsm1400_custom.upload.protocol=sam-ba
mkrgsm1400_custom.upload.maximum_size=262144
mkrgsm1400_custom.upload.use_1200bps_touch=true
mkrgsm1400_custom.upload.wait_for_upload_port=true
mkrgsm1400_custom.upload.native_usb=true
mkrgsm1400_custom.build.mcu=cortex-m0plus
mkrgsm1400_custom.build.f_cpu=48000000L
mkrgsm1400_custom.build.usb_product="Arduino MKR GSM 1400"
mkrgsm1400_custom.build.usb_manufacturer="Arduino LLC"
mkrgsm1400_custom.build.board=SAMD_MKRGSM1400
mkrgsm1400_custom.build.core=arduino
mkrgsm1400_custom.build.extra_flags=-DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ {build.usb_flags} -DUSE_BQ24195L_PMIC
mkrgsm1400_custom.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
mkrgsm1400_custom.build.openocdscript=openocd_scripts/arduino_zero.cfg
mkrgsm1400_custom.build.variant=mkrgsm1400_custom
mkrgsm1400_custom.build.vid=0x2341
mkrgsm1400_custom.build.pid=0x8052
mkrgsm1400_custom.bootloader.tool=openocd
mkrgsm1400_custom.bootloader.file=mkrgsm1400/samd21_sam_ba_arduino_mkrgsm1400.bin

But when I select the board Arduino MKR GSM 1400 Custom the compilation failed. All the files from the Arduino core are not found. Can you please tell me what I missed ?

I've made symbolic links from the standard core location to the one I want to actually use:

cd {Arduino}/portable/packages/arduino/hardware/samd

mv 1.6.19 1.6.19-original  # Save original core

ln -s ~/src/ArduinoCore-samd 1.6.19   # link to core from github

Even windows has an equivalent of symbolic links these days...