KL03 LPUART Driver Interrupt Crash

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

KL03 LPUART Driver Interrupt Crash

跳至解决方案
1,636 次查看
aes_mike
Contributor III

I created a project using the KSDK Project Generator 1.0 for a MKL03 MKL03Z32VFK4.  See image below.

144210_144210.JPGKDS_Project_Generator.JPG

 

I am trying to get the LPUART_DRV working using interrupts, but when the LPUART_DRV_SendData() runs it crashes when LPUART_BWR_CTRL_TIE(base, 1U) is run in function LPUART_DRV_StartSendData().  See attached image of the debug session. 

 

144211_144211.JPGCrash at LPUART_DRV_StartSendData.JPG

 

 

Also, attached is the project.

 

I am missing something, but cannot figure it out.  Any advice as to why it is crashing would be really appreciated.   Thank you.

Original Attachment has been moved to: MKL03_Device_Platform_MKL03Z32VFK4.zip

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
1,155 次查看
aes_mike
Contributor III

Jorge,

Thank you for the tip!

Turns out in the startup_MKL03Z4.s I had:

/* Flash Configuration */

    .section .FlashConfig, "a"

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFF39FE

it ought to be:

/* Flash Configuration */

    .section .FlashConfig, "a"

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFF3BFE

Mike

在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,155 次查看
gnichimohamed
Contributor III

The issue is that there is no project example using processor expert which is very weird!

0 项奖励
回复
1,155 次查看
aes_mike
Contributor III

The problem with processor expert after adding the blocks I need it compiles to around 24K before adding the application code.  Adding application puts the compiled code into the 40K range!  If I use the above, then the baseline will likely be around 15K which will be enough room for what I need to do.

I will give Carlos_Mendoza Employee  solution a try from your thread  lpuart issue .  At least compare and contrast the two projects.

0 项奖励
回复
1,155 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Mike:

Do you still have this issue? Have you tried in standalone mode without the debugger?

I tested your project from my side with a FRDM-KL03Z and it worked as expected. From your screenshot it seems that the core is using the vector table from the ROM bootloader.

Try adding the next code before any application code is executed (e.g. in SystemInit() or at the beginning of main():

// Disable force ROM.

RCM_BWR_FM_FORCEROM(RCM, 0);

// Clear status register (bits are w1c).

RCM_BWR_MR_BOOTROM(RCM, 3);

Best regards,
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,156 次查看
aes_mike
Contributor III

Jorge,

Thank you for the tip!

Turns out in the startup_MKL03Z4.s I had:

/* Flash Configuration */

    .section .FlashConfig, "a"

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFF39FE

it ought to be:

/* Flash Configuration */

    .section .FlashConfig, "a"

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFF3BFE

Mike

0 项奖励
回复
1,155 次查看
aes_mike
Contributor III

Also, the project is referencing the "libksdk_platform.a" library which was compiled using the ksdk_platform_lib_KL03Z4.   This is a KSDK 1.3.0 revision.

0 项奖励
回复