This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USART Debugging using STM32F407VG Disco board in Keil - can't debug

I've learned that, when debugging a code that utilizes USART, we can't do it over the ST-LINKV2 on the Disco board. 

I found that to achieve this we have to use a usb-to-serial converter. I have the PL2303HXA and i'm using it on my disco with the STM32F407VGT6 MCU. I've tried something but i can't debug. I've also considered the cross connection: tx(converter) - rx(mcu), rx(converter) - tx(mcu), and connected the common grounds and tried both 5V and 3.3V VCC, but still no result.

These are the connections i made:

Note: Here i have the LED1 blinking red (toggling), and when i try to debug like this it says: No ST-LINK detected and this one:

The other thing i did is this:

Here i connected the Mini USB to another usb port on my pc, and the PL2303HXA in another as can be seen.

Here i only get the error:  Error: Flash Download failed - "Cortex-M4"

Parents
  • You can't "debug" the device via USART. Your application can send data via this USART and with the serial to USB adapter you can use for example a terminal program on your PC to watch the output if your application sends ASCII chars.

    Using the uVision Debugger works via the onboard ST-Link. And to verify, that your board is working, disconnect the USART cables. Connect the mini USB cable, which connects the onboard ST-Link to the PC. Can you then flash the device and start a debug session with it?

    If flashing still fails, are there additional output messages in the Build Window, that tell more about possible failure reasons?

    Else, if flashing and debugging works then, only connect the data (TX and RX) cables and GND. As the board has a power supply via the ST-Link another power supply is not needed.

Reply
  • You can't "debug" the device via USART. Your application can send data via this USART and with the serial to USB adapter you can use for example a terminal program on your PC to watch the output if your application sends ASCII chars.

    Using the uVision Debugger works via the onboard ST-Link. And to verify, that your board is working, disconnect the USART cables. Connect the mini USB cable, which connects the onboard ST-Link to the PC. Can you then flash the device and start a debug session with it?

    If flashing still fails, are there additional output messages in the Build Window, that tell more about possible failure reasons?

    Else, if flashing and debugging works then, only connect the data (TX and RX) cables and GND. As the board has a power supply via the ST-Link another power supply is not needed.

Children