flash programming ok, but debugging problem?

Hello,

I am new to ARM, OpenOCD.

Can someone guide for programming flash of STM32F103ZC.

1.1 “My hardware” is just a minimum system built around STM32F103ZC.

Minimum system is nothing but Fig. 15 of App.Note AN2586

titled “STM32f10xxx hardware development: getting started”)

of ST Microelectronics,

1.2 I am using LM3S1968 Evaluation board as “JTAG debugger” for

“my hardware”.

I have connected “JTAG debugger” to PC using USB port and

“my hardware” using JTAG connector.

2.1 I have tried using Eclipse - GANYMADE as IDE. But it produces

following DUMP in the Eclipse…

(Note: it seems to detect both the devices viz. LM3s1968 &

STM32f103ZC)

Open On-Chip Debugger (2008-06-19 19:00) svn: 717

URL: http://svn.berlios.de/svnroot/repos/openocd/trunk

Info: options.c:50 configuration_output_handler(): jtag_speed: 40, 40

Info: options.c:50 configuration_output_handler(): Open On-Chip Debugger (2008-06-19 19:00) svn: 717

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x06414041 (Manufacturer: 0x020, Part: 0x6414, Version: 0x0)

Error: jtag.c:1399 jtag_examine_chain(): number of discovered devices in JTAG chain (2) doesn’t match configuration (1)

Error: jtag.c:1400 jtag_examine_chain(): check the config file and ensure proper JTAG communication (connections, speed, …)

Error: jtag.c:1556 jtag_init_inner(): trying to validate configured JTAG chain anyway…

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1565 jtag_init_inner(): Could not validate JTAG chain, exit

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x06414041 (Manufacturer: 0x020, Part: 0x6414, Version: 0x0)

Error: jtag.c:1399 jtag_examine_chain(): number of discovered devices in JTAG chain (2) doesn’t match configuration (1)

Error: jtag.c:1400 jtag_examine_chain(): check the config file and ensure proper JTAG communication (connections, speed, …)

Error: jtag.c:1556 jtag_init_inner(): trying to validate configured JTAG chain anyway…

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1565 jtag_init_inner(): Could not validate JTAG chain, exit

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x06414041 (Manufacturer: 0x020, Part: 0x6414, Version: 0x0)

Error: jtag.c:1399 jtag_examine_chain(): number of discovered devices in JTAG chain (2) doesn’t match configuration (1)

Error: jtag.c:1400 jtag_examine_chain(): check the config file and ensure proper JTAG communication (connections, speed, …)

Error: jtag.c:1556 jtag_init_inner(): trying to validate configured JTAG chain anyway…

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1456 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x11

Error: jtag.c:1565 jtag_init_inner(): Could not validate JTAG chain, exit

3.1 How can i program the flash of STM32F103ZC of “my hardware” using

the LM3s1968 Eval. board as JTAG debugger?

Kindly provide Scripts & configuration file.

Hemant.

hemant.mscs:
Hello,

(Note: it seems to detect both the devices viz. LM3s1968 &

STM32f103ZC)

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x06414041 (Manufacturer: 0x020, Part: 0x6414, Version: 0x0)

Error: jtag.c:1399 jtag_examine_chain(): number of discovered devices in JTAG chain (2) doesn’t match configuration (1)

Both TAPs belong to STM32. I suppose You are using wrong configuration file. Here is the correct one.
#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag_device 4 0x1 0xf 0xe
jtag_device 5 0x1 0x1 0x1e

#target <type> <startup mode>
target cortex_m3 little reset_halt 0
run_and_halt_time 0 30

working_area 0 0x20000000 16384 nobackup

#flash bank str7x <base> <size> 0 0 <target#> <variant>
flash bank stm32x 0 0 0 0 0

P.S. Don’t forget about interface part of configuration file.

Hello,

Thank you!!!

It seems that the device is being programmed properly.

I downloaded small program and the console showed the following message.

Open On-Chip Debugger (2008-06-19 19:00) svn: 717

URL: http://svn.berlios.de/svnroot/repos/openocd/trunk

Info: options.c:50 configuration_output_handler(): Open On-Chip Debugger (2008-06-19 19:00) svn: 717

Info: options.c:50 configuration_output_handler(): jtag_speed: 10, 10

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x06414041 (Manufacturer: 0x020, Part: 0x6414, Version: 0x0)

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x06414041 (Manufacturer: 0x020, Part: 0x6414, Version: 0x0)

Info: target.c:237 target_init_handler(): executing reset script ‘program.script’

Info: stm32x.c:631 stm32x_probe(): device id = 0x10016414

Info: stm32x.c:670 stm32x_probe(): flash size = 256kbytes

Info: options.c:50 configuration_output_handler(): stm32x mass erase complete

Info: options.c:50 configuration_output_handler(): wrote 8492 byte from file ./main.bin in 0.953125s (8.700820 kb/s)

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)

Info: jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x06414041 (Manufacturer: 0x020, Part: 0x6414, Version: 0x0)

But when i tried to debug the program, it displayed the following…

No symbol “new” in current context.

target extended-remote localhost:3333

Breakpoint 1 at 0x8000110: file main.c, line 47.

localhost:3333: No connection could be made because the target machine actively refused it.

b main

monitor soft_reset_halt

“monitor” command not supported by this target.

monitor sleep 500

“monitor” command not supported by this target.

continue

The program is not being run.

clear main

Is somthing wrong with the settings in Eclipse?

Regards.

Hemant.