README 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. How to build:
  2. a) Build requirements
  3. * make
  4. * Cortex M3 toolchain
  5. * snescom/sneslink
  6. * Xilinx FPGA synthesis tool (e.g. ISE WebPack)
  7. * PIC assembler
  8. b) Cortex M3 toolchain
  9. * obtain the cm3-toolchain builder:
  10. git clone http://snowcat.de/toolchain-cm3.git/
  11. * build the cm3-toolchain. Some tools, libraries, and headers are required,
  12. including but probably not limited to:
  13. - libz-dev
  14. - libcloog-ppl-dev
  15. - texinfo
  16. - libmpfr-dev
  17. - libgmp3-dev
  18. - gawk
  19. - bison
  20. - recode
  21. - flex
  22. - libncurses5-dev
  23. - libexpat-dev
  24. - make
  25. - gcc
  26. Package names may differ for your distribution.
  27. Newer gccs complain when compiling binutils, so you may have to add
  28. '--disable-werror' to the compiler options for binutils in the Makefile.
  29. The Makefile will install immediately so make sure you can write to the
  30. installation directory.
  31. c) snescom/sneslink
  32. * http://bisqwit.iki.fi/source/snescom.html
  33. d) ISE WebPack
  34. * http://www.xilinx.com/products/design-tools/ise-design-suite/ise-webpack.htm
  35. e) PIC assembler
  36. * e.g. GPUTILS, http://gputils.sourceforge.net/
  37. f) general order of operations
  38. 1) program the PIC (cic/supercic/supercic-key.asm)
  39. 2) build and program the bootloader.
  40. 3) build the firmware and copy it to the memory card
  41. 4) build the snes menu and copy it to the memory card
  42. 5) build and compress the FPGA configuration and copy it to the memory card
  43. 6) insert memory card, power on; the bootloader should begin flashing the
  44. firmware and boot it
  45. 1) Programming the PIC
  46. Use a PIC assembler + programmer of your choice and program a PIC12F629 with
  47. cic/supercic/supercic-key.asm. Make sure that the clock source is set to
  48. EC_OSC and MCLRE is disabled.
  49. After programming you can solder the PIC to the board and short JP401.
  50. Open JP401 in case you need to reprogram the PIC on board.
  51. 2) Building & programming the bootloader
  52. The Makefile is prepared for JTAG programming using OpenOCD 0.4 and an FT2232
  53. based USB-JTAG adapter.
  54. Connect a JTAG cable to J401 (14-pin header). The pinout is printed on the
  55. board. cd to src/bootldr and make && make program.
  56. 3) Building the firmware
  57. cd to src/utils and make.
  58. cd to src/ and make.
  59. You should obtain a firmware file called obj/firmware.img. Copy this file to
  60. <sdcard>/sd2snes/firmware.img.
  61. 4) Building the SNES menu
  62. snescom is required.
  63. cd to snes/ and make.
  64. Copy the resulting file menu.bin to <sdcard>/sd2snes/menu.bin.
  65. 5) Building the FPGA configuration
  66. Compile the RLE compressor in utils/rle.c:
  67. $ gcc -Wall -o rle rle.c
  68. Load verilog/sd2snes/sd2snes.xise in Xilinx ISE (or create your own project).
  69. Target is a XC3S400-4PQ208.
  70. Generate the programming file and compress it using utils/rle.c:
  71. $ rle main.bit fpga_base.bit
  72. Copy fpga_base.bit to <sdcard>/sd2snes/fpga_base.bit