Skip to content
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

Segmentation fault for STM32G070 #1170

Closed
5 tasks done
nuclearcat opened this issue Jul 30, 2021 · 0 comments · Fixed by #1166
Closed
5 tasks done

Segmentation fault for STM32G070 #1170

nuclearcat opened this issue Jul 30, 2021 · 0 comments · Fixed by #1166

Comments

@nuclearcat
Copy link

nuclearcat commented Jul 30, 2021

  • Programmer/board type: V2-clone
  • Operating system an version: Linux ubuntu
  • stlink tools version and/or git commit hash: latest, 26a63c1
  • stlink commandline tool name: st-util
  • Target chip (and board, if applicable): STM32G070

(It crashes without -n too, just with -n log is shorter)
st-util --listen_port 2331 -v99 -n
st-util 1.7.0-78-g26a63c1
2021-07-30T15:08:25 DEBUG common.c: *** looking up stlink version
2021-07-30T15:08:25 DEBUG common.c: st vid = 0x0483 (expect 0x0483)
2021-07-30T15:08:25 DEBUG common.c: stlink pid = 0x3748
2021-07-30T15:08:25 DEBUG common.c: stlink version = 0x2
2021-07-30T15:08:25 DEBUG common.c: jtag version = 0x25
2021-07-30T15:08:25 DEBUG common.c: swim version = 0x7
2021-07-30T15:08:25 DEBUG common.c: stlink current mode: debug (jtag or swd)
2021-07-30T15:08:25 DEBUG usb.c: JTAG/SWD freq set to 0
2021-07-30T15:08:25 DEBUG common.c: stlink current mode: debug (jtag or swd)
2021-07-30T15:08:25 DEBUG common.c: Loading device parameters....
2021-07-30T15:08:25 DEBUG common.c: *** stlink_core_id ***
2021-07-30T15:08:25 DEBUG common.c: core_id = 0x0bc11477
2021-07-30T15:08:25 DEBUG common.c: *** stlink_read_debug32 0x410cc601 at 0xe000ed00
2021-07-30T15:08:25 DEBUG common.c: *** stlink_read_debug32 0x20006460 at 0x40015800
Segmentation fault (core dumped)

gdb stacktrace

Program terminated with signal SIGSEGV, Segmentation fault.
#0 __memcmp_avx2_movbe () at ../sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S:70
70 ../sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S: No such file or directory.
[Current thread is 1 (Thread 0x7fb8ad5071c0 (LWP 2721076))]
(gdb) bt full
#0 __memcmp_avx2_movbe () at ../sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S:70
No locals.
#1 0x00007fb8ad776929 in stlink_chipid_get_params (chipid=1120) at /home/n/PROJECTS/stlink/src/stlink-lib/chipid.c:957
params = 0x0
p2 = 0x7fb8ad789140 <devices+3072>
#2 0x00007fb8ad76eed5 in stlink_load_device_params (sl=0x55d96824eca0) at /home/n/PROJECTS/stlink/src/common.c:1599
params = 0x0
flash_size = 1747250336
#3 0x00007fb8ad7766ba in stlink_target_connect (sl=0x55d96824eca0, connect=CONNECT_NORMAL) at /home/n/PROJECTS/stlink/src/common.c:4921
No locals.
#4 0x00007fb8ad77f7d6 in stlink_open_usb (verbose=UINFO, connect=CONNECT_NORMAL, serial=0x7ffc1b794634 "", freq=0) at /home/n/PROJECTS/stlink/src/stlink-lib/usb.c:1302
sl = 0x55d96824eca0
slu = 0x55d968267d80
ret = 0
config = 1
list = 0x55d9682787d0
cnt = 3
desc = {bLength = 18 '\022', bDescriptorType = 1 '\001', bcdUSB = 512, bDeviceClass = 0 '\000', bDeviceSubClass = 0 '\000', bDeviceProtocol = 0 '\000', bMaxPacketSize0 = 64 '@', idVendor = 1155,
idProduct = 14152, bcdDevice = 256, iManufacturer = 1 '\001', iProduct = 2 '\002', iSerialNumber = 3 '\003', bNumConfigurations = 1 '\001'}
devBus = 0
devAddr = 0
device = 0x0
mode = 2
#5 0x000055d967ffc361 in main (argc=3, argv=0x7ffc1b794758) at /home/n/PROJECTS/stlink/src/st-util/gdb-server.c:226
sl = 0x0
state = {logging_level = 50, listen_port = 2331, persistent = 0, connect_mode = CONNECT_NORMAL, freq = 0, serialnumber = '\000' <repeats 24 times>, semihosting = false, current_memory_map = 0x0}

(gdb) up
#1 0x00007fb8ad776929 in stlink_chipid_get_params (chipid=1120) at /home/n/PROJECTS/stlink/src/stlink-lib/chipid.c:957
957 if (memcmp (p2, params, sizeof (struct stlink_chipid_params) - sizeof (struct stlink_chipid_params *)) != 0) {
(gdb) print *p2
$1 = {chip_id = 1120, description = 0x7fb8ad7820b4 "G07x/G08x", flash_type = STLINK_FLASH_TYPE_G0, flash_size_reg = 536835552, flash_pagesize = 2048, sram_size = 36864, bootrom_base = 536805376,
bootrom_size = 28672, option_base = 536836096, option_size = 4, flags = 0, next = 0x0}
(gdb) print *params
Cannot access memory at address 0x0

If i change return to p2 and change if to 0 to disable this memcmp section - it works properly.

Let me know if you need more info.

@Nightwalker-87 Nightwalker-87 added this to the v1.7.1 milestone Jul 31, 2021
@Nightwalker-87 Nightwalker-87 changed the title [STM32G070]: st-util Segmentation fault Segmentation fault for STM32G070 Jul 31, 2021
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants