stm32flash: command not found
vadim@vadim-System-Product-Name:~/gotek/stm32flash$ rehash
No command 'rehash' found, did you mean:
 Command 'rahash' from package 'radare-common' (universe)
 Command 'rhash' from package 'rhash' (universe)
rehash: command not found
vadim@vadim-System-Product-Name:~/gotek/stm32flash$ stm32flash --help
stm32flash: command not found
vadim@vadim-System-Product-Name:~/gotek/stm32flash$ make compile
make: *** No rule to make target `compile'.  Stop.
vadim@vadim-System-Product-Name:~/gotek/stm32flash$ make
make: Nothing to be done for `all'.
vadim@vadim-System-Product-Name:~/gotek/stm32flash$ make install
install -d /usr/local/bin
install -m 755 stm32flash /usr/local/bin
install: cannot create regular file ‘/usr/local/bin/stm32flash’: Permission denied
make: *** [install] Error 1
vadim@vadim-System-Product-Name:~/gotek/stm32flash$ su
Password: 
su: Authentication failure
vadim@vadim-System-Product-Name:~/gotek/stm32flash$ su make install
No passwd entry for user 'make'
vadim@vadim-System-Product-Name:~/gotek/stm32flash$ sudo
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
            [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-u user] file ...
vadim@vadim-System-Product-Name:~/gotek/stm32flash$ sudo make install
[sudo] password for vadim: 
install -d /usr/local/bin
install -m 755 stm32flash /usr/local/bin
install -d /usr/local/share/man/man1
install -m 644 stm32flash.1 /usr/local/share/man/man1
vadim@vadim-System-Product-Name:~/gotek/stm32flash$ stm32flash
stm32flash 0.4

http://stm32flash.googlecode.com/

