RT1052, Failed to boot on NOR-FLASH

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

RT1052, Failed to boot on NOR-FLASH

398 Views
老鹰
Contributor I

My DIY board: MCU: RT1052; FLASH: W25Q64JVST, connect to FlexSPI_A(GPIO_SD_B1_06~11), DQS(GPIO_SD_B1_05) is float,

IDE: MCUXpresso V11.3, SDK: V2.9.1

BOOT_CFG1 and BOOT_CFG2 has tied to GND with 10K resister. BOOT_MODE[1:0] is [00].

Import a HelloWorld demo, config and confirm that marco XIP_EXTERNAL_FLASH=1, XIP_BOOT_HEADER_ENABLE=1, XIP_BOOT_HEADER_DCD_ENABLE1, add a line to MEMORY that is "FALSH 0x6000000 0x800000 MIMXRT1050_SFDP_QSPI.cfx".

The flexspi_nor_config_t is defined:

const flexspi_nor_config_t spiflash_config = {
  .memConfig =
  {
    .tag = FLEXSPI_CFG_BLK_TAG,
    .version = FLEXSPI_CFG_BLK_VERSION,
    .readSampleClksrc=kFlexSPIReadSampleClk_LoopbackInternally,
    .csHoldTime = 3u, 
    .csSetupTime = 3u,
    .columnAddressWidth = 0u,
    .deviceModeCfgEnable = 1u,
    .deviceModeType = 1u,
    .deviceModeSeq.seqNum = 1u,
    .deviceModeSeq.seqId = 4u,
    .deviceModeArg = 0x000200,
    .deviceType = kFlexSpiDeviceType_SerialNOR,
    .sflashPadType = kSerialFlash_4Pads,
    .serialClkFreq = kFlexSpiSerialClk_133MHz,
    .sflashA1Size = 8u * 1024u * 1024u, 
    //.dataValidTime = {16u, 16u},
    .lookupTable =
    {
      [0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
      [1] = FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),

      [1*4] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05, READ_SDR, FLEXSPI_1PAD, 0x04),

      [3*4] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06, STOP, FLEXSPI_1PAD, 0),

      [5*4] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20, RADDR_SDR, FLEXSPI_1PAD, 0x04),

      [9*4] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x32, RADDR_SDR, FLEXSPI_1PAD, 0x18),
      [9*4+1] = FLEXSPI_LUT_SEQ(WRITE_SDR,FLEXSPI_4PAD , 0x04, STOP, FLEXSPI_1PAD, 0),

      [11*4] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xc7, STOP, FLEXSPI_1PAD, 0),
      },
    },
    .pageSize = 256u
    .sectorSize = 4u * 1024u,
    .blockSize = 64u*1024u,
    .isUniformBlockSize = false,
  };

Connect Board to PC with CMSIS-DAP on SWD interface.

Bulid project and Debug.

It looks like it's running, it shows "Thread #1 1 (Running)(Running)" only, unfortunately, it doesn't enter main() function. 

The console shows some hint "Program stopped. 0x00215e8a in ?? ()"

The GDB tracer get some information as following:

