In QSPI LUTs, can you prepend a WRITE_ENABLE to an ERASE / PAGE PROGRAM?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

In QSPI LUTs, can you prepend a WRITE_ENABLE to an ERASE / PAGE PROGRAM?

Jump to solution
976 Views
np
Contributor IV

From time to time, the RT106x-based embedded device I'm working on has to save fat blobs of data out to a QSPI (e.g. on PortB1). To do this, you'd normally:

  • call FLEXSPI_TransferBlocking() to send a WRITE_ENABLE QSPI command (on the ISS IS25, this is CMD_SDR, kFLEXSPI_1PAD, 0x06)
  • call FLEXSPI_TransferBlocking() again to read the status register to make sure that WEL has been set; and then finally
  • call FLEXSPI_TransferBlocking() again to send out the PAGE PROGRAM command (CMD_SDR, kFLEXSPI_1PAD, 0x32, etc)

However, this involves a lot of CPU fussing around (e.g. making up and sending out three packets), when the device has a lot of other real-time stuff it would rather be doing.

Is there a smart way to (mostly) integrate these into a single composite command, e.g. replacing the status register polling with some kind of dummy wait? I'm thinking of something along the lines of:

  • CMD_SDR, kFLEXSPI_1PAD, 0x06
  • DUMMY_SDR, kFLEXSPI_4PAD,40  [or some other suitably long dummy wait value]
  • CMD_SDR, kFLEXSPI_1PAD, 0x32, etc

All/any suggestions/hints/tips gratefully received!

Cheers, Nick Pelling

0 Kudos
1 Solution
935 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @np ,

    About the DMA, you can refer to the flexSPI DMA code:

SDK_2.9.2_EVK-MIMXRT1060\boards\evkmimxrt1060\driver_examples\flexspi\nor\edma_transfer

  But to the combine a WRITE_ENABLE and a READ_STATUS into a single LUT entry, we didn't use it like that, normally, we still wait the WRITE_ENABLE is succeed, then do the detail operation, then call flexspi_nor_wait_bus_busy.

   If you still want to check the combined situation, I think you can test it on your side, but it is not confirmed work.

 

Wish it helps you!

Best Regards,

kerry

View solution in original post

0 Kudos
5 Replies
964 Views
np
Contributor IV

Hi Kerry,

Yes, that is indeed the proper way of doing it (as I said in my question). But you must admit that it is quite indirect, especially considering that the recommendation I've seen here is to have interrupts disabled while you're doing it if you want to write stuff out to a second QSPI on a RT1061. Hence my concern is that this will slow down the device's response to interrupts etc.

I guess another alternative might be to wrap all these stages up in an eDMA sequence, though I haven't seen anyone actually do this. You could even prepare a series of 256-byte page writes and get the eDMA to trigger an interrupt on completion, decoupling this from the CPU.

Thanks, Nick

0 Kudos
959 Views
np
Contributor IV

Perhaps it might be sensible to combine a WRITE_ENABLE and a READ_STATUS into a single LUT entry? Could that work?

0 Kudos
936 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @np ,

    About the DMA, you can refer to the flexSPI DMA code:

SDK_2.9.2_EVK-MIMXRT1060\boards\evkmimxrt1060\driver_examples\flexspi\nor\edma_transfer

  But to the combine a WRITE_ENABLE and a READ_STATUS into a single LUT entry, we didn't use it like that, normally, we still wait the WRITE_ENABLE is succeed, then do the detail operation, then call flexspi_nor_wait_bus_busy.

   If you still want to check the combined situation, I think you can test it on your side, but it is not confirmed work.

 

Wish it helps you!

Best Regards,

kerry

0 Kudos
932 Views
np
Contributor IV

Hi @kerryzhou ,

Thanks very much for that, that's very helpful!

Best regards, Nick Pelling

0 Kudos
966 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi np,

  It's better still divide it as the SDK method, as just when the first operation success, then it can go the next step.

  Eg, in the flexspi_nor_flash_program.

  It needs to write enable, after it returns success, it can go to the next page program command, and after the page program command success, then it goes to the flexspi_nor_wait_bus_busy.

  So, to the flexSPI operation, still refer to the SDK code method.

 

 

Wish it helps you!

Best Regards,

Kerry

0 Kudos