Closed maxgerhardt closed 4 years ago
Thanks for the very detailed bug report! Looks like this should be a straightforward fix.
(Btw, the reported "Unable to print the message and arguments" errors have been fixed on master.)
Hm actually this might be an invalid bug report. I've cloned the latest version from the repository and retried the same procedure, now the error is not occurring. Notice how the output beyond GDB received query: [b'Xfer', b'threads',
does not contain an error anymore. Either I can't reproduce an edge case here or the error has already been fixed in master. Maybe some safeguards were added to make sure self.STATES[self._state]
exists in the rtx5.py
code?
If you can't reproduce it and the code good looks good in current master, I'm closing this.
$ pyocd gdb -t cortex_m -v
0002578:DEBUG:pyusb_backend:[Errno 13] Access denied (insufficient permissions) while trying to interrogate a USB device (VID=04ca PID=703c). This can probably be remedied with a udev rule. See <https://github.com/mbedmicro/pyOCD/tree/master/udev> for help.
0002590:DEBUG:pyusb_backend:[Errno 13] Access denied (insufficient permissions) while trying to interrogate a USB device (VID=046a PID=b090). This can probably be remedied with a udev rule. See <https://github.com/mbedmicro/pyOCD/tree/master/udev> for help.
0002594:DEBUG:pyusb_backend:[Errno 13] Access denied (insufficient permissions) while trying to interrogate a USB device (VID=045e PID=0745). This can probably be remedied with a udev rule. See <https://github.com/mbedmicro/pyOCD/tree/master/udev> for help.
0002594:DEBUG:pyusb_backend:[Errno 13] Access denied (insufficient permissions) while trying to interrogate a USB device (VID=058f PID=6331). This can probably be remedied with a udev rule. See <https://github.com/mbedmicro/pyOCD/tree/master/udev> for help.
0002612:DEBUG:pyusb_v2_backend:[Errno 13] Access denied (insufficient permissions) while trying to interrogate a USB device (VID=04ca PID=703c). This can probably be remedied with a udev rule. See <https://github.com/mbedmicro/pyOCD/tree/master/udev> for help.
0002630:DEBUG:pyusb_v2_backend:[Errno 13] Access denied (insufficient permissions) while trying to interrogate a USB device (VID=046a PID=b090). This can probably be remedied with a udev rule. See <https://github.com/mbedmicro/pyOCD/tree/master/udev> for help.
0002635:DEBUG:pyusb_v2_backend:[Errno 13] Access denied (insufficient permissions) while trying to interrogate a USB device (VID=045e PID=0745). This can probably be remedied with a udev rule. See <https://github.com/mbedmicro/pyOCD/tree/master/udev> for help.
0002636:DEBUG:pyusb_v2_backend:[Errno 13] Access denied (insufficient permissions) while trying to interrogate a USB device (VID=058f PID=6331). This can probably be remedied with a udev rule. See <https://github.com/mbedmicro/pyOCD/tree/master/udev> for help.
0002823:DEBUG:session:Project directory: /home/max/eol
0002824:INFO:board:Target type is cortex_m
0002824:WARNING:board:Generic 'cortex_m' target type is selected; is this intentional? You will be able to debug but not program flash. To set the target type use the '--target' argument or 'target_override' option. Use 'pyocd list --targets' to see available targets types.
0002830:DEBUG:stlink:STLink probe 54FF6E067880565308420567 firmware version: V2J34M7
0002831:DEBUG:sequencer:Running task load_svd
0002831:DEBUG:sequencer:Running task create_flash
0002831:DEBUG:sequencer:Running task pre_connect
0002831:DEBUG:sequencer:Running task dp_init
0002831:DEBUG:sequencer:Running task connect
0002833:DEBUG:dap:Default wire protocol selected; using SWD
0002834:INFO:dap:DP IDR = 0x2ba01477 (v1 rev2)
0002834:DEBUG:sequencer:Running task clear_sticky_err
0002834:DEBUG:sequencer:Running task power_up_debug
0002836:DEBUG:sequencer:Running task create_discoverer
0002836:DEBUG:sequencer:Running task discovery
0002836:DEBUG:sequencer:Running task find_aps
0002837:DEBUG:sequencer:Running task create_aps
0002837:DEBUG:sequencer:Running task create_ap.0
0002839:DEBUG:ap:Using accelerated memory access interface
0002839:INFO:ap:AP#0 IDR = 0x24770011 (AHB-AP var1 rev2)
0002842:DEBUG:ap:AP#0 default HPROT=3 HNONSEC=0
0002843:DEBUG:ap:AP#0 implemented HPROT=3 HNONSEC=0
0002844:DEBUG:sequencer:Running task find_components
0002845:DEBUG:sequencer:Running task init_ap.0
0002852:INFO:rom_table:AP#0 Class 0x1 ROM table #0 @ 0xe00ff000 (designer=020 part=415)
0002855:INFO:rom_table:[0]<e000e000:SCS-M4 class=14 designer=43b part=00c>
0002858:INFO:rom_table:[1]<e0001000:DWT class=14 designer=43b part=002>
0002860:INFO:rom_table:[2]<e0002000:FPB class=14 designer=43b part=003>
0002863:INFO:rom_table:[3]<e0000000:ITM class=14 designer=43b part=001>
0002865:INFO:rom_table:[4]<e0040000:TPIU-M4 class=9 designer=43b part=9a1 devtype=11 archid=0000 devid=ca1:0:0>
0002868:INFO:rom_table:[5]<e0041000:ETM-M4 class=9 designer=43b part=925 devtype=13 archid=0000 devid=0:0:0>
0002868:DEBUG:sequencer:Running task create_cores
0002869:DEBUG:discovery:Creating SCS-M4 component
0002873:INFO:cortex_m:CPU core #0 is Cortex-M4 r0p1
0002879:INFO:cortex_m:FPU present: FPv4-SP
0002881:DEBUG:sequencer:Running task create_components
0002881:DEBUG:discovery:Creating DWT component
0002883:INFO:dwt:4 hardware watchpoints
0002886:DEBUG:discovery:Creating FPB component
0002887:INFO:fpb:6 hardware breakpoints, 4 literal comparators
0002888:DEBUG:fpb:fpb has been disabled
0002898:DEBUG:discovery:Creating ITM component
0002902:DEBUG:discovery:Creating TPIU-M4 component
0002903:DEBUG:sequencer:Running task check_for_cores
0002903:DEBUG:sequencer:Running task halt_on_connect
0002904:DEBUG:cortex_m:halting core 0
0002908:DEBUG:sequencer:Running task post_connect
0002909:DEBUG:sequencer:Running task post_connect_hook
0002909:DEBUG:sequencer:Running task notify
0002910:DEBUG:cortex_m:Setting vector catch to 0x00000001
0002915:INFO:server:Semihost server started on port 4444 (core 0)
0002936:INFO:gdbserver:GDB server started on port 3333 (core 0)
0002939:DEBUG:cortex_m:halting core 0
0003553:DEBUG:packet_io:Starting GDB server packet I/O thread
0003553:INFO:gdbserver:One client connected!
0003553:DEBUG:gdbserver:GDB received query: [b'Supported', b'multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;xmlRegisters=i386#6a']
0003554:DEBUG:gdbserver:GDB general set: b'StartNoAckMode'
0003555:DEBUG:gdbserver:GDB received query: [b'Xfer', b'features', b'read', b'target.xml', b'0,7fb#4a']
0003555:DEBUG:gdbserver:GDB query b'read_feature': offset: 0, size: 2043
0003558:DEBUG:gdbserver:GDB received query: [b'Xfer', b'features', b'read', b'target.xml', b'7fb,7fb#19']
0003558:DEBUG:gdbserver:GDB query b'read_feature': offset: 2043, size: 2043
0003560:DEBUG:gdbserver:GDB general set: b'NonStop:0'
0003560:DEBUG:gdbserver:GDB received query: [b'TStatus#49']
0003560:DEBUG:gdbserver:Current thread 0 is no longer valid, switching context to target
0003562:DEBUG:register:no accesses
0003562:DEBUG:register:out of date run token; invalidating cache
0003584:DEBUG:gdbserver:Tresponse=b'T0507:faffffff;0d:607f0010;0e:17590208;0f:3c5e0208;thread:1;'
0003587:DEBUG:gdbserver:GDB received query: [b'Xfer', b'threads', b'read', b'', b'0,7fb#d0']
0003587:DEBUG:gdbserver:GDB query b'threads': offset: 0, size: 2043
0003598:DEBUG:gdbserver:GDB received query: [b'Attached#8f']
0003598:DEBUG:gdbserver:GDB received query: [b'Offsets#4b']
0003599:DEBUG:gdbserver:GDB received query: [b'Xfer', b'memory-map', b'read', b'', b'0,7fb#e9']
0003599:DEBUG:gdbserver:GDB query b'memory_map': offset: 0, size: 2043
0003602:DEBUG:memory:no reads
0003602:DEBUG:memory:out of date run token; invalidating cache
0003602:DEBUG:memory:range [8007b80:8007bc0] is not cacheable
0003606:DEBUG:memory:range [8007c00:8007c40] is not cacheable
0003611:DEBUG:memory:range [8007c1a:8007c1c] is not cacheable
0003618:DEBUG:memory:range [8007c1a:8007c1e] is not cacheable
0003625:DEBUG:memory:range [8040740:8040780] is not cacheable
0003630:DEBUG:memory:range [804075c:804075e] is not cacheable
0003631:DEBUG:memory:range [804075c:804075e] is not cacheable
0003634:DEBUG:memory:range [804076c:804076e] is not cacheable
0003639:DEBUG:memory:range [804076c:8040770] is not cacheable
0003642:DEBUG:memory:range [8041504:8041506] is not cacheable
0003645:DEBUG:memory:range [8041504:8041506] is not cacheable
0003651:DEBUG:memory:range [804ce5c:804ce5e] is not cacheable
0003653:DEBUG:memory:range [804ce5c:804ce5e] is not cacheable
0003655:DEBUG:gdbserver:GDB received query: [b'Xfer', b'threads', b'read', b'', b'0,7fb#d0']
0003655:DEBUG:gdbserver:GDB query b'threads': offset: 0, size: 2043
0004109:DEBUG:memory:range [8025e3c:8025e40] is not cacheable
0004111:DEBUG:memory:range [8025e38:8025e3c] is not cacheable
0004112:DEBUG:memory:range [8025e3c:8025e40] is not cacheable
0004114:DEBUG:memory:range [8025e38:8025e3c] is not cacheable
0004116:DEBUG:memory:range [8025e3c:8025e3e] is not cacheable
0004118:DEBUG:memory:range [8025e3a:8025e3c] is not cacheable
0004120:DEBUG:memory:range [8025e38:8025e3a] is not cacheable
0004122:DEBUG:memory:range [8025e3c:8025e3e] is not cacheable
0004124:DEBUG:memory:range [8025e3a:8025e3c] is not cacheable
0004127:DEBUG:memory:range [8025e38:8025e3a] is not cacheable
0004132:DEBUG:memory:range [8025e3c:8025e40] is not cacheable
0004138:DEBUG:memory:range [8025e38:8025e3c] is not cacheable
0004143:DEBUG:memory:range [8025e3c:8025e40] is not cacheable
0004147:DEBUG:memory:range [8025e38:8025e3c] is not cacheable
0004158:DEBUG:memory:range [8025e3c:8025e40] is not cacheable
0004161:DEBUG:memory:range [8025e3c:8025e40] is not cacheable
0004164:DEBUG:memory:range [8025e3c:8025e40] is not cacheable
0004172:DEBUG:context_facade:GDB getting register context
0004315:DEBUG:context_facade:GDB reg: r0 = 0x49A1277
0004315:DEBUG:context_facade:GDB reg: r1 = 0x0
0004315:DEBUG:context_facade:GDB reg: r2 = 0x0
0004315:DEBUG:context_facade:GDB reg: r3 = 0x20001C00
0004315:DEBUG:context_facade:GDB reg: r4 = 0x8056FA0
0004315:DEBUG:context_facade:GDB reg: r5 = 0x4993C0C
0004315:DEBUG:context_facade:GDB reg: r6 = 0x8056FA0
0004316:DEBUG:context_facade:GDB reg: r7 = 0xFFFFFFFA
0004316:DEBUG:context_facade:GDB reg: r8 = 0x8028F33
0004316:DEBUG:context_facade:GDB reg: r9 = 0x70
0004316:DEBUG:context_facade:GDB reg: r10 = 0xFFF8000
0004316:DEBUG:context_facade:GDB reg: r11 = 0x0
0004316:DEBUG:context_facade:GDB reg: r12 = 0x3
0004316:DEBUG:context_facade:GDB reg: sp = 0x10007F60
0004316:DEBUG:context_facade:GDB reg: lr = 0x8025917
0004316:DEBUG:context_facade:GDB reg: pc = 0x8025E3C
0004316:DEBUG:context_facade:GDB reg: msp = 0x10007FC0
0004316:DEBUG:context_facade:GDB reg: psp = 0x10007F60
0004316:DEBUG:context_facade:GDB reg: primask = 0x1
0004316:DEBUG:context_facade:GDB reg: xpsr = 0x1070000
0004316:DEBUG:context_facade:GDB reg: control = 0x6
0004316:DEBUG:context_facade:GDB reg: basepri = 0x0
0004316:DEBUG:context_facade:GDB reg: faultmask = 0x0
0004316:DEBUG:context_facade:GDB reg: fpscr = 0x0
0004317:DEBUG:context_facade:GDB reg: d0 = 0x0
0004317:DEBUG:context_facade:GDB reg: d1 = 0x0
0004317:DEBUG:context_facade:GDB reg: d2 = 0x0
0004317:DEBUG:context_facade:GDB reg: d3 = 0x0
0004317:DEBUG:context_facade:GDB reg: d4 = 0x0
0004317:DEBUG:context_facade:GDB reg: d5 = 0x0
0004317:DEBUG:context_facade:GDB reg: d6 = 0x0
0004317:DEBUG:context_facade:GDB reg: d7 = 0x0
0004317:DEBUG:context_facade:GDB reg: d8 = 0x0
0004317:DEBUG:context_facade:GDB reg: d9 = 0x0
0004317:DEBUG:context_facade:GDB reg: d10 = 0x0
0004317:DEBUG:context_facade:GDB reg: d11 = 0x0
0004317:DEBUG:context_facade:GDB reg: d12 = 0x0
0004317:DEBUG:context_facade:GDB reg: d13 = 0x0
0004317:DEBUG:context_facade:GDB reg: d14 = 0x0
0004317:DEBUG:context_facade:GDB reg: d15 = 0x0
0004322:DEBUG:memory:range [10007f40:10007f80] is not cacheable
0004334:DEBUG:memory:range [8025e52:8025e56] is not cacheable
0004349:DEBUG:memory:range [8025e4e:8025e52] is not cacheable
0004353:DEBUG:memory:range [8025e52:8025e56] is not cacheable
0004364:DEBUG:memory:range [8025e4e:8025e52] is not cacheable
0004371:DEBUG:memory:range [8025e52:8025e54] is not cacheable
0004376:DEBUG:memory:range [8025e50:8025e52] is not cacheable
0004383:DEBUG:memory:range [8025e4e:8025e50] is not cacheable
0004387:DEBUG:memory:range [8025e52:8025e54] is not cacheable
0004393:DEBUG:memory:range [8025e50:8025e52] is not cacheable
0004395:DEBUG:memory:range [8025e4e:8025e50] is not cacheable
0004397:DEBUG:memory:range [8025e52:8025e56] is not cacheable
0004400:DEBUG:memory:range [8025e4e:8025e52] is not cacheable
0004407:DEBUG:memory:range [8025e52:8025e56] is not cacheable
0004415:DEBUG:memory:range [8025e4e:8025e52] is not cacheable
0004423:DEBUG:memory:range [8025e52:8025e56] is not cacheable
0004427:DEBUG:memory:range [8025e52:8025e56] is not cacheable
0004437:DEBUG:memory:range [8025e52:8025e56] is not cacheable
0004493:DEBUG:memory:range [80286f8:80286fc] is not cacheable
0004495:DEBUG:memory:range [80286f4:80286f8] is not cacheable
0004498:DEBUG:memory:range [80286f8:80286fc] is not cacheable
0004500:DEBUG:memory:range [80286f4:80286f8] is not cacheable
0004502:DEBUG:memory:range [80286f8:80286fa] is not cacheable
0004508:DEBUG:memory:range [80286f6:80286f8] is not cacheable
0004516:DEBUG:memory:range [80286f4:80286f6] is not cacheable
0004523:DEBUG:memory:range [80286f8:80286fa] is not cacheable
0004525:DEBUG:memory:range [80286f6:80286f8] is not cacheable
0004529:DEBUG:memory:range [80286f4:80286f6] is not cacheable
0004531:DEBUG:memory:range [80286f8:80286fc] is not cacheable
0004537:DEBUG:memory:range [80286f4:80286f8] is not cacheable
0004539:DEBUG:memory:range [80286f8:80286fc] is not cacheable
0004548:DEBUG:memory:range [80286f4:80286f8] is not cacheable
0004551:DEBUG:memory:range [80286f8:80286fc] is not cacheable
0004556:DEBUG:memory:range [80286f8:80286fc] is not cacheable
0004559:DEBUG:memory:range [80286f8:80286fc] is not cacheable
0004563:DEBUG:memory:range [8056fa0:8056fa8] is not cacheable
0004569:DEBUG:memory:range [8056fa0:8056fa8] is not cacheable
0004572:DEBUG:memory:range [8056fa0:8056fa8] is not cacheable
0004573:DEBUG:gdbserver:GDB received query: [b'Symbol', b'', b'#5b']
0004574:INFO:gdbserver:Attempting to load Argon
0004574:INFO:gdbserver:Attempting to load FreeRTOS
0004574:DEBUG:provider:Value for symbol uxCurrentNumberOfTasks = <none>
0004574:INFO:gdbserver:Attempting to load Zephyr
0004575:DEBUG:provider:Value for symbol _kernel = <none>
0004575:INFO:gdbserver:Attempting to load RTX5
0004575:DEBUG:rtx5:osRtxInfo = 0x200002c8
0004575:INFO:gdbserver:RTX5 loaded successfully
0004583:DEBUG:memory:range [8007c1a:8007c1c] is not cacheable
0004584:DEBUG:gdbserver:GDB breakpoint b'Z'0 @ 8007c1a
0004587:DEBUG:manager:set bkpt type SW at 0x8007c1a
0004587:DEBUG:manager:using hw bp instead because addr is flash
0004587:DEBUG:manager:selected bkpt type HW for addr 0x8007c1a
0004589:DEBUG:memory:range [804075c:804075e] is not cacheable
0004591:DEBUG:gdbserver:GDB breakpoint b'Z'0 @ 804075c
0004592:DEBUG:manager:set bkpt type SW at 0x804075c
0004592:DEBUG:manager:using hw bp instead because addr is flash
0004592:DEBUG:manager:selected bkpt type HW for addr 0x804075c
0004593:DEBUG:manager:using hw bp instead because addr is flash
0004593:DEBUG:manager:selected bkpt type HW for addr 0x8007c1a
0004594:DEBUG:memory:range [804076c:804076e] is not cacheable
0004596:DEBUG:gdbserver:GDB breakpoint b'Z'0 @ 804076c
0004597:DEBUG:manager:set bkpt type SW at 0x804076c
0004597:DEBUG:manager:using hw bp instead because addr is flash
0004597:DEBUG:manager:selected bkpt type HW for addr 0x804076c
0004597:DEBUG:manager:using hw bp instead because addr is flash
0004597:DEBUG:manager:selected bkpt type HW for addr 0x8007c1a
0004597:DEBUG:manager:using hw bp instead because addr is flash
0004598:DEBUG:manager:selected bkpt type HW for addr 0x804075c
0004601:DEBUG:memory:range [200002d0:200002d1] is not cacheable
0004602:DEBUG:gdbserver:thread_actions={1: None}; default_action=b'c'
0004603:DEBUG:cortex_m:resuming core 0
0004603:DEBUG:manager:added=[<UnrealizedBreakpoint@0x7fc4cba24c50 type=SW addr=0x08007c1a>, <UnrealizedBreakpoint@0x7fc4cba24bd0 type=SW addr=0x0804075c>, <UnrealizedBreakpoint@0x7fc4cba24310 type=SW addr=0x0804076c>] removed=[]
0004604:DEBUG:manager:using hw bp instead because addr is flash
0004604:DEBUG:manager:selected bkpt type HW for addr 0x8007c1a
0004605:DEBUG:fpb:fpb has been enabled
0004607:DEBUG:fpb:BP: wrote 0x88007c19 to comp @ 0xe0002008
0004607:DEBUG:manager:using hw bp instead because addr is flash
0004608:DEBUG:manager:selected bkpt type HW for addr 0x804075c
0004615:DEBUG:fpb:BP: wrote 0x4804075d to comp @ 0xe000200c
0004615:DEBUG:manager:using hw bp instead because addr is flash
0004615:DEBUG:manager:selected bkpt type HW for addr 0x804076c
0004620:DEBUG:fpb:BP: wrote 0x4804076d to comp @ 0xe0002010
0004621:DEBUG:manager:bps after flush={134249498: <HardwareBreakpoint@0x7fc4cb9ea790 type=HW addr=0x08007c1a>, 134481756: <HardwareBreakpoint@0x7fc4cb9ea2d0 type=HW addr=0x0804075c>, 134481772: <HardwareBreakpoint@0x7fc4cb9eab10 type=HW addr=0x0804076c>}
0004623:DEBUG:gdbserver:target resumed
0009781:DEBUG:gdbserver:receive CTRL-C
0009781:DEBUG:cortex_m:halting core 0
0009783:DEBUG:memory:no reads
0009783:DEBUG:memory:out of date run token; invalidating cache
0009784:DEBUG:memory:range [200002d0:200002d1] is not cacheable
0009785:DEBUG:register:48 reads [12% hits, 6 regs]
0009785:DEBUG:register:out of date run token; invalidating cache
0009797:DEBUG:memory:range [200002d0:200002d1] is not cacheable
0009803:DEBUG:gdbserver:Tresponse=b'T0207:faffffff;0d:387f0010;0e:17590208;0f:1c590208;thread:1;'
0009804:DEBUG:gdbserver:GDB received query: [b'Xfer', b'threads', b'read', b'', b'0,7fb#d0']
0009804:DEBUG:gdbserver:GDB query b'threads': offset: 0, size: 2043
0009810:DEBUG:memory:range [200002d0:200002d1] is not cacheable
0009847:DEBUG:gdbserver:GDB breakpoint b'z'0 @ 8007c1a
0009847:DEBUG:manager:remove bkpt at 0x8007c1a
0009848:DEBUG:gdbserver:GDB breakpoint b'z'0 @ 804075c
0009848:DEBUG:manager:remove bkpt at 0x804075c
0009853:DEBUG:gdbserver:GDB breakpoint b'z'0 @ 804076c
0009853:DEBUG:manager:remove bkpt at 0x804076c
0009855:DEBUG:memory:range [802591c:8025920] is not cacheable
Setup:
pyocd --version
:0.25.0
(latest release)pyocd gdb -t cortex_m -v
arm-none-eabi-gdb
as client and localhost:3333 as target.At first, the GDB server is started using
pyocd
. Then, CLion is connected to it (using the Debug button). Then the "Pause" button is pressed.pyocd
crashes immediately with an errorFull log: