??? 08/30/05 11:46 Read: times |
#100274 - what wrong? Responding to: ???'s previous message |
Jeroen Post said:
But the initialisation part of the bootloader disturb the device from clean and smooty functional start. Are you sure? Looking on source codes of ordinary Atmel bootloader I have not found crutical modifications of registers which make no posibility to start user bootloader correctly. Please look next yourself: Here is start point of Atmel bootloader. It executes either by hardware condition or due BLJB=0. RSEG BOOTLOADER_MODULE ;*F*************************************************************************** ; NAME: boot_loader ;----------------------------------------------------------------------------- ; PARAMS: ; ; RETURN: ; ;----------------------------------------------------------------------------- ; PURPOSE: boot loader program ; ;***************************************************************************** ; NOTE: located at address BOOT_ENTRY ; Boot entry process: ; FCON = 00h => hardware boot => execute atmel's boot loader ; FCON = F0h => programmed boot => execute user's boot loder ; if SBV < boot base address ;***************************************************************************** boot_loader: acall boot_process As you see the first command does call subroutine which check for user bootloader: RSEG SOFT_BOOT_PROCESS boot_process: mov A,FCON cjne A,#PROG_BOOT_VALUE,atmel_init ; test FCON F0h or 00h mov DPL,#SBV_ADDRESS acall fm_read_xrow ; read Software Boot Vector: A <- SBV mov R0,A ; save SBV clr C subb A,#BOOT_BASE_ADDRESS ; if SBV >= boot base address jnc atmel_init ; exec Atmel boot else User boot user_boot: mov DPH,R0 ; restore SBV clr A mov DPL,A jmp @A+DPTR ; jump to user's boot loader at @ [SBV]00h atmel_init: ret As you may see, there is nothing dangerous here before user bootloader may be executed. Just for all be clean, here is source of subroutine fm_read_xrow: fm_read_xrow: clr A mov DPH,A mov FCON,#SEL_XROW_MOVC ; map XROW in code space movc A,@A+DPTR ; read address mov FCON,#DESELECT_CL ; reset FCON ret What did you find in source of C5131 bootloader? Is it different from that I have posted above? Please post if so because it may be interest for us. Regards, Oleg |