ChibiStudio stm32f4discovery-failed to load demo project.

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
przem312
Posts: 1
Joined: Sat Jan 11, 2014 7:06 pm

ChibiStudio stm32f4discovery-failed to load demo project.

Postby przem312 » Sat Feb 01, 2014 1:01 am

Hi there!
I've got an issue regarding starting demo project by using chibistudio preview 5. Once I've build the ARMCM4-STM32F407-DISCOVERY project, started the openocd with stm32f4discovery.cfg, ran the debug and here's what i got:
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 v14 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : Target voltage: 2.886772
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection from 3333
Info : device id = 0x10016413
Info : flash size = 1024kbytes
Warn : acknowledgment received, but no packet pending
undefined debug reason 6 - target needs reset
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : Padding image section 0 with 8 bytes
Error: timeout waiting for algorithm, a target reset is recommended
Error: error executing stm32x flash write algorithm
Error: flash write failed = 00000040
Error: error writing to flash at address 0x08000000 at offset 0x00000000
Warn : The target is not in the halted nor running stated, stepi/continue ignored.
Warn : target not halted
Warn : target not halted
Warn : target not halted
Error: address + size wrapped(0xfffffffe, 0x00000004)
Error: address + size wrapped(0xfffffffe, 0x00000004)
Info : rejected 'gdb' connection, no more connections allowed
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Error: address + size wrapped(0xfffffffe, 0x00000004)
Error: address + size wrapped(0xfffffffe, 0x00000004)
Info : Padding image section 0 with 8 bytes
Error: Target is already running an algorithm
Error: error starting target flash write algorithm
Error: error writing to flash at address 0x08000000 at offset 0x00000000
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f4x.cpu failed, GDB will be halted. Polling again in 100ms
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Polling target stm32f4x.cpu succeeded again

Any ideas what might go wrong? Flash is ofc clean as should.

User avatar
Giovanni
Site Admin
Posts: 13008
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 742 times
Been thanked: 620 times
Contact:

Re: ChibiStudio stm32f4discovery-failed to load demo project

Postby Giovanni » Sat Feb 01, 2014 10:03 am

It could be an HW issue looking at that. Do you have another board to try?

Giovanni

inca
Posts: 37
Joined: Mon Apr 22, 2013 12:08 am

Re: ChibiStudio stm32f4discovery-failed to load demo project

Postby inca » Sat Apr 25, 2015 4:56 am

I can confirm the same occurs in the RT-STM32F429-DISCOVERY demo project in ChibiStudio Preview 10.7.

Steps to repeat on this STM32F429Discovery board:
* Build project
* Start openocd (onboard stlink-v2 via libusb-win32 1.2.6.0 zadig), select the scripts/board/stm32f429discovery.cfg
* OpenOCD [Flash, Run]
* At main entry point, select continue or step through the code.

$ ./bin/openocd.exe -f scripts/board/stm32f429discovery.cfg
Open On-Chip Debugger 0.9.0-dev-00268-ga9c90a0 (2015-02-08-10:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v23 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.892127
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'telnet' connection on tcp/4444
Info : accepting 'gdb' connection on tcp/3333
Info : device id = 0x10036419
Info : flash size = 2048kbytes
Error: address + size wrapped(0xfffffffe, 0x00000004)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : Padding image section 0 with 4 bytes
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0xfffffffc
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080001c0 msp: 0x00000400
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f4x.cpu failed, GDB will be halted. Polling again in 100ms
Error: JTAG failure -4
Error: JTAG failure -4
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f4x.cpu failed, GDB will be halted. Polling again in 300ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f4x.cpu failed, GDB will be halted. Polling again in 700ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f4x.cpu failed, GDB will be halted. Polling again in 1500ms


Stepping through the code results in the following trace to pal_lld.c:

Code: Select all

static void initgpio(stm32_gpio_t *gpiop, const stm32_gpio_setup_t *config) {}
...
gpiop->MODER   = config->moder;


I turned off optimization and now breakpoints don't seem to be getting hit for main(). We immediately get stuck in _unhandled_exception().

As far as I can tell, the code and hardware are in the virgin state.

I'll try the demo on a STM32F4 Disco board as well and report back if anything interesting occurs.

inca
Posts: 37
Joined: Mon Apr 22, 2013 12:08 am

Re: ChibiStudio stm32f4discovery-failed to load demo project

Postby inca » Sat Apr 25, 2015 5:11 am

The F4 Disco board has Black Magic Debugger on it and I'm not terribly interested in learning how to interface it to eclipse, even though it should be trivial.

The F3 Disco board demo, RT-STM32F303-DISCOVERY, works flawlessly. Breakpoints and all.


Return to “User Projects”

Who is online

Users browsing this forum: No registered users and 3 guests