I have a HW platform where I have a TI AM623 SOC uart driving the programming of a STM32 Nucleo-g070rb device. I have GPIOs BOOT0, RSTn, UART-TX, UART-RX connected to AM623 pins. I verified that I can connect to the UART reset the STM32 from the AM623 side. I am using the following algorithm to program the STM32:
/bin/stty cs8 -parenb -parodd -crtscts -ixon -ixoff 115200 -F /dev/ttyS0
echo 354 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio354/direction
echo 356 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio356/direction
// ENTRY sequence
echo 0 > /sys/class/gpio/gpio354/value
sleep 0.1
echo 0 > /sys/class/gpio/gpio356/value
sleep 0.5
/usr/bin/stm32flash -b 115200 -w nucleo-g070rb.bin /dev/ttyS0
// EXIT sequence
echo 1 > /sys/class/gpio/gpio356/value
echo 1 > /sys/class/gpio/gpio354/value
Am I doing something wrong here?
Anonymous
Just one tip: If you want to set up the serial port using stty and keep stm32flash from reconfiguring the port, use
-b 0.Are you sure
echo 1 > fileisn't interpreted asechowith stdout (file handle 1) redirected? I usually useecho 1 | tee filewhich avoids any ambiguity (and also because I can use sudo tee easily).It doesn't matter if I use "echo 1 | tee" or "echo 1". I put my multimeter
on BOOT0 & MCU_RSTn pins and added an exit from one stage to another. Both
pins are set correctly throughout the script.
Last edit: Tormod Volden 2025-01-03
Is there something I need to configure on the STM32 side to properly
support the stm32flash utility? So far I've not gotten into the STM32 side
of things, as another engineer is working on that SW.
Last edit: Tormod Volden 2025-01-03
Please see ST's AN2606 document for the details of your chip.
And generally, make sure all other UART or SPI lines are quiet.