Dear forum members,
We followed RT1170-EVK schematic design and enabled octal flash by adjusting the resistors.
Then we built the iled_blinky demo app with flexspi_nor_debug build type, then I loaded my app through gdb/openocd/DAPlink tools without seeing any errors. However, when I traced the app in gdb, I found that my break point at main() entrance didn't hit. This tells that the flashing process might failed silently.
Does anyone know how to use the octal flash?
Regards,
Yanfeng
Solved! Go to Solution.
Hi @yfliu ,
Don't worry, your issues should in the project FCB modification, and the flashdriver.
Do you use the MCUXPresso IDE SDK project?
If yes, I will share one project to you which I have tested on my MIMXRT1170-EVK board with the octal flash.
1. Hardware modification
OPTION2: USE Octal Flash( Mount R381/R378/R382/R389/R402/R377/R388/R391, DNP R380/R399/R386/R390/R392/R385)
2. Software
Please check my attached project.
I can make the octal flash works on my side.
Best Regards,
kerry
Dear @kerryzhou
Thanks for your promtly reply.
Sorry I am not using IDE as I must use GCC toolchain and cmake on Linux for development. To use the on-board debug probe, I am using JLink LPCXrepsso firmware on the probe and JLinkGDBServer v6.98+ on host side.
For example, I seemed can program the iled_blinky app to the target via JLinkGDBServer:
SEGGER J-Link GDB Server V6.98e GUI Version JLinkARM.dll V6.98e (DLL compiled Mar 29 2021 14:18:39) -----GDB Server start settings----- GDBInit file: none GDB Server Listening port: 2331 SWO raw output listening port: 2332 Terminal I/O port: 2333 Accept remote connection: yes Generate logfile: on Verify download: on Init regs on start: on Silent mode: off Single run mode: off Target connection timeout: 5000 ms ------J-Link related settings------ J-Link Host interface: USB J-Link script: none J-Link settings file: none ------Target related settings------ Target device: MIMXRT1176xxx8_M7 Target interface: SWD Target interface speed: 4000kHz Target endian: little Connecting to J-Link... J-Link is connected. Firmware: J-Link LPCXpresso V2 compiled Aug 23 2021 09:30:06 Hardware: V1.00 S/N: 726558173 Checking target voltage... Target voltage: 3.30 V Listening on TCP/IP port 2331 Connecting to target... Connected to target Waiting for GDB connection...Connected to 192.168.116.132 Reading all registers Read 4 bytes @ address 0x00000000 (Data = 0x20040000) Read 2 bytes @ address 0x00000000 (Data = 0x0000) Downloading 512 bytes @ address 0x30000400 - Verified OK Downloading 48 bytes @ address 0x30001000 - Verified OK Downloading 1024 bytes @ address 0x30002000 - Verified OK Downloading 15968 bytes @ address 0x30002400 - Verified OK Downloading 9124 bytes @ address 0x30006260 - Verified OK Downloading 8 bytes @ address 0x30008604 - Verified OK Downloading 4 bytes @ address 0x3000860C - Verified OK Downloading 4 bytes @ address 0x30008610 - Verified OK Downloading 100 bytes @ address 0x30008614 - Verified OK Writing register (PC = 0x300024bc) Read 4 bytes @ address 0x300024BC (Data = 0x4816B672) Read 2 bytes @ address 0x300024BC (Data = 0xB672) Reading 64 bytes @ address 0x30002BC0 Read 2 bytes @ address 0x30002BE4 (Data = 0xF000) Setting breakpoint @ address 0x30002BE4, Size = 2, BPHandle = 0x0001 Starting target CPU... ...Breakpoint reached @ address 0x30002BE4 Reading all registers Removing breakpoint @ address 0x30002BE4, Size = 2 Read 4 bytes @ address 0x30002BE4 (Data = 0xF9C2F000) Reading 64 bytes @ address 0x00000000 Performing single step... ...Breakpoint reached @ address 0x30002F6C Reading all registers Setting breakpoint @ address 0x30002BE4, Size = 2, BPHandle = 0x0002 Starting target CPU...
However, when I set a break point at main() entrance in gdb, the breakpoint can't be reached as expected. I also tried to use step-by-step debugging in gdb, I saw the app started from "ResetHandler" in the "startup_MIMXRT1176_cm7.S" module. However, somehow the program can't make its journey to the main() function.
So it will be nice if you can teach me how to download apps to Octal flash via JLink tools as well.
Regards,
yf
Hi @yfliu ,
Seems you are from china.
If you want to use JLINK, you can use our RT-UFL to download the code to the octal flash, more details, please check the following link:
https://www.cnblogs.com/henjay724/p/13951686.html
https://www.cnblogs.com/henjay724/p/14942574.html
To your app code, the FCB area, still use my previous attached code:
evkmimxrt1170_flexspi_nor_config.c
Best Regards,
Kerry
Thanks a lot for all the informaiton. So far we have verified that your octal flash sample works here on our RT110-EVK board and MCUXpress IDE tool.
We still need more time to verify your answer about JLink programming of Octal flash. I am still digesting the CSND blog posts you shared and trying to collect the tools.
To better understand the whole picture, could you please teach me:
So if my understanding is correct, my Jlink test session shared above might have correctly programmed the Octal flash device (as it claimed verifications all passed), but because my app lacks the correct XIP driver for Octal flash thus couldn't boot successfully into the main() function?
Regards,
yf
Hi @yfliu ,
Do you need debug the code or not?
If you even don't need debug, you can use the MCUBootUtility tool download code in serial download mode directly.
If you want to use the JLINK debug the code, you need to use the RT-UFL which I recommend you, that flashdriver will help you download code to the octal flash with JLINK.
to the .cfx in the MCUXPresso IDE, it is used for the CMSIS DAP debugger, as you know, the MIMXRT1170-EVK on board debugger is the CMSIS-DAP in default.
Answer your questions:
=>Answer: it is the FCB for the app, the RT1170 need to use the FCB to configure the external flash, which is used by the ROM, if the FCB in the XIP is not correct, you can't boot, that's why your previous method can't work, and my modified code works OK.
=>Answer: .cfx is the flashdriver used by the CMSIS DAP debugger in the MCUXPresso IDE. If you want to use the JLINK, refer to the blog which I recommend you, you need let the IDE call the JLINK driver which is select the flashdriver as the RT-UFL which can support octal flash.
Wish it helps you!
Best Regards,
kerry
Dear @kerryzhou ,
I tried UFL package with JLink 7.66 on Ubuntu but was not successful yet, please see attached jlink-octal-err.txt file for details.
Yet another question I have regarding the FCB thing, I noticed that there are different versions for the "boards/evkmimxrt1170/xip/evkmimxrt1170_flexspi_nor_config" files:
As you explained, these definitions are needed by the ROM to support XIP feature. As the ROM is not linked to our app program, thus variable names doesn't matter but the storage locations of these definition block need be known by the ROM, right? Is there a 2.0.1 version definition for octal flash?
Regards,
Yanfeng
Hi @yfliu ,
You must use my code to download, as I have modify it to the octal flash. to the default SDK, it is the QSPI flash, even you download it, you can't boot it.
Do you have JFLASH, I highly recommend you use the Jflash download my project generated .bin code, that should work!
BTW, we are testing the RT-UFL in the windows system, so you can test it on the windowns system at first, make sure it works on your platform, then you can try your Ubuntu, just check whether it is related to the PC OS.
Best Regards,
Kerry
Yes I was using "evkmimxrt1170_flexspi_nor_config.c" and header file from the package you shared to build my app.
I don't have JFlash here as I am using the on-board JLink probe, not standalone JLink probe hardware.
I tried RT-UFL with JLink 6.98e on Windows and it still doens't work, see jlink-err-octal-win.log for details.
Do you know if RT-UFL supports onboard JLink probe firmware?
Regards,
yf
Hi @yfliu ,
You may misunderstand the JFLASH, JFLASH is the JLINK software.
But JFLASH need the JLINK plus to support it, normal JLINK may don't have license.
RT-UFL can support the JLINK, if you check the link which I share with previously.
https://www.cnblogs.com/henjay724/p/14942574.html
More link, please check here:
https://www.cnblogs.com/henjay724/
All in Chinese, you can read it directly.
Best Regards,
Kerry
Kerry,
I just tried with Windows version JLink and updated my above ticket.
Not sure if you noticed, I have been using JLink OB in my test, thus I know I can't use JFlash tool due to license limitations.
I've read RT-UFL blogs already and I've downloaded the RT-URL-master.zip package from github and followed the blog to patch my JLink installation during my test. If you check my error logs, you can see that I connected JLinkGDBServer with the xxx-UFL_L0 device as suggested by the blog.
It will be nice if you can share me detaled versions of the following tools you are using there:
It will be nice if you can share a copy of your JLinkGDBServer log so that I can compare it with mine.
Regards,
yf
Hi @yfliu ,
The new version also works OK, just follow jay's blog, it will guide you, it's better to associate with the IDE, eg, MCUXPresso IDE to test it, if you can't use the Jflash.
Best Regards,
Kerry
Kerry,
Are you using the onboard Jlink probe or using a standalone probe?
Regards,
yf
Hi @yfliu
Onboard JLINK should also works, I have tested the RT-UFL with the on board JLINK in other RT board, eg, RT10XX.
So, you can follow the blog to test it, if meet any issues, let me know your log and test result.
best Regards,
Kerry
Thank you for confirming that JLink OB probe works at your side, that is really good.
I've provided multiple JLinkGDBServer log files in this conversation before, and I am attaching my build.log, latest Jlink OB programming log and my binary file here for your review, please check "jlinkob-octal-logs.tgz". From my JLinkGDB logs, it seems that I can't download the .elf program to octal flash via JLink OB.
Please let me know if you need more information.
Regards,
Yanfeng
Hi @yfliu ,
Your log, I find you even can't find the ARM core.
Please check your board power, and it's better to test it on the windows system, as my side also using the windows and no linux for testing now.
I think, you can use the windows test it with JLINK, after it works, then you can check linux again, then at least your board and tool works OK.
In windows, you can test with jlinkdriver, and the MCUXPresso IDE. Just follow the above blog which I share with you.
Best Regards,
Kerry
Can you please teach more details about "Your log, I find you even can't find the ARM core."? I acutally can use the same JLinkGDBServer link to load my program to RAM and run it correctly. So it is hard for me to understand from which log you got that conclusion.
I don't have Windows IDE to try here, but I tried JLink v7.66a on Windows and met similar Error: failed to erase flash, please see attached log file "jlink-win-v7.66a-octal-err.txt" for JLinkGDBServer console window log and "JLinkGDBServer.zip" for more detailed log generated by JLinkGDBServer tool.
I guess that IDE or command line is not the key factor, as RT-UFL is following JLink protocols to support new flash device types.
Regards,
yf
Hi @yfliu ,
Do you work this issue for your company?
If yes, I highly recommend you use the company email to create the account and create the question post, then we can put more time to help you. As the qq.com is the lowest level, normally, we just give you some guide, if you need more test result, please use the company email to ceate th question.
You also can use the JLINK command to connect your board, check whether you can find the ARM core or not.
Best Regards,
kerry