I ran into a problem because the portable arduino in the ATCwatch demo I was following contains all the necessary libraries and board files, but I am using a MacBook Pro and the demo was running on Windows. Unless I port it some how, I will not see it in Tools | Boards. Is there any way to port these files or create a cross platform board configuration?
Hi @lj001. Unfortunately they have created something that is very specific to Windows. It is not only a matter of the Arduino IDE application being the one for Windows, but also that the bundled custom boards platform that adds the smartwatch boards to the Tools > Board menu in Arduino IDE contains a Windows-specific toolchain.
I think it is possible to port it to Mac though. I did some experiment and think I have identified what needs to be done. I am not familiar with this project and don't own the hardware so I can't fully test this, but if nothing else it is a start to the porting effort. I can tell you that I am now able to compile sketches for the "DaFit Watch Bootloader 23" board and do uploads up to the point where it fails due to me not having the hardware connected to my computer.
I'll provide the instructions:
- If you don't have it installed already on your MacBook Pro, download and install the official version of Arduino IDE from the link on the "Software" page:
https://www.arduino.cc/en/software/ - Start Arduino IDE.
- Wait for Arduino IDE to finish starting up.
If this is the first time you started the IDE after installing it, it may install some additional resources. Wait for these processes to finish.
- Select File > Preferences from the Arduino IDE menus.
- Take note of the path shown in the "Sketchbook location" preference.
- Click the "CANCEL" button.
- Select File > Quit from the Arduino IDE menus.
- Open the folder that is at the path you noted from the "Sketchbook location" in Finder.
- Inside the sketchbook folder, create a subfolder named
hardware
- Inside the
hardware
folder, create a subfolder namedATCwatch
- Inside the
ATCwatch
folder, create a subfolder namednRF52
You should now have a folder structure that looks like this:
(where<sketchbook location>/ ├── hardware/ │ └── ATCwatch/ │ └── nRF52/ └── ...
<sketchbook location>
is the sketchbook folder) - Download the portable Arduino IDE installation provided in the readme of the project:
https://github.com/atc1441/ATCwatch#atcwatch---watch - Extract the downloaded
D6Arduino.rar
file. - Copy the full contents of this subfolder of the extracted folder:
to this path:portable/sketchbook/libraries/
You should now have a folder structure that looks like this:<sketchbook location>/libraries/
<sketchbook location>/ ├── libraries/ │ ├── BLEPeripheral/ │ └── ... └── ...
- Copy the full contents of this subfolder of the extracted folder:
to this path:portable/packages/sandeepmistry/hardware/nRF5/0.6.0/
You should now have a folder structure that looks like this:<sketchbook location>/hardware/ATCwatch/nRF52/
<sketchbook location>/ ├── hardware/ │ └── ATCwatch/ │ └── nRF52/ │ ├── boards.txt │ └── ... └── ...
- Open the file at the following path in a text editor:
<sketchbook location>/hardware/ATCwatch/nRF52/platform.txt
- Change line 103 from this:
to this:recipe.objcopy.zip.pattern="{runtime.ide.path}/portable/packages/sandeepmistry/tools/adafruit-nrfutil/adafruit-nrfutil.exe" dfu genpkg --application-version 65535 --application "{build.path}/{build.project_name}.hex" "{runtime.ide.path}/{build.project_name}.zip"
# recipe.objcopy.zip.pattern="{runtime.ide.path}/portable/packages/sandeepmistry/tools/adafruit-nrfutil/adafruit-nrfutil.exe" dfu genpkg --application-version 65535 --application "{build.path}/{build.project_name}.hex" "{runtime.ide.path}/{build.project_name}.zip"
- Save the file.
- Start Arduino IDE.
- Select File > Preferences from the Arduino IDE menus.
- Enter the following URL into the "Additional Boards Manager URLs" field:
https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json
If there are already Boards Manager URLs in the field, separate them with commas.
- Click the OK button.
- You will now see a "Downloading index: ..." notification at the bottom right corner of the IDE window. Wait for that notification to close.
- Select Tools > Board > Boards Manager from the Arduino IDE menus to open the "Boards Manager" view in the left side panel.
- Scroll down through the list of boards platforms until you see the "Nordic Semiconductor nRF5 Boards by Sandeep Mistry" entry.
- Click the "INSTALL" button at the bottom of the entry.
- Wait for the installation to finish.
- Select Tools > Board > Nordic Semiconductor nRF5 Boards (in sketchbook) from the Arduino IDE menus.
There will be a "Nordic Semiconductor nRF5 Boards" and a "Nordic Semiconductor nRF5 Boards (in sketchbook)" item in the menu. The first contains the standard boards of the platform you installed via Boards Manager. The second is the custom platform you installed manually in the sketchbook, which contains the smartwatch boards.
- Select the board for your smartwatch from the menu.
You should now be able to proceed with compiling and uploading to the smartwatch as you would on a Windows machine.
Hmm... Actually it seems it might be much more simple. I found the creator of that ATCwatch project also provides a version of the smartwatches platform that can be installed using the Arduino IDE Boards Manager. The installation instructions are here:
https://github.com/atc1441/D6-arduino-nRF5#installing
I recommend trying that first instead of the instructions I provided above.
That was an incredible response, @ptillisch. Thank you. I did put the json file in the Additional Board Managers and pulled down the configurations but ATC watch doesn't compile when I set it to DSD6 (class_def.h:10:18: fatal error: lvgl.h: No such file or directory). I was trying to get to the P8 ( Simple Arduino flashing the P8 Smartwatch - YouTube) so I thought I would fork the repo and create an additional board definition package (https://ljunquera.github.io/smartwatch-boards.json), which doesn't show up when I add it to the Additional Board Managers, so I'm doing something wrong. I want to make this repeatable.
I figured if I replaced some of the info in boards.txt and whatever else I needed to change from the portable configuration he used, I would be able to recreate this on my mac and have it be cross platform as well as having a place to deal with new smartwatch board configurations.
I see you created a dedicated topic for your project of creating a modified package index for your fork of the project. I have responded in that thread:
Now I'm getting this problem when I'm trying to install the custom board:
CRC doesn't match, file is corrupted. It may be a temporary problem, please retry later.
The MD5 seems fine. I tested it against another archive which downloaded/installed through the board manager fine. However the size field was different in the working archive. The size parameter in the json file for the working contributed board is 10287947 while when I run it locally (using ls -l, or gzip -l) I get 15614691.
The size I put in the json file was calculated using ls -l locally. The documentation simply says:
size
: the size of the archive in bytes
I'm assuming this is what is causing the problem not the checksum.
It was a mistake I made in the json file. It's installing now.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.