Skip to content
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

26L6420 flashing settings #997

Open
alx5962 opened this issue Jul 24, 2024 · 15 comments
Open

26L6420 flashing settings #997

alx5962 opened this issue Jul 24, 2024 · 15 comments

Comments

@alx5962
Copy link

alx5962 commented Jul 24, 2024

OSCR firmware version

14

OSCR hardware version

HW3

Attach OSCR_LOG.txt file here

No response

System used

Flashrom Programmer

Describe the issue.

I'd like to flash a 26L6420 (SOP44) eprom using this cart reader but I can't find infos about this topic.

I already own the 26L6420 PCB adapter to flash them from : https://github.com/sanni/cartreader/tree/bd3eaa106b6e4cbdffbfa89a3fb5fedf3e028b17/pcb/adapters. It's shaped as a SNES adapter and it's not mentioned in the wiki.
I'm using the latest firmware on the reader and enabled FLASH16 in the firmware.

First, I'd like to know how to set the 4 switches and what options do I have to use in the Flashrom programmer menu. I guess it's the 16 bits Flash one (but when I select it, it only displays [+] 16 bit flash).

Many thanks for this great project! I'm creating my own Gameboy game and I use it a lot!

@sanni
Copy link
Owner

sanni commented Jul 24, 2024

Seems like you found a bug. 😄
Please update to the latest Github code and try again: https://github.com/sanni/cartreader/archive/refs/heads/master.zip

Switches like this:
image
And "16bit Flash" menu selection.

@alx5962
Copy link
Author

alx5962 commented Jul 24, 2024

Thank you for the fast reply and for the very fast fix!

So I just flashed the new firmware and now I have this error: "Flash ID 1010 unknown flashrom". In the flash.ino file:

