Hello
I try to understand how to build bootable image for
flexspi flash.
As I see there are 2 approaches:
1. The linker in MCUXpresso IDE adds it to header of compiled image code, as done in example hello_world_xip.
2. using elftosb , so that it adds image header, to make it a bootable image, is that Right ?
Using elftosb approach, I found the following tutotirals:
Generating a Bootable Image for the RT1050
https://www.nxp.com/docs/en/application-note/AN12107.pdf
Yet, I don't understand how flexSPI configuration paramaters are added to hello_world example in these tutorials (not the same as hello_world_xip !)
Essentially, the example says to do the following:
1.
elftosb.exe -f imx -V -c ../../bd_file/imx10xx/imx-flexspinor-normal-unsigned.bd -o ivt_flexspi_nor_hello_world.bin hello_world.srec
2.
elftosb.exe -f kinetis -V -c ../../bd_file/imx10xx/program_flexspinor_image_HyperFlash.bd -o
boot_image.sb ivt_flexspi_nor_hello_world_nopadding.bin
Is it that the steps above add flexSPI configuration paramaters to image header ? Which command adds these parameters to image ? If not - where is it added to image header ?
I also don't find in "MCU Bootloader v2.5.0 Reference" documentation that flexSPI is mentioned as one of the device used for flash programming. So how is it that the tool can be used for flexSPI programming ?
Thank you ,
Ranran
Solved! Go to Solution.
>Are these 2 methods initialize flexSPI before the flash programming starts..
yes, as FlexSPI module will nor work without initialization.
>to use different hyperflash, does it mean we must make modifications related to "FCB"..
yes
> where ?
please reread carefully provided answers above.
Best regards
igor
You can also try this tool, with this tool, You can flash bare image into various boot devices easily and don't need to care about headers (ivt, boot data...)
Hi Ranran
>> flexSPI configuration paramaters to image header ? Which command adds these
>parameters to image ? If not - where is it added to image header ?
for "flexSPI configuration paramaters", Reference Manual calls it as "FlexSPI Configuration Block"
one can look at sect.8.6.1 Serial NOR Flash Boot via FlexSPI, sect.8.6.3.1 FlexSPI Configuration Block
sect.8.6.1.2 FlexSPI Serial NOR Flash Boot Operation i.MX RT1050 Processor Reference Manual:
"The ROM expects the 512-byte FlexSPI NOR configuration parameters as explained in
next section to be present at offset 0 in Serial NOR flash. The ROM reads these
configuration parameters using the read command specified by BOOT_CFG2[2:0] with
Serial clock operating at 30 MHz.
In the second step, ROM configures FlexSPI1 interface with the parameters provided in
configuration block read from Serial NOR flash and starts the boot procedure. Refer to
Table 8-17 for details regarding FlexSPI configuration parameters and to the FlexSPI
NOR boot flow chart for detailed boot flow chart of FlexSPI NOR."
https://www.nxp.com/docs/en/reference-manual/IMXRT1050RM.pdf
BD file is described in attached i.MX MCU Manufacturing User’s Guide (Chapter 4.1-2).
"MCU Bootloader v2.5.0 Reference"
https://www.nxp.com/docs/en/reference-manual/MCUBOOTRM.pdf
if you are asking about MCUXpresso, configuration is performed by
structure flexspi_device_config_t deviceconfig[] in ..driver_examples/flexspi/hyper_flash/polling_transfer/flexspi_hyper_flash_polling_transfer.c
Welcome | MCUXpresso SDK Builder
For understanding AN12107 may be useful to check sect.8.2.2.1 Typical use cases for FlexSPI NOR Configuration Block
attached MCUX Flashloader Reference Manual included in FlashLoader and
FlashLoader sources (*windows-all-MIMXRT1052xxxxB.zip)
structure flexspi_nor_config_t hyperflash_config[] in
../devices/MIMXRT1052/xip/evkbimxrt1050_hyper_config.c
https://mcuxpresso.nxp.com/en/license?hash=ad7870cf2d88e6a1da7ee9bb13881321&hash_download=1
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Igor,
Thank you for comment.
I have read these sections in TRM,
You have cited the definition of "FlexSPI Configuration Block", but in my question I asked which of the "elftosb" steps (mentioned in my above question) is actually adding this block into the image... , and if it's not done there, where is it actually added in this process ?
Obviously BD section is not the same as "FlexSPI Configuration Block".
So where did we add the "FlexSPI Configuration Block" into image ?
Does anyone know knows ?
Thank you,
ran
Hi ran
mfg tool uses some standard typical settings described in
sect.8.2.2.1 Typical use cases for FlexSPI NOR Configuration Block
MCUX Flashloader Reference Manual.pdf included in FlashLoader package.
Best regards
igor
Hi Igor,
Thank you.
This is very helpful !!
As to the 2nd part of my question:
>I also don't find in "MCU Bootloader v2.5.0 Reference" documentation that flexSPI is mentioned as one of the device >used for flash programming. So how is it that the tool can be used for flexSPI programming ?
The flexSPI is mentioned in the document you've referenced " MCUX Flashloader Reference Manual ", but not in ""MCU Bootloader v2.5.0 Reference".
Isn't "MCUX Flashloader " and "MCU Bootloader" the same thing, i.e. application on target which communicates with mfgtool and used for flash programming ?
Thank you very much,
ranran
Hi ran
"MCUX Flashloader " is based on "MCU Bootloader" but not the same.
Also you may be interested in below document sect.7 Flash Drivers
Overview of using the MIMXRT1020-EVK with MCUXpresso IDE
Best regards
igor
Thank you Igor,
Is it that the floashLoader initialize flexSPI before flash programming the hyperFlash or is it that it just add the header ?
I am very interested in this because we need to understand if flashLoader is capable to flash programming a "deadboard" (erased flash) , i.e. a flash without FCB block.
The same question is also relevant for jtag debug, i.e. is JTAG debug capable of flash programming when used with empty hyperFlash ?
I ask becuase we need to make a decision if we shall use jtag or flashLoader.
Thank you very much for your time,
ranran
Hi ran
I think answer depends on what exactly are you apeaking about.
As different environments suggest different programming ways, MCUXpresso, Flashloader utility,
IAR IDE, MDK Keil, OpenSDA, e.t.c When you speak "flashLoader" which one do you mean ?
Best regards
igor
Hello Igor,
You said:
"
As different environments suggest different programming ways, MCUXpresso, Flashloader utility,
IAR IDE, MDK Keil, OpenSDA, e.t.c When you speak "flashLoader" which one do you mean ?"
I am speaking about flash programming a hyperFlash (the original question above) which shall boot after a reset (if it can boot, than it is worthless).
What methods are there in NXP to do it ?
I thought there are 2 (please correct me if wrong):
1. flashloader utility (exactly the same "flashLoader" which you've answered me about in this discussion)
2. using debug with MCUXpresso
What I try to ask is:
Are these 2 methods initialize flexSPI before the flash programming starts (i.e. before press "debug" button in jtag, and before flashloader does the write into hyperFlash)?
We also plan to use different hyperflash, does it mean we must make modifications related to "FCB" in any of this two capabilities (flashloader utility/MCUXpresso debug) ? where ?
Thank you ,
ranran
>Are these 2 methods initialize flexSPI before the flash programming starts..
yes, as FlexSPI module will nor work without initialization.
>to use different hyperflash, does it mean we must make modifications related to "FCB"..
yes
> where ?
please reread carefully provided answers above.
Best regards
igor
Hi,
to anyone with same question:
the list of supported drivers for hyperFlash is listed in MCUXpresso IDE.
Thank you,
ranran
Igor,
Thank you very much!