keyboardio / attiny_i2c_bootloader

An I2C bootloader for ATTiny devices based on AVR112.
15 stars 6 forks source link

Device compatibility and creation of firmware #3

Open rdragonrydr opened 4 years ago

rdragonrydr commented 4 years ago

I had a couple questions regarding possible use of this on my project.

1: Is there any reason this would not work with an ATTINY85 running on an 8 mhz internal clock, since it's the same family?

2: I don't suppose it would work on a 328P...

3: The "Master" program that uploads the firmware confuses me. How would I get my firmware into a byte array like was shown in order to upload it? Normally it's a hex file.

Specifically, I am using an ESP8266 as the host device, where I would ideally upload the hex file to the internal filesystem (which I can do already). Can you elaborate on what algorithm (pseudocode or C++) would convert a hex file (or whatever compiled output you used) into a byte array as you demonstrated? I'm also not sure how it's safe to move it around address-wise without corrupting the program (unless it uses relative addressing by default, or it's somehow compiled that way).

obra commented 4 years ago

Hi!

As far as I know, it's only ever been used on a Tiny88. But in theory, it -should- work, You may need to adjust some stuff (like memory size, etc)

I don't know if it'd work on a 328P -- You'd need to do a fair bit of work to make things go.

For the master program, a better example to look at is: https://github.com/keyboardio/avr_keyscanner/blob/master/etc/flash_firmware.ino / https://github.com/keyboardio/avr_keyscanner/blob/master/etc/flash_firmware_h.template / https://github.com/keyboardio/avr_keyscanner/blob/master/Makefile#L62

On Sat, Feb 15, 2020 at 6:09 PM rdragonrydr notifications@github.com wrote:

I had a couple questions regarding possible use of this on my project.

1: Is there any reason this would not work with an ATTINY85 running on an 8 mhz internal clock, since it's the same family?

2: I don't suppose it would work on a 328P...

3: The "Master" program that uploads the firmware confuses me. How would I get my firmware into a byte array like was shown in order to upload it? Normally it's a hex file.

Specifically, I am using an ESP8266 as the host device, where I would ideally upload the hex file to the internal filesystem (which I can do already). Can you elaborate on what algorithm (pseudocode or C++) would convert a hex file (or whatever compiled output you used) into a byte array as you demonstrated? I'm also not sure how it's safe to move it around address-wise without corrupting the program (unless it uses relative addressing by default, or it's somehow compiled that way).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/keyboardio/attiny_i2c_bootloader/issues/3?email_source=notifications&email_token=AAALC2ASCO73G3Y7WJSIVE3RDCN5RA5CNFSM4KV6O3UKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IN2AF5A, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALC2H3VITSQNYRQJGSINLRDCN5RANCNFSM4KV6O3UA .