Implementing SAI module to a lvgl_guider project

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Implementing SAI module to a lvgl_guider project

998 次查看
daniJVV
Contributor III

Hello,

I'm using a custom board with a evkmimxrt1170_lvgl_guider_bm_cm7 example project modified and working with our screen. Also got working a evkmimxrt1170_sai_cm7 example project with a codec and a speaker. Both projects are working OK separately with some modifications in code.

Now I'm facing some problems with the integration of SAI module on the lvgl guider project.

Comenting the init code of SAI, the screen is working OK, but when I try the code of SAI module, I only can get working comenting the LVGL code and changing the memory mapping.

 

This is the memory mapping for a screen visualization:

Capturaaaa.PNG


For get the SAI code working, I need to move the SRAM_DTC_cm7 to the first RAM position:

Captur1a.PNG

I think I'm having a cache/allocation problem with some variables.

This is the build of the audio code:

daniJVV_0-1706269275772.png

This one is with both screen and audio code, with an overflow:

daniJVV_1-1706269461842.png

And this is changing the order in memory, compiling OK but audio not working:

daniJVV_2-1706269610860.png

 

More information:
When I debug the SAI code with the LVGL memory mapping, I get stucked when reproducing audio on RecordSDCard function, because when txCallback is called the I2S structure has value 0, and the variables on the previous function are lost.

Variables and I2C values before callback:

daniJVV_0-1706103289957.png

After callback:

daniJVV_1-1706103404768.png

Could you give me some information about what's happening?

Thank you very much!

 

0 项奖励
回复
1 回复

927 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @daniJVV,

I would highly recommend using the SLN-TLHMI-IOT example codes as reference, since these codes already implement LVGL and SAI features on the i.MX RT1170, and do a proper handling of the memory map that you can refer to. You can find the example codes on the following GitHub: GitHub - NXP/mcu-smhmi

BR,
Edwin.

0 项奖励
回复