-
Notifications
You must be signed in to change notification settings - Fork 1
FEATURE: Added arduino CLI support #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ketch using arduino CLI
…pload the sketch using arduino CLI
To be reviewed by @IAmMarcelJung. Can't add him as an assignee hence mentioned here. |
Thanks for this! Will look into it when I have the time :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for this! I added some suggestions and remarks. So far I could not test out uploading a firmware, since I don't have the hardware at hand.
Also, I got a lot of errors like /bin/sh: 9: @: not found
when running make setup-board-files
and also /bin/sh: 5: source: not found
when running make setup-arduino-cli
this should also be fixed.
# setup and install arduino CLI | ||
setup-arduino-cli: | ||
@ echo " " | ||
[ -d ~/arduino_cli ] || mkdir -p ~/arduino_cli; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably add a prompt for changing the installation directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also see nothing that implements this. Any thoughts?
- Move to directory `./software/clock_setup_using_arduino_code` which contains | ||
the Makefile required for setup, compilation and uploading the sketch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Move to directory `./software/clock_setup_using_arduino_code` which contains | |
the Makefile required for setup, compilation and uploading the sketch. |
These files are already in this directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still in the latest commits
[ -d ~/arduino_cli ] || mkdir -p ~/arduino_cli; \ | ||
cd ~/arduino_cli; \ | ||
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh; \ | ||
echo "========== Verifying installation..."; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this layout a standard from somewhere?
If not, what about something like this (also for all others and also the comments):
echo "========== Verifying installation..."; \ | |
echo "===== Verifying installation... ====="; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this formatting? This is also used on multiple occasions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor typos :)
- Verify your installation. | ||
|
||
```bash | ||
# arduino CLI installation path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# arduino CLI installation path | |
# Arduino CLI installation path |
# arduino CLI installation path | ||
which arduino-cli | ||
|
||
# arduino CLI installed version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# arduino CLI installed version | |
# Arduino CLI installed version |
[ -d ~/arduino_cli ] || mkdir -p ~/arduino_cli; \ | ||
cd ~/arduino_cli; \ | ||
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh; \ | ||
echo "========== Verifying installation..."; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this formatting? This is also used on multiple occasions
- Move to directory `./software/clock_setup_using_arduino_code` which contains | ||
the Makefile required for setup, compilation and uploading the sketch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still in the latest commits
# setup and install arduino CLI | ||
setup-arduino-cli: | ||
@ echo " " | ||
[ -d ~/arduino_cli ] || mkdir -p ~/arduino_cli; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also see nothing that implements this. Any thoughts?
- Run `make setup-arduino-cli` which will install `arduino-cli`. | ||
- Move to directory `./software/clock_setup_using_arduino_code` which contains the Makefile required for setup, compilation and uploading the sketch. | ||
```bash | ||
# install Arduino CLI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# install Arduino CLI | |
# Install Arduino CLI |
```bash | ||
# install Arduino CLI | ||
|
||
# NOTE: the CLI will be installed in the $PATH_INSTALL provided. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# NOTE: the CLI will be installed in the $PATH_INSTALL provided. | |
# NOTE: The CLI will be installed in the $PATH_INSTALL provided. |
I think something went wrong in the review and it appears two times. |
So I finally checked out your updates locally. Overall its very neat, easy to use and works out-of-the-box. Thanks for that! When executing $ make setup-board-files
==================== Creating board config file
arduino-cli config init && \
@ echo "==================== Copy file to config folder"; \
[ -d /home/marcel/.arduino15 ] || mkdir -p /home/marcel/.arduino15; \
cp -rv ./arduino-cli.yaml /home/marcel/.arduino15/arduino-cli.yaml && \
@ echo "==================== Update the core index"; \
arduino-cli core update-index && \
@ echo "==================== Search for WCH boards"; \
arduino-cli core search wch && \
@ echo "==================== Install the core"; \
arduino-cli core install WCH:ch32v && \
@ echo "==================== Verify installation"; \
arduino-cli core list && \
@ echo "==================== List all WCH boards"; \
arduino-cli board listall WCH
Config file written to: /home/marcel/.arduino15/arduino-cli.yaml
/bin/sh: 2: @: not found
'./arduino-cli.yaml' -> '/home/marcel/.arduino15/arduino-cli.yaml'
/bin/sh: 5: @: not found
Downloading index: package_index.tar.bz2 downloaded
Downloading index: package_ch32v_index.json downloaded
/bin/sh: 7: @: not found
Downloading missing tool builtin:[email protected]...
builtin:[email protected] downloaded
Installing builtin:[email protected]...
Skipping tool configuration....
builtin:[email protected] installed
ID Version Name
WCH:ch32v 1.0.4 CH32 MCU EVT Boards
/bin/sh: 9: @: not found
Platform WCH:[email protected] already installed
/bin/sh: 11: @: not found
ID Installed Latest Name
arduino:avr 1.8.6 1.8.6 Arduino AVR Boards
attiny:avr 1.0.2 1.0.2 ATtiny Microcontrollers
esp32:esp32 3.1.1 3.2.0 esp32
esp8266:esp8266 3.1.2 3.1.2 ESP8266 Boards (3.1.2)
WCH:ch32v 1.0.4 1.0.4 CH32 MCU EVT Boards
/bin/sh: 13: @: not found
Board Name FQBN
CH32V00x WCH:ch32v:CH32V00x_EVT
CH32V10x WCH:ch32v:CH32V10x_EVT
CH32V20x WCH:ch32v:CH32V20x_EVT
CH32V30x WCH:ch32v:CH32V30x_EVT
CH32X035 WCH:ch32v:CH32X035_EVT Probably we can ignore it, but it's still better if there are no errors :) |
Improvements
Added a simple, README, Makefile and YAML config file that automate the process of: