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

RTT: Crash with 'utf-8' codec can't decode byte when arrow key is pressed #1749

Open
Rodrigodd opened this issue Dec 19, 2024 · 0 comments
Open

Comments

@Rodrigodd
Copy link

Rodrigodd commented Dec 19, 2024

On Windows, on Powershell, if I press an arrow key while pyocd rtt is running, it crashes:

> pyocd rtt --target stm32c011f4px
0001518 I Target type is stm32c011f4px [board]
0001636 I DP IDR = 0x0bc11477 (v1 MINDP rev0) [dap]
0001636 I debugvar 'DbgMCU_APB_Fz1' = 0x0 (0) [pack_target]
0001636 I debugvar 'DbgMCU_APB_Fz2' = 0x0 (0) [pack_target]
0001636 I debugvar 'DbgMCU_CR' = 0x6 (6) [pack_target]
0001636 I AHB-AP#0 IDR = 0x04770031 (AHB-AP var3 rev0) [discovery]
0001636 I AHB-AP#0 Class 0x1 ROM table #0 @ 0xf0000000 (designer=020:ST part=466) [rom_table]
0001652 I [0]<e00ff000:ROM class=1 designer=43b:Arm part=4c0> [rom_table]
0001652 I   AHB-AP#0 Class 0x1 ROM table #1 @ 0xe00ff000 (designer=43b:Arm part=4c0) [rom_table]
0001652 I   [0]<e000e000:SCS v6-M class=14 designer=43b:Arm part=008> [rom_table]
0001652 I   [1]<e0001000:DWT v6-M class=14 designer=43b:Arm part=00a> [rom_table]
0001652 I   [2]<e0002000:BPU v6-M class=14 designer=43b:Arm part=00b> [rom_table]
0001652 I CPU core #0: Cortex-M0+ r0p1, v6.0-M architecture [cortex_m]
0001652 I   Extensions: [MPU] [cortex_m]
0001652 I Setting core #0 (Cortex-M0+) default reset sequence to ResetSystem [pack_target]
0001652 I 2 hardware watchpoints [dwt]
0001652 I 4 hardware breakpoints, 0 literal comparators [fpb]
0001704 I 3 up channels and 3 down channels found [rtt_cmd]
0001704 I Reading from up channel 0 ("Terminal") [rtt_cmd]
0001706 I Writing to down channel -1 ("") [rtt_cmd]
My micro output while I not press the arrow key...
and when I press an arrow key by accident:
0002058 C 'utf-8' codec can't decode byte 0xe0 in position 0: unexpected end of data [__main__]

When I press the arrows key, Powershell writes ANSI code to stdin:

> cat.exe > outptu.txt # press up, down, left, right, end, ctrl-c
> xxd .\outptu.txt
00000000: 1b5b 411b 5b42 1b5b 441b 5b43 0a         .[A.[B.[D.[C.

Version Info

> pyocd --version
0.36.0
> pwsh --version
PowerShell 7.4.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant