;---------------------------------------------------------------------------- ; ; FlashDt402Eb_b.bvc ; ; Command file for flash update on DT402EB ; Boundary scan functions, required: ; bsdl file (LSI402ZX.bsdl) ; monitor image file (Dt402Eb_b.bin) ; opt - lcd init image file (lcdinit.bin) ; ;---------------------------------------------------------------------------- base x ; set number base to hex JTAG 0 BSDL LSI402ZX.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 bscan ; scan all bits ; === init definitions for PLD access 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 pcs0n 0 ; assign active low pccs0 strobe to the (C)s function flashdisplay 0#8 ; show current contents of monitor location bmwrite 4 8 ; disable SRAM CS enable, so we can access flash flashdisplay 0#8 ; show current contents of monitor location ; === init definitions for flash access 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 dt402eb_b.bin v0 ; check if the file exists if (v0!=0) jump prog402 ; size 0, so abort programming operation Print "Can't open dt402eb_b.bin" jump exit .prog402 flashdisplay f800#8 ; show current contents of monitor location flashdisplay c000#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 DT402EB Rev B flash" flashload dt402eb_b.bin 0xf800 ; send binary data to file ;flashload lcdinit.bin 0xc000 ; send binary data to file flashdisplay f800#8 ; show current contents of monitor location flashdisplay c000#8 ; show current contents of monitor location .exit bmode 1 sample ; set first device in the SAMPLE/PRELOAD mode bscan ; scan bits to exit EXTEST bmflush ; send all buffered BSDL scans