From: Tomas V. <to...@us...> - 2017-09-04 05:24:53
|
Hi, Paul suggested target/kx.xfg from OpenOCD distribution. You are using kinetis_256k.cfg you've found somewhere on the net. Although your config might work with some ancient OpenOCD version, it does not work well with current OpenOCD. BTW Programming worked, the verify error is caused by FCF field protection mechanism. See 'kinetis fcf_source' and 'kinetis fopt' commands in http://openocd.org/doc/html/Flash-Commands.html#flashdriverlist (yes, we have the documentation...) Tom On 04.09.2017 1:57, Thomas Varghese wrote: > Hi Paul, > > This is almost working! Thanks a bunch!!! > > Here is what happened: > ----------- START ---------------- > $ ./bin/openocd.exe -f share/openocd/scripts/interface/ftdi/olimex-arm-usb-ocd.cfg -f share/openocd/scripts/target/kinetis_256k.cfg -c "program firmware.elf verify reset exit" > Open On-Chip Debugger 0.10.0 (2017-08-21) [https://github.com/sysprogs/openocd] > Licensed under GNU GPL v2 > For bug reports, read > http://openocd.org/doc/doxygen/bugs.html > Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'. > cortex_m reset_config sysresetreq > adapter speed: 1000 kHz > Info : add flash_bank kinetis pflash.0 > Info : clock speed 1000 kHz > Info : JTAG tap: kinetis.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) > START... > Info : kinetis.cpu: hardware has 6 breakpoints, 4 watchpoints > END... > Info : JTAG tap: kinetis.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) > START... > END... > target halted due to debug-request, current mode: Thread > xPSR: 0x01000000 pc: 0x000001bc msp: 0x20008000 > -event reset-init occured > ** Programming Started ** > auto erase enabled > Info : Kinetis MK20DX256xxx7 detected: 2 flash blocks > Info : 1 PFlash banks: 256k total > Info : 1 FlexNVM banks: 32k total, 32k available as data flash, 2048bytes FlexRAM > Warn : Missing bank 1 configuration, FCF protection flags may be incomplette > Warn : Missing bank 1 configuration, FCF protection flags may be incomplette > Warn : Flash Configuration Field written. > Warn : Reset or power off the device to make settings effective. > wrote 32768 bytes from file vs_pos_teensy_20170819_72MHz.ino.elf in 0.870272s (36.770 KiB/s) > ** Programming Finished ** > ** Verify Started ** > Error: No working memory available. Specify -work-area-phys to target. > Warn : not enough working area available(requested 52) > Error: checksum mismatch - attempting binary compare > diff 0 address 0x0000040c. Was 0xfe instead of 0xde > diff 1 address 0x0000040d. Was 0xff instead of 0xf9 > Error: No working memory available. Specify -work-area-phys to target. > Warn : not enough working area available(requested 52) > No more differences found. > ** Verify Failed ** > shutdown command invoked > ----------- END ---------------- > > The programming didn't work, the device is not doing anything as well, just to confirm it failed the programming. > > So more stupid questions: > 1) Autoerase is enabled, but may be it is not working? How do I erase the flash? I tried erasing the flash with no luck whatsoever, everything I try comes back with a "invalid subcommand". Tried the erase_address and erase_sector > 2) Do I need to telnet to port 4444 to do this or can I do it with a -c " insert commands here " > 3) I've heard the Kinetis parts are sometimes shipped with a security bit set and that needs to be removed with a chip erase. Any thoughts on how to do that? > 4) Any thoughts on the "No working memory available..."? Is it a problem? > > Feels like we are really, really close. > > Thanks so much for all your help so far. Really appreciate it. > > -Tom > > -----Original Message----- > From: Paul Fertser [mailto:fer...@gm...] > Sent: Sunday, September 3, 2017 1:11 PM > To: Thomas Varghese <to...@on...> > Cc: ope...@li... > Subject: Re: [OpenOCD-devel] How to program Kinetis with OpenOCD on windows? > > On Sun, Sep 03, 2017 at 09:08:12PM +0300, Paul Fertser wrote: >> I suggest you try running like this: >> >> openocd -f interface/ftdi/olimex-arm-usb-ocd.cfg -c "transport select swd" -f target/kx.cfg > Correction, > > openocd -f interface/ftdi/olimex-arm-usb-ocd.cfg \ > -f interface/ftdi/swd-resistor-hack.cfg \ > -c "transport select swd" \ > -f target/kx.cfg > |