HOWTO : Adding multiple OpenCR boards to the Arduino IDE


(Kei) #1

OS : Linux.


OpenCR can be managed by the Board Manager via thirdpary json.

However, developers sometimes want to work on various branches, including the develop branch, or on branches that they fork.
In this case, there is a way to add to the Arduino board list without using a json file.

This method is using the hardware folder in the sketchbook folder.

For example, if you want the develop branch, you can proceed as follows:

  • Use git to clone the desired branch(In this case, develop).
$ cd ~/Downloads
$ git clone --recursive https://github.com/ROBOTIS-GIT/OpenCR.git -b develop
  • Create an OpenCR folder inside the Arduino sketchbook/hardware folder.
$ mkdir YOUR/ARDUINO/SKETCHBOOK/HARDWARE/opencr_develop
  • Creates a symbolic link to the downloaded folder in the created folder.
$ cd YOUR/ARDUINO/SKETCHBOOK/HARDWARE/opencr_develop/
$ ln -s ~/Downloads/OpenCR/arduino/opencr_arduino/opencr/ ./opencr
  • If necessary, change the board name (to avoid confusion with other OpenCRs).
$ cd opencr
$ gedit boards.txt
CHANGE BOARD NAME TO THAT YOU WANT.
ex) OpenCR.name=OpenCR Board to OpenCR.name=OpenCR Board(develop)
SAVE YOUR CHANGES.

In this way, you can create various names in the sketchbook/hardware folder and modify the boards.txt so that you can use the OpenCR board without having to reinstall multiple source versions.

The description is based on linux, but you can do it in windows in a similar way.


#2

Thanks @OpusK,

As I mentioned in the thread:

You can also do this from Windows You use the command, mklink instead of ln, example on my machine I did:

mklink /D opencr D:\GitHub\OpenCR\arduino\opencr_arduino\opencr

As I noted in the other thread the name of the link (opencr) including it’s case is important as Arduino uses it.

Also side note: I have also done similar trick with OpenCM9.04. The process is almost identical (except for names), However in this case the Arduino will fail in the link phase. As it can not find the file:

...\opencm9.04\variants\OpenCM904/lib_f103.a

To resolve this, I used the command:

<full path to arm-non-eabi-ar> rcs lib_f103.a

Thanks again, your instructions make the process a lot clearer!


(Kei) #3

Thanks @Kurt

I should have written in the same thread as your Topic!
Anyway, thank you for mentioning your link.

Thank you for leaving content about Windows :slight_smile:


(Markus) #4

Very interesting! Thank`s!