Code compiles but can not be uploaded to KL03 32K by IAR development tool.

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

Code compiles but can not be uploaded to KL03 32K by IAR development tool.

Jump to solution
936 Views
rickstuart
Contributor V

Using IAR Systems\Embedded Workbench 7.3 I can not upload my C code project into a NXP KL03 32Kbyte processor.

I get this warning:

Fri Dec 09, 2016 10:46:23: Warning: Target inconsistency detected in Memory range 0x1FFFF800-0x1FFFF807

...then the IAR development tool falls apart with fatal errors about warnings during download of FLASH loader (assumed to be the above warning) and stating that other files (which I know are there) can not be found.

If your 1st though is that there is something at fault with any of the hardware (computer, PEmicro-Pod, Target or KL03-Processor), let me add that I can upload the same project after adjusting IAR to use a KL03 16Kbyte part with no problems what so ever.

If your 2nd thought is that the KL03 is not a 32Kbyte part but is in fact a 16Kbyte part, well, you may be correct.  I don't really know.  The section of the NXP documentation that describes the chip markings has been accidentally / purposely left out of the KL03 chip specifications.  However, if you do know how to read the KL03 chip identification numbers, all the characters etched into the top of the KL03 chips I have are:  "P03T5V" and "PSABA".  (Note, if you read the other KL chip specifications (i.e. KL02 & KL17), you will find the number 5 infers the processor contains 32Kbytes of program / flash memory.  Also, the packaging direct from NXP has a sticker on it with the full part number inferring these are 32Kbyte parts.)

If your 3rd thought is that I have not properly configured IAR to handle a 32Kbyte KL processor, well, you may be correct also.  However, I have successfully accomplished this same procedure while switching from a KL17 32Kbyte part to a larger KL17 64K part.  But I confess, there are so many IAR issues / changes when switching something as simple and as basic as program memory size that I may have over looked or incorrectly implemented some of them.  So any help in pointing me toward what ever might have cause the warning above in the IAR log would be appreciated.

-thanks

Labels (2)
Tags (3)
0 Kudos
1 Solution
627 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Rick stuart,

    Maybe it caused by your RAM range define, or the RAM overflow.

   You said, you get the warning:Target inconsistency detected in Memory range 0x1FFFF800-0x1FFFF807

  As you know, the KL03 32k just have 2KB RAM,

pastedImage_1.png

pastedImage_2.png

So, the RAM range is :

SRAM_L = 0X1FFFFE00~0X1FFFFFFF

SRAM_H=0X20000000~0X200005FF

0x1ffff800-0x1ffff807 is out of the KL03 32K RAM size.

You can use the official sample code, which can be download from this link:

Welcome to Kinetis Expert | Kinetis Expert

Choose build an SDK, then select the FRDM-KL03, and generated the IAR project.

Wish it helps you!

If you still have question, please let me know!


Have a great day,
Kerry

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

View solution in original post

5 Replies
628 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Rick stuart,

    Maybe it caused by your RAM range define, or the RAM overflow.

   You said, you get the warning:Target inconsistency detected in Memory range 0x1FFFF800-0x1FFFF807

  As you know, the KL03 32k just have 2KB RAM,

pastedImage_1.png

pastedImage_2.png

So, the RAM range is :

SRAM_L = 0X1FFFFE00~0X1FFFFFFF

SRAM_H=0X20000000~0X200005FF

0x1ffff800-0x1ffff807 is out of the KL03 32K RAM size.

You can use the official sample code, which can be download from this link:

Welcome to Kinetis Expert | Kinetis Expert

Choose build an SDK, then select the FRDM-KL03, and generated the IAR project.

Wish it helps you!

If you still have question, please let me know!


Have a great day,
Kerry

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

627 Views
rickstuart
Contributor V

Kerry,

After reading your answer I switched to using the file "FlashKLxx2K.out".**  You pointed out that there was only 2Kbyte of RAM on the KL03.  After that I was able to upload the flashloader and eventually my applicaion.

-thanks

** I believe this is an IAR maintained file normally located in this directory:

C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.3\arm\config\flashloader\Freescale

0 Kudos
627 Views
rickstuart
Contributor V

By the way, I changed my FlashKLxx32K.flash file from:

<?xml version="1.0" encoding="iso-8859-1"?>

<flash_device>
<exe>$TOOLKIT_DIR$\config\flashloader\Freescale\FlashKLxx.out</exe>
<page>4</page>
<block>32 0x400</block>
<flash_base>0x00000000</flash_base>
<macro>$TOOLKIT_DIR$\config\flashloader\Freescale\FlashKLxx.mac</macro>
<online>1</online>
<aggregate>1</aggregate>
<args_doc>--enable_config_write - allow programming of 0x40C - 0x40F with user supplied
data, in other case flashloader after erase of block 1 will write 0xFFFF_3DFE
(unsecure state).</args_doc>
</flash_device>

...to...

<?xml version="1.0" encoding="iso-8859-1"?>

<flash_device>
<exe>$TOOLKIT_DIR$\config\flashloader\Freescale\FlashKLxx2K.out</exe>
<page>4</page>
<block>32 0x400</block>
<flash_base>0x00000000</flash_base>
<macro>$TOOLKIT_DIR$\config\flashloader\Freescale\FlashKLxx.mac</macro>
<online>1</online>
<aggregate>1</aggregate>
<args_doc>--enable_config_write - allow programming of 0x40C - 0x40F with user supplied
data, in other case flashloader after erase of block 1 will write 0xFFFF_3DFE
(unsecure state).</args_doc>
</flash_device>

...and now I can upload my code.  However, as soon as the upload is finished several error windows popup and this is in the IAR SDK log:

---

Mon Dec 12, 2016 14:33:35: Loaded macro file: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.3\arm\config\debugger\Freescale\KLxx.dmac
Mon Dec 12, 2016 14:33:35: Loaded macro file: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.3\arm\config\flashloader\Freescale\FlashKLxx.mac
Mon Dec 12, 2016 14:33:41: P&E Interface detected - Flash Version 9.41
Mon Dec 12, 2016 14:33:43: Device is Freescale_KL0x_KL03Z32M4.
Mon Dec 12, 2016 14:33:43: Mode is In-Circuit Debug.
Mon Dec 12, 2016 14:33:43: Initial reset was performed
Mon Dec 12, 2016 14:33:43: CPU reset by debugger.
Mon Dec 12, 2016 14:33:43:
Mon Dec 12, 2016 14:33:43: Software reset was performed
Mon Dec 12, 2016 14:33:43: Watchdog disabled
Mon Dec 12, 2016 14:33:43: 768 bytes downloaded and verified (3.69 Kbytes/sec)
Mon Dec 12, 2016 14:33:43: Loaded debugee: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.3\arm\config\flashloader\Freescale\FlashKLxx2K.out
Mon Dec 12, 2016 14:33:43: Target reset
Mon Dec 12, 2016 14:33:47: Unloaded macro file: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.3\arm\config\flashloader\Freescale\FlashKLxx.mac
Mon Dec 12, 2016 14:33:47: The flash loader program reported an error.
---

Any help is appreciated.

0 Kudos
627 Views
rickstuart
Contributor V

Hi Kerry,

Thank you for your response.  But I'm having a hard time of understanding how the package I just downloaded from NXP's Espresso relates to my current NXP processor (KL17 32K, KL17 64K, KL03 16K & KL03 23K) projects that I have been working on for over a year.

In question (from my perspective) are the files named (and similarly named) "FlashKLxx32K.flash".  When I create and download a KL03 32K IAR project from NXP's Espresso I do not see these files at all.  I suspect my problems start with these files.

Did I miss something?  Was there a paradigm shift at NXP and / or IAR making how my projects are put together obsolete? 

0 Kudos
627 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Rick stuart,

    Did you mean just you own project have downloading problem?

   If you are convenient, you can send me your project, I will help you to check it.


Have a great day,
Kerry

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

0 Kudos