Perform some tests, but I do not understand how to set the configuration registers for the Bootloader can function after programming the Flash memory.
- KDS configured to generate .bin file to program microcontroller from Bootloader.

- I checked the binary file generated by a project for the KL27 Expert processor. The project has no modification, only that generated automatically. In position 0x0_040D meeting FTFA_FOPT settings generated by processor Expert with 0x3F value.

According to Table 6-2. Flash Option Register (FTFA_FOPT) definition ... 0x3F equals that will always start from the FLASH memory .. Especially the bits 6-7 (BOOTSRC_SEL = Boot from Flash) and bit 1 (BOOTPIN_OPT = Boot source configured by BOOTSRC_SEL).
For KL46Z is easy because ProcessorExpert amending LINKER and defines a memory space for these configurations and additionally generates a vector called / * Flash configuration field * / and has the values:
/* Flash configuration field */
__attribute__ ((section (".cfmconfig"))) const uint8_t _cfm[0x10] = {
/* NV_BACKKEY3: KEY=0xFF */
0xFFU,
/* NV_BACKKEY2: KEY=0xFF */
0xFFU,
/* NV_BACKKEY1: KEY=0xFF */
0xFFU,
/* NV_BACKKEY0: KEY=0xFF */
0xFFU,
/* NV_BACKKEY7: KEY=0xFF */
0xFFU,
/* NV_BACKKEY6: KEY=0xFF */
0xFFU,
/* NV_BACKKEY5: KEY=0xFF */
0xFFU,
/* NV_BACKKEY4: KEY=0xFF */
0xFFU,
/* NV_FPROT3: PROT=0xFF */
0xFFU,
/* NV_FPROT2: PROT=0xFF */
0xFFU,
/* NV_FPROT1: PROT=0xFF */
0xFFU,
/* NV_FPROT0: PROT=0xFF */
0xFFU,
/* NV_FSEC: KEYEN=1,MEEN=3,FSLACC=3,SEC=2 */
0x7EU,
/* NV_FOPT: ??=1,??=1,FAST_INIT=1,LPBOOT1=1,RESET_PIN_CFG=1,NMI_DIS=1,??=1,LPBOOT0=1 */
0xFFU,
0xFFU,
0xFFU
};
Any change in the vector immediately modifies the .bin generated and FOPT takes the values that I want. If I check the .map after compiling for KL46 I can find that:
*(.cfmconfig)
.cfmconfig 0x00000400 0x10 ./Generated_Code/Cpu.o
0x00000400 _cfm
0x00000410 . = ALIGN (0x4)
The specific question would be: How to get this same configuration but for the KL27.
jayheng
Reviewing the binary file generated after compiling and that was programmed into the microcontroller, I find that the value of FOPT is 0x3F ..
china-imm-fae-baolei-song2013w28
If I make that definition you recommend me, there is no change in the .bin file. Researching about it, it is possible that this definition serves but when you have a file called <vectors.h> and has something to do with IAR. Processor Expert does not generate that file and therefore no change doing what you recommend me.
Yong li,
Try updating the OPENSDA with the file you gave me and it was not possible to program the microcontroller KL27. Also I installed CodeWarrior 10.6, installed all available updates and after that CW can not create a project for the KL27, maybe that's why I is not supported by the OPENSDA to upgrade your you recommended me.
thank you very much for your time and for their assistance.
__________________________________________
EDIT:
I found the following paragraph in the document "Getting Started with the Kinetis ROM Bootloader":
"The Flash Configuration Area (0x400-0x40F) should be carefully populated with known values according to the Reference Manual for the specific Kinetis platform. In particular, values for the FSEC (0x40C) and FOPT (0x40D) locations may prevent future writes to the Kinetis flash. Extra attention to ensure the correct values in your application image at these offsets is highly recommended. If your code (other than the vector table) is linked to begin at offset 0x410, then the default erased value (0xFF) of these locations will make the device secure, but mass erase will be enabled."
I keep looking for an example of how to make sure these memory locations have the correct value. :smileyangry: