cmake-microchip
cmake-microchip copied to clipboard
Problem: No AVR support and path issues on windows
Solution:
- Add minimal generic MCU support for AVR ATtiny and ATxmega
- fix compiler path detection on windows
Tested against:
- Windows 10 20H2
- CMake 3.20
- Ninja / Ninja Multi-Config
- Microchip xc8 v2.31 at default windows install path
If current function AVR_OBJ2HEX is used the resulting hex file is maybe flashable with Microchip Studio but it is not sure if one can use avrdude for flashing. Usage of avrdude can result in out of range of memory addresses.
Microchip Studio calls avr-objcopy from XC8 with additional parameters: -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures. So created hex files are flashable with avrdude.
In my opinion it is not usefull to add these parameters as default to AVR_OBJ2HEX function, so i extend the function call to support additional parameters and let the user decide, which parameters are usefull for a given project.
This current project state is used since one year for massive CI generated firmware roll outs based on ATxmega256 and ATtiny1627 and XC 2.3x and 2.40 (XC 2.40 should be prefered with this both MCU since a couple of API corrections are made by Microchip in last 2 years). With these changes our resulting hex files are now automaticly flashed to the hardware.
Hey @argltuc,
Since this repo seems to be more or less unmaintained I am happy to take this change into my fork: https://github.com/enbyted/cmake-microchip
If you're okay with that please open a PR there, against xc8-cc branch.
Hi @enbyted, thanks for your response and offer. i will create the PR during the next days, since i work on some eeprom support stuff ;)