OpenOCD absolute beginner + EK-LM3S6965 + Eclipse + FreeRTOS

Hi,

I’m trying to develop/debug a project using FreeRTOS 6.1.1 on a LuminaryMicro EK-LM3S6965 evaluation board, under Win32.

I use FreeRTOS6.1.1 + Eclipse Helios + CodeSourcery G++ Lite for Arm Ver. 4.5.1 + OpenOCD 0.4.0

I can build and link the .bin file but… I have problems to debug with the OpenOCD (programmer and server not working).

No connection with the target and/or error messages.

I tried several .cfg files, with the result to increase my mental mess and to loose the faith in the Lord.

Any suggestion about the OpenOCD and the .cfg files to use?

I’m getting insane, please help me.

Thank you

Antonio

Hello Antonio,

might be we could help you better, if you answer the following questions:

Which debug adapter do you use?

How do you start OpenOCD (with which commands)?

What are the error messages OpenOCD produce?

best regards!

Stefan

Thank you Stefan,

I try to answer to your questions and to explain what happens.

I don’t use any debug adapter, just the EK-LM3S6965 board connected via USB link.

The USB/microcontroller interface is made using the FTDI FT2232 chip.

Today I started again from scratch reinstalling the whole environment and using the OpenOCD and the .cfg files delivered with the FreeRTOS 6.1.1 distribution.

When I start the OpenOCD to program the RTOSDemo.bin using the Eclipse GUI, I obtain the following messages:

– Info: openocd.c:92 main(): Open On-Chip Debugger (2007-08-17 11:00 CEST)

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

– Info: configuration.c:50 configuration_output_handler(): requesting target halt…

– Info: configuration.c:50 configuration_output_handler(): waiting for target halted…

– Info: configuration.c:50 configuration_output_handler(): target halted

– Warning: stellaris.c:379 stellaris_read_part_info(): stellaris flash only tested for LM3S811 series

– Info: configuration.c:50 configuration_output_handler(): flash ‘stellaris’ found at 0x00000000

– Info: configuration.c:50 configuration_output_handler(): #0: stellaris at 0x00000000, size 0x00040000, buswidth 0, chipwidth 0

– Warning: stellaris.c:379 stellaris_read_part_info(): stellaris flash only tested for LM3S811 series

– Info: configuration.c:50 configuration_output_handler():

– Info: configuration.c:50 configuration_output_handler(): LMI Stellaris information: Chip is class 1 LM3S6965 vA.2

– Info: configuration.c:50 configuration_output_handler(): did1: 0x1073502d, arch: 0x1073502d, eproc: ARMV7M, ramsize:64k, flashsize: 256k

– Info: configuration.c:50 configuration_output_handler(): master clock(estimated): 50000kHz, rcc is 0x1d20380

– Info: configuration.c:50 configuration_output_handler(): pagesize: 1024, lockbits: 128 0xffffffff, pages in lock region: 2

– Info: configuration.c:50 configuration_output_handler():

– Info: configuration.c:50 configuration_output_handler(): erased sectors 0 through 255 on flash bank 0 in 0s 485000us

– Warning: target.c:562 target_alloc_working_area(): not enough working area available

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x0, 21197 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x1000, 20173 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x2000, 19149 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x3000, 18125 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x4000, 17101 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x5000, 16077 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x6000, 15053 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x7000, 14029 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x8000, 13005 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x9000, 11981 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0xa000, 10957 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0xb000, 9933 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0xc000, 8909 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0xd000, 7885 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0xe000, 6861 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0xf000, 5837 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x10000, 4813 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x11000, 3789 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x12000, 2765 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x13000, 1741 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 717 words to 0x14000, 717 remaining

– Info: configuration.c:50 configuration_output_handler(): wrote 84788 byte from file ./RTOSDemo/RTOSDemo.bin to flash bank 0 at offset 0x00000000 in 14s 856000us (5.573558 kb/s)

Does it mean that the programming operation has been correctly performed? Why that plenty of warnings?

Then, when I start the OpenOCD server:

– Info: openocd.c:92 main(): Open On-Chip Debugger (2007-08-17 11:00 CEST)

with the program correctly stopped to main()

but when I start the debugging I get the following messages:

– Error: ft2232.c:1341 ft2232_init_ftd2xx(): unable to open ftdi device: 2

– Error: ft2232.c:1356 ft2232_init_ftd2xx(): ListDevices: 2

