cancel
Showing results for 
Search instead for 
Did you mean: 

failed to start debugging on STM32F0308-Discovery board with OpenSTM32

bluenow1896
Associate III
Posted on October 23, 2016 at 23:15

.ExternalClassE6B9D6A715684DEB9AF9BCF83BCA0443 pre.cjk {font-family:'Courier New',monospace;} .ExternalClassE6B9D6A715684DEB9AF9BCF83BCA0443 p {margin-bottom:0.1in;line-height:120%;}

I�m be interested to use OpenSTM32, as it runs across platforms of Linux,MacOSX and Windows,

with Eclipse and plugins to integrate Gnu ARM GCC and OpenOCD.

But I get a problem when try to start debugging session on the board of STM32F0308-Discovery.

I have the all toolchain installed and updated to latest. Start debugging on STM32F0Discovery

board is all fine.

The failure message on STM32F0308-Discovery says timeout and failed on holding reset,

and further information seems prompt a failure on erasing flash. I tried to invoke Target=> Erase chip,

from OpenSTM32, and it failed on timeout. However, when I try to use �ST-Link Utility� to

erase and programing the board of STM32F0308-Discovery, it went through all fine. And also,

I have another set of wrapper tool over OpenOCD, can start debugging session properly,

which of course means of erase/programming the flash on STM32F0308-Discovery properly.

So, after all, I have the question to the configuration file on OpenOCD for

STM32F0308-Discovery and STM32F0Discovery. I know they are been provided differently,

the question is, what the essential difference need to be between the two of OpenOCD configure

file? Please help.

#openstm32 #stm32f0308 #openocd
7 REPLIES 7
bluenow1896
Associate III
Posted on October 24, 2016 at 01:00

here is what I got from console:

Open On-Chip Debugger 0.10.0-dev-00272-gf17dc4a (2016-10-10-08:40)

Licensed under GNU GPL v2

For bug reports, read

    http://openocd.org/doc/doxygen/bugs.html

Info : auto-selecting first available session transport ''hla_swd''. To override use 'transport select <transport>'.

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

adapter speed: 950 kHz

adapter_nsrst_delay: 900

none separate

srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : clock speed 950 kHz

Info : STLINK v2 JTAG v28 API v2 SWIM v0 VID 0x0483 PID 0x3748

Info : using stlink api v2

Info : Target voltage: 2.915101

Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints

Info : accepting 'gdb' connection on tcp/3333

Info : Unable to match requested speed 1000 kHz, using 950 kHz

Info : Unable to match requested speed 1000 kHz, using 950 kHz

adapter speed: 950 kHz

Error: timed out while waiting for target halted

TARGET: stm32f0x.cpu - Not halted

in procedure 'reset'

in procedure 'ocd_bouncer'

Info : device id = 0x20006440

Info : flash size = 64kbytes

Info : Unable to match requested speed 1000 kHz, using 950 kHz

Info : Unable to match requested speed 1000 kHz, using 950 kHz

adapter speed: 950 kHz

Error: timed out while waiting for target halted

TARGET: stm32f0x.cpu - Not halted

in procedure 'reset'

in procedure 'ocd_bouncer'

Info : Unable to match requested speed 1000 kHz, using 950 kHz

Info : Unable to match requested speed 1000 kHz, using 950 kHz

adapter speed: 950 kHz

Error: timed out while waiting for target halted

TARGET: stm32f0x.cpu - Not halted

in procedure 'reset'

in procedure 'ocd_bouncer'

Error: Target not halted

Error: failed erasing sectors 0 to 7

Error: flash_erase returned -304

Error: address + size wrapped(0xffffffff, 0x00000004)

Info : dropped 'gdb' connection

slimen
Senior
Posted on October 24, 2016 at 15:26

Hello,

Try with GDB server from Em::Blocks.

Regards

bluenow1896
Associate III
Posted on October 26, 2016 at 17:21

Hi,

  Thank for help. I find the problem. My colleague had worked on this board and tried to use the built-in St-Link for external target board, so has the SB19 removed. As closed SB19, every thing went fine.

  But I'm still curious what you mean   GDB server from Em::Blocks ? Could you provide me little more details?

  And also, I'm be interested to know the guide line to ''how to turn built-in ST-Link v2 on STM32F0308-Discovery for external target? ''.  Maybe I should start a new topic address it.

 

Posted on October 26, 2016 at 17:51

The EmBlocks release likely has people behind it who have tested it and will support it, open source developers in general don't want the hear everyone's sad story about how to get things working, or walk them through it individually..

Using the on-board ST-LINK for external targets requires you disconnect the internal target, there are usually a pair of jumpers to disconnect SWDIO/SWCLK, but it is highly desirable to disconnect NRST and SWO.

There are a lot of small ST-LINK clones at this point that I can ship to my door for under $5 that hacking about with the DISCO/NUCLEO boards to exfiltrate a SWD connection to an external target seems a bit burdensome, especially if one wants to flip back and forth, or have a large box of DISCOs in random states of configuration/usability.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
bluenow1896
Associate III
Posted on October 27, 2016 at 02:00

Thanks for all the information.

Just realized that Em:Block is another development IDE for embedded software development.

Does STM32CubeMX project support Em::Block ?  What makes Em::Block better than others? I like OpenSTM32 just because it is Eclipse based, and run across platforms of Linux/MacOSX and Windows, by consistent user interface. and yes there are other Eclipse based development IDE support STM32, I like to compare and use them too.

Posted on October 27, 2016 at 04:59

I don't like Eclipse or Cube..

As ST is funding the OpenSTM32 project and migrating away from Atollic I'd suspect support with be on the road map.

A number of us have pushed for some more generic GNU/GCC make file support.

I'm of the opinion that these tool chains all need to do a much better job of importing projects from competing chains, or use some common/agreeable project definition.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
slimen
Senior
Posted on October 27, 2016 at 11:02

Hi,

I suggest you to review examples in

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef0.html

firmware, take a SW4STM32 template example of STM32F0308-Discovery:

STM32Cube_FW_F0_V1.6.0\Projects\STM32F0308-Discovery\Templates\SW4STM32 and compare it to your own configuration to know what is wrong.

Regards