-
Notifications
You must be signed in to change notification settings - Fork 64
SAMD21: Compiling
Paciente8159 edited this page Apr 17, 2023
·
5 revisions
µCNC for SAMD21can be built this way
- Get Visual Studio Code and install it.
- Install the PlatformIO extension.
- Open uCNC folder in VSCode.
- Edit
cnc_config.h file
andcnc_hal_config.h file
to fit your needs and board. - f needed edit the platformio.ini file environment for your board. Compile the sketch and upload it to your board.
WARNING: Arduino IDE will produce a larger output file. The makefile method has better compilation optimizations that produce a smaller binary file.
- Get Arduino IDE and install it.
- If you are using µCNC v1.6 or newer you also have to add the tinyUSB library for µCNC. Download the latest zipped version form here and on Arduino IDE add the library by going to
Sketch>Include Library>Add .ZIP library
- If you don't have install Arduino SAM boards via board manager
- Go to uCNC folder and open uCNC.ino sketch.
- Edit
cnc_config.h file
andcnc_hal_config.h file
to fit your needs and board. - Compile the sketch and upload it to your board.
- Download and install GCC tools for ARM inside your PC. You can download the latest version of GCC tool for ARM from here.
- Go to the
uCNC folder
and edit the boardcnc_config.h file
if you need to select a different ARM board. µCNC is configured by default to mimicGrbl
pin configuration in the Arduino UNO board. - If your board has/doesn't have a bootloader then the linker script
samd21.ld
file must be modified too. By default the firmware will be loaded to address 0x2000. This is modified in line 14 of the file (the ORIGIN parameter must be adjusted, LENGTH parameter can be left unchanged).FLASH (rx) : ORIGIN = 0x00002000, LENGTH = 248K
- Open a command console inside
makefiles/samd21
folder and runmake clean all
- If everything went well you should have a hex file inside
makefiles/samd21/build
folder. - Now just upload µCNC to your board using an appropriate tool and programmer. I use BOSSA to upload the firmware via bootloader. DO NOT FORGET TO SET THE PROPER OFFSET FOR YOUR BOARD OR YOU WILL ERASE THE BOOTLOADER
µCNC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. µCNC is distributed WITHOUT ANY WARRANTY.
Also without the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
µCNC Wiki
- Home
- Basic user guide
- Porting µCNC and adding custom HAL
- Customizing the HAL file
- Adding custom Tools and Modules to µCNC
- FAQ
µCNC for ALL MCU
µCNC for AVR
µCNC for STM32F1 and STM32F4
µCNC for SAMD21
µCNC for ESP8266
µCNC for ESP32
µCNC for NXP LPC176x
µCNC for NXP RP2040