cancel
Showing results for 
Search instead for 
Did you mean: 

Problem to start a new program after doing a bootloader in IAP mode

nicolas_homeostasie
Associate II
Posted on January 28, 2008 at 07:39

Problem to start a new program after doing a bootloader in IAP mode

1 REPLY 1
nicolas_homeostasie
Associate II
Posted on January 28, 2008 at 07:39

Hi,

After doing a bootloader to load a new program, i reset my MCU and only the code in sector 0 (main()) is executed. When the program calls the fist routine loacated in the sector 2, nothing happens. Why?

Otherwise, another test what i did consists to load the same software thanks to my bootloader. In this case, there is no problem!

Below, what i noticed when i change my original software located in MCU before loading again:

1) Original code in sector 2:

#if DEBUG_BOOT

sci_Send_Byte_Boot(0xA1);

#endif

becomes

#if DEBUG_BOOT

sci_Send_Byte_Boot(0xA2);

#endif

In this case, after loading this new program, no problem!

But now, if i add some new lines in my new software:

#if DEBUG_BOOT

sci_Send_Byte_Boot(0xAA);

sci_Send_Byte_Boot(0xA2);

sci_Send_Byte_Boot(0xBB);

#endif

In this case, the first routine in sector 2 is not called. Maybe it's due to the changing of memory size?

Below, a comparison between the original and new map file (only the beginning of sector 2 which begins to 0x1000 adress):

New:

Init_sector2 1000 3 ( 1) CODE INIT_SECTOR

Loop 1003 8 ( 1) CODE LOOP_SECTOR

interrupt_timerA 1020 26 ( 0) CODE CALL_VECTOR10

main_run 1046 86 ( 1) CODE FUNCS

main_task 10CC 3 ( 1) CODE FUNCS

main_serial 10CF 114 ( 2) CODE FUNCS

Original:

Init_sector2 1000 3 ( 1) CODE INIT_SECTOR

Loop 1003 8 ( 1) CODE LOOP_SECTOR

interrupt_timerA 1020 26 ( 0) CODE CALL_VECTOR10

main_run 1046 7C ( 1) CODE FUNCS

main_task 10C2 3 ( 1) CODE FUNCS

main_serial 10C5 114 ( 2) CODE FUNCS

Regards,

Nicolas

[ This message was edited by: nicolas_homeostasie on 28-01-2008 12:13 ]

[ This message was edited by: nicolas_homeostasie on 28-01-2008 12:14 ]

[ This message was edited by: nicolas_homeostasie on 28-01-2008 12:15 ]