README 2.7 KB

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