Open OCD with stm32F4dicovery

Discussions and support about ChibiStudio, the free development environment for ARM.
Post Reply
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Open OCD with stm32F4dicovery

Post by Tabulous »

Hi All.
just down load the latest Chibistudio and am trying to get the F4xx-RTC demo running.

Everything complies OK

But when starting the external tool what .cfg should i select ?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Open OCD with stm32F4dicovery

Post by Giovanni »

Hi,

C:\ChibiStudio\tools\openocd\scripts\board\stm32f4discovery.cfg

Giovanni
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: Open OCD with stm32F4dicovery

Post by Tabulous »

So i select external tool "OCD on ST-LINK/V2", when prompted i select stm32f4discovery.cfg

Below is the console output, there is a warning/Error not sure what this is......

Open On-Chip Debugger 0.7.0 (2013-05-05-10:41)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Warn : Interface already configured, ignoring
Error: already specified hl_layout stlink
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : This adapter doesn't support configurable speed
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : Target voltage: 2.897234
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints

I then proceed to open debug session and get the following GDB Hardware Debugger error "Execution is suspended because of error" in the details it says

Execution is suspended because of error.
continue
The program is not being run.

In the console for the arm-none-eabi-gdb

symbol-file C:\\ChibiStudio\\chibios\\testhal\\STM32F4xx\\RTC\\build\\ch.elf
set remotetimeout 20
monitor reset init
"monitor" command not supported by this target.
monitor sleep 50
"monitor" command not supported by this target.
load C:\\ChibiStudio\\chibios\\testhal\\STM32F4xx\\RTC\\build\\ch.elf
You can't do that when your target is `None'
tbreak main
Cannot access memory at address 0x8000194
continue
The program is not being run.
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: Open OCD with stm32F4dicovery

Post by Tabulous »

Found out the issue, the discoverykit must have been an old one, has a device 401 on and even STs own ST-Link software could not talk to it...


Cheers
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Open OCD with stm32F4dicovery

Post by Giovanni »

The F401 ones are the newest but the demos are targeted to the F407.

Giovanni
Ramazzukk
Posts: 25
Joined: Sun Jan 06, 2013 2:19 pm

Re: Open OCD with stm32F4dicovery

Post by Ramazzukk »

Hi there, I've got the same issue here.

OS: Tested with Win7/64 and WXP SP3

1. Installed fresh ChibiStudio with i586 Java. Apart from that, nothing else. No drivers for the discovery, nothing.
2. Project Explorer, Project ARMCM4-STM32F407-DISCOVERY open
3. Run/Debug History/ARMCM4-STM32F407-DISCOVERY (OpenOCD, Flash and Run)

Results:

Execution is suspended because of Error

1.PNG
1.PNG (10.69 KiB) Viewed 11406 times


symbol-file C:\\ChibiStudio\\chibios\\demos\\ARMCM4-STM32F407-DISCOVERY\\build\\ch.elf
set remotetimeout 20
monitor reset init
"monitor" command not supported by this target.
monitor sleep 50
"monitor" command not supported by this target.
load C:\\ChibiStudio\\chibios\\demos\\ARMCM4-STM32F407-DISCOVERY\\build\\ch.elf
You can't do that when your target is `None'
tbreak main
Cannot access memory at address 0x8000192
continue
The program is not being run.

On the board sits a STM32F407VGT6.

Do I miss something basic?
The jumpers on the ST-Link are in place. Do I have to connect something more?
Do I have to set breakpoints?
Do I need drivers for the ST-Link?

Thanks for any help or guidance beforehand!
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Open OCD with stm32F4dicovery

Post by Giovanni »

You need to launch OpenOCD before starding "flash and run", there is a link "OpenOCD on STLink v2" in the tools menu in the toolbar.

See the attached presentation.

Giovanni

ChibiOS-RT 4 Demo.zip
(1.11 MiB) Downloaded 869 times
Ramazzukk
Posts: 25
Joined: Sun Jan 06, 2013 2:19 pm

Re: Open OCD with stm32F4dicovery

Post by Ramazzukk »

Thank you very much, Giovanni! It works now..

Strange thing is, sometimes it doesn't connect, like the ST-Link is offline or something. When im connect the Board wit the STM32 ST-LINK Utility, it works properly afterwards..

What I couldn't get to work ist the Virtual Com Port. Is this driver the correct one?

http://www.st.com/web/en/catalog/tools/PF257938

And is there a way to turn on printing the code size into the console after compiling?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Open OCD with stm32F4dicovery

Post by Giovanni »

Hi,

If you launch the debugger twice then the second instance fails, could this be your problem?

It looks like the right driver, just try it.

Code size print will be present in 2.6.4.

Giovanni
Ramazzukk
Posts: 25
Joined: Sun Jan 06, 2013 2:19 pm

Re: Open OCD with stm32F4dicovery

Post by Ramazzukk »

Hi Giovanni

It works! Because I couldn't manage it to work, I installed so many different drivers afterwards nothing worked.. After I recovered a blank system and installed only


everything works fine now.

Thank you for your fast support!
Post Reply