ERROR: Device not specified
Usage: stm32flash [-bvngfhc] [-[rw] filename] [tty_device | i2c_device]
	-a bus_address	Bus address (e.g. for I2C port)
	-b rate		Baud rate (default 57600)
	-m mode		Serial port mode (default 8e1)
	-r filename	Read flash to file (or - stdout)
	-w filename	Write flash from file (or - stdout)
	-C		Compute CRC of flash content
	-u		Disable the flash write-protection
	-j		Enable the flash read-protection
	-k		Disable the flash read-protection
	-o		Erase only
	-e n		Only erase n pages before writing the flash
	-v		Verify writes
	-n count	Retry failed writes up to count times (default 10)
	-g address	Start execution at specified address (0 = flash start)
	-S address[:length]	Specify start address and optionally length for
	                   	read/write/erase operations
	-F RX_length[:TX_length]  Specify the max length of RX and TX frame
	-s start_page	Flash at specified page (0 = flash start)
	-f		Force binary parser
	-h		Show this help
	-c		Resume the connection (don't send initial INIT)
			*Baud rate must be kept the same as the first init*
			This is useful if the reset fails
	-i GPIO_string	GPIO sequence to enter/exit bootloader mode
			GPIO_string=[entry_seq][:[exit_seq]]
			sequence=[-]n[,sequence]
	-R		Reset device at exit.

Examples:
	Get device information:
		stm32flash /dev/ttyS0
	  or:
		stm32flash /dev/i2c-0

	Write with verify and then start execution:
		stm32flash -w filename -v -g 0x0 /dev/ttyS0

	Read flash to file:
		stm32flash -r filename /dev/ttyS0

	Read 100 bytes of flash from 0x1000 to stdout:
		stm32flash -r - -S 0x1000:100 /dev/ttyS0

	Start execution:
		stm32flash -g 0x0 /dev/ttyS0

	GPIO sequence:
	- entry sequence: GPIO_3=low, GPIO_2=low, GPIO_2=high
	- exit sequence: GPIO_3=high, GPIO_2=low, GPIO_2=high
		stm32flash -i -3,-2,2:3,-2,2 /dev/ttyS0

vadim@vadim-System-Product-Name:~/gotek/stm32flash$ ls /dev/
autofs           loop2               ram7      tty21  tty53      ttyS26
block            loop3               ram8      tty22  tty54      ttyS27
bsg              loop4               ram9      tty23  tty55      ttyS28
btrfs-control    loop5               random    tty24  tty56      ttyS29
bus              loop6               rfkill    tty25  tty57      ttyS3
cdrom            loop7               rtc       tty26  tty58      ttyS30
char             loop-control        rtc0      tty27  tty59      ttyS31
console          lp0                 sda       tty28  tty6       ttyS4
core             mapper              sda1      tty29  tty60      ttyS5
cpu              mcelog              sda2      tty3   tty61      ttyS6
cpu_dma_latency  mem                 sda5      tty30  tty62      ttyS7
cuse             memory_bandwidth    sg0       tty31  tty63      ttyS8
disk             net                 sg1       tty32  tty7       ttyS9
dri              network_latency     shm       tty33  tty8       uhid
ecryptfs         network_throughput  snapshot  tty34  tty9       uinput
fb0              null                snd       tty35  ttyprintk  urandom
fd               parport0            sr0       tty36  ttyS0      vcs
fd0              port                stderr    tty37  ttyS1      vcs1
full             ppp                 stdin     tty38  ttyS10     vcs2
fuse             psaux               stdout    tty39  ttyS11     vcs3
hidraw0          ptmx                tty       tty4   ttyS12     vcs4
hidraw1          pts                 tty0      tty40  ttyS13     vcs5
hidraw2          ram0                tty1      tty41  ttyS14     vcs6
hpet             ram1                tty10     tty42  ttyS15     vcsa
i2c-0            ram10               tty11     tty43  ttyS16     vcsa1
i2c-1            ram11               tty12     tty44  ttyS17     vcsa2
i2c-2            ram12               tty13     tty45  ttyS18     vcsa3
i2c-3            ram13               tty14     tty46  ttyS19     vcsa4
i2c-4            ram14               tty15     tty47  ttyS2      vcsa5
input            ram15               tty16     tty48  ttyS20     vcsa6
kmsg             ram2                tty17     tty49  ttyS21     vfio
kvm              ram3                tty18     tty5   ttyS22     vga_arbiter
log              ram4                tty19     tty50  ttyS23     vhci
loop0            ram5                tty2      tty51  ttyS24     vhost-net
loop1            ram6                tty20     tty52  ttyS25     zero
vadim@vadim-System-Product-Name:~/gotek/stm32flash$ clear

vadim@vadim-System-Product-Name:~/gotek/stm32flash$ cd ..
vadim@vadim-System-Product-Name:~/gotek$ ls
CortexAmigaFloppyEmulator            CP210x_VCP_Windows      stm32flash             stsw-mcu005
cortexamigafloppyemulator_v105a.zip  CP210x_VCP_Windows.zip  stm32flash-0.4.tar.gz  stsw-mcu005.zip
vadim@vadim-System-Product-Name:~/gotek$ cd CortexAmigaFloppyEmulator
vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator$ ls
Bootdisk  Firmware  version.txt
vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator$ cd Firmware
vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ ls
CortexAmigaFloppyEmulator_1.05a.hex  OLD
vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ ls /dev
autofs           i2c-3               psaux   serial    tty23  tty48      ttyS13  ttyUSB0
block            i2c-4               ptmx    sg0       tty24  tty49      ttyS14  uhid
bsg              input               pts     sg1       tty25  tty5       ttyS15  uinput
btrfs-control    kmsg                ram0    shm       tty26  tty50      ttyS16  urandom
bus              kvm                 ram1    snapshot  tty27  tty51      ttyS17  vcs
cdrom            log                 ram10   snd       tty28  tty52      ttyS18  vcs1
char             loop0               ram11   sr0       tty29  tty53      ttyS19  vcs2
console          loop1               ram12   stderr    tty3   tty54      ttyS2   vcs3
core             loop2               ram13   stdin     tty30  tty55      ttyS20  vcs4
cpu              loop3               ram14   stdout    tty31  tty56      ttyS21  vcs5
cpu_dma_latency  loop4               ram15   tty       tty32  tty57      ttyS22  vcs6
cuse             loop5               ram2    tty0      tty33  tty58      ttyS23  vcsa
disk             loop6               ram3    tty1      tty34  tty59      ttyS24  vcsa1
dri              loop7               ram4    tty10     tty35  tty6       ttyS25  vcsa2
ecryptfs         loop-control        ram5    tty11     tty36  tty60      ttyS26  vcsa3
fb0              lp0                 ram6    tty12     tty37  tty61      ttyS27  vcsa4
fd               mapper              ram7    tty13     tty38  tty62      ttyS28  vcsa5
fd0              mcelog              ram8    tty14     tty39  tty63      ttyS29  vcsa6
full             mem                 ram9    tty15     tty4   tty7       ttyS3   vfio
fuse             memory_bandwidth    random  tty16     tty40  tty8       ttyS30  vga_arbiter
hidraw0          net                 rfkill  tty17     tty41  tty9       ttyS31  vhci
hidraw1          network_latency     rtc     tty18     tty42  ttyprintk  ttyS4   vhost-net
hidraw2          network_throughput  rtc0    tty19     tty43  ttyS0      ttyS5   zero
hpet             null                sda     tty2      tty44  ttyS1      ttyS6
i2c-0            parport0            sda1    tty20     tty45  ttyS10     ttyS7
i2c-1            port                sda2    tty21     tty46  ttyS11     ttyS8
i2c-2            ppp                 sda5    tty22     tty47  ttyS12     ttyS9
vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ clear

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ ls
CortexAmigaFloppyEmulator_1.05a.hex  OLD
vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Error probing interface "serial_posix"
Cannot handle device "/dev/ttyUSB0"
Failed to open port: /dev/ttyUSB0

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ 
vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -u -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -u -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -u -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -u -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 9600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 9600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 9600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 9600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ 
vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 9600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 9600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 9600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 9600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 9600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 9600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ 
vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 9600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 9600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 9600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 9600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 9600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 9600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 9600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 9600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Error probing interface "serial_posix"
Cannot handle device "/dev/ttyUSB0"
Failed to open port: /dev/ttyUSB0

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -k -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0418 (Connectivity line)
- RAM        : 64KiB  (4096b reserved by bootloader)
- Flash      : 256KiB (sector size: 2x2048)
- Option RAM : 16b
- System RAM : 18KiB
Read-UnProtecting flash
Done.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -u -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -u -b 57600 /dev/ttyUSB0
stm32flash 0.4

http://stm32flash.googlecode.com/

Interface serial_posix: 57600 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0418 (Connectivity line)
- RAM        : 64KiB  (4096b reserved by bootloader)
- Flash      : 256KiB (sector size: 2x2048)
- Option RAM : 16b
- System RAM : 18KiB
Write-unprotecting flash
Done.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -u -b 57600 /dev/ttyUSB0ls
stm32flash 0.4

http://stm32flash.googlecode.com/

Error probing interface "serial_posix"
Cannot handle device "/dev/ttyUSB0ls"
Failed to open port: /dev/ttyUSB0ls

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ ls
CortexAmigaFloppyEmulator_1.05a.hex  OLD
vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -b 57600 /dev/ttyUSB0 -w CortexAmigaFloppyEmulator_1.05a.hex
stm32flash 0.4

http://stm32flash.googlecode.com/

Using Parser : Intel HEX
Interface serial_posix: 57600 8E1
Failed to init device.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ sudo stm32flash -b 57600 /dev/ttyUSB0 -w CortexAmigaFloppyEmulator_1.05a.hex
stm32flash 0.4

http://stm32flash.googlecode.com/

Using Parser : Intel HEX
Interface serial_posix: 57600 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0418 (Connectivity line)
- RAM        : 64KiB  (4096b reserved by bootloader)
- Flash      : 256KiB (sector size: 2x2048)
- Option RAM : 16b
- System RAM : 18KiB
Write to memory
Erasing memory
Wrote address 0x0800f5b0 (100.00%) Done.

vadim@vadim-System-Product-Name:~/gotek/CortexAmigaFloppyEmulator/Firmware$ 
