Skip to content

Commit 6f0e6e6

Browse files
committed
add missing file
1 parent ac1e85e commit 6f0e6e6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

examples/mcu/stm32f4_hello_gpio.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import sys
2+
sys.path.append("../..")
3+
4+
from qiling.core import Qiling
5+
from qiling.const import QL_VERBOSE
6+
7+
8+
def test_mcu_gpio_stm32f411():
9+
ql = Qiling(["../../examples/rootfs/mcu/stm32f411/hello_gpioA.hex"],
10+
archtype="cortex_m", profile="stm32f411", verbose=QL_VERBOSE.DEBUG)
11+
12+
ql.hw.create('usart2')
13+
ql.hw.create('rcc')
14+
ql.hw.create('gpioa')
15+
16+
17+
ql.hw.gpioa.hook_set(5, lambda: print('LED light up'))
18+
ql.hw.gpioa.hook_reset(5, lambda: print('LED light off'))
19+
20+
ql.run(count=10000)
21+
22+
if __name__ == "__main__":
23+
test_mcu_gpio_stm32f411()

0 commit comments

Comments
 (0)