Booting from SD Card in RT1170

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

Booting from SD Card in RT1170

Jump to solution
1,701 Views
abady1000
Contributor III

I am trying to boot form SD card in a custom board based on RT1170 chip but I can't do so!

I can program the SD card and read from it while connected to the chip using Secure Provisioning Tool and MCUBootUtility, the the chip never boot.

I followed steps here to program the SD card correctly using STP and MCUBootUtility.

- I linked my application to RAM and verified it works.
- I generated boot image in (STP/MCUB) with application in 0x1000 offset.
- I flashed the application using (STP/MCUB).
- Set
          [boot mode = internal]
          [BOOT_CFG1[6] = 1] to get BOOT_CFG1[7:6] = 0b01  or SD/eSD/SDXC boot from the
USDHC interface

but the application doesn't run

I verify the application status by monitoring serial UART printing of the chip.

How to debug boot failure? 

NOTE: I also tried to generate boot image from (s19) file in MCUBootUtility

0 Kudos
Reply
1 Solution
1,577 Views
abady1000
Contributor III

I fixed the issue, it happened due to error from NXP them selves.

SD Card pattern is wrong, instead of setting 7th switch ON, the 8th switch should be ON.

abady1000_0-1744789192421.png


Couldn't figure it out directly, some tries and errors fixed the issue.

BTW, I checked it in the Reference Manual, it is also wrong, this pattern should be for eMMC/MMC devices, not SD Card.

All this depends on how numbers in the reference manual are interpreted.

Here BOOT_CFG1[7:6] = 01, so I assumed BOOT_CFG1[7]=0 and BOOT_CFG1[6]=1

abady1000_1-1744789345941.png

why did I assumed this?
Because it is consistent with this table:

abady1000_2-1744789487279.png

Where Serial Downloader mode is actually BOOT_MODE[1:0]=01

The correct order for this is (it is verified):
BOOT_MODE[0]=1
BOOT_MODE[1]=0

Device enter Serial Downloader mode when switch 4 is ON and 3 is OFF

abady1000_3-1744789973981.png

 



Due to this inconsistency in the Reference Manual I couldn't boot from SD Card, and the maker of the MIMXRT1170-EVKB made a mistake in setting the boot mode switches.

Now I have SD Card working on both boards, mine and EVKB

 


Hope you fix this in coming versions

 

View solution in original post

14 Replies
1,578 Views
abady1000
Contributor III

I fixed the issue, it happened due to error from NXP them selves.

SD Card pattern is wrong, instead of setting 7th switch ON, the 8th switch should be ON.

abady1000_0-1744789192421.png


Couldn't figure it out directly, some tries and errors fixed the issue.

BTW, I checked it in the Reference Manual, it is also wrong, this pattern should be for eMMC/MMC devices, not SD Card.

All this depends on how numbers in the reference manual are interpreted.

Here BOOT_CFG1[7:6] = 01, so I assumed BOOT_CFG1[7]=0 and BOOT_CFG1[6]=1

abady1000_1-1744789345941.png

why did I assumed this?
Because it is consistent with this table:

abady1000_2-1744789487279.png

Where Serial Downloader mode is actually BOOT_MODE[1:0]=01

The correct order for this is (it is verified):
BOOT_MODE[0]=1
BOOT_MODE[1]=0

Device enter Serial Downloader mode when switch 4 is ON and 3 is OFF

abady1000_3-1744789973981.png

 



Due to this inconsistency in the Reference Manual I couldn't boot from SD Card, and the maker of the MIMXRT1170-EVKB made a mistake in setting the boot mode switches.

Now I have SD Card working on both boards, mine and EVKB

 


Hope you fix this in coming versions

 

1,251 Views
Sam_Gao
NXP Employee
NXP Employee

@abady1000 

I double checked with RT1170-EVKB about SD Card boot configuration, the description is correct both RM and schematic diagram, comments as below, please correct me if my undertsanding is wrong.

 

1. Schematic diagram:

The 7th switch of SW2 = CFG[6] = 1

The 6th switch of SW2 = CFG[5] = 0

Sam_Gao_1-1746693666767.png

2. RM, 'Table 10-9, Boot device selection, page 283'. 'Table 10-28, page 314. ' Schematic diagram Boot configuration.

Sam_Gao_5-1746694542939.png

 

Sam_Gao_3-1746694407981.png

 

Sam_Gao_4-1746694473569.png

 

 

 

 

 

 

 

 

 

0 Kudos
Reply
1,230 Views
abady1000
Contributor III

Hi @Sam_Gao ,

Your understanding for both the schematic and RM is correct, and that is the problem.

These configurations you have just mentioned in your comment won't run SD card.

 

Instead you have to use eMMC configurations :
BOOT_CFG[7] = 1

BOOT_CFG[6] = 0

 

These configurations only will run the SD card

So what I am saying is there is a mistake in the RM, which lead to a mistake in the MIMXRT1170-EVKB

0 Kudos
Reply
1,078 Views
Sam_Gao
NXP Employee
NXP Employee

