Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » AVR-GCC
  • » [avr-gcc-list] My first booloader is not working. [RSS Feed]

#1 Dec. 9, 2005 03:28:08

Khusro S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] My first booloader is not working.


Hi,

I have the following simple booloader...


void boot_test(void) BOOTLOADER_SECTION;

void boot_test(void)
{
long k = 0;
cli();
DDRB |= 0x90;
DDRE |= 0x18;
LEDS_ON_GREEN();

#if (1)
// If I include this loop, the boot loader never gets to main.
for (k = 0; k < 10; k++) {
LEDS_ON_YELLOW();
}
#endif

sei();
return;
}

void main( void )
{
long k;
while(1) {
LEDS_TOGGLE_RED();
for (k = 0; k < 64000; k++){};
}
}

The makefile linker flags are:
LDFLAGS += -Wl,--section-start=.bootloader=$(BOOTLOADER_START)
where
BOOTLOADER_START_2 = 0x1F000
BOOTLOADER_START = $(BOOTLOADER_START_2)

Now, when I include the for loop in the boot_test function then I never get to main.
I see the GREEN led go ON, then the YELLOW, but never see the RED toggling.
As soon as I remove the for loop (by setting #if(0)), the GREEN goes ON then the
RED starts toggling, as I expected.

make all provides the following outputs:
.bootloader 140 126976
The address shows that the bootloader is being put in the right section of FLASH.
And the fact that the RED flashes when there is no 'for' loop in the boot_test
function, indicates that the boot code is kind of working.

Could somebody please indicate what may be wrong when I include the for loop?
Your help would be much appreciated.

Thanks

KhusroSent from theAVR - gccforum at Nabble.com:My first booloader is not working._______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

  • Root
  • » AVR-GCC
  • » [avr-gcc-list] My first booloader is not working. [RSS Feed]

Board footer

Moderator control

Enjoy the 27th of April
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support