ElTangas / jtag2updi

UPDI programmer software for Arduino (targets Tiny AVR-0/1/2, Mega AVR-0 and AVR-DA/DB MCUs)
MIT License
336 stars 90 forks source link

Using jtag2updi as a library for a standalone Arduino (use case being over-the-air programming) #77

Open sieumap43 opened 3 months ago

sieumap43 commented 3 months ago

Hi @ElTangas, is it possible to use the jtag2updi as an Arduino library (or even C/C++ library) within an Arduino program? And thus the Arduino can manually flash the data from any source and not just what avrdude gives it. For example, the Arduino can flash an array inside its memory as a program const uint8_t hexData[] PROGMEM = { 0x0C, 0x94, 0x5C, 0x00, 0x0C, 0x94, 0x6E, 0x00, 0x0C, 0x94, 0x6E, 0x00, 0x0C, 0x94, 0x6E, 0x00, 0x0C, 0x94, 0x6E, 0x00, 0x0C, 0x94, 0x6E, 0x00 }; provided that the memory above is beforehand manually translated from hex file.

Is there any function like updi_flash(uint8_t * data, uint8_t length);?

Context: I want to build a wireless programmer (currently thinking of the NRF24L01+) without the use of the bootloader. Thus the Arduino receives the data, which was translated from the Hex file into bytes, and the flashes these bytes on the the target MCU.

Alternatively, anybody knows any other approach to Over-the-air for Attiny which have UPDI interface?

Thank you in advance.

FKW9 commented 2 months ago

Look at this: https://github.com/adafruit/Adafruit_AVRProg