Based on the following sources: https://github.com/blacksphere/blackmagic https://github.com/satoshinm/pill_serial https://github.com/satoshinm/pill_duck