Detecting FTFA vs FTFL vs FTFE and available Flash Commands

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

Detecting FTFA vs FTFL vs FTFE and available Flash Commands

2,000 Views
paulstoffregen
Contributor III

I'm developing a flash programming tool.  Currently it targets only a few chips, but I'd like to consider how to make it more general and possibly support all Kinetis parts.

Once I've established a debug connection, is there a recommended way to detect if the flash controller is FTFA vs FTFL vs FTFE (or something else)?

Is there a best practice to determine which Flash Commands are supported, and what parameters they require?  For example, the FTFA and FTFL controllers in the chips I'm using support the Program Longword (0x06) command, but the FTFE controller does not.  It has Program Phrase (0x07).  FTFA lacks Program Section (0x0B), but even on the FTFL and FTFE controllers which do support it, the FFCOB4/5 parameter specifies the block size differently, in longwords on some chips, phases on others, and double-phases on still other parts.

Currently, I'm reading the ARM CPUID register to detect Cortex-M0+ versus Cortex-M4.  The assumption is M0+ always has FTFA, and M4 always has FTFL and FTFE.  Maybe?

Can I use SIM_FCFG1[PFSIZE] to distinguish between FTFL and FTFE?  Is there some specific size where FTFE is always used?

Does each flash controller always support the same command set, at least for the types of memory the chip has?  Or will a FTFE, for example, sometimes have different commands available (and others unavailable)?

Even when I figure out which flash controller is present, how can I detect differences, like FTFL sometimes using the number of longwords on Program Section (0x0B) for some chips versus the number of phrases on other parts?

4 Replies

1,162 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Paul,

    Because kinetis have a variety of types,  there has no definite register to accurately identify the FTFE and FTFL, even you use SIM_SDID, it can't completely identify FTFE and FTFL for all the chip .

    Actually, for the programming tool, it should choose the chip type manually at first, then the programmer can use the according algorithm to program the chip, so, we recommend you create a interface  software to choose the chip type at first.

Wish it helps you!

If you still have question, please contact me!

    


Have a great day,
Jingjing

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

0 Kudos

1,162 Views
paulstoffregen
Contributor III

My main hope is to automatically detect the hardware.  My focus is on novice users (think Arduino used by kids), where requiring technical setup can be a real obstacle.

It's really unfortunate the flash controllers and Kinetis products were designed with a consistent identification scheme.

0 Kudos

1,162 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Yes,  in the K1(eg K60 before) series product, it is really not completed to indentify the specific chip name.

But in the K2 series product, for example, K63, K64,K65,K66,K22.etc products, these chip's SIM_SDID can identy the specific chip name, and can distinguish the FTFE and FTFL register.

Sorry for the inconvenience bring you.


Have a great day,

Jingjing

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

0 Kudos

1,162 Views
pgo
Senior Contributor V

Hi Paul,

USBDM uses the SDIDs to identify the chip and then select the algorithm based on that - not what you are looking for and not particularly reliable since there are quite a few chips with the wrong values.  Some of the other information is available such as ROM size and whether there is Pflash and Dflash but AFAIK there isn't a reliable way to determine the flash type.

There are some details that also vary according to the particular chip even though they have the same flash type - Bank swapping for example.

Why not use

USBDM: USBDM Debugger interface for Freescale RS08,HCS08,HCS12,Coldfire and ARM-Kinetis Devices.

or use OpenOCD ?

bye