Code integration issue with lpuart and flexspi with MXRT1020

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

Code integration issue with lpuart and flexspi with MXRT1020

1,017 Views
Shealtiel
Contributor II

I'm integrating flexspi nor polling code in lpuart interrupt handler code (my base code), I'm facing issue here while debugging it is going into hard fault error in flexspi_nor_flash_init(EXAMPLE_FLEXSPI);

can you please check this issue because i don't see any changes in configuration.

Board: IMXRT1020, I'm using latest SDK example code.

Thanks,

Shealtiel

0 Kudos
Reply
8 Replies

1,001 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @Shealtiel 

Can you use a debugger like SEGGER J-Link debugger to set breakpoints and step through your code?

This will allow you to see exactly where the program is failing.

Or add print statements in your code to output the values of variables and the status of operations.

This can help you identify where things start to go wrong.

Hope this will help you.

BR

Hang

0 Kudos
Reply

985 Views
Shealtiel
Contributor II

I'm getting 0x3 fault (interrupt program  status register) and getting hang in 

FLEXSPI_Init(base, &config);

 

 

Thanks

Shealtiel

0 Kudos
Reply

964 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @Shealtiel 

I tried to reproduce your question. I add FLEXSPI related files based on lpuart_interrupt_transfer example.

And i add flexspi_nor_flash_init(FLEXSPI) in the lpuart interrupt function. I did not add flexspi related pin initialization.

You can refer to the picture.

HangZhang_0-1718264996883.png

It can work without any mistakes.

HangZhang_1-1718265244939.png

 

So I think there may be some issues with your code, please double check it.

Hope this will help you.

BR

Hang

0 Kudos
Reply

958 Views
Shealtiel
Contributor II

Shealtiel_0-1718268636690.png

Still I'm facing same issue, Attached the code which I was trying. And I didn't understood ( I did not add flexspi related pin initialization)

Thanks,

Shealtiel

0 Kudos
Reply

937 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @Shealtiel 

I tested  your project on my board. I have encountered the same issue as you. And I ported the code in my own project. The same code works on IAR but not on MCUXpresso.  I will investigate this issue.

There are two workaround.

You can run your project using IAR IDE.

Or you can add lpuart polling code in flexspi_polling example on MCUXpresso.

HangZhang_0-1718337004094.png

 

 I have tested both methods and they can work.

And i will continue investigate the issue.

Hope this will help you.

BR

Hang

0 Kudos
Reply

930 Views
Shealtiel
Contributor II

Hi @Harry_Zhang 

Thank you for the quick response.

I have tried merging Lpuart code into flexspi code but I'm using custom board there I'm facing issue in Lpuart I'm not able to receive or transmit the data and it hangs in PRINTF debug console.

But separately when I check Lpuart and flexspi both are working, Facing issue after merging the code in custom board.

Checked all the register, pins, schematic all are proper.

But it works in EVK-MIMXRT1020.

Thanks

Shealtiel

0 Kudos
Reply

917 Views
Shealtiel
Contributor II

Hi @Harry_Zhang 

Can you send the IAR IDE working code so that I can also try it from my side.

Thank you 

Shealtiel

0 Kudos
Reply

856 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @Shealtiel 

This is the iar project, you can try it.

BR

Hang

0 Kudos
Reply