Closed retpolanne closed 1 year ago
Attached pdb, seem that the loop is on the ctx request:
╰→ newbot -c config.orange_pi_test_config tc.interactive.test_uboot_dhcp
tbot starting ...
├─Calling test_uboot_dhcp ...
│ ├─[local] picocom -b 115200 /dev/ttyUSB0
│ ├─POWERON (orange-pi)
> /home/retpolanne/Dev/orange-pi-one-plus-image/config/orange_pi_test_config.py(14)poweron()
-> with tbot.ctx.request(tbot.role.BoardUBoot) as ub:
(Pdb) l
9 baudrate = 115200
10 serial_port = "/dev/ttyUSB0"
11
12 def poweron(self):
13 import pdb; pdb.set_trace()
14 -> with tbot.ctx.request(tbot.role.BoardUBoot) as ub:
15 ub.exec0("reset")
16
17 def poweroff(self):
18 pass
19
(Pdb) n
│ ├─[local] picocom -b 115200 /dev/ttyUSB0
│ ├─POWERON (orange-pi)
> /home/retpolanne/Dev/orange-pi-one-plus-image/config/orange_pi_test_config.py(14)poweron()
-> with tbot.ctx.request(tbot.role.BoardUBoot) as ub:
(Pdb) n
│ ├─[local] picocom -b 115200 /dev/ttyUSB0
│ ├─POWERON (orange-pi)
> /home/retpolanne/Dev/orange-pi-one-plus-image/config/orange_pi_test_config.py(14)poweron()
-> with tbot.ctx.request(tbot.role.BoardUBoot) as ub:
(Pdb) n
│ ├─[local] picocom -b 115200 /dev/ttyUSB0
│ ├─POWERON (orange-pi)
> /home/retpolanne/Dev/orange-pi-one-plus-image/config/orange_pi_test_config.py(14)poweron()
-> with tbot.ctx.request(tbot.role.BoardUBoot) as ub:
(Pdb) n
│ ├─[local] picocom -b 115200 /dev/ttyUSB0
│ ├─POWERON (orange-pi)
> /home/retpolanne/Dev/orange-pi-one-plus-image/config/orange_pi_test_config.py(14)poweron()
-> with tbot.ctx.request(tbot.role.BoardUBoot) as ub:
I understood what I did wrong: poweron runs before connect and it seems that if I try to run this with BoardUBoot role I get to this loop. I wonder how am I able to send a reset to u-boot after picocom connects.
Fixed it :)
I moved the PowerControl to the OrangePiUBoot class and then added this to poweron:
def poweron(self):
¦ time.sleep(1)
¦ self.ch.sendline("reset")
Plays well with autoboot btw!
Hey!
I'm trying to test u-boot using tbot. I followed the documentation and created, on my config, a generic Board for running picocom connection and handling power cycling:
And a UBootShell for handling just u-boot stuff:
They are both registered:
My testcase should just run dhcp for now:
However, when I run that, I see a lot of parallel powerons running:
Then it fails with max recursion depth.
Am I missing something? The only way I know that I can powercycle on u-boot is by resetting, so I did it according to the documentation (poweron handles the reset while poweroff just passes).