Menu

#422 Modify the FPGA flash status register

0.11.0
new
nobody
None
2024-02-04
2024-02-04
KooLee
No

I successfully updated the xilinx xc7a35t firmware using FT2232 and openocd.
my configuration

interface ftdi
ftdi_vid_pid 0x0403 0x6011
ftdi_channel 0
ftdi_layout_init 0x0098 0x008b
reset_config none

source [find cpld/xilinx-xc7.cfg]
source [find cpld/jtagspi.cfg]
adapter_khz 10000

proc fpga_program {} {
    global _CHIPNAME
    xc7_program $_CHIPNAME.tap
}

init
jtagspi_init 0 bscan_spi_xc7a35t.bit
jtagspi_program fw.bin 0x0
fpga_program
shutdown

I have a question, is it possible to modify the status register of the Flash chip on the FPAG board via openocd.
I want to turn on Quad Enable by modifying the status register of the Flash chip on the FPGA board via openocd.

I checked the "12 Flash Commands" document and it seems that there is no command support.
Is there any way I can realize this idea, thanks.

Discussion

  • Andreas Bolsch

    Andreas Bolsch - 2024-02-04

    See 12.5.1 "Flash Driver: jtagspi
    Command: jtagspi cmd bank_id resp_num cmd_byte ..."

    Present in all not too old builds, see https://review.openocd.org/c/openocd/+/4876

     
    👍
    1
    • KooLee

      KooLee - 2024-02-04

      Thanks for your reply, but I don't quite understand the jtagspi cmd commands.
      Take is25lp128f flash chip as an example, I want to set the value of status register Bit6 QE to 1. Can you tell me the sample code, thanks a lot. :)

       
  • Andreas Bolsch

    Andreas Bolsch - 2024-02-04

    jtagspi cmd 0 1 0x05 ;# read status register
    jtagspi cmd 0 0 0x06 ;# write enable
    jtagspi cmd 0 1 0x05 ;# read status register again to check WEL
    jtagspi cmd 0 0 0x01 0x40 ;# set QE bit (assuming BP to remain cleared)

    Note that QE is a non-volatile bit, so it has to be set only once. From the datasheet it is NOT quite clear to me how QE bit and QIOEN/QIODI commands do interact. It is possible that setting QE instantly turns on QPI mode, so be prepared that after the seqence above the flash will only accept QPI commands permanently. So if you don't have a bitstream to set the FPGA to QPI mode, too, you're lost.

     
    ❤️
    1

Log in to post a comment.

MongoDB Logo MongoDB