Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

merge bootloader and app together for a attiny3227

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR XTINY/MEGAX/AVRX
View previous topic :: View next topic  
Author Message
Tiny

Bascom Member



Joined: 10 Nov 2010
Posts: 114
Location: The Netherlands

netherlands.gif
PostPosted: Thu Aug 14, 2025 12:43 pm    Post subject: merge bootloader and app together for a attiny3227 Reply with quote

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
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6229
Location: Holland

blank.gif
PostPosted: Thu Aug 14, 2025 3:29 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
Tiny

Bascom Member



Joined: 10 Nov 2010
Posts: 114
Location: The Netherlands

netherlands.gif
PostPosted: Fri Aug 15, 2025 7:19 am    Post subject: Reply with quote

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
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6229
Location: Holland

blank.gif
PostPosted: Fri Aug 15, 2025 8:44 am    Post subject: Reply with quote

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
View user's profile Visit poster's website
Tiny

Bascom Member



Joined: 10 Nov 2010
Posts: 114
Location: The Netherlands

netherlands.gif
PostPosted: Fri Aug 15, 2025 9:18 am    Post subject: Reply with quote

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
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR XTINY/MEGAX/AVRX All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum