Cart New Account Login

HomeAbout usProductsSupportForumsBlogCustomer Service

Please accept the use of cookies on our site

At PEmicro we use web browser cookies in order to provide you with an enhanced experience and in order to be able to do things like shopping cart processing and identify you when you login to our website.

Click here to accept

search inside this forum
search inside all forums
Cyclone Pro for ARM
Matthew S. Dec 9, 2014 at 08:58 AM (08:58 hours)
Staff: Takao Y.

  • I am using a Cyclone for ARM Devices to program a K60 and a K25 (KL25Z128VLK4). I can successfully program the K60. When I program the K25 the verify portion of the program fails with error code $00007009. I understand this means "Trim value invalid, blank, or zero". The new application is actually programmed in Flash (confirmed via software version string print on boot).

    What would cause this $00007009 error?

    I create the image for the K25 in the same way as was done for the K60. I can flash the K25 correctly via the P&E Multilink FX.


  • Greetings,

    Since I cannot see you image creation utility, could you tell me the command list you have for the image you are trying to execute? Also let us know which algorithm you have selected as well.

    If within your image you have the "PT" command, try removing it and see if it succeeded or not. I just want to know if the issue is specifically on the PT command.

    The Trim value is important in that it is loaded into your internal clock source right out of chip's reset. This value is what generates the specific internal clock you may need for you project. If within your S19/ELF file you have programmed the flash location that stores this TRIM value, then you will have a problem. If I remember correctly, this location is at $3FE and $3FF.

    To better debug your issues, we always provide the PROG software into your cyclone software install. This is a step-by-step flash programming software that works with your cyclone. Use this to see if the programming and verification is passing. See if you are programming at location $3FE and $3FF by using the "Show Module" command.

    Takao Yamada

    • Command List:
      CM ;C:\PEMicro\cyclone_arm\Algorithms\Kinetis\k25_freescale_kl25z128m4_1x32x32k_pflash.arp
      SS ;"image_to_flash"
      EM ;Erase Module
      PM ;Program Module
      VM ;Verify Module
      PT ;Program Trim

      Since I do have the PT command, I tried programming with it removed. When programming this way the Verify appears to pass, but the RED Error LED illuminates and the text output says "Warning TRIM is blank". The new software executable did program correctly.

      I will look into using PROG software to see if programming and verification is passing. I will also inspect the contents of $3FE and $3FF. I am assuming PROG is actually ProgACMP_FSL_Cyclone.exe when used for the K25 processor.

  • Greetings,

    You are correct that the software I want you to try is PROGACMP_FSL_Cyclone.exe.

    Do you know which compiler or IDE you used to get this S19/ELF file? If the compiler is smart enough, it should know not to program this location...unless the user changed the PRM or Listing files.


  • The compiler (CodeWarrior 10.4) produced srec can be flashed successfully via the Cyclone. 

    In our project we are adding a checksum at the end of m_text so that the application can confirm the contents of Program Flash match the expected checksum. This was being achieved via the following post-compile step:

    ..\srec_cat.exe K25-supervisor.hex -crop 0x0 0x0001FFFE -fill 0x00 0x0 0x0001FFFE -checksum-positive-l-e 0x0001FFFE 2 2 -o K25-supervisor.crc -line-length=46 -address-length=3

    The -fill value of 0x00 was causing the Cyclone Trim Value check to fail. I've since changed the -fill value to 0xFF to match the default erase value of the flash. This results in the Cyclone passing the PT Trim check.

    The side effect of this is that the Cyclone is inserting 0x7e00 at the trim address (0x3FE). This results in the failure of the application checksum test at power-on. If I remove the PT command from the Cyclone image creation then the programming fails with "Warning trim value is blank".

    Why does the Cyclone add this trim value while the P&E Multilink FX does not add this value when programming via the CodeWarrior 10.4 "Flash Programmer" utility?

  • Greetings,

    The "flash programmer" utility in Codewarrior is not our tool. It is Freescale's and how they implement is beyond us.

    However, if you run a debug session with Codewarrior, then that is P&E's implementation and it should always program TRIM no matter what hardware you use.

    No matter which method you use, you should avoid writing any data to the TRIM registers within non-volatile memory. If you use any P&E tools, we automatically calculate the TRIM default value. You can specify your TRIM value within Codewarrior by going into debug configurations and using the advanced programming options to set the frequency you want.

    Takao Yamada

  • Thank you for the clarification on the various tools. 

    I have updated our custom checksum generation to leave the trim value unmodified. Thank you for your assistance with this.

  • I facing the same issue with PEMicro to flash KL02Z MCU.
    The Binary was compiled with IAR IDE

    The binary able to flash successfully using OpenSDA FRDM-KL02Z development. But
    when try to flash using PEMicro 2 cases happen:

    1) Disable the TRIM. Able to program BUT the firmware not running on not response. even for a simple toggling IO HIGH and LOW.

    2) Enable the TRIM as suggested prompt out. Not able to program the firmware successfully with 0x00007009 error code.

    I stuck until here. Is there any setting in the IAR IDE with the finalize binary firmware need to be done in the first place?

    Pls Response ASAP.
    Thank you

    • Greetings,

      What you are saying is the exact same S19 or ELF file works fine in the Freedom board (FRDM-KL02Z), but does not work on your custom board?

      Error 7009 indicates trim value is invalid, blank, or zero. Are you programming a custom trim frequency? Are you leaving Trim blank? Another reason this could occur is if your binary writes to the TRIM address within flash, which I believe is between $400-$40F but check your reference manual.

      Takao Yamada

      • HI thanks for the replied..

        Yes exact s19 files work with Freedom board but not to the custom board.
        FYI for this I already took out the EXT OSC from the Freedom board so that we are sure that the firmware running on internal clock IRC. 32kHz producing 48Mhz using PLL.

        Address $400-$40F in new info to me, where to get the detail? which reference manual?
        How we can know we are using the trim frequency or not? I using default registry setting value.

  • Greetings,

    The chip already has default trim values and if you wish to base your project around that frequency that is fine. But many customers want to use TRIM to fine tune the frequency to their liking so they program the non-volatile TRIM value to set their bus frequency.

    Chapter 4.3.1 for KL02Z indicates the address of where the trim is located between $3FE-$3FF. You should also avoid programming from $400-$40F because of the security bits.

    If you wish to use default trim, then do not use the PT command and do not program over the trim register. If you wish to use trim, then use the PT command and still do not program over the trim. Use the P&E utility to specify the frequency and let the tool calculate the correct value for you.

    Takao Yamada

  • Greetings,

    Any update on this? Were you able to figure out your issue?

    Takao Yamada

Add comment

   Want to comment? Please login or create a new PEMicro account.

© 2018 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement