From: Windestam P. <pel...@co...> - 2012-06-11 10:43:05
|
I have a development board from IAR (STM3210C-SK) with an ARM Cortex M3 from ST called STM32F107VC, and I am experiencing some problems when I try to flash it using OpenOCD (I have a bus blaster 2.0a1 JTAG-debugger). The "first" time I flash it (when it was previously flashed using IAR Embedded Workbench) it succeeds, but ends up in the hardfault handler. If I try to flash it again after this, it complains about the flash size being 0 kB and exits (see output at the end of this e-mail). If I try to do a flash probe after the initial flash, it says 0 kB and immediately exits. These are the commands used to flash: init halt sleep 250 flash probe 0 stm32f1x mass_erase 0 sleep 500 flash_write bank 0 app.bin 0 reset shutdown Any ideas what could be causing this? This is the output during the initial flash procedure: 1000 kHz adapter_nsrst_delay: 100 jtag_ntrst_delay: 100 cortex_m3 reset_config sysresetreq Info : max TCK change to: 30000 kHz Info : clock speed 1000 kHz Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3) Info : JTAG tap: stm32.bs tap/device found: 0x06418041 (mfg: 0x020, part: 0x6418, ver: 0x0) Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x21000000 pc: 0x0801568e msp: 0x200003f8 Info : device id = 0x10016418 Info : flash size = 256kbytes Info : device id = 0x10016418 Info : flash size = 256kbytes flash 'stm32f1x' found at 0x08000000 stm32x mass erase complete wrote 117716 bytes from file m3_app.bin to flash bank 0 at offset 0x00000000 in 3.399134s (33.820 KiB/s) Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3) Info : JTAG tap: stm32.bs tap/device found: 0x06418041 (mfg: 0x020, part: 0x6418, ver: 0x0) Error: stm32.cpu -- clearing lockup after double fault target state: halted target halted due to debug-request, current mode: Handler HardFault xPSR: 0x21000003 pc: 0xfffffffe msp: 0x2000fdc0 Polling target failed, GDB will be halted. Polling again in 100ms shutdown command invoked Polling succeeded again This is the output when flashing the second time: 1000 kHz adapter_nsrst_delay: 100 jtag_ntrst_delay: 100 cortex_m3 reset_config sysresetreq Info : max TCK change to: 30000 kHz Info : clock speed 1000 kHz Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3) Info : JTAG tap: stm32.bs tap/device found: 0x06418041 (mfg: 0x020, part: 0x6418, ver: 0x0) Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints Info : device id = 0x10016418 Info : flash size = 0kbytes openocd: stm32f1x.c:1022: stm32x_probe: Assertion `num_pages > 0' failed. //Pelle |