Skip to content
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

Converting HEX's to the strings in the sketch #6

Open
ghost opened this issue Apr 12, 2013 · 4 comments
Open

Converting HEX's to the strings in the sketch #6

ghost opened this issue Apr 12, 2013 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 12, 2013

Really awesome project!

No longer using the ATMEGA8 and 168, so was hoping to repurpose the space used for those two, and instead add some of the other chips I regularly bootload (ATmega 1284p, 644p, etc)

Can you provide details of converting the hex to string (mentioned a Macro process?)

Peter

@WestfW
Copy link
Owner

WestfW commented Apr 14, 2013

No longer using the ATMEGA8 and 168, so was hoping to repurpose
the space used for those two, and instead add some of the other chips
I regularly bootload (ATmega 1284p, 644p, etc)
Can you provide details of converting the hex to string (mentioned a Macro process?)

I use EMACS, which permits me to define a "keyboard macro" that puts a quote at the beginning of a line, goes to the end of the line and adds "\n" and another quote, and then goes to the beginning of the next line.   Repeat the keyboard macro 34 times or so, add some curly brackets and such, and it's all done.

@WestfW
Copy link
Owner

WestfW commented Apr 14, 2013

No longer using the ATMEGA8 and 168, so was hoping to repurpose the space used for those two, and instead add some of the other chips I regularly bootload (ATmega 1284p, 644p, etc)
Can you provide details of converting the hex to string (mentioned a Macro process?)

Well, it's an EMACS keyboard macro that I repeat.  All it does it put a quote at the start and "\n" quote at the end of each line.
Then I manually insert some braces.  It's not "trivial", but it's not been difficult enough to put more effort into, either.  This is
from "M-X Edit-last-kbd-macro", which is likely to be pretty useless if you're not an EMACS person.  I assume that other editors have similar capabilities....

;; Keyboard Macro Editor.  Press C-c C-c to finish; press C-x k RET to cancel.
;; Original keys: " C-e \ n" C-n C-a

Command: last-kbd-macro
Key: none

Macro:

"            ;; self-insert-command
C-e            ;; move-end-of-line
\            ;; self-insert-command
n"            ;; self-insert-command * 2
C-n            ;; next-line
C-a            ;; move-beginning-of-line

Note that Adafruit has enhanced optiLoader: https://github.com/adafruit/Standalone-Arduino-AVR-ISP-programmer
And Nick Gammon has also done some work: http://www.gammon.com.au/forum/?id=11635

Enjoy
WestfW

@ghost
Copy link
Author

ghost commented Apr 28, 2013

Thanks for the replies

Replaced the array in images_8 with the converted Gen7 1284_20 bootloader hex with "" and \n added as in the examples. Fixed fuse and signature as appropriate. But sketch failed to compile:

error: initializer-string for array of chars is too long

The Gen7 bootloader is a lot bigger than OptiBoot - so not sure what to do - hardware guy here (;

@WestfW
Copy link
Owner

WestfW commented Jun 7, 2013

The current optiloader loads the entire hex file into RAM before programming it into the target, and it assumes a 512byte bootloader. It would take major modifications to support a 2k bootloader, since that would exceed the amount of RAM present in the chips. I'd suggest that you look at the adafruit or gammon enhancements, since I think this is one of the things that they do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant