99
1010from qiling .core import Qiling
1111from qiling .const import QL_VERBOSE
12- from qiling .extensions .soc .stm32f4 import stm32f407_env , stm32f411_env
13- from qiling .extensions .soc .gd32vf1 import gd32vf103_env
12+ from qiling .extensions .soc .stm32f4 import stm32f407 , stm32f411
13+ from qiling .extensions .soc .gd32vf1 import gd32vf103
1414
1515class MCUTest (unittest .TestCase ):
1616 def test_mcu_led_stm32f411 (self ):
1717 ql = Qiling (["../examples/rootfs/mcu/stm32f411/rand_blink.hex" ],
18- archtype = "cortex_m" , env = stm32f411_env , verbose = QL_VERBOSE .DISASM )
18+ archtype = "cortex_m" , env = stm32f411 , verbose = QL_VERBOSE .DISASM )
1919
2020 # Set verbose=QL_VERBOSE.DEFAULT to find warning
2121 ql .run (count = 1000 )
@@ -24,7 +24,7 @@ def test_mcu_led_stm32f411(self):
2424
2525 def test_mcu_usart_output_stm32f411 (self ):
2626 ql = Qiling (["../examples/rootfs/mcu/stm32f411/hello_usart.hex" ],
27- archtype = "cortex_m" , env = stm32f411_env , verbose = QL_VERBOSE .DEFAULT )
27+ archtype = "cortex_m" , env = stm32f411 , verbose = QL_VERBOSE .DEFAULT )
2828
2929 ql .hw .create ('usart2' )
3030 ql .hw .create ('rcc' )
@@ -38,7 +38,7 @@ def test_mcu_usart_output_stm32f411(self):
3838
3939 def test_mcu_usart_input_stm32f411 (self ):
4040 ql = Qiling (["../examples/rootfs/mcu/stm32f411/md5_server.hex" ],
41- archtype = "cortex_m" , env = stm32f411_env , verbose = QL_VERBOSE .OFF )
41+ archtype = "cortex_m" , env = stm32f411 , verbose = QL_VERBOSE .OFF )
4242
4343 ql .hw .create ('usart2' )
4444 ql .hw .create ('rcc' )
@@ -59,7 +59,7 @@ def test_mcu_usart_input_stm32f411(self):
5959
6060 def test_mcu_patch_stm32f411 (self ):
6161 ql = Qiling (["../examples/rootfs/mcu/stm32f411/patch_test.hex" ],
62- archtype = "cortex_m" , env = stm32f411_env , verbose = QL_VERBOSE .DEFAULT )
62+ archtype = "cortex_m" , env = stm32f411 , verbose = QL_VERBOSE .DEFAULT )
6363
6464 ql .hw .create ('usart2' )
6565 ql .hw .create ('rcc' )
@@ -72,7 +72,7 @@ def test_mcu_patch_stm32f411(self):
7272
7373 def test_mcu_freertos_stm32f411 (self ):
7474 ql = Qiling (["../examples/rootfs/mcu/stm32f411/os-demo.elf" ],
75- archtype = "cortex_m" , env = stm32f411_env , verbose = QL_VERBOSE .DEBUG )
75+ archtype = "cortex_m" , env = stm32f411 , verbose = QL_VERBOSE .DEBUG )
7676
7777 ql .hw .create ('usart2' )
7878 ql .hw .create ('rcc' )
@@ -94,7 +94,7 @@ def counter():
9494
9595 def test_mcu_dma_stm32f411 (self ):
9696 ql = Qiling (["../examples/rootfs/mcu/stm32f411/dma-clock.elf" ],
97- archtype = "cortex_m" , env = stm32f411_env , verbose = QL_VERBOSE .DEBUG )
97+ archtype = "cortex_m" , env = stm32f411 , verbose = QL_VERBOSE .DEBUG )
9898
9999 ql .hw .create ('usart2' )
100100 ql .hw .create ('dma1' )
@@ -112,7 +112,7 @@ def test_mcu_dma_stm32f411(self):
112112
113113 def test_mcu_i2c_stm32f411 (self ):
114114 ql = Qiling (["../examples/rootfs/mcu/stm32f411/i2c-lcd.bin" , 0x8000000 ],
115- archtype = "cortex_m" , env = stm32f411_env , verbose = QL_VERBOSE .DEBUG )
115+ archtype = "cortex_m" , env = stm32f411 , verbose = QL_VERBOSE .DEBUG )
116116
117117 ql .hw .create ('i2c1' )
118118 ql .hw .create ('rcc' )
@@ -144,7 +144,7 @@ def step(self):
144144
145145 def test_mcu_spi_stm32f411 (self ):
146146 ql = Qiling (["../examples/rootfs/mcu/stm32f411/spi-test.bin" , 0x8000000 ],
147- archtype = "cortex_m" , env = stm32f411_env , verbose = QL_VERBOSE .DEBUG )
147+ archtype = "cortex_m" , env = stm32f411 , verbose = QL_VERBOSE .DEBUG )
148148
149149 ql .hw .create ('spi1' )
150150 ql .hw .create ('rcc' )
@@ -158,7 +158,7 @@ def test_mcu_spi_stm32f411(self):
158158
159159 def test_mcu_led_rust_stm32f411 (self ):
160160 ql = Qiling (["../examples/rootfs/mcu/stm32f411/led-rust.hex" ],
161- archtype = "cortex_m" , env = gd32vf103_env , profile = "profiles/stm32f411.yml" , verbose = QL_VERBOSE .DEBUG )
161+ archtype = "cortex_m" , env = gd32vf103 , profile = "profiles/stm32f411.yml" , verbose = QL_VERBOSE .DEBUG )
162162
163163 count = 0
164164 def counter ():
@@ -175,7 +175,7 @@ def counter():
175175
176176 def test_mcu_uart_rust_stm32f411 (self ):
177177 ql = Qiling (["../examples/rootfs/mcu/stm32f411/uart-rust.hex" ],
178- archtype = "cortex_m" , env = stm32f411_env , verbose = QL_VERBOSE .DEBUG )
178+ archtype = "cortex_m" , env = stm32f411 , verbose = QL_VERBOSE .DEBUG )
179179
180180 ## cover env by profiles
181181
@@ -192,7 +192,7 @@ def test_mcu_uart_rust_stm32f411(self):
192192 def test_mcu_hacklock_stm32f407 (self ):
193193 def crack (passwd ):
194194 ql = Qiling (["../examples/rootfs/mcu/stm32f407/backdoorlock.hex" ],
195- archtype = "cortex_m" , env = stm32f407_env , verbose = QL_VERBOSE .OFF )
195+ archtype = "cortex_m" , env = stm32f407 , verbose = QL_VERBOSE .OFF )
196196
197197 ql .hw .create ('spi2' )
198198 ql .hw .create ('gpioe' )
@@ -221,7 +221,7 @@ def crack(passwd):
221221
222222 def test_mcu_blink_gd32vf103 (self ):
223223 ql = Qiling (['../examples/rootfs/mcu/gd32vf103/blink.hex' ], archtype = "riscv64" ,
224- env = gd32vf103_env , verbose = QL_VERBOSE .DEFAULT )
224+ env = gd32vf103 , verbose = QL_VERBOSE .DEFAULT )
225225
226226 ql .hw .create ('rcu' )
227227 ql .hw .create ('gpioa' )
0 commit comments