admin管理员组文章数量:1122846
I want to play around with a STM32F030. Therfore I bought a demoboard with a STM32F030C8T6 on it. With this board everything works fine. I can debug with my ST-Link V2 (Cheap China Clone) and OpenOCD with the folowing call:
C:\OpenOCD-20201228-0.10.0\bin\openocd.exe -f interface\stlink-v2.cfg -f target\stm32f0x.cfg
Now I designed my own board with a STM32F030F4P6 I run into trouble. I use the same code, the same environment, the same debugger, ...
connecting with OpenOCD still works fine, but when I try to log on with the GDB I get a strange behafior. There is not direktly an error message but the debugger reports "Unknown file".
I had a closer look on the output of OpenOCD ang got the following:
This is the output of the STM32F030F4P6 with error:
C:\OpenOCD\OpenOCD-20201228-0.10.0\bin\openocd.exe -f interface\stlink-v2.cfg -f target\stm32f0x.cfg
Open On-Chip Debugger 0.10.0 (2020-12-28) []
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
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
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.247525
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : starting gdb server for stm32f0x.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0xc1000003 pc: 0xfffffffe msp: 0xffffffd8
Info : device id = 0x10006444
Info : flash size = 16kbytes
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0xfffffffe msp: 0xfffffffc
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0xfffffffe msp: 0xfffffffc
This is the output of the STM32F030C8T6 without error:
C:\OpenOCD\OpenOCD-20201228-0.10.0\bin\openocd.exe -f interface\stlink-v2.cfg -f target\stm32f0x.cfg
Open On-Chip Debugger 0.10.0 (2020-12-28) []
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
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
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.251818
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : starting gdb server for stm32f0x.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
target halted due to debug-request, current mode: Thread
xPSR: 0x41000000 pc: 0x080000f2 msp: 0x20001000
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
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0x080000c0 msp: 0x20001000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0x080000c0 msp: 0x20001000
What really looks strange to me are the lines:
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0xc1000003 pc: 0xfffffffe msp: 0xffffffd8
As the connections with OpenOCD first is working fine I guess, the hardware shold be ok. Maybe it has something to do with the different types of the STM32F030 but I think the only different is the size of the flash and the RAM. Should I change something in the stm32f0x.cfg?
Can anybody help me with that issue, please?
Thanks in advances,
Drewle
Addtion:
I now realiced, that no data is written to the flash of the controller, the whole memeory is 0xFFFFFFFF, while on the working controller the area at 0x08000000 contains date which fit to my application. I also examined the option bytes:
0x1ffff800: 0x00ff55aa 0x00ff00ff 0x00ff00ff 0x00ff00ff
From my point of view this seems to be ok.
Why is my code not written to the flash?
Addtion:
I tried the following:
Open On-Chip Debugger
> halt
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0xc1000003 pc: 0xfffffffe msp: 0xffffffd8
> mdw 0x08000000 30
0x08000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
0x08000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
0x08000040: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
0x08000060: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
> flash fillw 0x08000000 0xAA55AA55 4
device id = 0x10006444
flash size = 16kbytes
Verification error address 0x08000000, read back 0xffffffff, expected 0xaa55aa55
> mdw 0x08000000 30
0x08000000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
0x08000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
0x08000040: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
0x08000060: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
It seems that everything is fine as the communication with the chip works fine. Never the less I can't flash my application on the chip. What could be the reason for that? Could there be something missing on the hardware?
This are the Optionregister: 0x1ffff800: 00ff55aa 00ff00ff 00ff00ff 00ff00ff ffffffff ffffffff ffffffff ffffffff
This is the factory setting!
本文标签: stm32f0STM32F030F4 with OpenOCD not working while STM32F030C8 okStack Overflow
版权声明:本文标题:stm32f0 - STM32F030F4 with OpenOCD not working while STM32F030C8 ok - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736305188a1932502.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论