Closed timactive closed 6 years ago
Normally if something’s not working there should be some output. What’s the exact commandline you’re using and what’s the output? Which stm8flash version are you using? Do any of the other commands work (e.g. reading the firmware)?
Hi Rumpeltux, The commandline i use is :
stm8flash -c espstlink -p stm8l051f3 -w blinky.ihx -s flash
The output is only :
Determine FLASH area
2 The version of stm8flash is 20170616-1.1.
3 Nothing command work. same result. Example of command i do for read stm8flash -c espstlink -p stm8l051f3 -r firmware.img
Can you give it a try with the current stm8flash HEAD version from https://github.com/vdudouyt/stm8flash?
Yes i use the head version from https://github.com/vdudouyt/stm8flash.
https://drive.google.com/file/d/1Wp9Dv0qsDXPgKrBvo2HR0x2DGx_L1w3W/view
Can you run
strace -x stm8flash -c espstlink -p stm8l051f3 -w blinky.ihx -s flash
and send me the output. It looks like it’s getting stuck somewhere but I don’t know where.
Also you can run gdb stm8flash
then
r -c espstlink -p stm8l051f3 -w blinky.ihx -s flash
Once it idles, hit ctrl+c
and type bt
and send me the output as well.
Thanks, for gdb i have
(gdb) bt
#0 0x00007ffff78e9091 in read () from /lib64/libc.so.6
#1 0x00000000004068e9 in error_check (fd=3, command=255 '\377', resp_buf=0x7fffffffd8d9 "", size=2) at libespstlink.c:101
#2 0x0000000000406be8 in espstlink_fetch_version (pgm=0x60c920) at libespstlink.c:166
#3 0x00000000004043c6 in espstlink_pgm_open (pgm=0x60b2a0 <pgms+192>) at espstlink.c:134
#4 0x00000000004050f0 in main (argc=9, argv=0x7fffffffdbc8) at main.c:340
For strace result command i have
access("/etc/selinux/config", F_OK) = 0
write(2, "Determine FLASH area\r\n", 22Determine FLASH area
) = 22
openat(AT_FDCWD, "/dev/ttyUSB0", O_RDWR|O_NOCTTY) = 3
ioctl(3, TCGETS, {B115200 -opost -isig -icanon -echo ...}) = 0
ioctl(3, TCFLSH, TCIFLUSH) = 0
ioctl(3, SNDCTL_TMR_START or TCSETS, {B115200 -opost -isig -icanon -echo ...}) = 0
ioctl(3, TCGETS, {B115200 -opost -isig -icanon -echo ...}) = 0
write(3, "\xff", 1) = 1
read(3,
https://drive.google.com/file/d/1e0aCQo7LeQuHLjen6bM3VcXPCLic1rin/view
The espstlink is not answering. Are you sure it’s connected at /dev/ttyUSB0?
Oh yes i am sure. I change ESP 12 F to ESP 12 E. I flash my ESP 12 E and i am not stuck to "determine flash".
[timactive@localhost sdcc-examples-stm8]$ stm8flash -c espstlink -p stm8l051f3 -w blinky.ihx -s flash
Determine FLASH area
Due to its file extension (or lack thereof), "blinky.ihx" is considered as INTEL HEX format!
71 bytes at 0x8000... Command 0x02 failed with code: 0x01
Command 0x01 failed with code: 0x03
OK
Bytes written: 71
[timactive@localhost sdcc-examples-stm8]$ stm8flash -cespstlink "-pstm8l051f3" -r flash.img
Determine FLASH area
Due to its file extension (or lack thereof), "flash.img" is considered as RAW BINARY format!
Reading 8192 bytes at 0x8000... Command 0x01 failed with code: 0x01
Requested 8192 bytes but received only 0.
Failed to read MCU
Thank for your help rumpeltux.
Some progress :) So now the communication with the espstlink works fine, but the SWIM communication doesn’t work reliably. I’ve never tested with in stm8l, so there may be slightly different timing that causes the trouble or your esps clock speed may be different or there’s some clock skew.
You can try using different pullup resistor value. Also in your picture it looks like there’s a resistor between the GPIO header and the ESP pin? (Which breakout board is that btw?) You can try attaching directly to the ESP pin.
If all of this doesn’t work, further debugging requires an oscilloscope or at least a signal analyzer.
Hi Rumpeltux, Ok first of all I'll have to learn how to use an oscilloscope :-)
And have a little more perspective on the swim communication, I think it's a new adventure finally it remains a hobby.
Hi, First of all thanks you for this amazing project. I flash with success my esp. When i try to flash my stm8l i have a message "determine flash area" but nothing is do after. Have you any idea? can you assistate me to determine the error?
https://drive.google.com/file/d/1hw_O9Va9USuNkC7dnIcV-yU91pLdVZcv/view