-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32L011G4 flash error (unknown coreid, write_half_pages failed) #564
Comments
Update: I realized that the commands I used above are specific to the libopencm3 examples. Here is the somewhat lengthy output of
|
I have added the STM32L011 but not 100% tested (only tested probe). Probably the configuration is broken (needs to verified against datasheet which I did not yet): See also: https://github.com/pavelrevak/pystlink/blob/master/lib/stm32devices.py#L82-L92 |
Thanks @xor-gate. I double-checked the
However after rebuilding I still got the same error. I'll keep looking into the issue. |
Ping @gluedig, @mcoquelin-stm32 could you verify this (if you have a target?). I'm not familiar with the current flash loaders. |
Probably @tomdeboer has also some thoughts as he had some commit history on the L0 flash loaders. |
Okay, I think I've got a fix for this. In common.h, there are a number of |
@zakqwy you may propose a pull request and get free credits :+) |
done. @xor-gate feel free to edit the PR, it's (ahem) my first. |
Thanks, feel free to open a new issue or PR when something is not working as expected. Thank you for your contribution! |
I am attempting to flash a simple 'hello-world' type LED blink program onto a bodged together STM32L011G4-based board, using my STM32F030 Discovery Board's on-board Stlink/v2.
Command:
$ make helloworld.stlink-flash
Output:
FLASH helloworld.bin
st-flash 1.3.1
2017-03-02T16:27:46 INFO src/common.c: Loading device parameters....
2017-03-02T16:27:46 INFO src/common.c: Device connected is: L011 device, id 0x10086457
2017-03-02T16:27:46 INFO src/common.c: SRAM size: 0x800 bytes (2 KiB), Flash: 0x4000 bytes (16 KiB) in pages of 128 bytes
2017-03-02T16:27:46 INFO src/common.c: Attempting to write 480 (0x1e0) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08000180 erased
2017-03-02T16:27:46 INFO src/common.c: Finished erasing 4 pages of 128 (0x80) bytes
2017-03-02T16:27:46 INFO src/common.c: Starting Half page flash write for STM32L core id
2017-03-02T16:27:46 ERROR src/flash_loader.c: unknown coreid, not sure what flash loader to use, aborting! coreid: bc11477, chipid: 457
2017-03-02T16:27:46 WARN src/flash_loader.c: Failed to write flash loader to sram!
2017-03-02T16:27:46 WARN src/common.c: stlink_flash_loader_init() == -1
2017-03-02T16:27:46 WARN src/common.c:
write_half_pages failed == -1
2/ 3 pages written
2017-03-02T16:27:46 INFO src/common.c: Starting verification of write complete
2017-03-02T16:27:46 ERROR src/common.c: Verification of flash failed at offset: 0
stlink_fwrite_flash() == -1
make: *** [helloworld.stlink-flash] Error 255
I got the same error using
st-util
and uploading the file manually. One thing I did notice -- when I first attempted to flash the chip the SRAM size was set to 0x4000 (i.e. 16 KiB); this was incorrect for the STM32L0 I am using so I changed line 455 ofchipid.c
to.sram_size = 0x800,
and rebuilt the program. The flash memory size is correct for the G4 version.I tried running
st-flash erase
and it seemed to work fine -- all 128 pages erased. I also tried shorting the BOOT0 pin (pin 1) to VCC and resetting the chip a few times, as suggested by other users experiencing similar-looking problems. This didn't seem to have any effect on subsequent programming attempts.Perusing
common.c
I did notice the following lines (ln 1835-1836):else if (sl->flash_type == STLINK_FLASH_TYPE_L0) {
/* use fast word write. todo: half page. */
Does this mean that the half page write mode isn't implemented and I just need to switch over to programming by word? I looked around for an option to do this but I couldn't find one.
The text was updated successfully, but these errors were encountered: