New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firmware transfer #3
Comments
Yeah, you need to compile first. I've updated the main README.md with some notes, and also for the menu-ing program kcmfs I've updated README-kcmfs.md. It has some additional notes as it's a Z80 program and requires sdcc and hex2bin in order to build. stm32 boards have several ways to flash them. I've included one of the easier ways in the README.md. That transfer.sh script is a one liner that uses dfu-util to flash the board over USB. I'll note that I hadn't looked at this project for a few years (if you look at my blog or other repos you'll see I've sort of done this whole ROM/FDC thing to a few systems now. They are all variations of the same code), but a reader recently reached out to me about it. He's had a lot of success with the ROM emulation , but some issues with the FDC side of things that we are still working through. I'm not quite sure what the issue is. These things are hard to troubleshoot remotely ;-) MSX as a standard is perhaps not as standard as I'd like it to be. It works fine on my Omega MSX2 thing. And it actually works on my MSX on a Breadboard as well ... but I haven't actually tried it myself on a proper (back in the day) MSX machine. Anyway, good luck. |
Hello again, I tried to compile the firmware with your advice but no luck. I used this board (https://stm32-base.org/boards/STM32F407VGT6-STM32F4XX-M.html) and I had to copy some .h files manually, but compile still failed with kinds of errors. Can you give me more advice for me? |
Can you paste in some details ; the distro you used (including version), whether you used a built in gcc-arm-none-eabi, or the developer.arm.com compiler chain (and which version), and then paste in what you see when you type 'make'. |
Not sure if this helps, but if you are familiar with docker then you can do the compile inside a docker container. As an example I did this on a linux system (if you are on Mac or Windows, I imagine the hardest part is putting the zip file from ST in the right place). I've left out most of the screen output except for what I see when I run make at the end.
You can then exit the running docker container. The hex file that you want to flash (or bin file if you the flashing tool requires a .bin, not a .hex) will be in the msx-rom-and-floppy-emulator directory. |
It's too long so I captured whole log into a text file. Please check attached. |
Thanks for sending that. Are you sure you downloaded the right en.stsw-stm32068.zip file from ST?. The one I have is 33042767 bytes long. MD5 is
With reference to the first error from your error_log.txt, |
I am just wondering if your directory structure of where you extracted the zip file is a bit incorrect. The Makefile will look for the STM32F4-Discovery_FW_V1.1.0 directory in the level above where the msx-rom-and-floppy-emulator directory is. Here's some ls commands to add some context
|
I succeeded to compile, flash and run on my actual MSX2 machine. Thank you for your kind advices! |
I think it will be perfect if we can change rom list page with LEFT/RIGHT cursor keys, instead of number key for each page. |
Cool. I'll have a look at that Russian keyboard page when I get some time. Meanwhile, I've just created a menu.rom that can use the number keys or the left/right keys to select pages. I'll attach it here. Can you try it and tell me if the cursor keys work. One other thing to mention is that the file listing is quite primitive, and if you have over 120 or so files in the msx directory it probably won't work properly. |
I tried your new menu.rom but it seems not working properly. I can see first page of rom list at the beginning, but the list disappear after pressing any key including letters(so I can't load any roms). Please check the attached video. IMG_3618.mov |
Thanks for posting the video. Interesting. I think I made the classic mistake of 'fixing one other thing which didn't quite work' in that last menu.rom. I'd added some code to do with 'clearing the screen' not working all the time. I've undone that. I've attached a new menu.rom that has some extra debug stuff in it. Firstly, if its an unknown keycode that is pressed (well, unknown from the perspective of my code), it will print a decimal keycode number down near were it says "(? - HELP)". If my code does understand the key pressed you won't see a number. The number is only on the screen for a second or two, before the screen generally clears. I've also made it so that the Z and X keys can act as the left and right cursor keys (this is more to help us debug it). I am guessing that the keycodes for left and right arrow must be quite different on your machine. So try the menu.rom and see what number appears next to the "(? - HELP)". I can try adding those numbers in then (there is a slim possibility that you get no number and the left/right keys actually work. Like I said, I introduced a bug in that last menu.rom) |
I tried it and it still seems working strange. Rom list still disappear after any of key press, and wierd string shown. This string seems not change by any key(cursors, numbers, letters, ?). Please check attached video. I think this is related with Korean keyboard type or keycode, or something. IMG_3627.mov |
How about to use kbhit() or getch() for keyboard input instead of getchar()? |
Thanks for the extra info. This is quite an interesting problem. So I'm using getchar() because that's one of the few BIOS calls I have using the SDCC setup I am using. It is just the 0x009f MSX BIOS function. So I was able to get MAME going emulating your CPC 400, and sure enough when I call getchar() I don't get anything useful back. It is obviously waiting for a key to be pressed but the value returned for any key seems the same. I've tried a few different ways to read a key and so far I am not having a lot of success. I'd prefer to leave it as some sort of BIOS call so I don't have to worry about different keyboard maps. While I scratch my head, I've done a build (attached) that does not use the keyboard getchar() at all and just uses the gtstck() and gttrig() BIOS functions for reading the joysticks OR cursor keys and space. So it only looks at the cursor keys and space. It is super primitive. There is no highlighted cursor. All you see is a letter down the bottom right. It will say 'a' initially. If you cursor down then it goes 'b' then 'c' and so on. Cursor up will go in the reverse direction. When you've got the letter you want you can press space to select that game and the machine should reboot. Left and Right Cursor keys will go to page 2 and 3 and so on. Selecting using the cursor is not a long term solution. I'll keep looking in to why the keyboard doesn't want to work. I'll just note too that using the menu.rom is optional. If you leave it off the SD card, the the rom/fdc emulator board will just boot off the first ROM/DSK you copied in to the msx directory. And then you can you use the NEXT and PREV keys to go back and forth 'blindly' through the list. It helps if the board is powered seperately via its USB port. That way you can turn off your MSX computer, hit the NEXT button on the board, then power the MSX computer back on again and it should run the next rom in the msx directory. |
Hi, thank you for repeated modification. I tried new menu.rom and the control is successful with cursor keys. I could select and road roms. IMG_3630.movIMG_3631.mov |
Yeah, I noticed you had the gotek. I'm not surprised it doesn't work. Effectively you'll have two disk ROMs loaded when you select a disk based game from the menu. I am guessing that MSX has some way of giving one disk ROM more priority than the other. In your case, it's probably given your internal disk ROM priority and hence it then goes and talks to the gotek through the internal floppy disk controller. I don't have an MSX machine with a real floppy drive, so I'm not much help. That might be 'too hard' for now. If you can find any references for how two disk ROMs are meant to work, then I can take a look. But I've also been trying to figure out all the keyboard problems still. It is super weird, but I think I understand it. In your machine I think it must modify some other registers when the BIOS chput and chget routines are called. The C library stuff I was using has some push/pop wrappers around these BIOS functions, but I'm thinking it doesn't push enough registers and so we get really strange behaviour. So I've ended up rewriting the entire menu in Z80 assembler, so I can easily then play around with the push/pop of registers. I have tested what I can in the MAME emulator for your machine. It looks a lot better. If you can try it, that would be good. It is keyboard only (number keys and the left and right arrow keys should work I think). When you type a letter like 'a', it should briefly show up in the lower right corner before the machine reboots. Also try the help screen. That should work. I made it so that it is either '?' or '/'. I have the changes in an experimental-kr git branch at the moment. I'll attach the menu.rom below |
Thank you for modifying of menu again! I tried it and worked perfectly. Great work! And I found disk rom solution also - If I keep pressing CTRL key during the system booting, the internal FDD(Gotek for my system) is ignored so I can use disk.rom in SD root of our cart. I can use that CTRL key technique when any booting, including first cold boot/auto reboot after rom select/hard reset/ETC. I think you can add this in your description ^^ Additionally, I'm considering to install a small OLED screen using I2C connection on the cart, to show current rom/dsk filename. Can you give me some advice about it? IMG_3632.mov |
Cool! I'll update the main master branch with the kcmfs menu.rom changes over the weekend (I think I will switch to this assembly version ... as it's almost easier to debug). And thanks for the tip about using CTRL. I'll try to update the README with that. I have one of those ssd 1306 OLED screen things .. but I've never played with it. I'll try to have a look myself over the weekend to see how hard it would be to put the filename on the screen. At this sort of level of stm32 stuff, you need to add in a lot of I2C initialisation and access functions to make it all work, before adding in any of the ssd 1306 stuff (like font loading etc). In the current master branch there are basically two places in the main.c where it is calculating the filename to load from the SD card (one for when you select a file using the menu.rom, and the other for if you use the next/prev buttons). Ultimately, you would grab the filename at these points and send it to the oled screen. I am actually about to change some of this filename stuff. I've been working on another branch 'multi-drive-support' that adds in B: drive support, and it also allows you to create subdirectories that contain a set of dsk images (eg. You might create an |
I've updated the master and multi-drive-support branch with the new Z80 asm kcmfs. I've also pushed a branch called oled-ssd1306-example. It does seem to work. But it's probably something I would just leave as an experimental branch for people who want to play with it. There is more detail in the README.md in that branch. The last thing I want to do is support all the different OLED displays out there. There seems to be some magic sequence hex numbers to send to them to initialise them ... and it can vary a bit (ie I had to go searching to find out how to get my particular ssd 1306 to work as it initially didn't work). Anyway, have a play. |
Thank you for your try even it's weekend! IMG_3658.mov |
Cool. Thanks for the pictures and video. I've made a few updates. I must admit I knew the PREV button would be hard now that I have subdirectories. I've made a few changes to the |
How about to use this kind of thumbwheel switch(https://uge-one.com/ts003-smd-thumbwheel-toggle-slide-dial-switch.html)? User can move PREV/NEXT with wheel, and go into a folder/execute a file with center click. Inside a every folder, such a 'BACK' or 'EXIT' menu item needed for go out. This is quite common way to do user operations in most of similar devices like as GOTEK or GBS-C. |
Hello. First, good job with the MSX ROM EMULATOR. I'm confused. I haven't Linux, and there is no way with windows. Can somebody send to me the compiled file? thank you so much for your help. I have already build the pcb and my sd card is completed. I hope you will help me. Regards. (to msxlegend@gmail.com) |
It helps me enormously (in terms of troubleshooting) if people can go to the effort of compiling the firmware. It is not that hard. I've added notes similar to what is noted higher up in a new README-compiling.md file. The easiest way is to just use docker to compile the firmware (and that should work in Linux, Mac and Windows) and there are specific notes in that new README file about that. |
Hi, It works fine, thank you. |
Hello, |
Hello, a novice here. Would you kindly share how can I flash this firmware to the STM board?
Do I need to compile first? How?
The text was updated successfully, but these errors were encountered: