KDS: Switching Between MCUs

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

KDS: Switching Between MCUs

750 Views
philhale
Contributor IV

I have an interesting problem that I am hopeful someone might have some ideas how to resolve.

I am using KDS 3.2.0. I am migrating an application from K64 to KL27. I am getting a hard fault that occurs anytime I am using standard library functions from, particularly, string.h.  Strtok, Strlen, etc.  Commenting these lines out and everything works fine.

It seems obvious that just changing the Target Processor isn't enough to point KDS to the correct standard libraries.

Any suggestions?

Phil

Labels (2)
0 Kudos
3 Replies

633 Views
BlackNight
NXP Employee
NXP Employee

Hi Phil,

did you switch from M4F to M0+?

pastedImage_1.png

Otherwise the library will use M4(F) instructions which are not available on M0+. The logical consequence will be a hard fault.

I hope this helps,

Erich

0 Kudos

633 Views
philhale
Contributor IV

Thank you for your kind reply, Erich.

Yes, I changed the Target Processor to "cortex-m0plus".  I verify this during compilation in the console.

Everything seems to be working just fine except standard library String.h functions. Strlen and Strtok are a few that trigger hard faults.

I must be missing something or inadvertently broke something but I don't know how I COULD.  Defining the Target Processor points to the standard cortex-m0plus libraries, from how I understand the system. Strange.

If you think of any other ideas, please let me know.

Thank you again for your reply, Erich.

Phil 

0 Kudos

633 Views
BlackNight
NXP Employee
NXP Employee

Hi Phil,

Usually I do port projects with the 'create new, then copy' method, but I have changed a few projects 'in-place' too. I have documented the process in Tutorial: Changing ARM Cortex Core or Microcontroller in Eclipse CDT Projects | MCU on Eclipse , maybe there is something you have missed?

I hope this helps,

Erich

0 Kudos