K32L2B3 issue in fsl_clock.c file.

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

K32L2B3 issue in fsl_clock.c file.

1,386 Views
nxf60094
NXP Employee
NXP Employee

Hello Everyone,

I am porting the NFC reader library on K32L2B3 Kinetis MCU. While debugging the debugger is stuck at Line 480 of the fsl_clock.c file which is : while (!(MCG->S & MCG_S_OSCINIT0_MASK)) { }. It would be helpful if anyone could provide some help. Thanks in Advance.

Yadhnyaseni

0 Kudos
7 Replies

1,262 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Yadhnyaseni Kayande ,

  Please give me the NFC reader library which you are using link.

  Or you also can share your project to me, and tell me the IDE you are using.

  But just analyze your question about the code is stopping at:

 while (!(MCG->S & MCG_S_OSCINIT0_MASK)) { }.

  Normally, it means your external crystal is not oscillating.

  So, please check your external osc circuit, is it oscillating? If it can't oscillate, you need to modify your load capacitor to meet your crystal demand, it is mainly the hardware issue.

   I don't know which K32L2 board you are using, the nxp offical board or the customer designed board.

  You also can try the internal IRC clock, whether your code can working or not.

Wish it helps you!

If you still have questions about it, please kindly let me know.

Kerry

 

-------------------------------------------------------------------------------
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 Kudos

1,262 Views
nxf60094
NXP Employee
NXP Employee

Hello Kerry,

I tried with IRC but the problem is persistent. I am using MCUXpresso IDE and following is the board I am using K32L2B3. I have also attached my project. If you have the board by any chance could you please test the following project on it. It would help me understand what changes are necessary from my end. Thanks in Advance.

FRDM-K32L2B-TOP.png

0 Kudos

1,262 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Yadhnyaseni Kayande,

 Didn't find your attachment about the project.

  Do you also test the SDK code? Any issues?

   If the SDK project has no issues, then you can port your NFC code again.

Wish it helps you!

If you still have questions about it, please kindly let me know.

Kerry

 

-------------------------------------------------------------------------------
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 Kudos

1,262 Views
nxf60094
NXP Employee
NXP Employee

Hello Kerry, 

Yes, I have tried SDK's examples they are working fine but when I am porting the NFC reader Lib I am facing issues.

I have attached the source code above. Thanks again.

Regards,

Yadhnyaseni 

0 Kudos

1,262 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Yadhnyaseni Kayande.

  Project lack ph_status.h files:

pastedImage_2.png

If you test the SDK project directly and without the OSC issues, then the problem still related to the NFC code porting.

Please provide the lacked source file. Or you can test it on your side, without build issues, then give me again.

If you still have questions about it, please kindly let me know.

Kerry

 

-------------------------------------------------------------------------------
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 Kudos

1,262 Views
nxf60094
NXP Employee
NXP Employee

Hey Kerry,

Sorry, I corrected the code and have uploaded the revised version. Now could you please check.

I checked the hello world demo example and it was working. If you have any documentation for NFC reader Lib porting apart from the ones available online could you please share it. Thanks.

Yadhnyaseni

0 Kudos

1,262 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Yadhnyaseni Kayande,

     Do you update your project in the first post?

    I download it again, but still the same result:

pastedImage_1.png

   Please double-check it again, I still didn't find your ph_status.h.

  I suggest you use the working K32 SDK code, and add your NFC code part by part, and debug the details.

  Do you use the FRDM-K32L2B3 board to test your project?

  I checked your project, why you use 32Mhz OSC.

pastedImage_2.png

You can check the SDK hello world project, it is using the internal 48Mhz

pastedImage_3.png

You can check the FRDM-K32L2B3 schematic, the EXTAL0 is 32Khz OSC:

pastedImage_5.png

This is the root reason why you stop at the OSC.

I don't know why you modify the K32 related code, you totally can use the SDK code.

Wish it helps you!

If you still have questions about it, please kindly let me know.

Kerry

 

-------------------------------------------------------------------------------
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 Kudos