Page 1 of 1

Open OCD with stm32F4dicovery

Posted: Mon Jan 20, 2014 12:02 pm
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 ?

Re: Open OCD with stm32F4dicovery

Posted: Mon Jan 20, 2014 12:17 pm
by Giovanni
Hi,

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

Giovanni

Re: Open OCD with stm32F4dicovery

Posted: Mon Jan 20, 2014 12:29 pm
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.

Re: Open OCD with stm32F4dicovery

Posted: Mon Jan 20, 2014 12:55 pm
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

Re: Open OCD with stm32F4dicovery

Posted: Mon Jan 20, 2014 1:49 pm
by Giovanni
The F401 ones are the newest but the demos are targeted to the F407.

Giovanni

Re: Open OCD with stm32F4dicovery

Posted: Sat Apr 05, 2014 8:31 pm
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 11416 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!

Re: Open OCD with stm32F4dicovery

Posted: Sat Apr 05, 2014 9:20 pm
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 870 times

Re: Open OCD with stm32F4dicovery

Posted: Mon Apr 07, 2014 6:07 am
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?

Re: Open OCD with stm32F4dicovery

Posted: Mon Apr 07, 2014 8:26 am
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

Re: Open OCD with stm32F4dicovery

Posted: Tue Apr 08, 2014 7:38 am
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!