From e8bc9fa81dd320e5999d7dbe8f1929b7509d99ea Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Thu, 14 Dec 2023 13:24:19 +0100 Subject: [PATCH] targets/sipeed_tang_nano_4k: adding description to write Gowin EMCU firmware --- litex_boards/targets/sipeed_tang_nano_4k.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/litex_boards/targets/sipeed_tang_nano_4k.py b/litex_boards/targets/sipeed_tang_nano_4k.py index a14d060..0f90721 100755 --- a/litex_boards/targets/sipeed_tang_nano_4k.py +++ b/litex_boards/targets/sipeed_tang_nano_4k.py @@ -165,7 +165,19 @@ def main(): if args.flash: prog = soc.platform.create_programmer() prog.flash(0, builder.get_bitstream_filename(mode="flash", ext=".fs")) # FIXME - prog.flash(0, builder.get_bios_filename(), external=True) + if args.cpu_type != "gowin_emcu": + prog.flash(0, builder.get_bios_filename(), external=True) + + if args.cpu_type == "gowin_emcu": + import time + bios_filename = builder.get_bios_filename() + msg = "\n" + msg += "Gowin EMCU firmware must be written in flash with:\n" + msg += f"openFPGALoader -b tangnano4k --mcufw {bios_filename}\n" + msg += "Warning: this will erase ALL the internal flash" + msg += "\n" + print(msg) + time.sleep(2) if __name__ == "__main__":