blackmagic-debug / blackmagic

In application debugger for ARM Cortex microcontrollers.
GNU General Public License v3.0
3.17k stars 761 forks source link

Load fails on STM32F746 - NRST not released #234

Closed elagil closed 7 years ago

elagil commented 7 years ago

Hello!

I am having problems loading an .elf to the STM32F746. It hangs after beginning to load the sections. I use the following commands:

$ arm-none-eabi-gdb
target extended-remote <COM-port>
monitor swdp_scan
attach 1
file flash.elf
load

Then, it starts loading the .elf:

Loading section .isr_vector, size 0x10c lma 0x8000000

but does not get past it. I do not get any error message, it just hangs there forever. Also, if I stop the command (SIGINT), the blackmagic probe does not react to further commands.

I also tested to flash and debug an STM32F1 and it works fine.

By the way, I can successfully mass erase the STM32F7, with:

mon erase_mass

Thanks in advance!

elagil commented 7 years ago

So, when I disconnect the NRST line, it works. Why is it so? It worked with the NRST connected when using an STM32F1.

The NRST line is not released when debugging an STM32F746.

UweBonnes commented 7 years ago

What BMP platform do you use? Why is NRST asserted at all? NRST assertion need some commands from your side, as far as I know..

elagil commented 7 years ago

I actually implemented the BMP V2.1 on my own PCB. The RST pin is just directly connected to PA2 of the STM32F103 on the BMP, just like it is in the reference design.

NRST is held low by the BMP all the time while debugging, as far as I can measure.

I use no special commands for assertion of NRST. You see the commands I used in the opening statement.

elagil commented 7 years ago

I noticed that I missed the inverter in the original BMP design. Sorry for causing a stir, that was stupid.

gsmcmullin commented 7 years ago

NRST is pulsed by cortexm_reset for targets where it is implemented correctly and does not pull NTRST with it. It sounds like this is just an error in your hardware design, so I'm closing the issue. Please reopen if that is not the case.