Minimig on C3 board

Project: Minimig on the C3 board.

back to C3 board, main minimig page.

links

robinsonb5/minimig_c3, rkrajnc/minimig-mist, rkrajnc/minimig-de1, so much guru - minimig, minimig-DE1-DE2, minimig-mist,

docs: MIST Manual, MIST - Getting Started, CoreStatus, CoreDocAmiga,

other links: Amiga Forever, retroramblings.net custom VGA output board, latching power circuit, techtravels.org - Minimig,

forum: minimig.net,

local links

c1, e1, Altera Quartus II Fedora, FreeBSD,

History

2021-10-03: I re-created this page on my self-hosted web server.

2018-09-18: e1 - minimig_c3 - Fampiga_C3 - test the mimimig C3 both with the two VGA pins (per color) mapped to MSB and to LSB. MSB works (as far as the bootloader and OSD) and also Ctrl-Alt-AltGr (Ctrl-Amiga-Amiga) works; the green LED turns offd then on. LSB doesn't give any signs of life at all.

2018-09-17: e1 - minimig_c3 - Fampiga_C3 - build the OSD firmware. First I had to get a m68k crosscompiler installed, see e1 page for that adventure. Next, in OSD directory

[tingo@kg-elitebook OSD]$ pwd
/home/tingo/personal/projects/fpga/Altera/c3/minimig_c3/Firmware/OSD

add tools to PATH

[tingo@kg-elitebook OSD]$ export PATH="${PATH}:~/x-tools/m68k-unknown-elf/bin/"

fix the Makefile

[tingo@kg-elitebook OSD]$ diff -u  Makefile_org Makefile
--- Makefile_org    2018-09-10 15:05:44.413195333 +0200
+++ Makefile    2018-09-17 16:25:53.148700466 +0200
@@ -1,5 +1,5 @@
 # Supply these as parameters from higher up.
-TARGET=m68k-elf
+TARGET=m68k-unknown-elf
 ARCH=68000

 C_SRC=fat.c fdd.c fpga.c hardware.c  hdd.c main.c menu.c mmc.c osd.c printf.c swap.c config.c rafile.c

try to compile, had to fix a few things more, related to the change from m68k-elf to m68k-unknown-elf. Now it fails here:

[tingo@kg-elitebook OSD]$ make
mkdir m68k-unknown-elf-build
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/vsnprintf.o klibc/vsnprintf.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/sprintf.o klibc/sprintf.c
klibc/sprintf.c: In function 'sprintf':
klibc/sprintf.c:14:7: warning: specified bound 4294967295 exceeds maximum object size 2147483647 [-Wformat-truncation=]
  rv = vsnprintf(buffer, ~(size_t) 0, format, ap);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/memcpy.o klibc/memcpy.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/memcmp.o klibc/memcmp.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/strcpy.o klibc/strcpy.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/strcat.o klibc/strcat.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/strncat.o klibc/strncat.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/strncmp.o klibc/strncmp.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/strlen.o klibc/strlen.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/memset.o klibc/memset.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/strncpy.o klibc/strncpy.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/strchr.o klibc/strchr.c
m68k-unknown-elf-ar -r libc.a m68k-unknown-elf-build/vsnprintf.o m68k-unknown-elf-build/sprintf.o m68k-unknown-elf-build/memcpy.o m68k-unknown-elf-build/memcmp.o m68k-unknown-elf-build/strcpy.o m68k-unknown-elf-build/strcat.o m68k-unknown-elf-build/strncat.o m68k-unknown-elf-build/strncmp.o m68k-unknown-elf-build/strlen.o m68k-unknown-elf-build/memset.o m68k-unknown-elf-build/strncpy.o m68k-unknown-elf-build/strchr.o
m68k-unknown-elf-ar: creating libc.a
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/fat.o fat.c
fat.c: In function 'FindDrive':
fat.c:248:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (!MMC_Read(0, sector_buffer)) // read MBR
     ^~
fat.c:251:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  boot_sector=0;
  ^~~~~~~~~~~
fat.c: In function 'ScanDirectory':
fat.c:808:90: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
                           strncpy(DirEntryLFN[nDirEntries], lfn, sizeof(lfn));
                                                                        ^

fat.c:820:110: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
           strncpy(DirEntryLFN[sort_table[MAXDIRENTRIES-1]], lfn, sizeof(lfn));
                                                                        ^

fat.c:850:80: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
                                     strncpy(DirEntryLFN[0], lfn, sizeof(lfn));
                                                                        ^

fat.c:865:94: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
                           strncpy(DirEntryLFN[nDirEntries], lfn, sizeof(lfn));
                                                                        ^

fat.c:877:114: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
           strncpy(DirEntryLFN[sort_table[MAXDIRENTRIES-1]], lfn, sizeof(lfn));
                                                                        ^

fat.c:905:96: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
                         strncpy(DirEntryLFN[sort_table[0]], lfn, sizeof(lfn));
                                                                        ^

fat.c:925:114: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
           strncpy(DirEntryLFN[sort_table[MAXDIRENTRIES-1]], lfn, sizeof(lfn));
                                                                        ^

fat.c:945:110: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
           strncpy(DirEntryLFN[sort_table[MAXDIRENTRIES-1]], lfn, sizeof(lfn));
                                                                        ^

fat.c:965:100: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
                         strncpy(DirEntryLFN[sort_table[0]], lfn, sizeof(lfn));
                                                                        ^

fat.c:979:96: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
                         strncpy(t_DirEntryLFN[nNewEntries], lfn, sizeof(lfn));
                                                                        ^

fat.c:992:118: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
       strncpy(t_DirEntryLFN[t_sort_table[MAXDIRENTRIES-1]], lfn, sizeof(lfn));
                                                                        ^

fat.c:1019:96: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
                         strncpy(t_DirEntryLFN[nNewEntries], lfn, sizeof(lfn));
                                                                        ^

fat.c:1032:118: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
       strncpy(t_DirEntryLFN[t_sort_table[MAXDIRENTRIES-1]], lfn, sizeof(lfn));
                                                                        ^

fat.c:1065:96: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
                         strncpy(t_DirEntryLFN[nNewEntries], lfn, sizeof(lfn));
                                                                        ^

fat.c:1078:118: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
       strncpy(t_DirEntryLFN[t_sort_table[MAXDIRENTRIES-1]], lfn, sizeof(lfn));
                                                                        ^

fat.c: At top level:
fat.c:1225: warning: ignoring #pragma section_code_init  [-Wunknown-pragmas]
 #pragma section_code_init

fat.c:1264: warning: ignoring #pragma section_no_code_init  [-Wunknown-pragmas]
 #pragma section_no_code_init

fat.c:1335: warning: ignoring #pragma section_code_init  [-Wunknown-pragmas]
 #pragma section_code_init

fat.c:1349: warning: ignoring #pragma section_no_code_init  [-Wunknown-pragmas]
 #pragma section_no_code_init

m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/fdd.o fdd.c
fdd.c: In function 'SendSector':
fdd.c:82:12: warning: suggest parentheses around '-' inside '>>' [-Wparentheses]
     x = 11 - sector >> 1 & 0x55;
         ~~~^~~~~~~~
fdd.c:96:12: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
     x = 11 - sector & 0x55;
         ~~~^~~~~~~~
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/fpga.o fpga.c
fpga.c: In function 'SendFile':
fpga.c:210:24: warning: variable 'c2' set but not used [-Wunused-but-set-variable]
     unsigned char  c1, c2;
                        ^~
fpga.c: In function 'SendFileEncrypted':
fpga.c:266:6: warning: unused variable 'badbyte' [-Wunused-variable]
  int badbyte=0;
      ^~~~~~~
fpga.c:260:24: warning: variable 'c2' set but not used [-Wunused-but-set-variable]
     unsigned char  c1, c2;
                        ^~
fpga.c: In function 'BootPrint':
fpga.c:322:23: warning: variable 'c2' set but not used [-Wunused-but-set-variable]
     unsigned char c1, c2, c3, c4;
                       ^~
fpga.c: In function 'PrepareBootUpload':
fpga.c:399:23: warning: variable 'c2' set but not used [-Wunused-but-set-variable]
     unsigned char c1, c2, c3, c4;
                       ^~
fpga.c: In function 'BootExit':
fpga.c:455:23: warning: variable 'c2' set but not used [-Wunused-but-set-variable]
     unsigned char c1, c2, c3, c4;
                       ^~
fpga.c: In function 'ClearMemory':
fpga.c:494:23: warning: variable 'c2' set but not used [-Wunused-but-set-variable]
     unsigned char c1, c2, c3, c4;
                       ^~
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/hardware.o hardware.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/hdd.o hdd.c
hdd.c: In function 'HandleHDD':
hdd.c:440:14: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
              while (!(GetFPGAStatus() & CMD_IDECMD)); // wait for empty sector buffer
              ^~~~~
hdd.c:442:11: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
           WriteStatus(IDE_STATUS_IRQ);
           ^~~~~~~~~~~
hdd.c:578:14: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
              while (!(GetFPGAStatus() & CMD_IDECMD)); // wait for empty sector buffer
              ^~~~~
hdd.c:580:11: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
           block_count = sector_count;
           ^~~~~~~~~~~
hdd.c:637:15: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
               while (!(GetFPGAStatus() & CMD_IDEDAT)); // wait for full write buffer
               ^~~~~
hdd.c:640:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
      if(sector_count!=1)
      ^~
hdd.c:726:19: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
                   while (!(GetFPGAStatus() & CMD_IDEDAT)); // wait for full write buffer
                   ^~~~~
hdd.c:729:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
       if(sector_count!=1)
       ^~
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/main.o main.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/menu.o menu.c
menu.c: In function 'HandleUI':
menu.c:1155:58: warning: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
             strncat(s, config.kickstart.long_name, sizeof(config.kickstart.long_name));
                                                          ^
menu.c:1157:53: warning: argument to 'sizeof' in 'strncat' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
             strncat(s, config.kickstart.name, sizeof(config.kickstart.name));
                                                     ^
menu.c:1375:69: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
                 strncpy(&s[14], config.hardfile[0].long_name, sizeof(config.hardfile[0].long_name));
                                                                     ^
menu.c:1377:64: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
                 strncpy(&s[14], config.hardfile[0].name, sizeof(config.hardfile[0].name));
                                                                ^
menu.c: In function 'InsertFloppy':
menu.c:2384:51: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
         strncpy(&drive->name[17], DiskInfo, sizeof(DiskInfo)); // copy disk number info
                                                   ^
menu.c: In function 'ErrorMessage':
menu.c:2426:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
         if (code)
         ^~
menu.c:2429:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
      OsdWrite(3, "", 0,0);
      ^~~~~~~~
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/mmc.o mmc.c
mmc.c:201: warning: ignoring #pragma section_code_init  [-Wunknown-pragmas]
 #pragma section_code_init

mmc.c:259: warning: ignoring #pragma section_no_code_init  [-Wunknown-pragmas]
 #pragma section_no_code_init

mmc.c:445: warning: ignoring #pragma section_code_init  [-Wunknown-pragmas]
 #pragma section_code_init

mmc.c:483: warning: ignoring #pragma section_no_code_init  [-Wunknown-pragmas]
 #pragma section_no_code_init

mmc.c:514: warning: ignoring #pragma section_code_init  [-Wunknown-pragmas]
 #pragma section_code_init

mmc.c:529: warning: ignoring #pragma section_no_code_init  [-Wunknown-pragmas]
 #pragma section_no_code_init

m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/osd.o osd.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/printf.o printf.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/swap.o swap.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/config.o config.c
config.c: In function 'LoadConfiguration':
config.c:196:3: warning: 'strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
   strncpy(config.kickstart.name, "KICK    ", sizeof(config.kickstart.name));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.c:206:3: warning: 'strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
   strncpy(config.hardfile[0].name, "HARDFILE", sizeof(config.hardfile[0].name));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.c:208:3: warning: 'strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
   strncpy(config.hardfile[1].name, "HARDFILE", sizeof(config.hardfile[1].name));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.c:195:3: warning: 'strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
   strncpy(config.id, config_id, sizeof(config.id));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.c: In function 'ApplyConfiguration':
config.c:277:58: warning: '%.3s' directive writing up to 3 bytes into a region of size between 2 and 10 [-Wformat-overflow=]
           sprintf(s, "\nHardfile 1 (with fake RDB): %.8s.%.3s", hdf[1].file.name, &hdf[1].file.name[8]);
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.c:277:11: note: 'sprintf' output between 31 and 42 bytes into a destination of size 40
           sprintf(s, "\nHardfile 1 (with fake RDB): %.8s.%.3s", hdf[1].file.name, &hdf[1].file.name[8]);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.c:286:61: warning: '%d' directive writing between 1 and 11 bytes into a region of size 3 [-Wformat-overflow=]
           sprintf(s, "\nHardfile 0: using SD card partition %d",hdf[0].type-HDF_CARD); // Number from 1
                                                             ^~
config.c:286:22: note: directive argument in the range [-2147483648, 2147483645]
           sprintf(s, "\nHardfile 0: using SD card partition %d",hdf[0].type-HDF_CARD); // Number from 1
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.c:286:11: note: 'sprintf' output between 39 and 49 bytes into a destination of size 40
           sprintf(s, "\nHardfile 0: using SD card partition %d",hdf[0].type-HDF_CARD); // Number from 1
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.c:302:58: warning: '%.3s' directive writing up to 3 bytes into a region of size between 2 and 10 [-Wformat-overflow=]
           sprintf(s, "\nHardfile 1 (with fake RDB): %.8s.%.3s", hdf[1].file.name, &hdf[1].file.name[8]);
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.c:302:11: note: 'sprintf' output between 31 and 42 bytes into a destination of size 40
           sprintf(s, "\nHardfile 1 (with fake RDB): %.8s.%.3s", hdf[1].file.name, &hdf[1].file.name[8]);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.c:311:61: warning: '%d' directive writing between 1 and 11 bytes into a region of size 3 [-Wformat-overflow=]
           sprintf(s, "\nHardfile 1: using SD card partition %d",hdf[1].type-HDF_CARD); // Number from 1
                                                             ^~
