-
Notifications
You must be signed in to change notification settings - Fork 131
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
Issue with ESPlay micro #57
Comments
I noticed that there's an esplay target, but for some reason it's not included in the main releases. (Maybe it's not done?) I don't have an esplay micro of my own, but maybe this firmware I built will work for you. |
Thanks ! Unfortunately it doesn't flash, There is an header mismatch error and erase error. |
Edit : the .img flash but it's stuck with a white screen, as for mrgc-g32 release... |
Esplay micro isn't supported. No reason it couldn't be, but someone will have to write the target file :) . The mrgc target is a good starting point, from what I can tell it's already a close match in terms of hardware and pinout. Maybe borrowing the lcd init sequence from the esplay micro's code would be enough, I don't know. |
Drat, ok. There are multiple units that use the ESPlay name, and I was having trouble figuring out which one we have a target for. @monsieurPiGG Is this the unit you have? I was thinking about possibly picking up one at some point. |
@Cralex, yes, this is the unit I have ! |
@monsieurPiGG Do you have a build environment set up? If I have time, maybe I can look at the source code for one of your device's firmwares and see if there are any clues there to get your screen working. |
Hi ! Sorry for the delay ! |
I have an ESPlay Micro V2 on order. Time permitting, I'll be able to attempt building and testing Retro-Go ports for it once it finally arrives. 🚀 Edit: Looking for firmware source code for the device to reference the screen's init code. It's hard to tell what's for the original ESPlay Micro vs the V2 (if there's even a difference) until I have one in hand. It'll be nice once we have a Retro-Go port up and running... Make it easier to, ah, avoid potentially copyrighted content while just looking for firmware. |
Sorry I didn't,t have time to try something... |
That is an important clue, though. I noticed, of the multiple firmwares available for the ESPlay Micro, none of it is labeled V1 or V2. If they are in fact all capable of running the same firmware, that gives us a lot of working code to base a Retro-Go port off of and I might be justified in naming the target just ESPlay Micro. @ducalex I noticed that it's possible to specify shoulder buttons in Retro-Go targets. Since this device actually has some, are the emulators set up to take advantage of them? Edit: My unit arrived today. The buttons are clicky (So clicky! It burns my ears!) and all the acrylic parts and screen had protective coverings that required disassembly to remove. The board designer flipped A and B compared to how they're normally on Nintendo consoles. Perhaps worst of all, my screen came crooked and was mounted with some really sticky adhesive foam. But enough complaining. This thing needs Retro-Go and I can't work on porting it if I break the screen while trying to straighten it. (ง'̀-'́)ง I found a couple possible screen init codes to try in the OG firmware source code to get me started. |
Sorry to bug, @ducalex , but I'm having some trouble building a compatible firmware file that doesn't do the "header mismatch error" thing. Also, the firmware files from https://github.com/pebri86/esplay-micro-firmware-collections don't seem to work either. I'm attaching some firmware that came on the device's card. Could you possibly check it to see what format we should aim for? Thanks. Edit: Seems like a firmware format that Retro-Go hasn't used yet. I tried placing both the ODG and the G32 firmware files in there as a sanity check to make sure I wasn't compiling my WIP firmware wrong, but both firmware files give the header mismatch error. |
Currently no but rg_input supports them in most drivers I think, so it's only needed to be added on the emulator side. Feel free to send a PR or just tell me what mapping should be added where :).
Those .fw files seem to match the esplay format:
I don't see anything obvious as to why those are accepted as valid and the ones produced by retro-go (in esplay mode) are not... |
Indeed. You can lift the screen up with a thin blade. I've added a strong double sided tape, the one used for carpets. That's strange that the mrgc-g32 retro go .fw doesn't have the header mismatch error and seems to install since retro go folders are created in sd card. |
@monsieurPiGG That's a cute case! I don't have access to a 3D printer but I might have to order one made at some point. Regarding Retro-Go folders, you mentioned that you tried flashing the .img file that I uploaded before and that succeeded, but there was nothing on the screen, right? I am guessing that Retro-Go was able to boot at that time (just without the proper screen configuration) and that's when the folders were created. I'll keep trying and see if I come up with anything. This device is unusual among the other ESP32 handhelds I've used in that it displays an animated splash screen before starting the installed firmware or boot loader. No idea how that works or if it matters. I'll probably try to flash it over USB or something and see if I can at least get it running. |
I meant the mrgc-g32 release of retro go. This one seems to launch, but with a display issue. Unfortunately, the .fw and the .img files you provided earlier gave the header mismatch error. |
Progress, but ugh, it was a bear getting here. (I'm partly writing this so I don't forget how on earth I got here.) Since I can't get it to accept .fw files, I tried flashing the .img file I compiled instead using esptool. It kept failing to connect and giving me a Edit: Since I actually know very little about how esp32 works under the hood, what defines whether or not a .fw needs to be in ESPlay format or not, the hardware or the bootloader, @ducalex ? If for some reason, I am never able to figure out how to load Retro-Go in .fw format in the stock bootloader, would porting and flashing your Odroid Multi-Firmware bootloader neutralize the format problem? Since I know how to flash the stock bootloader now, I am willing to experiment if it comes to that. Edit2: I took another look at the aforementioned firmware collections github and you can clearly see that the Esplay Micro's main emulation firmware was updated to support the V2 hardware. Sure enough, it matches what came on the card and explains why most of the older firmware doesn't work with it. I found the commit where the firmware was updated here. Perhaps the key lies in the |
@Cralex it's amazing ! You're almost there ! |
It is the flashing utility that resides in the factory partition (the app that starts when you power up holding a specific button). It's called odroid-go-firmware on the ODROID GO.
Yes it would, but surely finding the .fw format would be easier! The .fw format can be known from two sources:
Alternatively if someone can provide me a .fw that IS recognized by the firmware and a .fw that ISN'T but SHOULD BE recognized, I might be able to find the issue. It has to be something minor! I can't explain why your device rejects the mrgc-g32 builds I published, but have you double checked that your own builds are indeed in the esplay format? Maybe your target isn't configured correctly and retro-go makes the .fw in the odroid-go format? |
I'm very nearly done with the screen. It fills the display properly and everything looks great, but everything is still flipped across the y-axis. (So, right-side up but mirrored.) I tried changing the value of I looked at the resulting firmware in a hex editor and it definitely showing as an esplay firmware. Might looking at the various emulator firmware versions for the Esplay Micro line help? The "update 2.0" version is an exact match for the one on the card and is valid, while the "new release" one is for the V1 and is not valid. (Other changes were made as well, I'm sure.) Still do do: verify sound works, finish mapping buttons, make sure networking works... Also flashing the .img never seems to allow me to actually launch an emulator. That's not normal, right? I'm only building with retro-core and launcher for now. Haven't checked for serial output yet. |
Take a look at the 0x36 command/register, it controls scanning direction. It's called "Memory Access Control" in the datasheet. Can't really help with your other questions but I imagine obtaining debug output would be a good place to start :). |
I don't know if it could help, but I've ever use ILI9341 display with rasp pi. In raspbian (config.txt), display_lcd_rotate can take that arguments :
|
Can this be helpful ? |
Thanks @ducalex for pointing me in the right direction, and @monsieurPiGG for the legwork. We have a fully functional screen, ready to be merged. 😁 Edit: Probably gonna call it a night. I tinkered around a little now that I have a legible display. Here's where I'm at.
|
This look great. |
That's progress at least! I built a .fw with our mkfw.py and their mkfw.c[1] then compared the result and they were identical. So I'm tempted to say our .fw format is fine. An SD Card issue (driver or card) perhaps? |
Since it has problems launching emulators from roms stored in the supplied sd card, I'm also tempted to point the sd card. |
Well, I thought I'd tried flashing from the bootloader after I switched cards, or maybe I just did a backup of what was already on the card without checking the validity of my build. I flashed the bootloader and copied over a fresh build of retro-go... It works. Icon appears, it flashes, it boots. Oy! Sorry all for the wild goose chase. In addition to simply working, I also tested the headphone audio (can people solder a speaker to this?), the wifi again, and the battery. Battery needs more tweaking, but everything else works fine. I'm taking another look at the buttons. I'm using the I2C driver, and I noticed that past a certain point the buttons start to repeat themselves without hitting Menu, L, and R. I'm going to keep trying and see if maybe the new buttons can be mapped by passing by the first repeats. I'll post my results when I have them. Oh yeah, I'll bet all those other esplay micro firmwares will work fine now that I'm copying them to a good card. 🙃 |
Okay, now that the self-inflicted flashing problem is solved, I see no reason not to put out an alpha release for ESPlay Micro owners to test out. See usage and installation notes in the link. I also made a pull request with all the necessary files to build the firmware in case anyone wants to help me work on it. |
I've try this alpha version. look like the [select] button and [menu] button is the same. This might need some fix. |
Amazing ! Point 3 in the release :
It's not necessary. Just hold menu while booting and the device boots the boot loader.
@nod3011, it's normal and intended by @Cralex in order to make it playable.
I have a speaker soldered to it and it works. Sound glitches with snes but I guess it's a known issue. It's amazing ! I'm impressed by the snes performance, still not 100% speed but good enough to play some games (with patience !). |
After a nice long rest, I'm back to look at the buttons, this time with moderately more research. There's a diagram of the unit's component connections here. Note the PCF8574 GPIO extender chip that appears to be used to wire some of the buttons. There's a little guide on how to use the thing here. As little experience as I have with ESP32, I have even less with Arduino. But it seems as though someone wanting to use this with Arduino would need to add some libraries. Does it look like Retro-Go would need to do this as well? I glanced over the stock firmware and it doesn't seem as though they do. There also seems to be a section in the guide that hints that the addresses for the added pins should start at 0x20, but I don't know how to apply the knowledge. This is all rather above my head, but I really want to improve the port for this device. |
In retro-go you can use rg_i2c_* functions to talk to the chip. The equivalent to what they do here would be So essentially in |
I've been working for a few hours on the button mapping and could use a break and/or another set of (human) eyes.
Under
It builds, but always boots to Recovery Mode regardless of how I've set the button mapping, so either I'm not expressing the buttons correctly or my additions to rg_input.c are inherently buggy. I eventually stumbled on a repo containing some simple tests for the unit here, including a helpful button test for reference. The repo mentions that only the L, R and MENU keys are directly connected to the IO pins, while the other keys are connected through the PCF8574. But yeah, need sleep. I'll think on this more tomorrow. |
I think it should look more like: uint8_t buttons = rg_i2c_read_byte(0x20, -1);
for (size_t i = 0; i < keymap_size; ++i)
{
if ((buttons & keymap[i].src) == keymap[i].src)
state |= keymap[i].key; RG_GAMEPAD_MAP is a table where each entry has:
But maybe you should ignore the map until you get things working, it can get a bit confusing. Another reason to ignore RG_GAMEPAD_MAP for now is that it isn't super flexible, it can't express two sources of inputs (gpio+i2c extender) nicely. We'll have to fix that... Anyway just to get things working you could just do something like that: uint8_t buttons = rg_i2c_read_byte(0x20, -1);
if (buttons & (1 << 0))
state |= RG_KEY_UP;
if (buttons & (1 << 1))
state |= RG_KEY_DOWN;
if (!gpio_get_level(MENU GPIO))
state |= RG_KEY_MENU;
if (!gpio_get_level(L GPIO))
state |= RG_KEY_L; |
Not exactly sure why, but this doesn't seem to work with ESPLAY Micro V1 (along with other boards based on it). Have any of you been able to get it to work on a V1 board? V1 - ESP32 WROVER, Dual-core processor with Integrated 4MB Flash + 4MB PSRAM The two V1 boards that I have just loop:
Solved by reflashing the bootloader with JP1 connected to ground. This is what the end of the log shows toward the end of the V1.40 flashing process:
The last four lines loop. @ducalex It might be worth renaming the release to V2 unless someone with a V1 confirms it works. |
I don't have any of those devices so we'll wait for @Cralex to see if he knows what's going on before I make any naming or code changes. But that sounds like maybe retro-go doesn't fit in the flash and, for whatever reason, the firmware/bootloader tries to flash it anyway? Based on that log, it would end at 0x410000 (1.40 is 3.75MB). Which is likely past the 4MB flash. We have several options to make retro-go smaller:
We could also instruct users to flash a (non-reduced) .img version instead. But it's perhaps less convenient. Let me know what you all think is the best route to take and I'll see how I can integrate those needs in my next release. |
Darn. I might swap out my Wrover module for an 8MB one. I was looking forward to testing those two systems. Losing networking isn't a huge issue. |
Yeah, I also don't have a V1 board, and I'm guessing (I don't know off the top of my head. Maybe the MRGC GameBox Mini?) that all the ports I've been working on so far have had enough flash storage to install a full build of Retro-Go using the bootloader's flashing feature. Renaming the port to specify a V2 target is certainly one option, although I'm curious to know how well it runs Retro-Go. Were you able to flash a Retro-Go .img on your V1 directly, without using the bootloader? Like Ducalex said, building it without some of the extra components (networking, SNES, Genesis) should hopefully result in an image small enough to flash from the bootloader. I am rather spoiled by the networking features, but I can compile a copy without it if you would like to test it out. |
If I'm being honest you're not missing much, neither is running very well. Attached build is as small as I could pack things, can you test it to confirm it's just a size issue? Nothing was cut, I've just moved snes9x to retro-core. retro-go_1.41-dirty_esplay-micro.zip If it still doesn't work for other reasons then I'm ok with making it clear retro-go is v2 only! |
I'll try and update you with the results. The strange thing is this person was able to get retro-go working on a 4MB V1 derivative based on their serial output: #91 (comment) edit To other users, be aware that this may not work for V1 derivative boards. The one that I have cannot boot this dirty build, but a real ESPLAY Micro can.
Stock ESPLAY Firmware
|
I am unsure of how to do this. Do you use Flash_Download_Tool/esptool? |
I'm not sure this is a retro-go issue (at least based on the logs you provided). In the first log, boot fails because the bootloader expected to find a 16MB flash chip but found a 4MB instead. This is likely because the bootloader/firmware was configured for 16MB flash at build time, and you didn't override that during flashing. If flashed correctly, this line:
should become:
I think for esptool you just have to use Just to be clear: This could still be a retro-go issue because clearly the same bootloader works when a different .fw is flashed? Retro-Go is configured for 16MB flash but I'm almost sure that the flash size info isn't preserved in the .fw format, so I'm not sure what's going on. |
retro-go (mrgc-g32 last version) installs and launch in ESPlay micro but display remains white.
We can argue it installs since retro-go folder are created in the sd card.
ESPlay should be a clone of odroid-go.
Here are the specs :
ESP32 WROVER, Dual-core processor with Integrated 16MB Flash + 8MB PSRAM
Integrated WIFI and Bluetooth 4 BLE
2,4" ILI9341 TFT Panel
Micro SD slot connected to SDMMC Host in 1 Line Mode for saving GPIO pin
Integrated I2S DAC via UDA1334A
Is it a known issu with other odroid go clones ? Is there a workaround ? Thanks !
The text was updated successfully, but these errors were encountered: