;---------------------------------------------------------------------------- ; ; FlashEb403.cmd ; ; Command file for flash update on EB403 ; Boundary scan functions, required: ; bsdl file (LSI403LP.bsdl) ; image file (FlashEb403.bin) ; ;---------------------------------------------------------------------------- base x ; set number base to hex JTAG 0 BSDL LSI403LP.bsdl ; configure boundary scan bmode 1 sample ; set first device in the SAMPLE/PRELOAD mode bscan ; scan all bits bmode 1 extest ; set first device in the EXTEST mode bcopy 1 ; copy scanned in data to the output buffer bmfunction remove ; remove old definitions of the functions bmfunction a 1 addr ; assign all addr bits to the (A)ddr function bmfunction d16 1 data ; assign 16 data bits to the (D)ata function bmfunction w 1 wr0n 0 ; assign active low wr0 strobe to the (W)r function bmfunction r 1 rdn 0 ; assign active low rd strobe to the (R)d function bmfunction c 1 ics0n 0 ; assign active low ics0 strobe to the (C)s function bmreadid ; Read flash id (call procedure) if (v0==0x89) jump microndevice ; we can read device ID, so continue bmreadid3 ; read flash id using triple word accesses if (v0==0x01) jump amddevice ; we can read device ID, so continue if (v0==0x20) jump amddevice ; we can read device ID, so continue if (v0==0xbf) jump amddevice ; we can read device ID, so continue Print "Invalid device found, aborting operation" jump exit ; end command file execution .amddevice print "Found AMD/SST/STM flash, continuing" flashmode 1 ; set flash accesses in AMD/SST/ST mode jump programFlash ; jump back to the programming algorithm .microndevice ; flashmode 2 ; assume micron flash .programFlash filesize flasheb403.bin v0 ; check if the file exists if (v0!=0) jump prog403 ; size 0, so abort programming operation Print "Can't open flasheb403.bin" jump exit .prog403 flashdisplay f800#8 ; show current contents of monitor location Print "Clearing flash sector" flashclear 0xf800 ; clear sector where we will program data in flashdisplay f800#8 ; show current contents of monitor location Print "Programming EB403 flash" flashload flasheb403.bin 0xf800 ; send binary data to file flashdisplay f800#8 ; show current contents of monitor location .exit