|
1 | 1 | simavr - a lean and mean Atmel AVR simulator for linux
|
2 | 2 | ======
|
3 | 3 |
|
| 4 | +# Notes for compiling on MinGW |
| 5 | + |
| 6 | +Get MSys2 mingw from https://www.msys2.org/ |
| 7 | +Start the MSYS MinGW shortcut (e.g. MSYS2 MinGW 32-bit or 64-bit) |
| 8 | + |
| 9 | +Update packages |
| 10 | + |
| 11 | +``` |
| 12 | +pacman -Syu |
| 13 | +``` |
| 14 | + |
| 15 | +Install toolchains and dependencies. For 64-bit |
| 16 | + |
| 17 | +``` |
| 18 | +pacman -S mingw-w64-x86_64-toolchain |
| 19 | +pacman -S mingw-w64-x86_64-libelf |
| 20 | +pacman -S mingw-w64-x86_64-avr-toolchain |
| 21 | +pacman -S mingw-w64-x86_64-freeglut |
| 22 | +``` |
| 23 | + |
| 24 | +Replace `x86_64` with `i686` to get the 32-bit version instead. |
| 25 | + |
| 26 | +``` |
| 27 | +pacman -S mingw-w64-i686-toolchain |
| 28 | +pacman -S mingw-w64-i686-libelf |
| 29 | +pacman -S mingw-w64-i686-avr-toolchain |
| 30 | +pacman -S mingw-w64-i686-freeglut |
| 31 | +``` |
| 32 | + |
| 33 | +etc. **There currently is an issuw with the AVR toolchain:** https://github.com/msys2/MINGW-packages/issues/9183 |
| 34 | + |
| 35 | +Note: If you are using the 32-bit version, you **may** have to adapt `Makefile.common` regarding `AVR_ROOT := /mingw64/avr` to `AVR_ROOT := /mingw32/avr`. I have not tested this and the paths may be the same, but if you run into errors regarding AVR, check there. |
| 36 | + |
| 37 | +In the normal user directory (`cd ~`), clone this repo |
| 38 | + |
| 39 | +``` |
| 40 | +git clone https://github.com/maxgerhardt/simavr.git |
| 41 | +cd simavr |
| 42 | +``` |
| 43 | + |
| 44 | +Start building with |
| 45 | + |
| 46 | +``` |
| 47 | +make build-simavr V=1 |
| 48 | +``` |
| 49 | + |
| 50 | +That should be successfull. |
| 51 | + |
| 52 | +Now create a install directory and install it. Note that `/home/Max/` is in this case my home directory. |
| 53 | + |
| 54 | +Additionally this renames `simavr` to `simavr.exe` to make it properly executable. Ignore the compile error in the examples, it only counts that simavr is copied to the install directory. |
| 55 | + |
| 56 | +``` |
| 57 | +mkdir simavr_installed |
| 58 | +make install DESTDIR=/home/$USER/simavr/simavr_installed/ |
| 59 | +mv simavr_installed/bin/simavr simavr_installed/bin/simavr.exe |
| 60 | +``` |
| 61 | + |
| 62 | +Copy the compiled output back to the normal Windows environment, e.g. |
| 63 | + |
| 64 | +``` |
| 65 | +cp -r /home/$USER/simavr/simavr_installed/ /c/Users/$USER/Desktop |
| 66 | +``` |
| 67 | + |
| 68 | +You should now have a working simavr executable. |
| 69 | + |
| 70 | +``` |
| 71 | +C:\Users\Max\Desktop\simavr_installed\bin>simavr --help |
| 72 | +Usage: simavr [...] <firmware> |
| 73 | + [--freq|-f <freq>] Sets the frequency for an .hex firmware |
| 74 | + [--mcu|-m <device>] Sets the MCU type for an .hex firmware |
| 75 | + [--list-cores] List all supported AVR cores and exit |
| 76 | + [--help|-h] Display this usage message and exit |
| 77 | + [--trace, -t] Run full scale decoder trace |
| 78 | + [-ti <vector>] Add traces for IRQ vector <vector> |
| 79 | + [--gdb|-g [<port>]] Listen for gdb connection on <port> (default 1234) |
| 80 | + [-ff <.hex file>] Load next .hex file as flash |
| 81 | + [-ee <.hex file>] Load next .hex file as eeprom |
| 82 | + [--input|-i <file>] A vcd file to use as input signals |
| 83 | + [--output|-o <file>] A vcd file to save the traced signals |
| 84 | + [--add-trace|-at <name=kind@addr/mask>] Add signal to be traced |
| 85 | + [-v] Raise verbosity level |
| 86 | + (can be passed more than once) |
| 87 | + <firmware> A .hex or an ELF file. ELF files are |
| 88 | + prefered, and can include debugging syms |
| 89 | +``` |
| 90 | + |
| 91 | +----------------------- |
| 92 | + |
4 | 93 | _simavr_ is a new AVR simulator for linux, or any platform that uses avr-gcc. It uses
|
5 | 94 | avr-gcc's own register definition to simplify creating new targets for supported AVR
|
6 | 95 | devices. The core was made to be small and compact, and hackable so allow quick
|
|
0 commit comments