Stuck with Default ISR

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stuck with Default ISR

Jump to solution
4,198 Views
michaelkoller
Contributor III

Hey there!

 

For a couple of hours now I try to get a previously working project running again.

(I have switched the Debugger from OpenOCD to PEMicro, because the K64F was unresponsive and dropped a new .bin file into the bootloader, otherwise everything should be exactly the same.)

In my project I am using Uart, SPI and the low power timer, so far.

One driver example(uart non blocking), that I modified a bit and was ok before, works to an extent, not all of it (flow control).

I made a new project to see if that maybe works. I thought I had the solution, when I noticed I had forgotten to copy the fsl_uart_irq.c, fsl_dspi_irq.c and fsl_lptmr_irq.c file into the Sources folder. So I thought, thats why I was stuck at the default ISR during runtime. But that only solved the problem for the LPTMR and DSPI.

UART still doesn't work and I suspect I have forgotten to declare or include something.

 

Here are my includes:

"../Sources"

"/home/michael/MCU/KSDK_1.3.0/platform/drivers/src/uart"

"../Sources/Board"

"../Sources/Utilities"

"/home/michael/MCU/KSDK_1.3.0/platform/osa/inc"

"/home/michael/MCU/KSDK_1.3.0/platform/osa/src"

"/home/michael/MCU/KSDK_1.3.0/platform/drivers/inc"

"/home/michael/MCU/KSDK_1.3.0/platform/drivers/src"

"/home/michael/MCU/KSDK_1.3.0/platform/hal/inc"

"/home/michael/MCU/KSDK_1.3.0/platform/hal/src"

"/home/michael/MCU/KSDK_1.3.0/platform/system/inc"

"/home/michael/MCU/KSDK_1.3.0/platform/system/src"

"../Project_Settings/Startup_Code"

"../SDK/platform/CMSIS/Include"

"../SDK/platform/devices"

"../SDK/platform/devices/MK64F12/include"

"${PROJECT_KSDK_PATH}/platform/utilities/inc"

"${PROJECT_KSDK_PATH}/platform/utilities/src"

"${PROJECT_KSDK_PATH}/platform/drivers/src/lptmr"

"${PROJECT_KSDK_PATH}/platform/drivers/inc"

 

I also have the necessary files in the Sources/Board and Sources/Utilities folder. I have found 2 pdf files that describe how to set up a new project and I've followed them.

 

I think it is again a beginner mistake, and maybe someone here can see it!

 

Thanks for any help and information,

Michael

Labels (1)
0 Kudos
Reply
1 Solution
3,332 Views
michaelkoller
Contributor III

Hey Alice!

So, I found the problem. I am using the following:

---UART1 for communication with my rs485 transceiver that lets me communicate with my motor drivers in that bus:

UART_DRV_SendData(UART_INSTANCE_1, rxIntCmdFromUser, 9u);

---UART_DEBUG _INSTANCE like this:

UART_DRV_ReceiveData(BOARD_DEBUG_UART_INSTANCE, rxCharCmdFromUser, 14u);

--- and UART for the printf() function

Apparently I have to do two different inits for the two usages of the debug uart.

I have attached my project anyways, maybe you can take a quick look at it and tell me if I missed something or there are other grave mistakes, if you dont mind, of course.

(For example, in my project I also use SPI0 with the Chip Select 0,1,2 and 4. Switching the Chip Select in the main while loop somehow does not work, but using only one Chip Select the whole time works fine. I know if I change the Chip Select I have to do a new MasterInit and then use the transfer, but somehow it does not work. Maybe you can point out an obvious mistake!)

Thanks a lot,

Michael

View solution in original post

0 Kudos
Reply
6 Replies
3,333 Views
michaelkoller
Contributor III

Hey Alice!

So, I found the problem. I am using the following:

---UART1 for communication with my rs485 transceiver that lets me communicate with my motor drivers in that bus:

UART_DRV_SendData(UART_INSTANCE_1, rxIntCmdFromUser, 9u);

---UART_DEBUG _INSTANCE like this:

UART_DRV_ReceiveData(BOARD_DEBUG_UART_INSTANCE, rxCharCmdFromUser, 14u);

--- and UART for the printf() function

Apparently I have to do two different inits for the two usages of the debug uart.

I have attached my project anyways, maybe you can take a quick look at it and tell me if I missed something or there are other grave mistakes, if you dont mind, of course.

(For example, in my project I also use SPI0 with the Chip Select 0,1,2 and 4. Switching the Chip Select in the main while loop somehow does not work, but using only one Chip Select the whole time works fine. I know if I change the Chip Select I have to do a new MasterInit and then use the transfer, but somehow it does not work. Maybe you can point out an obvious mistake!)

Thanks a lot,

Michael

0 Kudos
Reply
3,332 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Michael,

Before you do a new MasterInit , please  shots down the DSPI use MasterDeinit() function .

dspi_status_t DSPI_DRV_MasterDeinit(uint32_t instance);

Hope it helps
Have a great day,
Alice

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

0 Kudos
Reply
3,332 Views
michaelkoller
Contributor III

Hey Alice!

Thank you, I'll try that now!

If it doesn't work I would be glad if I could send you the project, that's a very generous offer.

Cheers and have a great day, too,

Michael

0 Kudos
Reply
3,332 Views
michaelkoller
Contributor III

Hello Alice,

yeah, I have the startup file in the startup code folder of my project.

I created my project with the New->Project->1.x option.

I have installed the KSDK 1.3

Here are some screenshots:

1.png2.png

3.png

I have everythin included that the UART non blocking example has included. What could be the problem?

Thanks for your help,

Michael

PS: I have the default ISR problem in all projects that use UART at the moment.

PPS: I have included the OSA includes, but not called OSA_Init() in my main. I fixed that, but there is still the default ISR. Here are screenshots from the debugger:

4.png

From reading Debugging and diagnosing hard faults on ARM Cortex-M CPUs I have learned, that the default ISR is called, if a handler is missing. How can I determine which handler that is?

0 Kudos
Reply
3,332 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Michael,

I recommend you first test the demo code under KSDK :

KSDK_1.3.0\examples\frdmk64f\driver_examples\uart

Then refer to the code to configure your code , especially

check the UART interrupt handler , the configuration about UART,

also about the flag UART interrupt .

If still can not work , you can send your project to me , i will debug and

check it on my side .

Hope it helps


Have a great day,
Alice

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

0 Kudos
Reply
3,332 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Michael,

Do you have the file of "startup_MK64F12.S" ?

What about your project ? Does it create base on KSDK 1.3 ? Or porting one project without KSDK to this project ?

If you just change the debugger mode , we needn't change anything code.

Hope it helps


Have a great day,
Alice

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

0 Kudos
Reply