How to switch from KL17 64Ks parts to KL17 32Ks parts in IAR IDE.

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

How to switch from KL17 64Ks parts to KL17 32Ks parts in IAR IDE.

948 Views
rickstuart
Contributor V

I’m missing something and I can't switch from KL17 64Ks parts to KL17 32Ks parts.  I keep getting:

Fri Dec 04, 2015 16:23:05: 768 bytes downloaded and verified (4.36 Kbytes/sec)

Fri Dec 04, 2015 16:23:05: Warning: Target inconsistency detected in Memory range 0x1FFFF000-0x1FFFF007

Fri Dec 04, 2015 16:23:06: Fatal error: There were warnings during download of FLASH loader, see Log Window   Session aborted!

Fri Dec 04, 2015 16:23:06: Failed to load flash loader: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.3\arm\config\flashloader\Freescale\FlashKLxx16KROM.out

I'm a little confused about that last line.  Why is the IAR IDE trying to load a 16K anything?  Why not the 32K version?

-thanks

0 Kudos
7 Replies

624 Views
rickstuart
Contributor V

I should add that I have switched from the KL17 64K to the KL17 32K in the following locations in the IDE tool ( or added Freescale files):

1. Options->GeneralOptions->Target->Device: Freescale MKL17Z32xxx4

2. Options->Linker->Config->LinkerConfigFile: $PROJ_DIR$\..\config files\MKL17Z32xxx4_flash.icf

3. Added the files:

MKL17Z32xxx4_flash.icf

MKL17Z32xxx4_ram.icf

-thanks

0 Kudos

624 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Rick,

The steps of porting is correctly.
Have a great day,
Ping

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

0 Kudos

624 Views
rickstuart
Contributor V

Perhaps, but something is missing.  As IAR is not putting the image into the KL17 32K part.  I think it has something to do with the header files I am including.  I believe I am using: MKL17Z644.h, MKL17Z644_extension.h, MKL17Z644_features.h, startup_MKL17Z644.s, system_MKL17Z644.c and system_MKL17Z644.h.  Assuming the "64" in the file names are referring to the 64K part, I started searching the freescale directories for an aptly named file for the 32K part.   That is, MKL17Z324.h instead of MKL17Z644.h.  But I haven't found any such file.  I then tried to google "site:freescale.com MKL17Z324.h" but still have not found a thing.

0 Kudos

624 Views
rickstuart
Contributor V

Well, decided to start from scratch using IAR and what ever was loaded when I added Freescale (aka NXP) support.  The default main.c code compiled fine.  So I decided to download it to our KL17 23K chip.  It didn't work.  But the error is different.  Now it says "Mon Dec 07, 2015 14:22:51: Warning: Stack pointer is setup to incorrect alignment. Stack addr = 0xFFFFFFFF ".  I assume this has something to do with the MKL17Z32xxx4.icf file that was automatically (included) in the build.

-thanks

0 Kudos

624 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Rick,

The MKL17Z644.h is also suitable for the MKL17Z32xxx4, and I was wondering if you can share this demo project.

I'm looking forward to your reply.
Have a great day,
Ping

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

0 Kudos

624 Views
rickstuart
Contributor V

I should finish out this thread by saying if you use  the "KSDK_Project_Generator.exe" tool and pick your processor (avoid picking a Freescale board if your target is your own board!) you will probably end up with a working project.  Manually switching between the same chip but different size memory was tedious.   But if needed I could probably recount what I did.

The down side of using the "KSDK_Project_Generator.exe" approach is the dozens and dozens of extra source and header files added to your project which either abstract the hardware or are drivers for different features of the chip.  As far as I can tell, there is no way to turn this off the abstraction layer.  I haven't worked with this enough to figure out if this "extra software" will get in the way of any existing-working code.

0 Kudos

624 Views
mjbcswitzerland
Specialist V

Rick

The message "Warning: Stack pointer is setup to incorrect alignment. Stack addr = 0xFFFFFFFF" is typical of when nothing has been programmed to flash and the address 0x00000000 is still blank/erased (0xffffffff). Check that it is setup to use the flash loader when downloading/debugging (rather than just connection, which may be the default case).

The original problem looks to be to do with incorrect memory maps because the KL17 32k has SRAM between 0x1ffff800 and 0x200017ff and

"Warning: Target inconsistency detected in Memory range 0x1FFFF000-0x1FFFF007" looks to be trying to load the Flash loader to a non-existent RAM area (it would be suitable for the 64k part but not the 32k part).
You could force it to use "FlashKLxx32KROM.out" instead in case the "FlashKLxx16KROM.out" is not suitable. I think that the default is in fact

$TOOLKIT_DIR$\config\flashloader\Freescale\FlashKLx732KROM.board in the debugger's downloader setting.

Regards

Mark

0 Kudos