Author Topic: RP2040 Boot Stage 2 Question  (Read 477 times)

0 Members and 1 Guest are viewing this topic.

Offline Rob MorleyTopic starter

  • Newbie
  • Posts: 7
  • Country: ca
RP2040 Boot Stage 2 Question
« on: February 20, 2024, 10:02:54 pm »
I am trying to understand the steps the RP2040 boot stage 2 takes to set up the flash chip in XIP mode. I have read through the RP2040 datasheet (section 2.8.1.3, and Section 4.10) about what boot stage 2 does and looked at the assembly language examples in the Pico-SDK repository. I understand what is being done. Where I run into problems with the setting is when they put the Flash IC into continuous mode after Fast Read Quad IO command for "W25Q" flash devices. In the RP2040 datasheet and the example assembly files it says you can set the mode bits (M7-0) to 0xA0, and the Flash chip goes into continuous mode allowing you to skip the command part of the flash read access. However, I cannot find this in the Winbond W25Q128JV datasheet. The only mention of it is a small note in Figure 24a, saying that M7-0 should be set to 0xFx. I've searched for other documents explaining the mode bits but there is nothing on the Winbond site or in the google searches I've done.

Could someone point me to a document or website that explains the mode bits for the "W25Q" flash chips or where the Raspberry PI people got this information.

Thanks.

 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: RP2040 Boot Stage 2 Question
« Reply #1 on: February 20, 2024, 10:46:34 pm »
Memory datasheets are really bad about documenting this stuff. 0xA0 is a common code for this. So, I guess they just assumed that any reasonable flash will support it.

A random memory datasheet that explicitly mentions 0xA0 (0xAx actually) is S25FS512S, for example. But most QSPI flash devices would support it, nobody would want to market incompatible product.
« Last Edit: February 20, 2024, 10:48:35 pm by ataradov »
Alex
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14481
  • Country: fr
Re: RP2040 Boot Stage 2 Question
« Reply #2 on: February 21, 2024, 12:55:41 am »
0xA0 sets a continuous read mode. I'm unfortunately not completely sure all Flash chips do support it, although I agree that the info omitted in some datasheet is not by itself evidence that said chip doesn't support it, as those datasheets often omit a lot of stuff.

I've found this thread on the RPi forum: https://forums.raspberrypi.com/viewtopic.php?t=356424
with approx. zero reply.
 :-//
 

Offline Rob MorleyTopic starter

  • Newbie
  • Posts: 7
  • Country: ca
Re: RP2040 Boot Stage 2 Question
« Reply #3 on: February 21, 2024, 03:20:43 am »
I do understand that 0xA0 after the address should put the QSPI flash IC into continuous mode, but how do I confirm that when there no documentation and wasting money on PCB

For example:


I can only assume that memory IC vendors think that stuff is standard knowledge to most of its clients that buy millions of these IC's but It makes it dam frustrating when trying to confirm vague claims from third party vendors in their SDK's when you're only buying a handful >:(. I did look on the raspberry pi forum about this issue first but most posts including the one posted here were unanswered, not a good sign. So I came here.

Quote
But most QSPI flash devices would support it, nobody would want to market incompatible product.

Again, this comes down to the documentation issue of not documenting a feature or assuming everyone knows about it. Is there a JEDEC type standard for QSPI Flash memory, they all seem to follow the same command values?

... A few hours later ...  :palm:

Ok, I found JEDEC standards that relate to xSPI Interface, JEDEC216, and JEDEC251, but no help there. Then ... (Copilot to the rescue)

Found this in a Microchip doc : https://onlinedocs.microchip.com/oxy/GUID-C0DEC68F-9589-43E1-B26B-4C3E38933283-en-US-1/GUID-CF766800-7EB7-4611-B926-21177855F899.html#GUID-CF766800-7EB7-4611-B926-21177855F899__ID-00000E88, It shows details about mode bits and what code enter/exit SPI 0-4-4 mode (XIP). Again, it's third-party documentation :horse:, but better than nothing.

Thanks for your help.








 
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: RP2040 Boot Stage 2 Question
« Reply #4 on: February 21, 2024, 04:01:27 am »
You will find that this is not the only piece of information missing. This specific W25Q is particularly crap, but other are not much better.

I assume Pi people had enough pull to confirm directly with Windbond. I doubt that would reply to random people, so your only real option is to test. You don't really need a PCB, it is an 8-pin IC, easy enough to dead bug.
Alex
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf