Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
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

List of 28 messages in thread
TopicAuthorDate
Programming 89C5131 via hardware            01/01/70 00:00      
   the chip manufacturers have become wise            01/01/70 00:00      
      Programming 89C5131 via hardware (2)            01/01/70 00:00      
         just one question            01/01/70 00:00      
            Programming 89C5131 via hardware (3)            01/01/70 00:00      
               one problem with this is that you have n            01/01/70 00:00      
                  Atmel contact            01/01/70 00:00      
                     here we go again            01/01/70 00:00      
                        self-timing            01/01/70 00:00      
                           FLIP issue (modern technologies)            01/01/70 00:00      
                              lifetime            01/01/70 00:00      
                              transparent erasure            01/01/70 00:00      
                                 to: Jan Waclawek            01/01/70 00:00      
                              You've go to be kidding            01/01/70 00:00      
                                 self-timing            01/01/70 00:00      
                                    can you give me a reference to the fact            01/01/70 00:00      
                                       other way round            01/01/70 00:00      
         Contact Atmel            01/01/70 00:00      
      Bootloader bootloader            01/01/70 00:00      
         no way            01/01/70 00:00      
         Re: bootloader bootloader            01/01/70 00:00      
   Sounds like fun. Count me in.            01/01/70 00:00      
      Programming 89C5131 via hardware (2)            01/01/70 00:00      
   user bootloader?            01/01/70 00:00      
      Re: user bootloader?            01/01/70 00:00      
         what wrong?            01/01/70 00:00      
            Not, that old urban legend again            01/01/70 00:00      
               Atmel contact            01/01/70 00:00      

Back to Subject List