KSDK and IAR: Problems with interrupts

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

KSDK and IAR: Problems with interrupts

Jump to solution
1,082 Views
s_l_
Contributor II

Hi guys,

 

again I have some troubles while using IAR.

I want to use the KSDK within IAR. I copied the platform folder out of the KSDK folder to the project folder and made the following settings within IAR project settings:

     - C/C++ Compiler --> Preprocessor --> Defined symbols:

               CPU_MK22FN512VLH12

     - C/C++ Compiler --> Preprocessor --> Additional include directories:

               $PROJ_DIR$\platform\devices\MK22F51212\include

               $PROJ_DIR$\platform\devices\MK22F51212\startup

               $PROJ_DIR$\platform\CMSIS\Include

               $PROJ_DIR$\platform\composite\inc

               $PROJ_DIR$\platform\devices

               $PROJ_DIR$\platform\devices\inc

               $PROJ_DIR$\platform\drivers\inc

               $PROJ_DIR$\platform\hal\inc

               $PROJ_DIR$\platform\osa\inc

               $PROJ_DIR$\platform\system\inc

               $PROJ_DIR$\platform\utilities\inc

 

In my example I'm initializing PIT0 with interrupts. As interrupt handler I added void PIT0_IRQHandler(void){}.

But while debugging I can't set a breakpoint within the handler and the debugger gets stuck within a NMI handler, I guess because the handler for the pit isr isn't known by the cpu.

 

Copying that project to KDS it works, because within the project a Startup_Code folder is generated, where the startup_MK22F51212.S file is included. In this file I can find the declaration of the PIT0_IRQHandler.

Where I have to include this file in IAR?

 

Best greetz,

S. L.

Labels (1)
0 Kudos
Reply
1 Solution
754 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello S.L,

In IAR, you can also include the file of "startup_MK22F51212.S" , please refer to

the KSDK demo on IAR , for example: \KSDK_1.3.0\examples\frdmk22f\driver_examples\pit\iar

Hope it helps


Have a great day,
Alice Yang

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

View solution in original post

0 Kudos
Reply
4 Replies
754 Views
s_l_
Contributor II

Hi Alice Yang,

once I'm using the startup code, I'm getting serious troubles while reconfiguring the clock module.

So I tried to initialize the CU without the startup files.

Now I'm encountering again the initial problem: The PIT0_IRQHandler isn't known by the CPU, I even can't set a breakpoint inside the handler.

How to make the handler known by the CPU?

Which table I have to include to my project?

Thanks and nice greetings,

S. L.

0 Kudos
Reply
754 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello S.L

I recommend you use the  "Kinetis SDK Project Generator TOOL" to generate one KSDK project on IAR, then refer to the PIT demo

under KSDK1.3 to configure your project .This method is easy.

You can download the Generator Tool at here :

Software Development Kit for Kinetis MCUs|NXP

pastedImage_1.png

After this , if your project still have problem ,  you can send it to me , i will help you to check it .

Hope it helps

ALICE

0 Kudos
Reply
755 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello S.L,

In IAR, you can also include the file of "startup_MK22F51212.S" , please refer to

the KSDK demo on IAR , for example: \KSDK_1.3.0\examples\frdmk22f\driver_examples\pit\iar

Hope it helps


Have a great day,
Alice Yang

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

0 Kudos
Reply
754 Views
s_l_
Contributor II

Hi Alice Yang,

thanks for your response!

I was adding the files in the startup folder within the example to my project. But then the linker threw some errors.

After some tries I found that the 'original' linker file that came with IAR doesn't fit to KSDK. I changed this to the linker file include in KSDK package and all works fine!

Again thanks for your help!

Have a nice day,

S. L.

0 Kudos
Reply