stm32gbcart-fw icon indicating copy to clipboard operation
stm32gbcart-fw copied to clipboard

How to transfer my roms

Open modlfo opened this issue 5 years ago • 5 comments

Hi! thank you for sharing this project.

I made one of this cartridges using a STM32 board I had at hand and I flashed your firmware. I'm trying to figure out how can I transfer a ROM. I tried copying it to the drive it appears when plugging it to the computer but seems like it didn't work (It could be that my cartridge does not work).

I noticed that the ROMS can be added with an #include. How do you process them to be able of compile the code it the ROM included?

modlfo avatar May 14 '20 18:05 modlfo

I figured it out. I just flashed the ROM contents to the address 0x08020000 using the STM32CubeProgrammer.

modlfo avatar May 14 '20 19:05 modlfo

Good, but now I'm interested why it didn't work the normal way. Can you give more information on what you did? Your operating system, file manager etc. Sometimes the system is too smart and doesn't just straight up write to the file, which is required for it to work. Also try reading it out now that you flashed it.

Emeryth avatar May 14 '20 19:05 Emeryth

I did more testing on Mac, Linux and Windows. I have successfully copied the rom only in Windows.

In all three cases, when trying to copy the new rom.gb file, the file manager tells me that there's no space left in the device. So I have to delete the existing file first. Once it's deleted I copy the new file, wait for a few seconds and then eject the device. In Windows I used shit+del to permanently deleting the file. This can be the key.

Seems like the ST implementation of the file system firmware has other issues in Linux and Mac. When ejecting the file system, it immediately mounts back. I'll try other things and check if I find something interesting.

modlfo avatar May 15 '20 04:05 modlfo

At the end I was able of transferring the rom in Linux as well by permanently delete file first (using shift+del). In Mac it only works if I copy the file from the terminal. So the Finder (the regular file manager) must be doing something weird when deleting and copying the file.

modlfo avatar May 15 '20 05:05 modlfo

Thanks for your feedback. For me, cp in the terminal works on Linux, but using a file manager fails because it tries to write to a temporary file, then rename it. I never tried deleting the file first because I assumed the system wouldn't write to the exact same block.

Emeryth avatar May 15 '20 06:05 Emeryth