I'm trying to make a bitcoin hardware wallet on an stm32f469-disco. I want to disable the REPL for security, to reduce the device's attack surface. On the other hand, the wallet needs to talk to my laptop, so I need a UART to read and write. Reduced example of what I've tried:
Code: Select all
# kill REPL
uos.dupterm(None, 1)
uart = pyb.UART(BUS_NUMBER, 115200)
uart.write("ping \n")
while not uart.read():
pass
led.toggle()
Bus #2 is more interesting. The REPL is using it, so I know that it works in principle. But the dupterm still prevents me from using bus #2 even if I kill off the dupterm from python code. When I try to init pyb.UART, I get "UART(2) doesn't exist".
So--what is the easiest way to do what I am trying to do? Can I, in fact, use bus #3 or #6? Is there some straightforward way to disable dupterm from C code to free up bus #2? Would that even solve my problem?
Can't tell you how much I would appreciate some help. Cheers!