Cannot connect to target STM32G0316-DISCO - stm32

I had a working STM32G0316-DISCO board, but after programming the STM31G031 I cannot connect to the MCU anymore using ST-LINK. This is because I set pin 7 and 8 to a digital input whereas pin 7 and 8 are SWDIO and SWCLK respectively as well. This messes up the communication. I tried to pull pin 8 high (which is the boot0 pin as well) when powering the board in order to force it in a different boot mode, but STM32CubeProgrammer still cannot connect to the board, reporting "Error: No STM32 target found!"
I also tried setting the program mode to "under reset" and the reset mode to "Software reset", but nothing seems to work. What I can do?

https://electronics.stackexchange.com/a/303827
Program under reset is what you need to do but reset must be held using reset pin.

Related

Olimax STM32-E407 cannot connect over SWD

Good day
The problem:
I am trying to connect/flash/debug a Olimax STM32-E407 dev board over SWD and I am not able
When trying to connect, using CubeProgrammer, I get: "No STM32 Target Found"
What I have tried:
I have connected a ST-link V3 mini to the pinout of the the 20pin header of the Olimax board including 3.3V, GND, SWDIO (PA13/Pin7), SWCLK (PA14/Pin9) and NRST (Pin15).
I am powering the powering the board from a power supply into the power jack
All jumpers and solder bridges are in stock places.
I have also tried manually pulling NRST to ground and doing a full chip erase, but that has not worked either.
I have used these ST-link debuggers on other boards I made and it works perfectly fine
I have 3 Olimax boards and none of them work
Any help would he hugely appreciated.
Debugging problems on microcontrollers have two general common methodes.
Hardware Problems:
In this part, it is highly recommended that use an oscilloscope to monitor circuit.
Make sure the microcontroller is powered with a correct and stable power supply.
Check the soldering quality and there is no short circuit on the board (especially between ground pins and other pins).
Check the NRST pin is high when the board is powered.
Remember that this reset is active low so during programming or debugging this pin should be high. Also, check this pin is debounced with a capacitor.
Also you can check the JTAG pins signals with an Oscilloscope to check if the programmer device is working fine.
Sometimes adding a capacitor between debugging pins and GND increases the bus capacitance and solves the problem. The value of the capacitor should be found by trying.
Software Problems
Check the programmer driver is correctly installed on your PC.
Check the programming method is true(for example maybe the board is designed to be programmed with SWD, not JATG).
Sometimes reducing the programming clock of the programmer solved the problem.
If all of these methods didn't work and you are sure that the board is fine, probably the programmer is broken, so change the programmer with another one.

STM32F030x sends ST20033000022056000063227OV every 5 seconds and cannot be programmed

I built 2 baremetal development boards, both using the STM32F030K6T6. The MCU on one board can be programmed as indicated in the datasheet using the boot pin selection and via USART pins PA14 and PA15. The second does not respond to flashing command and instead keeps sending the same message ST20033000022056000063227OV on the USART TX pin every 5 seconds with a 9600 baud rate.
I was not able to find any references related to this in the datasheet or elsewhere. I could just ditch the board but I'd like to understand what is it that's happening. It seems like the MCU is in some sort of a failure mode. What does the message mean?
I tried flashing using the stm32flash script available in the STM32 library for Arduino. The signal's baud rate was determined using a scope. The messages were then captured with:
cu -l /dev/ttyUSB0 -s 9600
Both MCUs came from the same batch and the development boards have the same aditional components (2 decoupling capacitors, a boot selector jumper and a reset button).

pi-zero usb otg port identified as unknown device during boot

I currently have a pi zero which acts as a bluetooth keyboard which - when attached to a computer - types text read from the SD card. I followed this tutorial https://www.rmedgar.com/blog/using-rpi-zero-as-keyboard-setup-and-device-definition. I use only the USB "Data" port, to power it up and to send data.
This setup works really fine on nearly all computers I tested it on, just on some Windows 7 systems it is not working at all. The system where it is not working on identify the pi zero as "Unknown device" and then never "re-identify" it as the keyboard which it is supposed to be.
All other systems first identify the device as "Unknown device" and after some seconds "re-identify" it as the actual keyboard. IMO the problem is the one mentioned by scruss in this post: https://raspberrypi.stackexchange.com/questions/60056/cant-see-raspberry-pi-zero-via-usb-otg-on-windows-10
I'm looking for a possibility to fix this problem. Is there some possibility to configure the pi zero in a way that during boot it does not identify as any USB device. Maybe that during boot the data USB port acts only as a power USB port.
Or can I turn the USB port off and on after a boot so that form the computers point of view it looks like the usb devices is removed and reattached??
I fixed that with the help of a colleague.
The solutions seems super simple - just remove the usb gadget and add it again.
The code necessary is equally simple:
#Remove usb gadget
echo "" > UDC
#Add it again
ls /sys/class/udc > UDC

PC cannot identify the ST-LINK

The development board is STM32F4DISCOVERY, which includes an ST-LINK embedded debug tool. Recently, my computer cannot identify the ST-LINK on it. The Device Manager shows that 'Unknown USB Deviceļ¼ˆDevice Descniptor Request Failed)' with a yellow '!'.Besides, the LD1(LED) on the board change between Red and Green every 5s. Below is the SCH of the ST-LINK.
ps: I've already re-install the device driver, changed the micro-USB cable and even tried on another computer. Still not work.
I had similar behavior when I shorted-circuit on 5V (of course accidentally). Please check voltage on D1, on both sides must be 5V.
Also, if the voltage is OK, I would recommend testing board on another PC.

Set initial state as input on pins using FTDI device FT4232H

I am using a USB device from FTDI called FT4232H and I want to write on the EEPROM to make sure that some pins are set to inputs at start. I am using the D2XX drivers (pdf here). Here I found at page 106 that there is a struct called FT_EEPROM_4232H. Could this be something to use to make sure the pins are set to inputs at the beginning or is this totaly wrong? There are four UCHAR variables called A-, B-, C- and DDriverType. Does anyone know what these should be used for?
I realise this question is 3 months old now but I believe pins on the FTx232H series of chips only get set as GPIO once the MPSSE command SetOutput is issued.
The EEPROM configuration is used to define things like drive strength, slew rate and whether the pin is a schmitt input and what each of the 4 ports are set up to be (async FIFO akin to FT245 series, serial port (FT232), etc).
If anyone else can disprove this, I would be interested to know also!
I just plugged my FT232H board in my PC and ran FTDI FT_Prog, it does not appears you can control the GPIO mode input/output at start time. There is nothing in the FTDI FT_Prog UI that allow to set a mode for GPIO pins and set them as input.
I did set programmatically my FT232H board as an SPI device with 8 GPIOS
but this was done after the chip was started.
A video experimenting with the FT232H
I also once asked FTDI support a similar question for the FT232RL which is as default a UART and I asked if there was a way to configure the chip to start in Synchronous bit banging mode and set the GPIOs as OUTPUT. The answer was no.
The FT232RL will always start as a UART and then by software I can activate Synchronous bit banging mode, and set the mode of my GPIO.
I suppose it is the same for the FT232H, FT2232H and FT4232H.