How do I operate FlexSPI flash while using a USB sound card?(I.MX RT102x)

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

How do I operate FlexSPI flash while using a USB sound card?(I.MX RT102x)

1,063 Views
jarman_zhou
Contributor I

Hi,I ran the evkmimxrt1020_dev_composite_hid_audio_unified_freertos test with only the SDK, but I added the flexSPI flash to the project, which caused the program to crash. However, if you turn on USB or FlexSPI alone, it will work fine!image_err.jpg

0 Kudos
6 Replies

1,050 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @jarman_zhou 

Please monitor the usage of internal SRAM while enabling both peripherals . How much usage of SRAM DTC do you get?

Test moving  FlexSPI  code to run in a different SRAM area. You can use the linker scripts for that. 

 Also, let me you using any of our EVKs.

Best regards, 

Diego

0 Kudos

1,046 Views
jarman_zhou
Contributor I

Hi,Diego

I used IMXRT1021-EVKB to run the USB sample program in the SDK_2_11_0_EVK-MIMXRT1020, which is normal. However, after I added the code of FlexSPI to this project, the FLASH program would crash when the USB sound card was started. I checked the SRAM DTC and tried other SRAM, and the phenomenon was the same.

thank you.

0 Kudos

971 Views
diego_charles
NXP TechSupport
NXP TechSupport

 Hi @jarman_zhou 

Thanks for your reply and for your patience. 

Would you be able to see if disabling the interrupts before  and after the FlexSPI routines makes a difference?

Best regards, 

Diego

 

0 Kudos

969 Views
jarman_zhou
Contributor I

Hi @diego_charles

I've tried disabling and turning on global interrupts before and after FLASH(__disable_irq/__enable_irq), but this causes a stuttering or stalling of USB audio, which is obviously not what I want.

Best regards, 

Jarman

0 Kudos

934 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @jarman_zhou 

Thanks for your reply!

I am glad that we are narrowing the issue. Per your description it sounds that the USB sound card can not work properly if interrupts are disabled during  FlexSPI in application programming. For example, a function like USB_DeviceCallback may  not be called when expected.

I would ty to avoid having USB and FlexSPI IAP working at the same time, mainly because the FlexSPI IAP takes quite some time in comparison. But per my experience comes down to implementation requirements.

Diego

0 Kudos

928 Views
jarman_zhou
Contributor I

Hi,@diego_charles

Thanks for your reply!

It may not be just disabling global interrupts. For example, when I erase FLASH, other system interrupts block because it takes 100 milliseconds to erase a sector, which affects the response of other interrupts such as timers. However, this has a significant impact on our production application.

How do I solve the problem of erasing flash without affecting other interrupt responses? Can you provide a solution?

Best regards, 

Jarman

0 Kudos