Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 641388 - dev-embedded/stm32flash Failed to erase memory
Summary: dev-embedded/stm32flash Failed to erase memory
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-16 16:09 UTC by RAPHEAD
Modified: 2017-12-18 13:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Emerge Info Lg (emerge--info.txt,6.62 KB, text/plain)
2017-12-18 13:46 UTC, RAPHEAD
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RAPHEAD 2017-12-16 16:09:35 UTC
With the current version 0.5 emerged via Gentoo I cannot flash my device as I get this error:

...
Erasing memory
Mass erase failed. Try specifying the number of pages to be erased.
Failed to erase memory

An strace of this looks like this:

...
write(1, "Version      : 0x31\n", 20Version      : 0x31
)   = 20
write(1, "Option 1     : 0x00\n", 20Option 1     : 0x00
)   = 20
write(1, "Option 2     : 0x00\n", 20Option 2     : 0x00
)   = 20
write(1, "Device ID    : 0x0417 (STM32L05x"..., 42Device ID    : 0x0417 (STM32L05xxx/06xxx)
) = 42
write(1, "- RAM        : 8KiB  (4096b rese"..., 52- RAM        : 8KiB  (4096b reserved by bootloader)
) = 52
write(1, "- Flash      : 64KiB (size first"..., 49- Flash      : 64KiB (size first sector: 32x128)
) = 49
write(1, "- Option RAM : 32b\n", 19- Option RAM : 32b
)    = 19
write(1, "- System RAM : 4KiB\n", 20- System RAM : 4KiB
)   = 20
write(1, "Write to memory\n", 16Write to memory
)       = 16
write(1, "Erasing memory\n", 15Erasing memory
)        = 15
write(3, "D\273", 2)                    = 2
read(3, "y", 1)                         = 1
write(3, "\377\377\0", 3)               = 3
read(3, "\37", 1)                       = 1
write(2, "Mass erase failed. Try specifyin"..., 68Mass erase failed. Try specifying the number of pages to be erased.
) = 68
write(2, "Failed to erase memory\n", 23Failed to erase memory
) = 23
ioctl(3, TCFLSH, TCIFLUSH)              = 0
ioctl(3, SNDCTL_TMR_START or TCSETS, {B9600 -opost -isig -icanon -echo ...}) = 0
close(3)                                = 0
write(1, "\n", 1
)                       = 1
exit_group(1)                           = ?
+++ exited with 1 +++


When I `git clone git://git.code.sf.net/p/stm32flash/code`
and compile it, it works although it seems to be the same version.
So the Gentoo version must have some issue.
Comment 1 Jonas Stein gentoo-dev 2017-12-16 17:59:07 UTC
Thank you for the report. Please *attach* the logfiles,
https://wiki.gentoo.org/wiki/Bugzilla/Bug_report_guide#Report_a_build-time_bug_.28emerge_failed.29

Also add the logs from the manual compilation. Perhaps we can see something there...

Which exact version/commit did you compile? Was it 2783493f8cb25d61b0a143114b908002cf05aa21?
Comment 2 RAPHEAD 2017-12-17 16:51:49 UTC
Here is the log compiling the git cloned version:

/opt/stm32flash-code $ make
cc -Wall -g   -c -o dev_table.o dev_table.c
cc -Wall -g   -c -o i2c.o i2c.c
cc -Wall -g   -c -o init.o init.c
cc -Wall -g   -c -o main.o main.c
cc -Wall -g   -c -o port.o port.c
cc -Wall -g   -c -o serial_common.o serial_common.c
cc -Wall -g   -c -o serial_platform.o serial_platform.c
cc -Wall -g   -c -o stm32.o stm32.c
stm32.c: In function 'stm32_mass_erase':
stm32.c:758:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  if ((port->flags & PORT_STRETCH_W)
  ^~
stm32.c:761:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
   return STM32_ERR_UNKNOWN;
   ^~~~~~
cc -Wall -g   -c -o utils.o utils.c
cd parsers && make parsers.a
make[1]: Entering directory '/opt/stm32flash-code/parsers'
cc -Wall -g   -c -o binary.o binary.c
cc -Wall -g   -c -o hex.o hex.c
ar rc parsers.a binary.o hex.o
make[1]: Leaving directory '/opt/stm32flash-code/parsers'
cc  -o stm32flash dev_table.o i2c.o init.o main.o port.o serial_common.o serial_platform.o stm32.o utils.o parsers/parsers.a
Comment 3 Jonas Stein gentoo-dev 2017-12-18 12:19:01 UTC
Please *attach* the logfiles,
https://wiki.gentoo.org/wiki/Bugzilla/Bug_report_guide#Report_a_build-time_bug_.28emerge_failed.29

Which exact version/commit did you compile? Was it 2783493f8cb25d61b0a143114b908002cf05aa21?
Comment 4 RAPHEAD 2017-12-18 13:46:04 UTC
Created attachment 510724 [details]
Emerge Info Lg
Comment 5 RAPHEAD 2017-12-18 13:46:37 UTC
I'm running version 0.5 from portage.