Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Same .bin for XMEGA192A3U and XMEGA256A3U?

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
hzz

Bascom Member



Joined: 20 Feb 2007
Posts: 314

spain.gif
PostPosted: Mon Sep 06, 2021 12:55 pm    Post subject: Same .bin for XMEGA192A3U and XMEGA256A3U? Reply with quote

I have several devices, some using XMEGA192A3U and some using XMEGA256A3U, all of them with Bascom bootloader. Is there a way to update them without knowing which processor each one is using?

I guess this is the same as asking If I can compile a software that works with both chips given that the only difference bewteen these chips is the amount of flash (the program fits in both of them) and the amount of EEPROM (which I'm not using) and given that the Bootloader was compiled specifically for each chip.

Or more specifically, what changes should be done to a Bascom Bootloader which will be compiled for and loaded into a XMEGA192A3U chip in order for it to accept a .bin file compiled for a XMEGA256A3U and programm correctly the XMEGA192?

Regards
Héctor

PD: Chips shortage will make us do extrange things.




(BASCOM-AVR version : 2.0.8.3 , Latest : 2.0.8.4 )
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Mon Sep 06, 2021 6:51 pm    Post subject: Reply with quote

Those XMegas (192 & 256) have the same amount of SRAM (16KB) so I think programs should work the same on both Very Happy
If amount of SRAM differ then only programs for smaller SRAM uC should work on bigger because Hwstack is placed on the end of SRAM.

Bootloaders will place application code (bin) from address 00 so till everything fits it should work without any changes in the bootloaders I think.

Test it! Very Happy
Back to top
View user's profile Visit poster's website
hzz

Bascom Member



Joined: 20 Feb 2007
Posts: 314

spain.gif
PostPosted: Mon Sep 06, 2021 7:18 pm    Post subject: Reply with quote

Thanks!

When you send a 256K bin file to a 192K Flash chip, the bootloader will write to flash the first 192K which is OK, but it will keep writing blocks to inexistent flash addresses until it receives the EOT. I wonder if this will be a problem.
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Mon Sep 06, 2021 7:23 pm    Post subject: Reply with quote

It will write only till the end of BIN file with alignment into 128 Bytes at the end if for example there will be only 80 Bytes (because XMODEM protocol checksum). If BIN file for XM256 will be smaller than 192KB it should fit because they have even separate flash space for bootloaders.
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 All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot 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