if (flashid == 0xC2FC) {
println_Msg(F("MX26L6420 detected"));

So I added my own flashid, now let's try if all works well.

@alx5962
Copy link
Author

alx5962 commented Jul 27, 2024

Some feedback: I used another eprom and now flashid is correctly detected as 0xC2FC. I tried to erase it, 20 mn later still erasing it. How long does it take to erase, usually? I will double check every pins as I use an adapter like this:

SOP44 adapter

So I had to wire myself every pins to the SNES/Eprom adapter.

@alx5962
Copy link
Author

alx5962 commented Jul 27, 2024

I double checked and my wiring is fine. Flashid is 0xC2FC and blankcheck works fine but after 1 hour erasing still erasing (led off). Also tried to flash a blank eprom and after 1 hour I have the same result and no blinking (led always on).

I have a question about the 26l6420 adapter schematics found at: https://github.com/sanni/cartreader/blob/bd3eaa106b6e4cbdffbfa89a3fb5fedf3e028b17/pcb/adapters/26L6420_adapter_schematics.png

image

Somes pins have no direct link with the chip numbers: A21 is connected to WE, WE to BYTE, A20 to WP but some have the correct number: A18 is connected to A18, A17 to A17,... On the offical doc (below), A21 is an address input so it should be linked to A21.

Do these changes are linked to eprom flashing with this adapter? Or a issue with the schematic?

  • Official MX26L6420 datasheet:

image

image

@sanni
Copy link
Owner

sanni commented Jul 27, 2024

You can ignore the pin descriptions. Just have forgotten to change the symbol in KiCad.

352766262-d15e2ed4-753c-488b-a870-532a8270a84a

@alx5962
Copy link
Author

alx5962 commented Jul 27, 2024

Thank you for the feedback. Any idea about why the led is not blinking while flashing? Or is it only in 8 bit mode?

@sanni
Copy link
Owner

sanni commented Jul 27, 2024

One thing you could try is flashing V4.3 from the firmware archive, it should be the first version with 26l6420 support, to check if maybe over the past 5 years something got changed that broke 26l6420 support.

@herzmx
Copy link
Contributor

herzmx commented Jul 27, 2024

I try this and works, but 16bit Flash adaptador need a mod to work.
First cut trace on PH1
20240727_141727
And next join OE to PH3
20240727_141744

I don't remember if firmware need a mod, but i take a look in my old files.

This tested on HW5

@alx5962
Copy link
Author

alx5962 commented Jul 28, 2024

I try this and works, but 16bit Flash adaptador need a mod to work. First cut trace on PH1 20240727_141727 And next join OE to PH3 20240727_141744

I don't remember if firmware need a mod, but i take a look in my old files.

This tested on HW5

A big thank you for your hardware update! I will fix my adapter later today. Does this mod update the flashid number or is it still C2FC ? And can you tell me what firmware version is flashed on your reader?

@alx5962
Copy link
Author

alx5962 commented Jul 28, 2024

@herzmx I followed your instructions to mod my adapter:

my adapter

I reverted to the latest firmware and checked again my wiring. Now the detected flashid is 9090 and not C2FC. Don't know if it's ok or if my tests fried the eprom...

Also I noticed on your picture another wire on ground. Not related to this mod?

@herzmx
Copy link
Contributor

herzmx commented Jul 30, 2024

I'm back, i lose my old files, but with rewind in my mind, so when 16-BIT adapter released PH1 is tracked to CPU CLK in SNES, now in HW5 PH1 don't tracked to SNES Slot, because use CICCLK instead.
The change in adapter is to use PH3 to activate/deactivate OE and read words, this change works editing word readWord_Flash function

word readWord_Flash(unsigned long myAddress) {
  PORTF = myAddress & 0xFF;
  PORTK = (myAddress >> 8) & 0xFF;
  PORTL = (myAddress >> 16) & 0xFF;

  // Arduino running at 16Mhz -> one nop = 62.5ns
  __asm__("nop\n\t");

  // Setting OE(PH3) LOW
  PORTH &= ~(1 << 3);

  __asm__("nop\n\t"
          "nop\n\t"
          "nop\n\t"
          "nop\n\t"
          "nop\n\t"
          "nop\n\t");

  // Read
  word tempWord = ((PINA & 0xFF) << 8) | (PINC & 0xFF);

  __asm__("nop\n\t");

  // Setting OE(PH3) HIGH
  PORTH |= (1 << 3);
  __asm__("nop\n\t"
          "nop\n\t"
          "nop\n\t"
          "nop\n\t"
          "nop\n\t"
          "nop\n\t");

  return tempWord;
}

Please test...
FLASH.zip

I don't know if this affect other flash memorys, so i don't make PR at this time, enjoy your GD-ROM conversion 👍

@alx5962
Copy link
Author

alx5962 commented Jul 30, 2024

@herzmx thank you for your reply. I'm using HW3 so your update will work on it too or is it specific to HW5?

So you noticed my message on arcade projects forum 😁

@herzmx
Copy link
Contributor

herzmx commented Jul 30, 2024

Sorry i didn't see HW version on issue description, so no HW mod it's need because CLK1 switch in HW3 activates PH1, but with HW mod you need use the FLASH.ini attached in previous message.

Please test, it should work on HW3 as well, in my previous test I had issues with the memory having a sticker with chinese characters.

@alx5962
Copy link
Author

alx5962 commented Jul 30, 2024

Sorry i didn't see HW version on issue description, so no HW mod it's need because CLK1 switch in HW3 activates PH1, but with HW mod you need use the FLASH.ini attached in previous message.

Please test, it should work on HW3 as well, in my previous test I had issues with the memory having a sticker with chinese characters.

no problem at all!

I flashed the reader using the flash.ino file you provided. Now flashid is well detected (C2FC). But erasing doesn't seem to work (or takes more than 1 hour). I gonna try to find another 26l6420 eprom to check if the current one is not dead.

@TailsnicRetroworks
Copy link

Hi. I have seen with this project, 26L6420 eproms can be flashed, so I want to ask if this type of rom is fully compatible with erasing/writting/reading mode for making the entire PCB, many thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants