Debug problems with FlexSPI2 on i.MX RT1171

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

Debug problems with FlexSPI2 on i.MX RT1171

Jump to solution
2,555 Views
BRK_Y
Contributor III

Hello,

iMX RT1171 SDK v2.15.1 was used for the linker, startup, and driver files.

External Flash is connected with FlexSPI2 - A pins.

For this reason, the flash base address in the linker has been updated to 0x60000000.

FLEXSPI_INSTANCE is set to 2 with the help of GPIO pins.

FLEXSPI_PIN_GROUP_SEL = 1 and FLASH_CONNECTION_SEL = 0 efuses are set.

At this stage, I have no problem writing to external flash. When I read it after writing, it was seen that there were spi configurations at 0x60000400.

However, when I start debugging, it branches to different unknown points. What could be my problem here? Can you explain the steps I should check?

  • Should I burn fuses like FLEXSPI_PIN_GROUP_SEL and FLASH_CONNECTION_SEL to help set up FlexSPI-2?
  • Is there a place I need to update in the linker and startup in imx1171 SDK v2.15.1?
0 Kudos
Reply
1 Solution
2,457 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @BRK_Y ,

 

There are technical sharing on this topic, please kindly refer to the following links for details.

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/i-MX-RT-FLEXSPI-booting-guide/ta-p/1669262

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1170-flexSPI1-secondary-QSPI-flash-debug-flash... 

 

Hope that helps,

 

Have a great day,
Kan


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

View solution in original post

0 Kudos
Reply
4 Replies
2,519 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @BRK_Y ,

 

If I understand correctly , your application can run standalone without any issue but failed to debug with it, right?

Was the application running in XIP mode or not? Was the boot mode configure by GPIO or eFuse? Please kindly clarify.

 

Have a great day,
Kan


-------------------------------------------------------------------------------
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
2,472 Views
BRK_Y
Contributor III

Hi @Kan_Li,

The external flash I use is different from the eval-board external flash. For this reason, I need to change the settings in the flexspi_nor_config file. Can you give me flexspi_nor_config.c configurations or documentation that explains how to configure according to my external flash?

 

BrK__0-1715581351290.pngBrK__1-1715581379946.png

 

0 Kudos
Reply
2,458 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @BRK_Y ,

 

There are technical sharing on this topic, please kindly refer to the following links for details.

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/i-MX-RT-FLEXSPI-booting-guide/ta-p/1669262

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT1170-flexSPI1-secondary-QSPI-flash-debug-flash... 

 

Hope that helps,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
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
2,508 Views
BRK_Y
Contributor III

Hi @Kan_Li,

If I were to give information about my latest situation:

  • I can now work in debug mode.
  • I made some edits to the Flexspi_nor_config.c file; I activated QEN and set serialclkfreq to 50mhz.
  • I set the gpio to FLEXSPI INSTANCE 2. I set the FLEXSPI_PIN_GROUP_SEL bit of the 0x9a0 flexspi nor efuse and burnt it.
  • I defined XIP_BOOT_HEADER_ENABLE=1.
  • I updated the flash base addresses in the linker to start from 0x60000000.
  • I am working in internal boot mode.

In this case, I expect it to work in XIP mode and now I can debug it.

But my current problem is that when I turn the power of my microcontroller off and on, my code does not run. I observed it with the debug LED I put in the code.

I think the problem here may be that it goes into serial downloader mode due to an error during the rom bootloader.

What should I check or is there a fuse I should use or a flexspi configuration I should change?

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1860658%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EDebug%20problems%20with%20FlexSPI2%20on%20i.MX%20RT1171%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1860658%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EiMX%20RT1171%20SDK%20v2.15.1%20was%20used%20for%20the%20linker%2C%20startup%2C%20and%20driver%20files.%3C%2FP%3E%3CP%3EExternal%20Flash%20is%20connected%20with%20FlexSPI2%20-%20A%20pins.%3C%2FP%3E%3CP%3EFor%20this%20reason%2C%20the%20flash%20base%20address%20in%20the%20linker%20has%20been%20updated%20to%200x60000000.%3C%2FP%3E%3CP%3EFLEXSPI_INSTANCE%20is%20set%20to%202%20with%20the%20help%20of%20GPIO%20pins.%3C%2FP%3E%3CP%3EFLEXSPI_PIN_GROUP_SEL%20%3D%201%20and%20FLASH_CONNECTION_SEL%20%3D%200%20efuses%20are%20set.%3C%2FP%3E%3CP%3EAt%20this%20stage%2C%20I%20have%20no%20problem%20writing%20to%20external%20flash.%20When%20I%20read%20it%20after%20writing%2C%20it%20was%20seen%20that%20there%20were%20spi%20configurations%20at%200x60000400.%3C%2FP%3E%3CP%3EHowever%2C%20when%20I%20start%20debugging%2C%20it%20branches%20to%20different%20unknown%20points.%20What%20could%20be%20my%20problem%20here%3F%20Can%20you%20explain%20the%20steps%20I%20should%20check%3F%3C%2FP%3E%3CUL%3E%3CLI%3EShould%20I%20burn%20fuses%20like%20FLEXSPI_PIN_GROUP_SEL%20and%20FLASH_CONNECTION_SEL%20to%20help%20set%20up%20FlexSPI-2%3F%3C%2FLI%3E%3CLI%3EIs%20there%20a%20place%20I%20need%20to%20update%20in%20the%20linker%20and%20startup%20in%20imx1171%20SDK%20v2.15.1%3F%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1865222%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Debug%20problems%20with%20FlexSPI2%20on%20i.MX%20RT1171%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1865222%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F210673%22%20target%3D%22_blank%22%3E%40BrK_%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThere%20are%20technical%20sharing%20on%20this%20topic%2C%20please%20kindly%20refer%20to%20the%20following%20links%20for%20details.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-RT-Knowledge-Base%2Fi-MX-RT-FLEXSPI-booting-guide%2Fta-p%2F1669262%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-RT-Knowledge-Base%2Fi-MX-RT-FLEXSPI-booting-guide%2Fta-p%2F1669262%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-RT-Knowledge-Base%2FRT1170-flexSPI1-secondary-QSPI-flash-debug-flashdriver%2Fta-p%2F1761851%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-RT-Knowledge-Base%2FRT1170-flexSPI1-secondary-QSPI-flash-debug-flashdriver%2Fta-p%2F1761851%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHope%20that%20helps%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHave%20a%20great%20day%2C%3CBR%20%2F%3EKan%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3ENote%3A%3CBR%20%2F%3E-%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22Mark%20Correct%22%20button.%20Thank%20you!%3CBR%20%2F%3E-%20We%20are%20following%20threads%20for%207%20weeks%20after%20the%20last%20post%2C%20later%20replies%20are%20ignored%3CBR%20%2F%3EPlease%20open%20a%20new%20thread%20and%20refer%20to%20the%20closed%20one%2C%20if%20you%20have%20a%20related%20question%20at%20a%20later%20point%20in%20time.%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1864089%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Debug%20problems%20with%20FlexSPI2%20on%20i.MX%20RT1171%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1864089%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F59276%22%20target%3D%22_blank%22%3E%40Kan_Li%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EThe%20external%20flash%20I%20use%20is%20different%20from%20the%20eval-board%20external%20flash.%20For%20this%20reason%2C%20I%20need%20to%20change%20the%20settings%20in%20the%20flexspi_nor_config%20file.%20Can%20you%20give%20me%20flexspi_nor_config.c%20configurations%20or%20documentation%20that%20explains%20how%20to%20configure%20according%20to%20my%20external%20flash%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrK__0-1715581351290.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22BrK__0-1715581351290.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F278382iB963F45552C7BA2E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22BrK__0-1715581351290.png%22%20alt%3D%22BrK__0-1715581351290.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BrK__1-1715581379946.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22BrK__1-1715581379946.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F278383iEF5CC8784DA122D7%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22BrK__1-1715581379946.png%22%20alt%3D%22BrK__1-1715581379946.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1862749%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Debug%20problems%20with%20FlexSPI2%20on%20i.MX%20RT1171%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1862749%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F59276%22%20target%3D%22_blank%22%3E%40Kan_Li%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EIf%20I%20were%20to%20give%20information%20about%20my%20latest%20situation%3A%3C%2FP%3E%3CUL%3E%3CLI%3EI%20can%20now%20work%20in%20debug%20mode.%3C%2FLI%3E%3CLI%3EI%20made%20some%20edits%20to%20the%20Flexspi_nor_config.c%20file%3B%20I%20activated%20QEN%20and%20set%20serialclkfreq%20to%2050mhz.%3C%2FLI%3E%3CLI%3EI%20set%20the%20gpio%20to%20FLEXSPI%20INSTANCE%202.%20I%20set%20the%20FLEXSPI_PIN_GROUP_SEL%20bit%20of%20the%200x9a0%20flexspi%20nor%20efuse%20and%20burnt%20it.%3C%2FLI%3E%3CLI%3EI%20defined%20XIP_BOOT_HEADER_ENABLE%3D1.%3C%2FLI%3E%3CLI%3EI%20updated%20the%20flash%20base%20addresses%20in%20the%20linker%20to%20start%20from%200x60000000.%3C%2FLI%3E%3CLI%3EI%20am%20working%20in%20internal%20boot%20mode.%3C%2FLI%3E%3C%2FUL%3E%3CP%3EIn%20this%20case%2C%20I%20expect%20it%20to%20work%20in%20XIP%20mode%20and%20now%20I%20can%20debug%20it.%3C%2FP%3E%3CP%3EBut%20my%20current%20problem%20is%20that%20when%20I%20turn%20the%20power%20of%20my%20microcontroller%20off%20and%20on%2C%20my%20code%20does%20not%20run.%20I%20observed%20it%20with%20the%20debug%20LED%20I%20put%20in%20the%20code.%3C%2FP%3E%3CP%3EI%20think%20the%20problem%20here%20may%20be%20that%20it%20goes%20into%20serial%20downloader%20mode%20due%20to%20an%20error%20during%20the%20rom%20bootloader.%3C%2FP%3E%3CP%3EWhat%20should%20I%20check%20or%20is%20there%20a%20fuse%20I%20should%20use%20or%20a%20flexspi%20configuration%20I%20should%20change%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1862348%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Debug%20problems%20with%20FlexSPI2%20on%20i.MX%20RT1171%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1862348%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F210673%22%20target%3D%22_blank%22%3E%40BrK_%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EIf%20I%20understand%20correctly%20%2C%20your%20application%20can%20run%20standalone%20without%20any%20issue%20but%20failed%20to%20debug%20with%20it%2C%20right%3F%3C%2FP%3E%0A%3CP%3EWas%20the%20application%20running%20in%20XIP%20mode%20or%20not%3F%20Was%20the%20boot%20mode%20configure%20by%20GPIO%20or%20eFuse%3F%20Please%20kindly%20clarify.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHave%20a%20great%20day%2C%3CBR%20%2F%3EKan%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3ENote%3A%3CBR%20%2F%3E-%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22Mark%20Correct%22%20button.%20Thank%20you!%3CBR%20%2F%3E-%20We%20are%20following%20threads%20for%207%20weeks%20after%20the%20last%20post%2C%20later%20replies%20are%20ignored%3CBR%20%2F%3EPlease%20open%20a%20new%20thread%20and%20refer%20to%20the%20closed%20one%2C%20if%20you%20have%20a%20related%20question%20at%20a%20later%20point%20in%20time.%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E