Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Flashing M2561 from SD Card

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

Bascom Member



Joined: 11 Jul 2011
Posts: 79
Location: United States

usa.gif
PostPosted: Sun Mar 11, 2018 7:17 pm    Post subject: Flashing M2561 from SD Card Reply with quote

Bootloader goes through the steps of flashing the program (boot.hex) as verified by the serial com output. However, program space ends up empty. MCU endlessly reboots into bootloader.
Same results on 1GB FAT16 and 8Gb FAT32 cards.

Please help! Thanks!!

(see attached files)
Back to top
View user's profile AIM Address
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Mon Mar 12, 2018 1:14 pm    Post subject: Reply with quote

best to include the terminal log.
also, is the boot loader renamed?

_________________
Mark
Back to top
View user's profile Visit poster's website
jeremywilson

Bascom Member



Joined: 11 Jul 2011
Posts: 79
Location: United States

usa.gif
PostPosted: Mon Mar 12, 2018 8:00 pm    Post subject: Reply with quote

boot loader is DOS_Boot2.BAS.
main program is Boot.hex (renaming to Bootdone.hex worked fine until I disabled it).

after pressing mcu reset & button on E.4, terminal shows:

BCDFPM (short pause after F, long pause after P)
M
M
M
M
M
(M repeats forever)


reading the program memory with AVR Studio & JTAGICE confirms program space is empty (except where bootloader is).
Back to top
View user's profile AIM Address
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Fri Mar 16, 2018 10:26 am    Post subject: Reply with quote

i would recommend to start with a normal boot loader.
if that works, try this one. i also would shrink it down so it uses either bin or hex files.

a good way to debug is to run the code a a normal program.
then disable the actual erasing/writing but instead and much more debug info to see where it goes wrong.

when you say flash is empty, check if no fuse byte (or actual lock byte) disables the programming.

_________________
Mark
Back to top
View user's profile Visit poster's website
jeremywilson

Bascom Member



Joined: 11 Jul 2011
Posts: 79
Location: United States

usa.gif
PostPosted: Sun Mar 18, 2018 10:15 pm    Post subject: Reply with quote

Quote:
i would recommend to start with a normal boot loader.

The attached bootloader works fine.

The program that I'm trying to load from the SD works fine when programmed without bootloader.
SD card routines work, too.


Quote:
a good way to debug is to run the code a a normal program.
then disable the actual erasing/writing but instead and much more debug info to see where it goes wrong.

I will try this.
Back to top
View user's profile AIM Address
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Tue Mar 20, 2018 9:16 pm    Post subject: Reply with quote

i have no idea who made the bootloader. but what i find odd is this :

!lds r0, {vl} 'store them into r0 and r1 registers
!lds r1, {vh}

usually this is done when writing to the page buffer, it is not required for all operations.
So i would compare to the original boot loader and modify accordingly.

_________________
Mark
Back to top
View user's profile Visit poster's website
jeremywilson

Bascom Member



Joined: 11 Jul 2011
Posts: 79
Location: United States

usa.gif
PostPosted: Sat Mar 24, 2018 4:44 am    Post subject: Reply with quote

Finally had a chance to work on it today.
Found the problem right away. The BOOTSZ fuse was set to 1024.
Works like a charm now.

Back to top
View user's profile AIM Address
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR-DOS 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