Thank you for all your answer. I found one issue if I use subprocess function in combination with stm32loader. So, I have stm32loader.py script and additional file (sthdbg.bin) in mwork directory -> path (/home/projects/mwork) on my RPi.
If I use cmd and if I go in mwork directory I can use this command:
If I use this command from another script which is also in mwork directory in combination with subprocess function then command looks like this:
But I get error "NameError: name 'sthdbg' is not defined".
Do I need to use path?
If I use cmd and if I go in mwork directory I can use this command:
sudo python stm32loader.py -p '/dev/ttyAMA0' -e -w -v sthdbg.bin
If I use this command from another script which is also in mwork directory in combination with subprocess function then command looks like this:
subprocess.Popen(['sudo', 'python', 'stm32loader.py', '-p', "/dev/ttyAMA0", '-e', '-w', '-v', sthdbg.bin])
But I get error "NameError: name 'sthdbg' is not defined".
Do I need to use path?