KL03 LPUART Driver Interrupt Crash

cancel
Showing results for 
Search instead for 
Did you mean: 

KL03 LPUART Driver Interrupt Crash

Jump to solution
753 Views
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

Labels (1)
Tags (2)
0 Kudos
1 Solution
272 Views
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

View solution in original post

0 Kudos
5 Replies
272 Views
gnichimohamed
Contributor III

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

0 Kudos
272 Views
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 Kudos
272 Views
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 Kudos
273 Views
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 Kudos
272 Views
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 Kudos