How to program hyperflash S26KS512 on rt1170 with JLink

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

How to program hyperflash S26KS512 on rt1170 with JLink

Jump to solution
3,420 Views
yalin
Contributor II
We have a board of rt1170 with an external hyperflash S26KS512, but I can't download project by the RT-UFL driver using MCUXpresso IDE, can you help give us some suggestion about it? The following are steps I download project referred to the old case about octal flash programming https://community.nxp.com/t5/i-MX-RT/How-to-program-rt1170-evk-octal-flash-with-JLink/m-p/1499097#M. 1. Download RT-UFL-master.zip from https://github.com/JayHeng/RT-UFL; 2. Copy RT-UFL-master\algo\SEGGER\JLink_Vxxx to my C:\Program Files\SEGGER\JLink; 3. Import the project evkmimxrt1170_iled_blinky_cm7 to workspace, replace evkmimxrt1170_flexspi_nor_config.c and evkmimxrt1170_flexspi_nor_config.h by evkbimxrt1050_flexspi_nor_config.c and evkbimxrt1050_flexspi_nor_config.h because there is hyperflash configuration on rt1050; 4. Modify flash driver to MIMXRT1170_UFL_L1/L2 in Jlink debugger configuration. 5. Debug the project. However, I can't download the project normally, I also tried replacing fsl_flexspi_nor_boot.h and fsl_flexspi_nor_boot.c of rt1170 by the files of rt1050, but it didn't work. The project will break at different address and then break at address "0xdeadbeee". So, can you help check the following questions? 1. Is the configuration in evkbimxrt1050_flexspi_nor_config.c suitable for the hyperflash S26KS512 on rt1170? 2. Can the driver MIMXRT1170_UFL_L1/L2 work normally for the hyperflash S26KS512 on rt1170? 3. Is there any configuration I omit? Thanks.
0 Kudos
Reply
1 Solution
3,346 Views
jay_heng
NXP Employee
NXP Employee

1. evkbimxrt1050_flexspi_nor_config.c is suitable for the hyperflash S26KS512 on rt1170

2. It should be MIMXRT1170_UFL_L2 for the hyperflash S26KS512

 

You can set boot mode to 2'b01 - SDP mode, then try again.

View solution in original post

0 Kudos
Reply
13 Replies
3,410 Views
jay_heng
NXP Employee
NXP Employee

Are you following below two blogs to use UFL?

超级下载算法RT-UFL v1.0发布,附J-Link下安装教程
超级下载算法RT-UFL v1.0在MCUXpresso IDE下的使用

What is the FlexSPI pin connection to S26KS512 in your board?

 

3,376 Views
yalin
Contributor II

Hi @jay_heng,

Do you have any idea about my recent reply? Or can you help provide the right hyperflash configration of S26KS512 in rt1170 XIP and the sutiable .cfx file for S26KS512 of rt1170?

Thanks.

0 Kudos
Reply
3,403 Views
yalin
Contributor II

Hi @jay_heng,

Thanks for support.

The FlexSPI pin connection to S26KS512 on my board is like the following picture shows.

pinpin

I followed your blogs to use UFL, just like the discription I mentioned before, I also tried Jlink download but failed, and when I tried to read back the flash, it also failed. The result is like the following.

download_errordownload_error

read_back_errorread_back_error

I think the problem may come from the complied bin or the hyperflash driver, can you help check the following questions?

1. Is the configuration in evkbimxrt1050_flexspi_nor_config.c suitable for the hyperflash S26KS512 on rt1170?

2. Can the driver MIMXRT1170_UFL_L1/L2 work normally for the hyperflash S26KS512 on rt1170?

3. Is there any configuration I omit?

Thanks.

0 Kudos
Reply
3,347 Views
jay_heng
NXP Employee
NXP Employee

1. evkbimxrt1050_flexspi_nor_config.c is suitable for the hyperflash S26KS512 on rt1170

2. It should be MIMXRT1170_UFL_L2 for the hyperflash S26KS512

 

You can set boot mode to 2'b01 - SDP mode, then try again.

0 Kudos
Reply
3,324 Views
yalin
Contributor II

Hi @jay_heng 

I have a question that whether setting boot mode to 2'b01 and programing flash with JLink is exact SDP mode, or setting boot mode to 2'b01 and programing flash with UART/USB is just exact SDP mode, as I notice this discription in "i.MX RT1170 Processor Reference Manual".

sdp.png

What's more, my board enter an error state that even ram can't be programed, and I guess it is because of some wrong flash programing tests. How can I make the board restore to the initial state that I can program the ram for debug at least before I can program the flash normally? It's important to point out that I don't have UART/USB to enter SDP mode, and I just have JLink now. So is there any software or hardware method to restore it?

Thanks.

0 Kudos
Reply
3,310 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @yalin  ,
Thanks for your reply.
Can the Jlink be able to detect the core in Jlink commander either the BOOT_MODE[1:0]= 01 or other settings?
Have a great day,
TIC

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

0 Kudos
Reply
3,306 Views
yalin
Contributor II

Hi @jeremyzhou 

Thanks for support.

Actually Jlink can be able to connect. And with Jlink, I can program the ram when setting boot mode to 2'b01 now, but can't program the ram in internal boot mode, I think this may be because of some wrong flash programing tests. And I can't program the flash still in either 2'b01 or internal boot mode just with Jlink.

So in my situation, without UART or USB,

1.Is there any way to restore my board to the initial state that I can program the ram in internal boot mode?

2.Is there other way to program my flash just with Jlink beside the ways mentioned before?

Thanks.

0 Kudos
Reply
3,299 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
I'd like to suggest two ways to recover, the first way is trying to trigger the enter debug action after setting boot mode to 2'b01, for instance, debug a hello_world demo, etc.
Next, you can try to load a demo code in the ram when setting boot mode to 2'b01, and the demo code should be able to erase the blocks of hyperflash S26KS512.
Please give it a try.
Have a great day,
TIC

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

0 Kudos
Reply
3,295 Views
yalin
Contributor II

Hi @jeremyzhou 

As I know that triggering the debug action when setting boot mode to 2'b01 with UART can restore the board from a flash error state, should this method be effective with Jlink theoretically?

I'm sorry but I have tried the two methods you mentioned when setting boot mode to 2'b01 with Jlink, after that I can't program the ram in internal boot mode also.

Can you help check that?

Thanks.

0 Kudos
Reply
3,268 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @yalin ,
Thanks for your reply.
Please refer to the attached demo, then try to load a demo code into RAM to run for erasing S26KS512.
Have a great day,
TIC

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

0 Kudos
Reply
3,137 Views
yalin
Contributor II

@jeremyzhou 

Thanks for your support.
I have a test board with uart now and try to flash it with MCU Boot Utility, but it failed when click "configure boot device" as the picture shows.

configure boot device errorconfigure boot device error

The boot device configuration is like the following.

boot device configurationboot device configuration

And I switch the BOOT_CFG[9] to ON according to the following discription in MIMXRT1170-EVK schematic.

boot_cfgboot_cfg

So is the boot_cfg right for hyperflash? Or is there any hardware signal to check?

Thanks.

0 Kudos
Reply
3,126 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
Firstly, I was wondering if you can share the schematic of this board,
next, please use the
evkbimxrt1050_flexspi_hyper_flash_polling_transfer demo to try to access the Hyperflash,
lastly, can you upload the log of the MCU Boot Utility.
Have a great day,
TIC

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

0 Kudos
Reply
3,086 Views
yalin
Contributor II

@jeremyzhou 

Thanks for support.
There is a hardware issue on my board, and I can program the hyperflash after fixing it.