Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

SD card/USART bootloader

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 711

poland.gif
PostPosted: Tue Nov 24, 2020 4:16 am    Post subject: SD card/USART bootloader Reply with quote

Hello.
If you use SD card in your device you can upgrade firmware from it.
If you also have internet connection then you can even upgrade your device remotely.
So if you, for example, have Mega2560 with Ethernet shield you can do this easly.



One condition is that you have uC with 4096 words bootspace. So Mega2560, Mega644, Mega128 , Mega1284 and others can do this.

This bootloader is some kind universal. It is compatible with MCS Bootloader so firmware can be uploaded via Serial (USB/RS232/RS485) directly from the Bascom IDE or dedicated standalone PC software. This is convienant when developing software. But when you ship your device to someone then it can be upgraded by sending only BIN file to that person. You can encrypt your software if you want so it can be flashed only into your device.

For flashing new software you must rename BIN file into "example.bin" and load it into the SD card with some card rider for PC. Then you must add file "update.txt" with atleast one char inside. During boot bootloader will search for "update.txt" and if found it then search for "example.bin". After flashing the file "update.txt" will be deleted.

Like I wrote earlier, if you have Internet like Wizz5100/Wizz5500 you can download new firmware from your server (VPS for example), store it on the card and then set the boot_flag "boot_status" in the eeprom. Then during boot bootloader find it and try to search for "example.bin"

I attach example for Arduino Mega2560 with Ethernet shield. If you use Bascom for write bootloader then programmer try to set the FuseBits automatically to 4096 Words boot size. If your programmer dont support this then you must set it manually and eventually BOOTRST too.

After flashing with programmer you can insert the card with the attached Blink code Very Happy So...if everything working then your Arduino orange LED should Blink Very Happy

There is some bytes left for additional checks like CRC or Crypt (this is simplified version of bootloader Im using). You can disable Debug for spare some additional bytes.
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5153
Location: Holland

blank.gif
PostPosted: Tue Nov 24, 2020 9:51 am    Post subject: Reply with quote

thanks for sharing EDC Very Happy .

A dual boot loader is indeed very convenient. And with the additional Ethernet everything is covered.

_________________
Mark
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 -> Share your working BASCOM-AVR code here 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