Hi all,

I started working with Kinetis MK22FN1M0VLL12
According to reference manual this chip has FTFE with two 512kB flash 
blocks nad 4kB sectors.
src/flash/nor/kinetis.c assigns granularity 3 for 
KINETIS_K_SDID_K22_M120, what means:
     pflash_sector_size_bytes = 4kB ...OK
     unsigned num_blocks = 4 ...wrong

I defined
flash bank pflash.0 kinetis 0 0 0 0 $_TARGETNAME
flash bank pflash.1 kinetis 0 0 0 0 $_TARGETNAME

> flash probe 0: seems OK except number of blocks and size
Debug: 283 15888 kinetis.c:1145 kinetis_read_part_info(): SDID: 
0x00001318 FCFG1: 0x0D020F00 FCFG2: 0x40C00000
Debug: 284 15888 kinetis.c:1213 kinetis_read_part_info(): FlexNVM: 0 
PFlash: 1048576 FlexRAM: 0 PFLSH: 1
Debug: 285 15888 kinetis.c:1224 kinetis_read_part_info(): 4 blocks 
total: 4 PFlash, 0 FlexNVM
Info : 286 15888 kinetis.c:1306 kinetis_read_part_info(): Probing flash 
info for bank 0
User : 292 15891 command.c:546 command_print(): #0 : kinetis at 
0x00000000, size 0x00040000, buswidth 0, chipwidth 0

> flash probe 1
Debug: 154 148158 kinetis.c:1174 kinetis_read_part_info(): SDID: 
0x00001318 FCFG1: 0x0D020F00 FCFG2: 0x40C00000
Debug: 155 148158 kinetis.c:1242 kinetis_read_part_info(): FlexNVM: 0 
PFlash: 1048576 FlexRAM: 0 PFLSH: 1
Debug: 156 148158 kinetis.c:1253 kinetis_read_part_info(): 4 blocks 
total: 4 PFlash, 0 FlexNVM
Warn : 157 148158 kinetis.c:1261 kinetis_read_part_info(): Flash 
ordinal/bank number mismatch

Erasing sectors in low half of block 0 and mdm mass erase works good.
Programming fails:
Error: 1499 91529 kinetis.c:793 kinetis_ftfx_command(): ftfx command 
failed FSTAT: A0 FCCOB: 0B000000 01000000 00000000
Error: 1500 91530 core.c:93 flash_driver_write(): error writing to flash 
at address 0x00000000 at offset 0x00000000
Debug: 1501 91530 command.c:628 run_command(): Command failed with error 
code -902

I investigated the problem further and found that programming session of 
length 1kB or less works.
Reference manual K22P100M120SF5RM does not help here.

Thanks to comment in kinetis.c I assume the chip uses a granularity #5 
not yet supported in OpenOCD.
And Freescale limited PGMSEC command to 1kB size. Why???! Programming 
acceleration RAM has 4kB.

Please, can any of flash driver authors (or anybody else) comment on this?

Tomas

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to