Skip to content

Commit 0cf8ecd

Browse files
committed
Test the USART crash bug
1 parent c57879c commit 0cf8ecd

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

tests/test_mcu.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,20 @@ def counter():
169169

170170
del ql
171171

172+
def test_mcu_uart_rust_stm32f411(self):
173+
ql = Qiling(["../examples/rootfs/mcu/stm32f411/uart-rust.hex"],
174+
archtype="cortex_m", profile="stm32f411", verbose=QL_VERBOSE.DEBUG)
175+
176+
ql.hw.create('rcc')
177+
ql.hw.create('gpioa')
178+
ql.hw.create('usart2')
179+
180+
ql.hw.usart2.send(b'123')
181+
ql.run(count=10000)
182+
self.assertTrue(ql.hw.usart2.recv() == b'1')
183+
184+
del ql
185+
172186
def test_mcu_hacklock_stm32f407(self):
173187
def crack(passwd):
174188
ql = Qiling(["../examples/rootfs/mcu/stm32f407/backdoorlock.hex"],

0 commit comments

Comments
 (0)