config.c:311:22: note: directive argument in the range [-2147483648, 2147483645]
           sprintf(s, "\nHardfile 1: using SD card partition %d",hdf[1].type-HDF_CARD); // Number from 1
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.c:311:11: note: 'sprintf' output between 39 and 49 bytes into a destination of size 40
           sprintf(s, "\nHardfile 1: using SD card partition %d",hdf[1].type-HDF_CARD); // Number from 1
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config.c:249:7: warning: 'strcpy' writing 9 bytes into a region of size 8 overflows the destination [-Wstringop-overflow=]
       strcpy(config.kickstart.name, "KICK    ");
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/rafile.o rafile.c
m68k-unknown-elf-gcc -m68000 -Wall -Wno-char-subscripts -Os -fno-common -fomit-frame-pointer -I./include -DACTIONREPLAY_BROKEN -c -o m68k-unknown-elf-build/startup_m68k-unknown-elf.o startup_m68k-unknown-elf.s
m68k-unknown-elf-gcc -m68000 -Xlinker -Map=menu.map -nostartfiles -L. -o m68k-unknown-elf-build/menu.elf -T osd_m68k-unknown-elf.ld m68k-unknown-elf-build/fat.o m68k-unknown-elf-build/fdd.o m68k-unknown-elf-build/fpga.o m68k-unknown-elf-build/hardware.o m68k-unknown-elf-build/hdd.o m68k-unknown-elf-build/main.o m68k-unknown-elf-build/menu.o m68k-unknown-elf-build/mmc.o m68k-unknown-elf-build/osd.o m68k-unknown-elf-build/printf.o m68k-unknown-elf-build/swap.o m68k-unknown-elf-build/config.o m68k-unknown-elf-build/rafile.o m68k-unknown-elf-build/startup_m68k-unknown-elf.o
/home/tingo/x-tools/m68k-unknown-elf/m68k-unknown-elf/bin/ld.real: m68k:cpu32 architecture of input file `/home/tingo/x-tools/m68k-unknown-elf/lib/gcc/m68k-unknown-elf/8.1.0/libgcc.a(_mulsi3.o)' is incompatible with m68k:68000 output
/home/tingo/x-tools/m68k-unknown-elf/m68k-unknown-elf/bin/ld.real: m68k:cpu32 architecture of input file `/home/tingo/x-tools/m68k-unknown-elf/lib/gcc/m68k-unknown-elf/8.1.0/libgcc.a(_udivsi3.o)' is incompatible with m68k:68000 output
/home/tingo/x-tools/m68k-unknown-elf/m68k-unknown-elf/bin/ld.real: m68k:cpu32 architecture of input file `/home/tingo/x-tools/m68k-unknown-elf/lib/gcc/m68k-unknown-elf/8.1.0/libgcc.a(_umodsi3.o)' is incompatible with m68k:68000 output
/home/tingo/x-tools/m68k-unknown-elf/m68k-unknown-elf/bin/ld.real: m68k:cpu32 architecture of input file `/home/tingo/x-tools/m68k-unknown-elf/lib/gcc/m68k-unknown-elf/8.1.0/libgcc.a(_modsi3.o)' is incompatible with m68k:68000 output
/home/tingo/x-tools/m68k-unknown-elf/m68k-unknown-elf/bin/ld.real: m68k:cpu32 architecture of input file `/home/tingo/x-tools/m68k-unknown-elf/lib/gcc/m68k-unknown-elf/8.1.0/libgcc.a(_divsi3.o)' is incompatible with m68k:68000 output
/home/tingo/x-tools/m68k-unknown-elf/m68k-unknown-elf/bin/ld.real: m68k:cpu32 architecture of input file `/home/tingo/x-tools/m68k-unknown-elf/lib/gcc/m68k-unknown-elf/8.1.0/libgcc.a(_udivdi3.o)' is incompatible with m68k:68000 output
/home/tingo/x-tools/m68k-unknown-elf/m68k-unknown-elf/bin/ld.real: m68k:cpu32 architecture of input file `/home/tingo/x-tools/m68k-unknown-elf/lib/gcc/m68k-unknown-elf/8.1.0/libgcc.a(_umoddi3.o)' is incompatible with m68k:68000 output
collect2: error: ld returned 1 exit status
make: *** [Makefile:38: m68k-unknown-elf-build/menu.elf] Error 1

ok. I reconfigured the toolchain with ct-ng so it has CT_ARCH_CPU="68000" and CT_TARGET_ALIAS="m68k-elf", then rebuilt it, finally I was able to make

OSD68K01.sys

with that on the SDcard, the machine boots, and I can press F12 and get the OSD menu. Now the KICK.ROM (or kick.rom) file is read too. Still no other picture on the screen than the bootloader and the OSD.

2018-09-17: e1 - minimig_c3 - Fampiga_C3 - what happens if I moved my two-bit VGA from LSB to MSB? in C3BoardToplevel.vhd from

attribute chip_pin of vga_red : signal is "13, 9, 5, 240, 38, 22";
attribute chip_pin of vga_green : signal is "12, 14, 235, 237, 44, 41";
attribute chip_pin of vga_blue : signal is "239, 236, 18, 238, 50, 46";

to

attribute chip_pin of vga_red : signal is "38, 22, 13, 9, 5, 240";
attribute chip_pin of vga_green : signal is "44, 41, 12, 14, 235, 237";
attribute chip_pin of vga_blue : signal is "50, 46, 239, 236, 18, 238";

test it. Yes - it works, now I get white text on a blue background:

"Minimig by Dennis van Weeren"
"Bug fixes, mods and extensions by Jakub Bednarski and Sascha Boing"

"Bootloader      2010-09-10"
"Minimig core   2011-04-10"

"Agnus ID: $00 (PAL) Denise ID: $FF

nice! Now, do I need a mouse to get to the OSD menu?

2018-09-14: e1 - minimig_c3 - Fampiga_C3 - added a LED board

135 leds[0] - green
167 leds[1] - yellow
169 leds[2] - orange
173 leds[3] - red

2018-09-14: e1 - minimig_c3 - Fampiga_C3 - pin assignments verified ok.

2018-09-13: e1 - minimig_c3 - Fampiga_C3 - I should verify that the pin assignments in C3BoardRTL/C3BoardToplevel.vhd matches the setup og my board, especially for SDRAM.

2018-09-13: e1 - minimig_c3 - DE2 - I selected the DE2 project, changed device to EP3C25Q240C8, cleared all pin assignments. Did a test compile. After removing some pins (flash, sram, hex digit displays) the project compiled. Fitter summary

Fitter Status : Successful - Thu Sep 13 14:01:42 2018
Quartus II 32-bit Version : 13.1.4 Build 182 03/12/2014 SJ Web Edition
Revision Name : Fampiga
Top-level Entity Name : minimig_de2_top
Family : Cyclone III
Device : EP3C25Q240C8
Timing Models : Final
Total logic elements : 18,111 / 24,624 ( 74 % )
    Total combinational functions : 16,192 / 24,624 ( 66 % )
    Dedicated logic registers : 7,153 / 24,624 ( 29 % )
Total registers : 7218
Total pins : 144 / 149 ( 97 % )
Total virtual pins : 0
Total memory bits : 253,952 / 608,256 ( 42 % )
Embedded Multiplier 9-bit elements : 12 / 132 ( 9 % )
Total PLLs : 1 / 4 ( 25 % )

ok.

2018-08-12: e1 - minimig-mist - I set up the minimig-mist project and changed settings to my fpga (EP3C25Q240C8N), cleared the pin assignments and did a test compile. It compiled. directory

[tingo@kg-elitebook minimig-mist_c3]$ pwd
/home/tingo/personal/projects/fpga/Altera/c3/minimig-mist_c3

fitter summary

Fitter Status : Successful - Wed Sep 12 14:10:27 2018
Quartus II 32-bit Version : 13.1.4 Build 182 03/12/2014 SJ Web Edition
Revision Name : minimig_mist
Top-level Entity Name : minimig_mist_top
Family : Cyclone III
Device : EP3C25Q240C8
Timing Models : Final
Total logic elements : 20,000 / 24,624 ( 81 % )
    Total combinational functions : 16,601 / 24,624 ( 67 % )
    Dedicated logic registers : 9,574 / 24,624 ( 39 % )
Total registers : 9663
Total pins : 77 / 149 ( 52 % )
Total virtual pins : 0
Total memory bits : 271,872 / 608,256 ( 45 % )
Embedded Multiplier 9-bit elements : 16 / 132 ( 12 % )
Total PLLs : 1 / 4 ( 25 % )

ok.

2018-09-11: e1 - pin assignments , change to

attribute chip_pin of vga_scandbl : signal is "234";

recompile and test. OK, now the monitor is in 720x576 31.2 kHz 50 Hz mode. Still no picture and not booting though.

2018-09-11: e1 - testing - loading the .svf file into the FPGA gives something on the monitor, but it complains about not optimum mode, and goes into "Power LED blink" mode.

2018-09-11: e1 - I set up a 4GB SDcard, fat23, and copied kick.rom (and a few others) from my Amiga Forever to the root of the SD card.

2018-09-10: e1 - pin assignments, in C3BoardToplevel.vhd: video (VGA, I only have two bits per color)

attribute chip_pin of vga_red : signal is "13, 9, 5, 240, 38, 22";
attribute chip_pin of vga_green : signal is "12, 14, 235, 237, 44, 41";
attribute chip_pin of vga_blue : signal is "239, 236, 18, 238, 50, 46";
attribute chip_pin of vga_hsync : signal is "52";
attribute chip_pin of vga_vsync : signal is "56";

audio (nothing connected here yet)

attribute chip_pin of aud_l : signal is "6";
attribute chip_pin of aud_r : signal is "4";

PS/2, only keyboard connected (I need another PS/2 adapter)

attribute chip_pin of ps2k_clk : signal is "43";
attribute chip_pin of ps2k_dat : signal is "39";
attribute chip_pin of ps2m_clk : signal is "21";
attribute chip_pin of ps2m_dat : signal is "37";

RS232

attribute chip_pin of rs232_rxd : signal is "224";
attribute chip_pin of rs232_txd : signal is "232";

(rts, pin230 is not used)

SD card interface

attribute chip_pin of sd_cs : signal is "49"; attribute chip_pin of sd_miso : signal is "57"; attribute chip_pin of sd_mosi : signal is "51"; attribute chip_pin of sd_clk : signal is "45";

Power and LEDs - nothing here yet

attribute chip_pin of power_hold : signal is "171"; attribute chip_pin of power_button : signal is "94";

attribute chip_pin of leds : signal is "173, 169, 167, 135";

attribute chip_pin of vga_scandbl : signal is "231";

free pins, some are commented out

-- attribute chip_pin of misc_ios_1 : signal is "12,14,56,234,21,57";

-- attribute chip_pin of misc_ios_21 : signal is "226,232"; -- attribute chip_pin of misc_ios_22 : signal is "176,183,200,202,207,216,218,224,230";

attribute chip_pin of joy1 : signal is "201,223,221,219,217,214,203"; attribute chip_pin of joy2 : signal is "184,182,177,197,195,189,187";

clock, button and LED are unchanged

attribute chip_pin of clk_50 : signal is "152"; attribute chip_pin of reset_button : signal is "181"; attribute chip_pin of led_out : signal is "233";

SDRAM assignments are unchanged:

attribute chip_pin of sd1_addr : signal is "83,69,82,81,80,78,99,110,63,64,65,68"; attribute chip_pin of sd1_data : signal is "109,103,111,93,100,106,107,108"; attribute chip_pin of sd1_ba : signal is "70,71"; attribute chip_pin of sdram1_clk : signal is "117"; attribute chip_pin of sd1_cke : signal is "84"; attribute chip_pin of sd1_dqm : signal is "87"; attribute chip_pin of sd1_cs : signal is "72"; attribute chip_pin of sd1_we : signal is "88"; attribute chip_pin of sd1_cas : signal is "76"; attribute chip_pin of sd1_ras : signal is "73";

attribute chip_pin of sd2_addr : signal is "142,114,144,139,137,134,148,161,120,119,118,113"; attribute chip_pin of sd2_data : signal is "166,164,162,160,146,147,159,168"; attribute chip_pin of sd2_ba : signal is "126,127"; attribute chip_pin of sdram2_clk : signal is "186"; attribute chip_pin of sd2_cke : signal is "143"; attribute chip_pin of sd2_dqm : signal is "145"; attribute chip_pin of sd2_cs : signal is "128"; attribute chip_pin of sd2_we : signal is "133"; attribute chip_pin of sd2_cas : signal is "132"; attribute chip_pin of sd2_ras : signal is "131";

ok

2018-09-10: e1 - set up the robinsonb5/minimig_c3 project
```sh
[tingo@kg-elitebook c3]$ pwd
/home/tingo/personal/projects/fpga/Altera/c3

get source

[tingo@kg-elitebook c3]$ git clone https://github.com/robinsonb5/minimig_c3.git
Cloning into 'minimig_c3'...
remote: Counting objects: 947, done.
remote: Total 947 (delta 0), reused 0 (delta 0), pack-reused 947
Receiving objects: 100% (947/947), 1.19 MiB | 440.00 KiB/s, done.
Resolving deltas: 100% (525/525), done.

fix submodule

[tingo@kg-elitebook c3]$ cd minimig_c3/
[tingo@kg-elitebook minimig_c3]$ git submodule init
Submodule 'Firmware' (https://github.com/robinsonb5/Minimig_Firmware.git) registered for path 'Firmware'
[tingo@kg-elitebook minimig_c3]$ git submodule update
Cloning into '/zs/tingo/personal/projects/fpga/Altera/c3/minimig_c3/Firmware'...
Submodule path 'Firmware': checked out '9bc8fdb9cd48c018dbe6f087c846e0a9fed8036a'

ok.

2018-07-27: c1 - I start Quartus II (64-bit) and open Project, the select the C3BoardProject/Fampiga_C3.qpf file, then I start compilation. It takes about ten minutes. From the report file Fampiga_C3.flow.rpt:

+---------------------------------------------------------------------------------+
; Flow Summary                                                                    ;
+------------------------------------+--------------------------------------------+
; Flow Status                        ; Successful - Fri Jul 27 22:07:53 2018      ;
; Quartus II 64-Bit Version          ; 13.1.4 Build 182 03/12/2014 SJ Web Edition ;
; Revision Name                      ; Fampiga_C3                                 ;
; Top-level Entity Name              ; C3BoardToplevel                            ;
; Family                             ; Cyclone III                                ;
; Device                             ; EP3C25Q240C8                               ;
; Timing Models                      ; Final                                      ;
; Total logic elements               ; 18,246 / 24,624 ( 74 % )                   ;
;     Total combinational functions  ; 16,368 / 24,624 ( 66 % )                   ;
;     Dedicated logic registers      ; 7,168 / 24,624 ( 29 % )                    ;
; Total registers                    ; 7256                                       ;
; Total pins                         ; 132 / 149 ( 89 % )                         ;
; Total virtual pins                 ; 0                                          ;
; Total memory bits                  ; 253,952 / 608,256 ( 42 % )                 ;
; Embedded Multiplier 9-bit elements ; 12 / 132 ( 9 % )                           ;
; Total PLLs                         ; 2 / 4 ( 50 % )                             ;
+------------------------------------+--------------------------------------------+

good to know. Then I open the Programmer (Tools, Programmer in Quartus II), it already has Fampiga_C3.sof file in its window. I want a SVF file, so I do File -> Create JAM, JBC, SVF or ISC File. In the Windows that comes up, I select Serial Vector Format (.svf), it asks about "TCK frequency" which is pre-set to 25 MHz, and "Supply voltage" which is pre-set to 3.3 volts. The conversion takes only a few seconds. Afterwards, I comment out the 'TRST ABSENT' line by making it '!TRST ABSENT' in the Fampiga_C3.svf file.

2018-07-27: c1 - get the source

tingo@kg-core1$ pwd
/home/tingo/personal/projects/fpga/altera/C3

clone it

tingo@kg-core1$ git clone https://github.com/robinsonb5/minimig_c3.git
Cloning into 'minimig_c3'...
remote: Counting objects: 947, done.
remote: Total 947 (delta 0), reused 0 (delta 0), pack-reused 947
Receiving objects: 100% (947/947), 1.19 MiB | 797.00 KiB/s, done.
Resolving deltas: 100% (525/525), done.

fix the submodule thing

tingo@kg-core1$ cd minimig_c3/
tingo@kg-core1$ git submodule init
Submodule 'Firmware' (https://github.com/robinsonb5/Minimig_Firmware.git) registered for path 'Firmware'
tingo@kg-core1$ git submodule update
Cloning into '/zs/tingo/personal/projects/fpga/altera/C3/minimig_c3/Firmware'...
Submodule path 'Firmware': checked out '9bc8fdb9cd48c018dbe6f087c846e0a9fed8036a'

now everything should be ready to open in Quartus II.

2018-07-27: c1 - even if I don't have the necessary I/O connections for the Cyclone III (C3) board yet, I still want to try out Quartus II now that I have it installed on my FreeBSD workstation.

tingo@kg-core1$ uname -a
FreeBSD kg-core1.kg4.no 10.4-STABLE FreeBSD 10.4-STABLE #1 r329982: Sun Feb 25 20:35:06 CET 2018
     root@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64

ok

2018-07-27: I created this page.