733,316 2-list-thread-groups
733,318 2^done,groups=[{id="i1",type="process"}]
733,318 (gdb)
736,947 3-gdb-version
736,950 ~"GNU gdb (GNU Arm Embedded Toolchain 9-2020-q2-update) 8.3.1.20191211-git\n"
736,950 ~"Copyright (C) 2019 Free Software Foundation, Inc.\n"
736,950 ~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is fre\
e software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitt\
ed by law."
736,950 ~"\nType \"show copying\" and \"show warranty\" for details.\n"
736,950 ~"This GDB was configured as \"--host=i686-w64-mingw32 --target=arm-none-eabi\".\n"
736,950 ~"Type \"show configuration\" for configuration details.\n"
736,950 ~"For bug reporting instructions, please see:\n"
736,950 ~"<http://www.gnu.org/software/gdb/bugs/>.\n"
736,950 ~"Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/\
software/gdb/documentation/>."
736,951 ~"\n\n"
736,951 ~"For help, type \"help\".\n"
736,951 ~"Type \"apropos word\" to search for commands related to \"word\".\n"
736,951 3^done
736,951 (gdb)
736,952 4-environment-cd E:/McuXpresso/evkbimxrt1050_hello_world
736,966 4^done
736,966 (gdb)
736,966 5-gdb-set breakpoint pending on
736,982 5^done
736,982 (gdb)
736,982 6-gdb-set detach-on-fork on
736,998 6^done
736,998 (gdb)
736,998 7-enable-pretty-printing
737,014 7^done
737,014 (gdb)
737,014 8-gdb-set python print-stack none
737,030 8^done
737,030 (gdb)
737,030 9-gdb-set print object on
737,046 9^done
737,046 (gdb)
737,046 10-gdb-set print sevenbit-strings on
737,062 10^done
737,062 (gdb)
737,062 11-gdb-set host-charset UTF-8
737,078 11^done
737,078 (gdb)
737,078 12-gdb-set target-charset GBK
737,093 12^done
737,093 (gdb)
737,093 13-gdb-set target-wide-charset UTF-16
737,109 13^done
737,109 (gdb)
737,109 14-gdb-set dprintf-style call
737,125 14^done
737,125 (gdb)
737,125 15-gdb-set target-async on
737,141 15^done
737,141 (gdb)
737,141 16-gdb-set record full stop-at-limit off
737,156 16^done
737,156 (gdb)
737,156 17-gdb-set non-stop on
737,172 17^done
737,172 (gdb)
737,172 18-gdb-set auto-solib-add on
737,187 18^done
737,187 (gdb)
737,188 19-file-exec-and-symbols --thread-group i1 E:/McuXpresso/evkbimxrt1050_hello_world/Debug/evk\
bimxrt1050_hello_world.axf
737,249 19^done
737,249 (gdb)
737,250 20-interpreter-exec console "set non-stop on"
737,266 20^done
737,266 (gdb)
737,267 21-interpreter-exec console "set pagination off"
737,281 =cmd-param-changed,param="pagination",value="off"
737,281 21^done
737,281 (gdb)
737,281 22-interpreter-exec console "set mi-async"
737,297 22^done
737,297 (gdb)
737,298 23-interpreter-exec console "set remotetimeout 60000"
737,313 =cmd-param-changed,param="remotetimeout",value="60000"
737,313 23^done
737,313 (gdb)
737,353 24-target-select extended-remote | crt_emu_cm_redlink -msg-port=55734 -g -mi -2 -pMIMXRT1052\
xxxxB -vendor=NXP --connectscript=RT1050_connect.scp -ProbeHandle=1 -CoreIndex=0 -cache=disable --f\
lash-hashing --flash-driver= -x E:/McuXpresso/evkbimxrt1050_hello_world/Debug --flash-dir C:/nxp/MCU\
XpressoIDE_11.3.0_5222/ide/plugins/com.nxp.mcuxpresso.tools.bin.win32_11.3.0.202101111546/binaries/F\
lash --flash-dir E:/McuXpresso/.mcuxpressoide_packages_support/MIMXRT1052xxxxB_support/Flash --telne\
[message truncated to 5 lines. More lines can be set in the Preference->Debug->GDB eclipse preference page.]
739,656 =thread-group-started,id="i1",pid="42000"
739,656 =thread-created,id="1",group-id="i1"
739,656 *running,thread-id="1"
739,802 ~"\nProgram"
739,802 ~" stopped.\n"
739,820 ~"0x00215e8a in ?? ()\n"
739,820 *stopped,reason="signal-received",signal-name="0",signal-meaning="Signal 0",frame={addr="0x0\
0215e8a",func="??",args=[],arch="armv7e-m"},thread-id="1",stopped-threads=["1"]
739,820 24^connected
739,820 (gdb)
739,822 25-interpreter-exec console "set mem inaccessible-by-default on"
739,823 25^done
739,823 (gdb)
739,824 26-interpreter-exec console "mon ondisconnect cont"
739,845 26^done
739,845 (gdb)
739,846 27-interpreter-exec console "set arm force-mode thumb"
739,846 =cmd-param-changed,param="arm force-mode",value="thumb"
739,846 27^done
739,846 (gdb)
739,849 28-interpreter-exec console "set remote hardware-breakpoint-limit 6"
739,850 =cmd-param-changed,param="remote hardware-breakpoint-limit",value="6"
739,850 28^done
739,850 (gdb)
739,850 29set range-stepping on
739,851 &"set range-stepping on\n"
739,851 29^done
739,851 (gdb)
739,852 30-interpreter-exec console "mon semihost enable"
739,876 30^done
739,876 (gdb)
739,876 31-target-download
739,892 31+download,{section=".boot_hdr",section-size="8192",total-size="1779440"}
739,892 31+download,{section=".boot_hdr",section-sent="8192",section-size="8192",total-sent="8192",t\
otal-size="1779440"}
739,908 31+download,{section=".text",section-size="17948",total-size="1779440"}
739,909 31+download,{section=".data",section-size="104",total-size="1779440"}
740,391 32-list-thread-groups
740,586 31^done,address="0x600022f0",load-size="26244",transfer-rate="361360",write-rate="6561"
740,586 (gdb)
740,586 33-interpreter-exec console "mon SWO datasource"
740,586 32^done,groups=[{id="i1",type="process",pid="42000",executable="E:\\McuXpresso\\evkbimxrt105\
0_hello_world\\Debug\\evkbimxrt1050_hello_world.axf"}]
740,586 (gdb)
740,590 34-list-thread-groups i1
740,602 33^done
740,602 (gdb)
740,606 35-gdb-show --thread-group i1 language
740,618 34^done,threads=[{id="1",target-id="Thread 1",details="Runnable",frame={level="0",addr="0x60\
0022f0",func="ResetISR",args=[],file="../startup/startup_mimxrt1052.c",fullname="E:\\McuXpresso\\evk\
bimxrt1050_hello_world\\startup\\startup_mimxrt1052.c",line="638",arch="armv7e-m"},state="stopped"}]\

