From: Benjamin B (BBenj) <bal...@gm...> - 2017-07-29 10:36:43
|
Thank you all for your help! The WORKAREASIZE RAM space thing is explained clearly in the config file, I overlooked that so hard... (facepalm) :-p Anyway, it is almost working flawlessly, the write works but the verify step fail. The program is running. >From the data sheet I can see that the mismatch is in the Flash config field, the Flash Option Register at 0x40D, so it is not critical. I probably have to change something on my build settings I guess, I will look into that. Or is it up to openocd to ignore that part? I changed WORKAREASIZE to 0x600 as suggested to make it work, tried with 0 (same result but slower). I also tried with 0x800, same result (exact same output) but write is working too. Open On-Chip Debugger 0.10.0+dev-00166-g0e4fbfba (2017-07-05-19:07) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'. WORKAREASIZE: 0x600 Info : add flash_bank kinetis klx.pflash adapter speed: 1000 kHz none separate cortex_m reset_config sysresetreq Info : CMSIS-DAP: SWD Supported Info : CMSIS-DAP: JTAG Supported Info : CMSIS-DAP: Interface Initialised (SWD) Info : CMSIS-DAP: FW Version = 1.0 Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1 Info : CMSIS-DAP: Interface ready Info : clock speed 1000 kHz Info : SWD DPIDR 0x0bc11477 Info : MDM: Chip is unsecured. Continuing. Info : klx.cpu: hardware has 2 breakpoints, 2 watchpoints Info : MDM: Chip is unsecured. Continuing. target halted due to debug-request, current mode: Thread xPSR: 0x61000000 pc: 0x1c0000c0 msp: 0x20000218 Info : Kinetis MKL03Z32xxx4 detected: 1 flash blocks Info : 1 PFlash banks: 32k total Info : Disabling Kinetis watchdog (initial SIM_COPC 0x0c) ** Programming Started ** auto erase enabled Info : Padding image section 0 with 832 bytes Info : This device supports Program Longword execution only. Warn : not enough working area available(requested 2048) Info : This device supports Program Longword execution only. Warn : not enough working area available(requested 2048) Warn : Flash Configuration Field written. Warn : Reset or power off the device to make settings effective. Info : This device supports Program Longword execution only. Warn : not enough working area available(requested 2048) wrote 14336 bytes from file /Volumes/Vault/Projects/NXP/Kinetis/build-TestKinetisSDK-EZR-Debug/qtc_EZR_0c3ed5a7-debug/TestKinetisSDK.qtc-EZR-0c3ed5a7.6fca1447/TestKinetisSDK.axf in 1.362001s (10.279 KiB/s) ** Programming Finished ** ** Verify Started ** Error: checksum mismatch - attempting binary compare diff 0 address 0x0000040d. Was 0xff instead of 0x3d No more differences found. ** Verify Failed ** shutdown command invoked Best regards, Benjamin Le 29 juillet 2017 à 07:44:26, Paul Fertser (fer...@gm...) a écrit: Hello, On Fri, Jul 28, 2017 at 07:00:01PM -0400 <http://airmail.calendar/2017-07-29 01:00:01 UTC+2>, Benjamin B (BBenj) wrote: > I'm trying to flash a MKL03Z32VFK4 (KL03Z freedom dev board) with openocd using > the command: > > openocd -f interface/cmsis-dap.cfg -f target/klx.cfg \ If this part has only 2KiB of RAM, then you need to add -c "set WORKAREASIZE 2048" before -f target/klx.cfg as the config specifies 4 KiB by default. If this doesn't help, please post a -d3 output. > -c "init" -c "targets" \ > -c "halt" \ These three are unnecessary and do not affect anything. > -c "program test.bin verify reset exit" Usually I recommend to use ELF files directly to simplify the build process, avoid messing up the offset etc. HTH -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fer...@gm... <fer...@gm...> Le 29 juillet 2017 à 07:39:18, Tomas Vanek (to...@us...) a écrit: Ooops, I was too fast. set WORKAREASIZE=0x600 (or 0) (because RAM does not start at 0x20000000) On 29.07.2017 7:35, Tomas Vanek via OpenOCD-user wrote: Hi Your KL03Z device probably has only 2 kbyte RAM. klx.cfg assumes device with 4 kbyte or more RAM. Set WORKAREASIZE=0x800 (or WORKAREASIZE=0 to disable async flash algo) before including klx.cfg. Tom On 29.07.2017 1:00, Benjamin B (BBenj) wrote: Hello, I'm trying to flash a MKL03Z32VFK4 (KL03Z freedom dev board) with openocd using the command: openocd -f interface/cmsis-dap.cfg -f target/klx.cfg \ -c "init" -c "targets" \ -c "halt" \ -c "program test.bin verify reset exit" But the memory write fail: Open On-Chip Debugger 0.10.0+dev-00166-g0e4fbfba (2017-07-05-19:07) Licensed under GNU GPL v2 For bug reports, read <http://openocd.org/doc/doxygen/bugs.html> http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'. Info : add flash_bank kinetis klx.pflash adapter speed: 1000 kHz none separate cortex_m reset_config sysresetreq Info : CMSIS-DAP: SWD Supported Info : CMSIS-DAP: JTAG Supported Info : CMSIS-DAP: Interface Initialised (SWD) Info : CMSIS-DAP: FW Version = 1.0 Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1 Info : CMSIS-DAP: Interface ready Info : clock speed 1000 kHz Info : SWD DPIDR 0x0bc11477 Info : MDM: Chip is unsecured. Continuing. Info : klx.cpu: hardware has 2 breakpoints, 2 watchpoints TargetName Type Endian TapName State -- ------------------ ---------- ------ ------------------ ------------ 0* klx.cpu cortex_m little klx.cpu halted Info : MDM: Chip is unsecured. Continuing. target halted due to debug-request, current mode: Thread xPSR: 0x61000000 pc: 0x1c0000c0 msp: 0x20000218 Info : Kinetis MKL03Z32xxx4 detected: 1 flash blocks Info : 1 PFlash banks: 32k total Info : Disabling Kinetis watchdog (initial SIM_COPC 0x0c) ** Programming Started ** auto erase enabled Info : This device supports Program Longword execution only. Info : This device supports Program Longword execution only. Warn : Flash Configuration Field written. Warn : Reset or power off the device to make settings effective. Info : This device supports Program Longword execution only. Info : SWD DPIDR 0x0bc11477 Error: Failed to write memory at 0x20000600 Error: Error executing kinetis Flash programming algorithm Error: error writing to flash at address 0x00000000 at offset 0x00000000 ** Programming Failed ** shutdown command invoked I can't figure out why. Seems to me that a write to 0x20000600 isn't right... I successfully programmed other chips like KL25Z or EFM32, but this one doesn't want to. Flashing using OpenSDA is working, but here I'm trying to proof that I will be able to use openocd with a custom board based on a KL04Z, and it's not going very well... Please help! Thanks! Best regards, Benjamin ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ OpenOCD-user mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/openocd-user ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ OpenOCD-user mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/openocd-user |