Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - marshall

#1
LPC9xx/LPC9xxx / LPC925 ISP - Erasing Hangs FM
December 31, 2006, 03:08:39 AM
Hi there, I have successfully entered ISP mode using the NoTouch on a LPC925, and can perform all the ISP commands, like Blank Check, Device ID.....

However when I go to program the device with my code, FM hangs on Erasing a Block, it will sit like this for 20+ minutes and never complete. I can see with a serial sniffer that whatever it is trying to do it keeps trying every minute (based on the timeout in the advanced options I suspect). When I try and cancel the operation, this has no affect either and the same message is transmitted to my device.

I think that there is a bug (or several) in the FM version 3.41.178 the bugs are:

1. There are 2 check boxes under Step 2, Erase all Flash & Erase Blocks used by Hex File. if both of these are unchecked, it is logical to assume that no erase will occur at all, however, when trying to progam the device in step 5, the selected block in the list box in step 2 is always attempted to be erased, there is no way in the list box to have no line selected.

2. As from my comments above, the Erase hangs, and there is no way to successfully cancel it other than closing the application. of course this leaves the device still in ISP which is the next issue. It appears that others have had this same issue at http://forum.flashmagictool.com/index.php?topic=501.0 & http://forum.flashmagictool.com/index.php?topic=563.0

3. Once the device has entered ISP mode and the auto baud has been completed, the device will no longer autobaud, (in the code in AN10337) yet FM will continue to send a "U" (0x55) to the serial port at which point the device will reply with a 0x00. and then FM will spit the dummy as it is expecting an echoed "U" back. at this point there is now no way to force a download from FM and no way to recover the device from the ISP mode. This of course happens when youo have to shut FM down from a failed erase, as it doesn't cancel the erase and never closes the comm port. The only way I can recover from this is to reflash the device using ICP (and the same code)


4. Not a bug but I thought someone may be interested in the NoTouch Code from Erik, I have added an extra section in it to set the bootvector to the ISP code, as I found that having the code as per the included examples, would not cause my device (LPC925) to enter the ISP. adding the Bootvector address made all the difference, call it a fail safe if you will. I would happily post this on 8052.com but it is down at the moment.

$NOMOD51
$include (REG922.INC)

NAME NOTOUCH925

PGM_MTP    EQU 0FF03H

?PR?no_touch925?NOTOUCH925     SEGMENT CODE
    public no_touch925
   
   ; void no_touch925(){
   
    RSEG ?PR?no_touch925?NOTOUCH925
no_touch925:
    push    IEN0            ;save EA Status
    clr     EA              ;disable int's
    mov     R0,     #0FFH   ;IAP authourisation key first
    mov     @R0,    #96H
    mov     A,      #02
    mov     R5,     #01     ;write bootstat with 01H
    mov     R7,     #03
    lcall   PGM_MTP
   
    ;mkb added boot vector for the ISP (31-Dec-2006)
    mov     R0,     #0FFH   ;IAP authorisation key first
    mov     @R0,    #96H
    mov     A,      #02
    mov     R5,     #1FH     ;write bootvec with 1FH
    mov     R7,     #02
    lcall   PGM_MTP
   
   
    pop     IEN0            ;restore EA status
    RET
   
    ;}
   
; END of no_touch925
 
  END


I am using the following kit LPC925, RC oscillator, Acqura PDS900 Emulator, Raisonance IDE, SerialMon (hhdsoftware.com) serial port sniffer) WinXP Pro with a real serial port. LPC voltages are OK @ 3.492VDC 

Any help or thoughts on this are appreciated.