740,618 (gdb)
740,619 35^done,value="auto"
740,619 (gdb)
740,619 36-gdb-set --thread-group i1 language c
740,619 36^done
740,619 (gdb)
740,619 37-interpreter-exec --thread-group i1 console "p/x (char)-1"
740,620 ~"$1 = 0xff\n"
740,620 37^done
740,620 (gdb)
740,620 38-data-evaluate-expression --thread-group i1 "sizeof (void*)"
740,620 38^done,value="4"
740,620 (gdb)
740,621 39-gdb-set --thread-group i1 language auto
740,621 39^done
740,621 (gdb)
740,621 40-interpreter-exec --thread-group i1 console "show endian"
740,621 ~"The target endianness is set automatically (currently little endian)\n"
740,621 40^done
740,621 (gdb)
740,624 41-break-insert -t -h -f main
740,624 42-stack-info-depth --thread 1 11
740,665 41^done,bkpt={number="1",type="hw breakpoint",disp="del",enabled="y",addr="0x6000266e",func=\
"main",file="../source/hello_world.c",fullname="E:\\McuXpresso\\evkbimxrt1050_hello_world\\source\\h\
ello_world.c",line="36",thread-groups=["i1"],times="0",original-location="main"}
740,665 (gdb)
740,665 42^done,depth="1"
740,665 (gdb)
740,665 43-gdb-show --thread-group i1 new-console
740,666 43^error,msg="Undefined show command: \"new-console\". Try \"help show\"."
740,666 (gdb)
740,666 44-exec-continue --thread-group i1
740,666 44^running
740,666 *running,thread-id="1"
740,729 (gdb)
741,073 45-thread-info 1
741,097 46-thread-select 1
741,105 47-thread-select 1
741,153 45^done,threads=[{id="1",target-id="Thread 1",details="Running",state="running"}]
741,153 (gdb)
741,201 46^done,new-thread-id="1"
741,201 (gdb)
741,248 47^done,new-thread-id="1"
741,248 (gdb)

What's wrong??? 

0 Kudos
0 Replies