Go Down

Topic: Project Bambino (Read 6 times) previous topic - next topic

janost

I'm also drawing on the Enzo Project.

Thats a Bambino with a Nano footprint for breadboarding Projects.

Still the same capabilities as Bambino.

janost

I was thinking of making a trampoline routine in the top bootloader area to be able to write code with the SPM instruction to the application area (selfprogramming)

By calling it with a pointer to a page in SRAM to write to flash, it could compile code onboard?

Can I just write the trampoline code in AVRASM with the right ORG, make a hexfile, and write that to flash and it will write it in the correct location in flash?

Then just call it from the application area with code in the SRAM?

Does the ISP programmer write the code at the correct location straight or does it fill all the way up before writing it?

janost

Perhaps just use fungus example of including .S files?

And the .ORG in the .S file function set to BLS?

janost

This should work.
Combining the app and bls code.

Code: [Select]

E:\avr>type app.hex
:100000000C942A000C943F000C943F000C943F0089
:100010000C943F000C943F000C943F000C943F0064
:100020000C943F000C943F000C943F000C943F0054
:100030000C943F000C943F000C943F000C943F0044
:100040000C943F000C943F000C943F000C943F0034
:100050000C943F0011241FBECFE5D4E0DEBFCDBF1E
:1000600010E0A0E6B0E0EAE9F0E002C005900D92F1
:10007000A236B107D9F70E9441000C944B000C94B2
:100080000000E0916000F091610009950C94001E61
:0A00900080E090E00895F894FFCF9F
:02009A00003C28
:00000001FF

E:\avr>type boot.hex
:103C00000C942A1E0C94341E0C94341E0C94341EF6
:103C10000C94341E0C94341E0C94341E0C94341EDC
:103C20000C94341E0C94341E0C94341E0C94341ECC
:103C30000C94341E0C94341E0C94341E0C94341EBC
:103C40000C94341E0C94341E0C94341E0C94341EAC
:103C50000C94341E11241FBECFE5D4E0DEBFCDBFCF
:103C60000E94361E0C943C1E0C94001E8FEF87BBE6
:0C3C700088B3809588BBFCCFF894FFCF90
:0400000300003C00BD
:00000001FF

E:\avr>copy /b app.hex + boot.hex  combined.hex

E:\avr>type combined.hex
:020000040000FA
:200000000C942A000C943F000C943F000C943F000C943F000C943F000C943F000C943F00FD
:200020000C943F000C943F000C943F000C943F000C943F000C943F000C943F000C943F00C8
:200040000C943F000C943F000C943F000C943F000C943F0011241FBECFE5D4E0DEBFCDBFA2
:2000600010E0A0E6B0E0EAE9F0E002C005900D92A236B107D9F70E9441000C944B000C9413
:1C0080000000E0916000F091610009950C94001E80E090E00895F894FFCF003C52
:203C00000C942A1E0C94341E0C94341E0C94341E0C94341E0C94341E0C94341E0C94341E1E
:203C20000C94341E0C94341E0C94341E0C94341E0C94341E0C94341E0C94341E0C94341EF4
:203C40000C94341E0C94341E0C94341E0C94341E0C94341E11241FBECFE5D4E0DEBFCDBF07
:1C3C60000E94361E0C943C1E0C94001E8FEF87BB88B3809588BBFCCFF894FFCF22
:0400000500003C00BB
:00000001FF


But then i need the HEX file produced from the ArduinoIDE?

Go Up