KW45 - LPSPI with DMA

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

KW45 - LPSPI with DMA

288 次查看
ArushThomas
Contributor III

Hi all,

I'm trying to implement simplex SPI transmissions with the KW45B41Z-EVK evaluation board. My goal is to perform fast SPI transmissions with DMA. The end goal is to drive an ILI9341 LCD display via the LPSPI1 peripheral.

The problem I face is that the SPI transaction length is longer than specified in software. When I try to transmit 4 bytes, there are 12 bytes on the bus. When I try to transmit 64 bytes, there are 72 bytes on the bus. What I found is that there are always 8 more bytes transmitted than I intend to transmit. This appears to be related to the 'bits per frame' field, which I had set to 8 previously. Changing it to 16, I see that there are always 16 more bytes transmitted on the bus than there should be. This, of course, causes buffer overflows. 

These same symptoms can be reproduced with both the  LPSPI_MasterTransferEDMALite() and the  LPSPI_MasterTransferEDMA() functions. The debugger shows that the bytesPerFrame value is 1, and therefore, I meet the conditions specified in the documentation.

I require help resolving this buffer overflow. I've attached the project directory, as Bringup_LPSPI_eDMA.zip

Thanks,

Arush

标记 (3)
0 项奖励
回复
3 回复数

196 次查看
luis_maravilla
NXP Employee
NXP Employee

Hello Arush,

 

Could you help us confirm if you are using an SDK examples as base? Does an SDK example in the latest version[25.06], can match your requirements for SPI DMA transmissions for example [kw45b41evk_lpspi_edma_b2b_transfer_master] ?

 

By any chance do you count with 2 KW4B4I-EVK boards?

 

Best Regards

Luis

0 项奖励
回复

181 次查看
ArushThomas
Contributor III

Hello,

I'm referring to the following example: [kw45b41zevk_lpspi_edma_b2b_transfer_master]. Both the example, and my own project, are on SDK version 25.06.00(890 2025-06-27)

I don't have a second EVK. I have been testing with an oscilloscope. These tests have been valid for blocking SPI transactions on this board, as well as past experience with different MCUs.

The example project does work correctly, it transmits exactly 64 bytes, as specified by the TRANSFER_SIZE macro. In my project, I'm doing all the peripheral configurations via the peripherals configuration tool. The initialization code is auto-generated by that tool, and runtime code follows the example's logic. I suspect the flaw is somewhere in here, but I can't quite find it.

As an aside; the peripherals tool workflow is what I've followed with the "S32DS for S32 Platform" and the "S32DS for ARM" IDEs. But none of the examples I've seen for MCUXpresso utilize the peripherals tool. Where might I find examples for KW45 that use the peripherals tool?

Thanks,

Arush

0 项奖励
回复

137 次查看
luis_maravilla
NXP Employee
NXP Employee

Hello,

Could you help us confirm if the peripherals tool you are referring is the one in MCUXpresso Config Tools?

For more information about this tool and the workflow for MCUXpresso please refer to [MCUXIDECTUG] chapter 5 and 5.3.  On this guide you could see the peripherals configuration

 

Please consider we do not recommend the usage of ConfigTools with the Wireless examples, as it could overwrite previous configurations needed for the wireless part.

 

Hope this help you!

Best Regards

Luis

0 项奖励
回复