View previous topic :: View next topic |
Author |
Message |
Tiny
Joined: 10 Nov 2010 Posts: 114 Location: The Netherlands

|
Posted: Thu Aug 14, 2025 12:43 pm Post subject: merge bootloader and app together for a attiny3227 |
|
|
Hello,
I have a working bootloader for the attiny3227 that starts at address &h00.
The application starts at &h800.
And if I first install the loader in the attiny3227 and then upload the application via the bootloader, everything works as it should.
But I'd like to have the bootloader and application in a single file so we only have to program it once.
Can anyone help me with this? |
|
Back to top |
|
 |
albertsm
Joined: 09 Apr 2004 Posts: 6229 Location: Holland

|
Posted: Thu Aug 14, 2025 3:29 pm Post subject: |
|
|
you can merge the 2 hex files. then load the hex and program it.
When i was working on a customer project with a bootloader i thought about some directive to merge either the boot loader or merge the user code in the bootloader.
I think it makes most sense to include the loader in the project with something like $bootmerge "somefile.bin"
It would merge the specified bootloader binary with the project bin. it would however not simulate.
When enough interest i can add that to some future release. Of if you want it quick you can ask support for a quote.
You can not have the source of both in 1 app. that will not work because of relocation in the normal code. _________________ Mark |
|
Back to top |
|
 |
Tiny
Joined: 10 Nov 2010 Posts: 114 Location: The Netherlands

|
Posted: Fri Aug 15, 2025 7:19 am Post subject: |
|
|
Hi Mark,
Thanks for your quick response.
But there's no rush; merging the two hex files will work just fine for now.
An option like $bootmerge "somefile.bin" would be a nice addition to the IDE of Bascom avr.
So you don't have to do this manually afterward.
You'd think I'm not the only user who uses bootloaders to easily update firmware of your device.
Kind regards, Tiny |
|
Back to top |
|
 |
albertsm
Joined: 09 Apr 2004 Posts: 6229 Location: Holland

|
Posted: Fri Aug 15, 2025 8:44 am Post subject: |
|
|
Only prof customers seem to use the boot loader. But they have the problem to update on distance by a customer.
A better way as discussed in the past :
- load the bootloader
- load a test firmware that can check the hardware
- load the actual firmware
Now you know the firmware can be updated. the risk you have when you integrate it and use UPDI is that you did not test the serial interface (most users use a uart for this)
I had cases of flaws in the PCB production where a UART via was failing. You do not catch that. That is why i changed the procedure to always use the BL first. _________________ Mark |
|
Back to top |
|
 |
Tiny
Joined: 10 Nov 2010 Posts: 114 Location: The Netherlands

|
Posted: Fri Aug 15, 2025 9:18 am Post subject: |
|
|
Hi Mark,
If updating through the UART thats correct, then this hasn't been tested.
In this case, the Attiny3227 is an additional chip that communicates by i2c in a device that can be updated by OTA.
So the bootloader in the Attiny3227 uses I2C for updating.
Therefore, we want a single program cycle that programs the bootloader and the main app.
Kind regards, Tiny |
|
Back to top |
|
 |
|