[Blue Pill] Unknown coreid 2ba01477 [SOLVED]

Post Reply
hennep
Posts: 7
Joined: Wed Jan 15, 2020 2:10 pm
Location: Netherlands

[Blue Pill] Unknown coreid 2ba01477 [SOLVED]

Post by hennep »

I'm trying to upload the blink sketch to a blue pill board with the ST-link-V2 programmer. I bought 5 new boards on eBay and these show the same error all five.
photo_2020-09-30_18-55-09.jpg
photo_2020-09-30_18-55-09.jpg (67.8 KiB) Viewed 4869 times
Sketch uses 14212 bytes (21%) of program storage space. Maximum is 65536 bytes.
Global variables use 3128 bytes (15%) of dynamic memory, leaving 17352 bytes for local variables. Maximum is 20480 bytes.
/home/hennep/Arduino/hardware/Arduino_STM32/tools/linux/stlink_upload /tmp/arduino_build_187156/Blink.ino.bin
2020-09-30T17:33:24 INFO src/stlink-common.c: Loading device parameters....
2020-09-30T17:33:24 INFO src/stlink-common.c: Device connected is: F1 Medium-density device, id 0x20036410
2020-09-30T17:33:24 INFO src/stlink-common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes
2020-09-30T17:33:24 INFO src/stlink-common.c: Attempting to write 14212 (0x3784) bytes to stm32 address: 134217728 (0x8000000)
2020-09-30T17:33:24 WARN src/stlink-common.c: unknown coreid 2ba01477, page erase failed
2020-09-30T17:33:24 ERROR src/stlink-common.c: Failed to erase_flash_page(0x8000000) == -1
stlink_fwrite_flash() == -1
Is there something I need to change in a config file or are these boards defective?

When I try the same sketch on a board that I bought earlier (years ago), then it works fine.

Lubuntu 20.04.1 LTS
Arduino 1.8.11
Board: Generic STM32F103C Series
Variant: STM32F103C8 (20k RAM/ 64k Flash)
Upload method: STLink
Last edited by hennep on Thu Oct 01, 2020 12:41 pm, edited 1 time in total.
hennep
Posts: 7
Joined: Wed Jan 15, 2020 2:10 pm
Location: Netherlands

Re: [Blue Pill] Unknown coreid 2ba01477

Post by hennep »

The st-info program shows that it is a 128k F1 Medium-density device
Is there a way to check whether the board has the right microcontroller or not?

[quote]$ st-info --probe
Found 1 stlink programmers
serial: 503f6f065265565031111067
openocd: "\x50\x3f\x6f\x06\x52\x65\x56\x50\x31\x11\x10\x67"
flash: 131072 (pagesize: 1024)
sram: 20480
chipid: 0x0410
descr: F1 Medium-density device[quote]
User avatar
fpiSTM
Posts: 1227
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 60
Location: Le Mans
Contact:

Re: [Blue Pill] Unknown coreid 2ba01477

Post by fpiSTM »

Try with the STM32CubeProgrammer tools.
Maybe an issue with the open source stlink tools.
hennep
Posts: 7
Joined: Wed Jan 15, 2020 2:10 pm
Location: Netherlands

Re: [Blue Pill] Unknown coreid 2ba01477

Post by hennep »

I had already installed that programmer but I could not make it work with the Arduino_STM32 software from Roger Clark.

So I dug a little deeper in the scripts. When I try to upload from the Arduino IDE, I get a different location every time I compile
Sketch uses 14212 bytes (10%) of program storage space. Maximum is 131072 bytes.
Global variables use 3128 bytes (15%) of dynamic memory, leaving 17352 bytes for local variables. Maximum is 20480 bytes.
/home/hennep/Arduino/hardware/Arduino_STM32/tools/linux/stlink_upload /tmp/arduino_build_406061/Blink.ino.bin
2020-10-01T14:10:18 INFO src/stlink-common.c: Loading device parameters....
2020-10-01T14:10:18 INFO src/stlink-common.c: Device connected is: F1 Medium-density device, id 0x20036410
2020-10-01T14:10:18 INFO src/stlink-common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes
2020-10-01T14:10:18 INFO src/stlink-common.c: Attempting to write 14212 (0x3784) bytes to stm32 address: 134217728 (0x8000000)
2020-10-01T14:10:18 WARN src/stlink-common.c: unknown coreid 2ba01477, page erase failed
2020-10-01T14:10:18 ERROR src/stlink-common.c: Failed to erase_flash_page(0x8000000) == -1
stlink_fwrite_flash() == -1
So when I try to upload the path shown in the above output:
$ st-flash --reset write /tmp/arduino_build_406061/Blink.ino.bin 0x08000000
It works (and the led is blinking as well)
st-flash 1.6.0
2020-10-01T14:11:32 INFO common.c: Loading device parameters....
2020-10-01T14:11:32 INFO common.c: Device connected is: F1 Medium-density device, id 0x20036410
2020-10-01T14:11:32 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes
2020-10-01T14:11:32 INFO common.c: Attempting to write 14212 (0x3784) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08003400 erased
2020-10-01T14:11:32 INFO common.c: Finished erasing 14 pages of 1024 (0x400) bytes
2020-10-01T14:11:32 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2020-10-01T14:11:32 INFO flash_loader.c: Successfully loaded flash loader in sram
14/14 pages written
2020-10-01T14:11:33 INFO common.c: Starting verification of write complete
2020-10-01T14:11:33 INFO common.c: Flash written and verified! jolly good!
Last edited by hennep on Thu Oct 01, 2020 1:02 pm, edited 4 times in total.
hennep
Posts: 7
Joined: Wed Jan 15, 2020 2:10 pm
Location: Netherlands

[Blue Pill] Unknown coreid 2ba01477 [SOLVED]

Post by hennep »

There are several tools on my disk named "st-flash"
$ locate st-flash
/home/hennep/Arduino/hardware/Arduino_STM32/tools/linux/stlink/st-flash
/home/hennep/Arduino/hardware/Arduino_STM32/tools/linux64/stlink/st-flash
/home/hennep/Arduino/hardware/Arduino_STM32/tools/macosx/stlink/st-flash
/home/hennep/Arduino/hardware/Arduino_STM32/tools/win/texane-stlink/st-flash.exe
/usr/bin/st-flash
/usr/share/man/man1/st-flash.1.gz
I have chosen the one in /usr/bin/ that came with "sudo apt install stlink-tools"

After I modified the script from Roger Clark (/home/hennep/Arduino/hardware/Arduino_STM32/tools/linux/stlink_upload)
it works when I upload in the IDE:
#!/bin/bash
# $(dirname $0)/stlink/st-flash write "$1" 0x8000000
/usr/bin/st-flash --reset write "$1" 0x8000000
exit 0
The original line is commented #
And I put the path /usr/bin/ hardcoded in the script.
Last edited by hennep on Thu Oct 01, 2020 2:06 pm, edited 1 time in total.
User avatar
fpiSTM
Posts: 1227
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 60
Location: Le Mans
Contact:

Re: [Blue Pill] Unknown coreid 2ba01477 [SOLVED]

Post by fpiSTM »

No the stlink tools does not come from the CubeProgrammer.
You probably install the stlink package: https://launchpad.net/ubuntu/+source/stlink
hennep
Posts: 7
Joined: Wed Jan 15, 2020 2:10 pm
Location: Netherlands

Re: [Blue Pill] Unknown coreid 2ba01477 [SOLVED]

Post by hennep »

You are right, I installed stlink-tools to have the st-info command available.
I found this in my command history: "sudo apt install stlink-tools"
bdpak
Posts: 2
Joined: Wed Jul 28, 2021 9:05 am

Re: [Blue Pill] Unknown coreid 2ba01477 [SOLVED]

Post by bdpak »

hello hennep,

I am facing similar [Blue pill] unknown coreID 2ba01477 as below
USB Status [unknown]
2021-07-28T05:25:50 INFO src/common.c: Loading device parameters....
2021-07-28T05:25:50 INFO src/common.c: Device connected is: F1 Medium-density device, id 0x20036410
2021-07-28T05:25:50 INFO src/common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes
2021-07-28T05:25:50 INFO src/common.c: Attempting to write 12780 (0x31ec) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08002400 erased2021-07-28T05:25:50 INFO src/common.c: Finished erasing 13 pages of 1024 (0x400) bytes
2021-07-28T05:25:50 INFO src/common.c: Starting Flash write for VL/F0/F3 core id
2021-07-28T05:25:50 ERROR src/common.c: unknown coreid, not sure what flash loader to use, aborting!: 2ba01477
2021-07-28T05:25:50 WARN src/common.c: Failed to write flash loader to sram!
2021-07-28T05:25:50 ERROR src/common.c: init_flash_loader() == -1
Flash page at addr: 0x08003000 erased
stlink_fwrite_flash() == -1
USB Status [unknown]
Waiting for tty device

should now be available.
I tried
$ st-flash --reset write ~/Desktop/gpio.bin 0x8000000
The same unknown coreid error persists

I tired your method of tinkering with st_upload as well as sudo apt install stlink-tools but no luck

But no luck.

Please let me know if you have better idea of solving this issue.
bdpak
Posts: 2
Joined: Wed Jul 28, 2021 9:05 am

Re: [Blue Pill] Unknown coreid 2ba01477 [SOLVED]

Post by bdpak »

I am using mx linux 64 bits as OS and st-linkv2 for programming
hennep
Posts: 7
Joined: Wed Jan 15, 2020 2:10 pm
Location: Netherlands

Re: [Blue Pill] Unknown coreid 2ba01477 [SOLVED]

Post by hennep »

You tried:
$ st-flash --reset write ~/Desktop/gpio.bin 0x8000000
Are you sure there is only one such script on your system?

To be sure that you use the right script from stlink-tools try:
$ /usr/bin/st-flash --reset write ~/Desktop/gpio.bin 0x8000000


I'm not an expert in this matter. It was sheer luck that I discovered multiple scripts on my system.
Post Reply

Return to “STLink”