# How to use execute linux commands using QProcess

#### zazas321

Joined Nov 29, 2015
779
Hey. I am trying to execute linux commands using QProcess. I am trying to flash and read back data from STM32 micro using raspberry pi using the stm32flash utility as such : http://manpages.ubuntu.com/manpages/bionic/man1/stm32flash.1.html I am able to flash the STM32 chip using this command on the linux terminal:
stm32flash -w datafile.hex /dev/ttyUSB0

and then read the data using

All I am trying to do is call one or another command using the Qprocess so I do not need to use terminal. Reading the QT QProcess examples, it seems straight forward and should work using the code below:

C:
QObject *parent;
QString program = "/home/pi/stm32flash-code/stm32flash";
QStringList arguments;
myProcess->start(program, arguments);