– Error: ft2232.c:1358 ft2232_init_ftd2xx(): 0: Stellaris Evaluation Board B

– Error: ft2232.c:1358 ft2232_init_ftd2xx(): 1: terface ft2232

– ft2232_device_desc “Stellaris Evaluation Board A”

– f™ÿ

Sometimes I get the message saying that there are no “launches available”.

Here below you can find the .cfg files I use:

fury_ft2232.cfg

#daemon configuration

– telnet_port 4444

– gdb_port 3333

#interface

– interface ft2232

– ft2232_device_desc “Stellaris Evaluation Board A”

– ft2232_layout evb_lm3s811

– ft2232_vid_pid 0x0403 0xbcd9

– jtag_speed 40

#LM3S811 Evaluation Board has only srst

– reset_config srst_only separate

#jtag scan chain

#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)

– jtag_device 4 0x1 0xf 0xe

#target configuration

– daemon_startup attach

#target

#target arm7tdmi

– target cortex_m3 little run_and_halt 0

– # 4k working area at base of ram

– working_area 0 0x20000800 0x1200 nobackup

#target_script 0 reset …/doc/scripts/evb_lm3s811_test.script

#flash configuration

– flash bank stellaris 0 0 0 0 0

fury_ft2232_flash.cfg

#daemon configuration

– telnet_port 4444

– gdb_port 3333

#interface

– interface ft2232

– ft2232_device_desc “Stellaris Evaluation Board A”

– ft2232_layout evb_lm3s811

– ft2232_vid_pid 0x0403 0xbcd9

– jtag_speed 40

#LM3S811 Evaluation Board has only srst

– reset_config srst_only separate

#jtag scan chain

#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)

– jtag_device 4 0x1 0xf 0xe

#target configuration

– daemon_startup reset

#target

#target arm7tdmi

– target cortex_m3 little run_and_init 0

– # 4k working area at base of ram

– working_area 0 0x20000800 0x1200 nobackup

#target_script 0 reset …/doc/scripts/evb_lm3s811_test.script

– target_script 0 reset program.script

#flash configuration

– flash bank stellaris 0 0 0 0 0

program.script

– halt

– sleep 200

– wait_halt

– flash probe 0

#sleep 500

– flash info 0

#sleep 500

#flash protect 0 0 31 off

#sleep 500

– flash erase 0 0 255

– sleep 200

– flash write 0 ./RTOSDemo/RTOSDemo.bin 0

– sleep 200

– reset run

– shutdown

That’s all guys!

I need a beer :))

Thank you very much again.

Antonio - Milano (Italy)

Hello,

I also have the same problem. How can I solve it ? Someone have the solutions?

antoniomilano:
Thank you Stefan,

I try to answer to your questions and to explain what happens.

I don’t use any debug adapter, just the EK-LM3S6965 board connected via USB link.

The USB/microcontroller interface is made using the FTDI FT2232 chip.

Today I started again from scratch reinstalling the whole environment and using the OpenOCD and the .cfg files delivered with the FreeRTOS 6.1.1 distribution.

When I start the OpenOCD to program the RTOSDemo.bin using the Eclipse GUI, I obtain the following messages:

– Info: openocd.c:92 main(): Open On-Chip Debugger (2007-08-17 11:00 CEST)

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

– Info: configuration.c:50 configuration_output_handler(): requesting target halt…

– Info: configuration.c:50 configuration_output_handler(): waiting for target halted…

– Info: configuration.c:50 configuration_output_handler(): target halted

– Warning: stellaris.c:379 stellaris_read_part_info(): stellaris flash only tested for LM3S811 series

– Info: configuration.c:50 configuration_output_handler(): flash ‘stellaris’ found at 0x00000000

– Info: configuration.c:50 configuration_output_handler(): #0: stellaris at 0x00000000, size 0x00040000, buswidth 0, chipwidth 0

– Warning: stellaris.c:379 stellaris_read_part_info(): stellaris flash only tested for LM3S811 series

– Info: configuration.c:50 configuration_output_handler():

– Info: configuration.c:50 configuration_output_handler(): LMI Stellaris information: Chip is class 1 LM3S6965 vA.2

– Info: configuration.c:50 configuration_output_handler(): did1: 0x1073502d, arch: 0x1073502d, eproc: ARMV7M, ramsize:64k, flashsize: 256k

– Info: configuration.c:50 configuration_output_handler(): master clock(estimated): 50000kHz, rcc is 0x1d20380