@abady1000 

You mean that you use eMMC configuration(BOOT_CFG[7] = 1, BOOT_CFG[6] = 0 ) to boot SD card? That seems be impossbile.

If you use RT1170-EVKB and SD card(Default is supported) to boot, it should be 'BOOT_CFG[6] = 1, BOOT_CFG[5] = 0',

it means: 7th switch of SW2 = CFG[6] = 1, 6th switch of SW2 = CFG[5] = 0

0 Kudos
Reply
1,050 Views
Sam_Gao
NXP Employee
NXP Employee

@abady1000 @haryanl 

We double checked both from SW/HW, let me clairfy details here to help understand.

There are various types of SD cards on the market(e.g, Sandisk, Samsung), some support 4 lines, some support 1 line. Because eMMC is compatible with some SD protocols, it will cause the boot from the SD card to become the boot from the compatible eMMC. So, please check the following steps:

Force the use of SD card 4-wire mode (BOOT_CFG[9] = 1) which should be supported by most SD cards.  Then, if configured correctly as documented (BOOT_CFG[6] = 1, BOOT_CFG[5] = 0) , booting from the SD card will succeed.

Sam_Gao_0-1747379786025.png

Please tell me if this issue is fixed.

 

 

 

0 Kudos
Reply
1,286 Views
haryanl
Contributor IV

Surprisingly, I don't see any difference on the schematic and Ref.Manual, But it works when SW8 is turned on instead of SW7 as you said

1,267 Views
abady1000
Contributor III
Yes, it was surprising.

Hope this post helped you saving some valuable time
0 Kudos
Reply
1,635 Views
abady1000
Contributor III

Following the given post didn't help me run SD card on MIMXRT1170-EVKB board, I followed the same steps for an example project from SDK library (iled_blinky_cm7), I verified that application is working using debug interface after linking it to RAM (internal RAM). but it doesn't boot of SD card !!!

0 Kudos
Reply
1,664 Views
Sam_Gao
NXP Employee
NXP Employee

Hi @abady1000 

It is hard to give comments about the root cause about the fauilure of booting from SD card base on a custom board, it is out of our scope actually.

Please check if the issue is still happened even base on NXP EVK board, if it works well, you need to check hardware on the custom board.

Here is a post about boot SD casd on RT1050 EVK board for your reference.

 

B.R,

Sam

 

0 Kudos
Reply
1,653 Views
abady1000
Contributor III
Actually SD card connection is very straight forward, and secure provision tool and MCUBootUtility both are capable of detecting and programming sd card, so I think this proof that connection is valid.

Anyhow, I couldn't get it to work on MIMXRT1170-EVKB, is there a version for rt1170? I will try to follow the steps in this tutorial anyway.

Thanks
0 Kudos
Reply
1,627 Views
Sam_Gao
NXP Employee
NXP Employee

Hi,

i.MX RT1170 EVKB is our offcial develop board which supports MCUXpresso SDK as well. 

If you want to boot from SD Card, plesae follow below steps which based on our i.MX RT1170 EVKB board (No any hardware issues).

1. Verify SD card

   It works well if running evkmimxrt1170\sdmmc_examples\sdcard_polling example.
2. Refer to this post but it is with minor changes applicable to i.MX RT 1170.

3. Useful AN: How to Enable Non-XIP Boot on i.MX RT Series EVK Board

 

0 Kudos
Reply
1,620 Views
abady1000
Contributor III

Thank you for your response...

1. The SD card work, I can read it, write it on the NXP and on the PC

I run the application you suggested and it works perfectly.
Here is the output:

abady1000_0-1744714505311.png

One thing I notice is that it works on 1.8V, does this require special actions?

2. I have already followed this tutorial before posting, that problem is that it uses a tool called "Flashloader_i.MX1050" and I couldn't find it any way, how to get this tool?

abady1000_1-1744714705947.png



3. I will check the Application Note.

0 Kudos
Reply
1,592 Views
Sam_Gao
NXP Employee
NXP Employee

 

Hi,

One more thing I need to give comments, this post involves some outdated tools or documents, such as flashloader, MFG,etc.

1. Flashloader: https://www.nxp.com/search?keyword=Flashloader&start=0

2. 'it works on 1.8V, does this require special actions?'

Please clarify what it is.

0 Kudos
Reply
1,580 Views
abady1000
Contributor III

Thank you @Sam_Gao 

1. Regarding the Flashloader tool you didn't send a link for the tool but for a search results, which I have already did in order to find Flashloader for RT1170 MCU, but there were none.

I guess the tutorial is outdated since the tools in it are no longer available for newer MCUs, and AN12238 clearly states that tools use is not interchangeable

abady1000_0-1744779349958.png

Is there any updates regarding this?

2. I mean if SD card works on 1.8V or 3.3V, does this require any modifications to the GPIO BOOT pins or fuse register to make it work fine? or it should work fine regardless the voltage level?

0 Kudos
Reply
OSZAR »