1.. _m2gl025-miv: 2 3Microchip M2GL025 Mi-V 4###################### 5 6Overview 7******** 8 9The Microchip M2GL025 board is an IGLOO2 FPGA based development board. 10The Mi-V RISC-V soft CPU can be deployed on the MGL025 board. 11More information can be found on 12`Microchip's website <https://www.microchip.com/en-us/products/fpgas-and-plds/fpga-and-soc-design-tools/mi-v>`_. 13 14Programming and debugging 15************************* 16 17Building 18======== 19 20Applications for the ``m2gl025_miv`` board configuration can be built as usual 21(see :ref:`build_an_application`): 22 23.. zephyr-app-commands:: 24 :board: m2gl025_miv 25 :goals: build 26 27Flashing 28======== 29 30In order to upload the application to the device, you'll need OpenOCD and GDB 31with RISC-V support. 32You can get them as a part of SoftConsole SDK. 33Download and installation instructions can be found on 34`Microchip's SoftConsole website 35<https://www.microchip.com/en-us/products/fpgas-and-plds/fpga-and-soc-design-tools/soc-fpga/softconsole>`_. 36 37With the necessary tools installed, you can connect to the board using OpenOCD. 38To establish an OpenOCD connection run: 39 40.. code-block:: bash 41 42 sudo LD_LIBRARY_PATH=<softconsole_path>/openocd/bin \ 43 <softconsole_path>/openocd/bin/openocd --file \ 44 <softconsole_path>/openocd/share/openocd/scripts/board/microsemi-riscv.cfg 45 46 47Leave it running, and in a different terminal, use GDB to upload the binary to 48the board. You can use the RISC-V GDB from a toolchain delivered with 49SoftConsole SDK. 50 51Here is the GDB terminal command to connect to the device 52and load the binary: 53 54.. code-block:: console 55 56 <softconsole_path>/riscv-unknown-elf-gcc/bin/riscv64-unknown-elf-gdb \ 57 -ex "target extended-remote localhost:3333" \ 58 -ex "set mem inaccessible-by-default off" \ 59 -ex "set arch riscv:rv32" \ 60 -ex "set riscv use_compressed_breakpoints no" \ 61 -ex "load" <path_to_executable> 62 63Debugging 64========= 65 66Refer to the detailed overview of :ref:`application_debugging`. 67