– Info: configuration.c:50 configuration_output_handler(): pagesize: 1024, lockbits: 128 0xffffffff, pages in lock region: 2

– Info: configuration.c:50 configuration_output_handler():

– Info: configuration.c:50 configuration_output_handler(): erased sectors 0 through 255 on flash bank 0 in 0s 485000us

– Warning: target.c:562 target_alloc_working_area(): not enough working area available

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x0, 21197 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x1000, 20173 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x2000, 19149 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x3000, 18125 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x4000, 17101 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x5000, 16077 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x6000, 15053 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x7000, 14029 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x8000, 13005 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x9000, 11981 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0xa000, 10957 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0xb000, 9933 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0xc000, 8909 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0xd000, 7885 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0xe000, 6861 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0xf000, 5837 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x10000, 4813 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x11000, 3789 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x12000, 2765 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 1024 words to 0x13000, 1741 remaining

– Warning: stellaris.c:686 stellaris_write_block(): Algorithm flash write 717 words to 0x14000, 717 remaining

– Info: configuration.c:50 configuration_output_handler(): wrote 84788 byte from file ./RTOSDemo/RTOSDemo.bin to flash bank 0 at offset 0x00000000 in 14s 856000us (5.573558 kb/s)

Does it mean that the programming operation has been correctly performed? Why that plenty of warnings?

yes the flash operation succeeded, you can verify by using:

verify_image ./RTOSDemo/RTOSDemo.bin 0

You are using an old version of OpenOCD, the warnings have been removed in newer versions.

antoniomilano:
Then, when I start the OpenOCD server:

– Info: openocd.c:92 main(): Open On-Chip Debugger (2007-08-17 11:00 CEST)

with the program correctly stopped to main()

but when I start the debugging I get the following messages:

– Error: ft2232.c:1341 ft2232_init_ftd2xx(): unable to open ftdi device: 2

– Error: ft2232.c:1356 ft2232_init_ftd2xx(): ListDevices: 2

– Error: ft2232.c:1358 ft2232_init_ftd2xx(): 0: Stellaris Evaluation Board B

– Error: ft2232.c:1358 ft2232_init_ftd2xx(): 1: terface ft2232

– ft2232_device_desc “Stellaris Evaluation Board A”

– f™ÿ

I am guessing you still have the previous instance of OpenOCD running.

OpenOCD is a daemon, and will stay running until told to quite via the shutdown cmd (or ctrl-c).

antoniomilano:
Sometimes I get the message saying that there are no “launches available”.

Here below you can find the .cfg files I use:

fury_ft2232.cfg

#daemon configuration

– telnet_port 4444

– gdb_port 3333

#interface

– interface ft2232

– ft2232_device_desc “Stellaris Evaluation Board A”

– ft2232_layout evb_lm3s811

– ft2232_vid_pid 0x0403 0xbcd9

– jtag_speed 40

#LM3S811 Evaluation Board has only srst

– reset_config srst_only separate

#jtag scan chain

#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)

– jtag_device 4 0x1 0xf 0xe

#target configuration

– daemon_startup attach

#target

#target arm7tdmi

– target cortex_m3 little run_and_halt 0

– # 4k working area at base of ram

– working_area 0 0x20000800 0x1200 nobackup

#target_script 0 reset …/doc/scripts/evb_lm3s811_test.script

#flash configuration

– flash bank stellaris 0 0 0 0 0

fury_ft2232_flash.cfg

#daemon configuration

– telnet_port 4444

– gdb_port 3333

#interface

– interface ft2232

– ft2232_device_desc “Stellaris Evaluation Board A”

– ft2232_layout evb_lm3s811

– ft2232_vid_pid 0x0403 0xbcd9

– jtag_speed 40

#LM3S811 Evaluation Board has only srst

– reset_config srst_only separate

#jtag scan chain

#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)

– jtag_device 4 0x1 0xf 0xe

#target configuration

– daemon_startup reset

#target

#target arm7tdmi

– target cortex_m3 little run_and_init 0

– # 4k working area at base of ram

– working_area 0 0x20000800 0x1200 nobackup

#target_script 0 reset …/doc/scripts/evb_lm3s811_test.script

– target_script 0 reset program.script

#flash configuration

– flash bank stellaris 0 0 0 0 0

OpenOCD config scripts can change so i would always recommend you use the ones provided, eg.
source [find board/ek-lm3s6965.cfg]

Also get a newer version of OpenOCD the one above is 5 years old.

Cheers

Spen