RT117x: explanation of how ROM boot chooses which image to run

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

RT117x: explanation of how ROM boot chooses which image to run

414 Views
mastupristi
Senior Contributor I

 Hi

In an old post of mine (https://community.nxp.com/t5/i-MX-RT/RT117x-dual-image-how-to-know-if-the-running-image-is-the-quot/...) @jingpan  linked me to this article https://tinyurl.com/4nrhbprv (already translated using google).

A few days ago the same article was also quoted to me by @diego_charles  (https://community.nxp.com/t5/i-MX-RT/RT117x-preserve-bits-and-RAM-location-across-warm-reset/m-p/188...)

I read the article and there are some things I didn't understand. I don't know how to get in touch with the author, so I'm writing here

First of all, it's illustrated GPR10 (which in Ref Man is GPR9)

mastupristi_0-1718102855926.png

In Ref. Man. it is clearly stated that PERSIST_REDUNDANT_BOOT is “Used for both SPI NAND and SLC raw NAND devices", while it is PERSIST_SECONDARY_BOOT that is "Used only for eMMC/SD/FlexSPI NOR boot"

Let me remind you that the author states that his scenario is just that FlexSPI NOR. So I wonder why use the PERSIST_REDUNDANT_BOOT field which is (apparently) the wrong one? Is the documentation wrong?

The layout of the author's memory is this:

mastupristi_1-1718103626513.png

imageL is placed at low addresses while imageH is placed at high addresses

mastupristi_2-1718103826198.png

I highlighted two (seemingly) contradictory statements with the memory layout. Can you explain what the author meant?

 

mastupristi_3-1718104035065.png

I have a scenario where imageL version value is 0xFFFFFF and imageH version value is valid (specifically 0xFFFE0001). It always starts imageL though, and that would contradict what is stated in the table above.

 

I put all my good will into it but I didn't understand how this article can answer the question in my post (https://community.nxp.com/t5/i-MX-RT/RT117x-dual-image-how-to-know-if-the-running-image-is-the-quot/...)

 

best regards

Max

0 Kudos
Reply
4 Replies

394 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @mastupristi 

Thank you for reaching out!

Yes, you are correct about GPR9. When I quoted the article, forgot to tell you about that discrepancy. The register that the ROM uses is at 0x40C0_4038. From SRC_GPR10, but from SW point of view, it is SRC->GPR[9]

Let me check If we can reach the AN author. 

Diego

0 Kudos
Reply

383 Views
mastupristi
Senior Contributor I

Hi @diego_charles 

Would be great if the author himself could comment.

A reminder of the open questions:

  1. why use the PERSIST_REDUNDANT_BOOT field which is (apparently) the wrong one? Is the documentation wrong?
  2. explanation of the discrepancy between memory layout and the two sentences "image H with a lower physical address" and "image L with the higher physical address"
  3. why in my scenario (imageL version 0xFFFFFF, and imageH version 0xFFFE0001), the ROM boot always run imageL?
  4. how to know if the running image is the "chosen" or "backup" image (see https://community.nxp.com/t5/i-MX-RT/RT117x-dual-image-how-to-know-if-the-running-image-is-the-quot/...)?

best regards

Max

0 Kudos
Reply

318 Views
jay_heng
NXP Employee
NXP Employee

1. RT1170 ROM uses PERSIST_REDUNDANT_BOOT  field for FlexSPI NOR actually. so it is RM typo.

2.  "lower physical address" is always image L, "higher physical address" is always image H in my article.

3. For you case, i believe ROM will boot image H first

4. ROM will not record such info, so we can only keep some tracking info in image itself.

0 Kudos
Reply

292 Views
mastupristi
Senior Contributor I

Hi @jay_heng 

RT1170 ROM uses PERSIST_REDUNDANT_BOOT  field for FlexSPI NOR actually. so it is RM typo.

so I suggest you change the documentation

"lower physical address" is always image L, "higher physical address" is always image H in my article.

then this is a typo in the article, as this screenshot shows:

mastupristi_0-1718960488190.png

For you case, i believe ROM will boot image H first

what you believe is contradicted by the result of my tests. Image L (with version 0xFFFFFF) is booted even though image H has version 0xFFFE0001 and is valid

ROM will not record such info, so we can only keep some tracking info in image itself.

this is really bad news. Couldn't we use PERSIST_REDUNDANT_BOOT? Isn't it 1 when it boots the backup image?
Let's try to think outside the box to find a way.

0 Kudos
Reply