LPSPI is only working when setting a breakpoint

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

LPSPI is only working when setting a breakpoint

1,658 次查看
Michi_O
Contributor II

Hi,
I'm facing some strange behavior concerning LPSPI on MIMXRT1052.

When I run my code in debug mode SPI (set up as master) doesn't send anything. However, as soon as I set a breakpoint data is sent out. It doesn't matter if I set or remove a breakpoint during runtime and even more, it doesn't matter where the breakpoint is placed. Even if it is at a point that will never be reached at this point in program execution.
I'm using eDMA to handle SPI transmission. However, I tested my code also with using SPI in polling mode without eDMA and it shows the same behavior. That's why I suspect the issue to be in SPI directly.
The problem occurs on LPSPI2 (master), while LPSPI1 (set up as slave) seems to work well.

I'm using a J-Link probe for programming and debugging from MCUXpresso IDE v11.3.1 [Build 5262] [2021-04-02].

Thanks for your help

标签 (1)
0 项奖励
回复
3 回复数

1,652 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I was wondering if you can introduce your testing environment, for instance, EVK board, demo project, IDE, etc.
Then I can replicate the phenomenon on my site.
Looking forward to your reply.
Have a great day,
TIC

-------------------------------------------------------------------------------
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 项奖励
回复

1,645 次查看
Michi_O
Contributor II

Hi and thanks for your reply

Unfortunately I cannot provide you the whole project due to my companies compliance rules.

However, I prepared a test project which only contains FreeRTOS, LPSPI2 in combination with eDMA and an unfinished LED driver, which makes use of LPSPI2. I attached it to this post.
Sending data over LPSPI2 is triggered by the callback function of a FreeRTOS timer.
The behavior is exactly the same as with the original project. I'm monitoring the SPI pins with a logic analyzer which triggers only in the mentioned situation, that a breakpoint is activated or deactivated regardless of if this breakpoint is reached or not. I tried the logic analyzers trigger for every signal (CS, CLK, MOSI).

For the hardware I'm using a custom board, but IMXRT1050-EVKB is used as a basis for the project.

Thanks for your support.

 

0 项奖励
回复

1,632 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
After having a breif review of the code, I don't find something wrong.
So I'd like to suggest you to refe to freertos_lpspi or freertos_lpspi_b2b_master demo to adjust your demo project.
Have a great day,
TIC

-------------------------------------------------------------------------------
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 项奖励
回复