Page 1 of 1

STM32F205 Project Not Booting

Posted: Wed Apr 06, 2016 8:07 pm
by chrismerck
Hi,

I'm having trouble booting my project and would appreciate some help. I have had success in the past with F0 and F1 parts, but am having some trouble with the F2.

The board is custom, based on STM32F205RGT6 using the STLinkV2-1/SWD from a Nucleo board. I can successfully flash and debug bare metal code using the defaults in SW4STM32 (openocd), so I know the hardware is OK. I setup a ChibiOS 16.1.5 project, based on RT-STM32F207-DISCOVERY demo project, except with the mcu type define changed to STM32F205xx, and pins set as inputs to avoid contention. I can compile/link no problem.

When I download and attempt to debug (using texane/st-util and gdb, a combination that works for me with an F0 part), I get the following output:

Code: Select all

cmerck@klendathu:~/src/xanthos/firmware/RT-STM32F207-DISCOVERY$ sudo ./debug.stlink.sh -f
***
PROJECT=ch
HEXFILE=build/ch.hex
***
make: Nothing to be done for `all'.
**** Reset board now! ****
2016-04-06T14:52:44 INFO src/stlink-common.c: Loading device parameters....
2016-04-06T14:52:44 INFO src/stlink-common.c: Device connected is: F2 device, id 0x20076411
2016-04-06T14:52:44 INFO src/stlink-common.c: SRAM size: 0x20000 bytes (128 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 131072 bytes
Mass erasing................
**** Success! ****
2016-04-06T14:53:02 INFO src/stlink-common.c: Loading device parameters....
2016-04-06T14:53:02 INFO src/stlink-common.c: Device connected is: F2 device, id 0x20076411
2016-04-06T14:53:02 INFO src/stlink-common.c: SRAM size: 0x20000 bytes (128 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 131072 bytes
2016-04-06T14:53:02 INFO gdbserver/gdb-server.c: Chip ID is 00000411, Core ID is  2ba01477.
2016-04-06T14:53:02 INFO gdbserver/gdb-server.c: Target voltage is 3245 mV.
2016-04-06T14:53:02 INFO gdbserver/gdb-server.c: Listening at *:4242...
GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from build/ch.elf...done.
2016-04-06T14:53:02 INFO gdbserver/gdb-server.c: Found 6 hw breakpoint registers
2016-04-06T14:53:02 INFO gdbserver/gdb-server.c: GDB connected.
0x1fff3de4 in ?? ()
Loading section startup, size 0x1c0 lma 0x8000000
Loading section .text, size 0x6910 lma 0x80001c0
Loading section .data, size 0xb8 lma 0x8006ad0
2016-04-06T14:53:03 INFO src/stlink-common.c: Attempting to write 16384 (0x4000) bytes to stm32 address: 134217728 (0x8000000)
EraseFlash - Sector:0x0 Size:0x4000
Flash page at addr: 0x08000000 erased
2016-04-06T14:53:03 INFO src/stlink-common.c: Finished erasing 1 pages of 16384 (0x4000) bytes
2016-04-06T14:53:03 INFO src/stlink-common.c: Starting Flash write for F2/F4/L4
2016-04-06T14:53:03 INFO src/stlink-common.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 16384
2016-04-06T14:53:03 INFO src/stlink-common.c: Starting verification of write complete
2016-04-06T14:53:03 INFO src/stlink-common.c: Flash written and verified! jolly good!
2016-04-06T14:53:03 INFO src/stlink-common.c: Attempting to write 16384 (0x4000) bytes to stm32 address: 134234112 (0x8004000)
EraseFlash - Sector:0x1 Size:0x4000
Flash page at addr: 0x08004000 erased
2016-04-06T14:53:04 INFO src/stlink-common.c: Finished erasing 1 pages of 16384 (0x4000) bytes
2016-04-06T14:53:04 INFO src/stlink-common.c: Starting Flash write for F2/F4/L4
2016-04-06T14:53:04 INFO src/stlink-common.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 16384
2016-04-06T14:53:04 INFO src/stlink-common.c: Starting verification of write complete
2016-04-06T14:53:04 INFO src/stlink-common.c: Flash written and verified! jolly good!
Start address 0x80001c0, load size 27528
Transfer rate: 14 KB/sec, 6882 bytes/write.

<here there was no more console output, and I pressed Ctrl-c>

^CError detected on fd 7
.gdbinit:3: Error in sourced command file:
Remote communication error.  Target disconnected.: Interrupted system call.
(gdb) quit


The line which stands out to me is:

Code: Select all

0x1fff3de4 in ?? ()
Somehow it seems the code is not linked properly. But looking over the datasheet, it seems I shouldn't need to change the STM32F207 linker file for use with F205RGT.

The fact that I can download & debug a bare metal project in SW4STM32 leads me to believe this is a software issue. My OS is Ubuntu 14.04 LTS if that matters.

Thanks for any pointers.

-Chris

Re: STM32F205 Project Not Booting

Posted: Wed Apr 06, 2016 8:17 pm
by Giovanni
Hi,

Just to know, the STM32F207-Discovery demo has never been tested on any HW, that board does not exist. So please do not assume it is necessarily correct, it has been derived from the F407 demo changing the F4 references.

Said that, I am not sure about that error and its meaning.

Giovanni

Re: STM32F205 Project Not Booting

Posted: Wed Apr 06, 2016 8:22 pm
by chrismerck
Thanks for the heads up, Giovanni. Good to know.

I will search for anyone who has gotten ChibiOS running on STM32F205 and compare with their configs.

Best,
Chris

Re: STM32F205 Project Not Booting

Posted: Sat Apr 16, 2016 12:44 am
by RoccoMarco
I will give a try in few weeks using the STM32 Nucleo-144 F207. I will keep you up to date.

Re: STM32F205 Project Not Booting

Posted: Sun May 01, 2016 9:46 pm
by RoccoMarco
Hi,
now you can find working demos for STM32F207 in trunk. They will be released with ChibiOS 16.7.1 or whatever.

Ciao,
RM