About BootLoading

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

About BootLoading

1,140 次查看
omerkaanbasakin
Contributor IV

Hello we are working on IMXRT 1052 on custom board. We are using PE Micro Universal Multilink and MCUXpresso IDE. We want to write the code to flash and get the code at startup copy the ram and run it from there. I 'm new to this topic. Haven't found a solution yet.

I can write code the flash but I think code runs from flash and running slow. 

At projects xip folder, change 1050_flexspi_nor_config.c code as:

/*
* Copyright 2017 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/

#include "evkbimxrt1050_flexspi_nor_config.h"

/* Component ID definition, used by tools. */
#ifndef FSL_COMPONENT_ID
#define FSL_COMPONENT_ID "platform.drivers.xip_board"
#endif

/*******************************************************************************
* Code
******************************************************************************/
#if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1)
#if defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__)
__attribute__((section(".boot_hdr.conf")))
#elif defined(__ICCARM__)
#pragma location = ".boot_hdr.conf"
#endif

const flexspi_nor_config_t qspiflash_config = {
.memConfig =
{
.tag = FLEXSPI_CFG_BLK_TAG,
.version = FLEXSPI_CFG_BLK_VERSION,
.readSampleClksrc=kFlexSPIReadSampleClk_LoopbackFromDqsPad,
.csHoldTime = 3u,
.csSetupTime = 3u,
// Enable DDR mode, Wordaddassable, Safe configuration, Differential clock
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_100MHz,
.sflashA1Size = 8u * 1024u * 1024u,
.lookupTable =
{
// Read LUTs
FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),
},
},
.pageSize = 256u,
.sectorSize = 4u * 1024u,
.blockSize = 256u * 1024u,
.isUniformBlockSize = false,
};
#endif /* XIP_BOOT_HEADER_ENABLE */

and set BOARD FLASH SIZE  0x80000.

In MCU settings qspi adress = 0x60000000, size 0x800000 and driver is MIMXRT1050-EVK_IS25WP064A.cfx.

 

0 项奖励
回复
2 回复数

1,108 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi omerkaanbasakin,

   If all your code is located in the RAM, which just need to download to the external flash.

   I suggest you use the MCUXPresso IDE generated the code with non XIP, and located in the internal RAM directly, but please note, you need to locate the code address up 0x2000, JUST make sure you leave 0X2000 address which will be used for the flashloader header . 

   Then use the RAM app, download it to the external flash, after booting, the ROM will help you copy the RAM code from flash to the RAM, and run from RAM.

   You also can refer to my post, which may be useful to you, just this document locate the code to the SDRAM, and download to the SDCARD:

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1050-SDRAM-app-code-boot-from-SDcard-burn-with...

  You can use our MCUBootUtility tool, MCUXpresso secure provisioning tool, or the flashloader with MFG tool to realize it.

 

Wish it helps you!

If you still have questions about it, please kindly let me know!

Best Regards,

Kerry

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored

Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

-----------------------------------------------------------------------------

1,130 次查看
mjbcswitzerland
Specialist V

Hi

Consider the following for a complete solution for your requirements and to ease development:
1. Serial loader (USB, Ethernet, LPUART, SD-card, I2C)
2. Allows upload of AES256 encrypted application that runs in internal RAM or SD RAM (with clone protection)
3. Supports fail-safe Over-the-Air loading of application and new serial loader versions
4. Allows larger applications to be uploaded and run in QSPI flash (XiP) using On-The-Fly AES128 decryption

i.MX RT 1050:
- https://www.utasker.com/iMX/RT1050.html
- https://www.utasker.com/iMX/iMX_RT1052_OEM.html

Boot Loader concept flow chart: https://www.utasker.com/docs/iMX/Loader.pdf and usage reference https://www.utasker.com/docs/iMX/uTaskerLoader_TestDrive.pdf
Concept video: https://www.youtube.com/watch?v=2XfgZq19XDw&list=PLWKlVb_MqDQEOCnsNOJO8gd3jDCwiyKKe&index=3
Serial Loader features: https://www.utasker.com/docs/uTasker/uTaskerSerialLoader.pdf
Building the loader with MCUXpress: https://www.utasker.com/docs/iMX/MCUXpresso.pdf (and video guide https://youtu.be/p_eUGo6GypY ) - the guide document explains how to use with any application (eg. SDK) and to enabling its operation with On-The-Fly decryption in 5 minutes
Building the loader with IAR: https://www.utasker.com/docs/iMX/IAR.pdf (and video guide https://youtu.be/XPCwVndP99s )
Building the loader with VisualStudio and GCC: https://www.utasker.com/docs/iMX/GCC.pdf (and video guide https://youtu.be/0UzLLSXABK8 )

Regards

Mark
uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training or product development requirements