Gathering DS flashcard knowledge - DIY "opencard" idea

NathaanTFM

Active Member
Newcomer
Joined
Jan 20, 2018
Messages
39
Trophies
0
Website
www.nathaan.com
XP
180
Country
France
I assume the latency from your microcontroller is the cause of the tight timings. Any decent NAND flash chip with a minimum of a 8 bits wide bus should be fast enough assuming the block mapping table is cached and the read request goes immediately to the NAND.
I'm working on a budget with chips I can afford, and there's also limited space on a physical cartridge, so the best I can use are SPI NAND FLASH chips, which have slower read speeds. I have looked at some more SPI NAND flash chips, and it turns out the "slower" transfer rate (240µs before writing the first byte) is more than enough.

I'm planning on getting a RP2040 dev board soon - I was lucky with how cheap I got those STM32 MCUs.
 
  • Like
Reactions: kjhota123

nullmalachite

New Member
Newbie
Joined
Apr 13, 2024
Messages
1
Trophies
0
Age
18
XP
15
Country
United States
Hey, I found this while doing research into whether it would be possible to make NDS repro carts at home (note my wording, "possible" not "practical", i just wanna do it to see if I could lol) and after almost losing hope that it is even a possibility I find this thread! I'll have to do research of my own but this helps a LOT in getting me off the ground. Thank you so much!
Post automatically merged:

Something im not understanding is exactly what instructions are necessarry on the microcontroller to get the DS to see the game and boot it. Sorry if theres something obvious im missing but I just wanna know how hard it would be to replicate this.
 
Last edited by nullmalachite,
  • Like
Reactions: kjhota123

NathaanTFM

Active Member
Newcomer
Joined
Jan 20, 2018
Messages
39
Trophies
0
Website
www.nathaan.com
XP
180
Country
France
Hey, I found this while doing research into whether it would be possible to make NDS repro carts at home (note my wording, "possible" not "practical", i just wanna do it to see if I could lol) and after almost losing hope that it is even a possibility I find this thread! I'll have to do research of my own but this helps a LOT in getting me off the ground. Thank you so much!
Post automatically merged:

Something im not understanding is exactly what instructions are necessarry on the microcontroller to get the DS to see the game and boot it. Sorry if theres something obvious im missing but I just wanna know how hard it would be to replicate this.

If you want to write your own program for your microcontroller, I think the best I can do is to explain how mine currently works? I'm not an expert in this field so there are most likely some parts that are wrong.

The DS cartridge protocol is documented on GBATEK. It works like SPI but with 8 bits of data: you have a Chip Select (CS1) pin, a Clock (CLK, driven by the DS), and input/output. CLK and CS1 are initially high ; when the DS wants to receive or send data to the cartridge (which is a proprietary ROM in official cartridges, and in mine it's a STM32 microcontroller), it firsts drives CS1 low. Then, when CLK becomes low, the console/cartridge drives the pins I/O7 to I/O0 depending on the byte it wants to send. I/O7 is bit 7 (MSB), I/O0 is bit 0 (LSB). High means 1, low means 0. Quick and dirty drawing for the timings. The DS doesn't care when you toggle the pins as long as it gets the value when CLK goes low.

1713115419994.png


So when a transfer begins, CS1 goes low, and the console transmits 8 bytes (CLK goes low 8 times) ; that's the command. The commands are documented on the page I linked above. After those 8 bytes, there might or might not be a gap, then the transfer reverses ; it's now the cartridge that drives the IO pins. The console still drives the clock, and every time the clock goes down, the console reads a new byte. Retail cartridges drives the I/O pins when the clock goes low, but due to timing issues with my microcontroller, I drive them when the clock goes high. The transfer ends when the console drives CS1 high.

The transfer's clock is initially at 4.2MHz, then goes up to 6.7MHz for (all?) retail games. This depends on the cartridge header. There's also encryption (KEY1/KEY2, also documented on GBATEK) and don't forget that there's a whitelist on non-homebrew DSi/3DS units.

Don't underestimate the clock rate. I'm using a STM32G431CBU6 which is clocked at 150 MHz, has many DMA channels I'm abusing, and DMA request generators for external interrupts/events. With the transfer rate, I can run *at most* 150/6.7 = 23 cpu instructions between two CLK falling-edges (not counting multi-cycles instructions and the time it takes to read the instruction from the internal flash). I am also using a NOR flash chip which are fast enough for retail games but somewhat expensive.

Sorry if that's hard to understand, this is my first time dealing with these and my vocabulary isn't really good (and english isn't my native language). I don't have much free time rn, so I'll try putting my current code for the STM32 cartridge on GitHub soon without bothering to clean it up.

EDIT: https://github.com/NathaanTFM/stm32cart. Haven't tested the few edits I've made.
 
Last edited by NathaanTFM,

XLuma

Pkmn Rom Hacker
Member
Joined
Feb 12, 2017
Messages
490
Trophies
0
Age
23
Location
Quebec
XP
659
Country
Canada
I am part of a team by the name of Lost Nintendo History. For the past 3 years now, we've been working on an open-source flashcart targeting every system in the *DS line of products.

The flashcart is based on the rp2040, and we expect to release the project to the public soon(tm, very relative to how much progress we make over time).

The cartridge can boot titles, as well as homebrew. It will not be sold anywhere, instead users will be able to order a shell and a pcb from popular manufacturers like JLPCB or PCBWAY as we do not intend (or want) to make any money from this project.

Now, this project is not meant to be used as a "reproduction" cartridge, rather being a modern replacement for all the flashcarts on the market currently. the STM32 projet could be good leverage towards programmable cartridges, maybe.

We thought we would let people know here so no effort is wasted on another rp2040 cartridge (especially since everything will be made open source, and open to contributions)

Picture of the cartridge on our twitter account:
 

WolfyBuilder

Member
Newcomer
Joined
Apr 2, 2023
Messages
5
Trophies
0
Age
20
XP
203
Country
United States
I am part of a team by the name of Lost Nintendo History. For the past 3 years now, we've been working on an open-source flashcart targeting every system in the *DS line of products.

The flashcart is based on the rp2040, and we expect to release the project to the public soon(tm, very relative to how much progress we make over time).

The cartridge can boot titles, as well as homebrew. It will not be sold anywhere, instead users will be able to order a shell and a pcb from popular manufacturers like JLPCB or PCBWAY as we do not intend (or want) to make any money from this project.

Now, this project is not meant to be used as a "reproduction" cartridge, rather being a modern replacement for all the flashcarts on the market currently. the STM32 projet could be good leverage towards programmable cartridges, maybe.

We thought we would let people know here so no effort is wasted on another rp2040 cartridge (especially since everything will be made open source, and open to contributions)

Picture of the cartridge on our twitter account:

That's awesome, I had no idea your team was working on a new flashcart!

I'd love for it to have NOR flash memory, similar to EZ-FLASH's OMEGA. I think that would solve the lack of DSi-enhanced support, while also finally allowing Pokemon Dream Radar and Poke Transporter to work
 
  • Like
Reactions: kjhota123

Deleted member 698398

Well-Known Member
Newcomer
Joined
Mar 26, 2024
Messages
99
Trophies
0
XP
131
I am part of a team by the name of Lost Nintendo History. For the past 3 years now, we've been working on an open-source flashcart targeting every system in the *DS line of products.

The flashcart is based on the rp2040, and we expect to release the project to the public soon(tm, very relative to how much progress we make over time).

The cartridge can boot titles, as well as homebrew. It will not be sold anywhere, instead users will be able to order a shell and a pcb from popular manufacturers like JLPCB or PCBWAY as we do not intend (or want) to make any money from this project.

Now, this project is not meant to be used as a "reproduction" cartridge, rather being a modern replacement for all the flashcarts on the market currently. the STM32 projet could be good leverage towards programmable cartridges, maybe.

We thought we would let people know here so no effort is wasted on another rp2040 cartridge (especially since everything will be made open source, and open to contributions)

Picture of the cartridge on our twitter account:

Ooooooo, neat. I'll probably order one from PCBWay just to have one. I kinda wonder if any Chinese cloners will start making these carts too. I suppose it depends on how well it ends up working. The RP2040 is such a cheap and versatile little chip.
 
  • Like
Reactions: kjhota123

XLuma

Pkmn Rom Hacker
Member
Joined
Feb 12, 2017
Messages
490
Trophies
0
Age
23
Location
Quebec
XP
659
Country
Canada
That's awesome, I had no idea your team was working on a new flashcart!

I'd love for it to have NOR flash memory, similar to EZ-FLASH's OMEGA. I think that would solve the lack of DSi-enhanced support, while also finally allowing Pokemon Dream Radar and Poke Transporter to work
Our project will support dsi-enhanced features as well as dsi exclusive titles.

Making a programmable cartridge is outside the scope of the project, though nothing will prevent you or anybody from making your own flashcart with the features you want

Ooooooo, neat. I'll probably order one from PCBWay just to have one. I kinda wonder if any Chinese cloners will start making these carts too. I suppose it depends on how well it ends up working. The RP2040 is such a cheap and versatile little chip.
The design files for the hardware and all the code for the firmware and other components will be made open source. Obviously there will be clones reusing everything, however you can avoid buying from these resellers anyway
 

Deleted member 698398

Well-Known Member
Newcomer
Joined
Mar 26, 2024
Messages
99
Trophies
0
XP
131
Our project will support dsi-enhanced features as well as dsi exclusive titles.

Making a programmable cartridge is outside the scope of the project, though nothing will prevent you or anybody from making your own flashcart with the features you want


The design files for the hardware and all the code for the firmware and other components will be made open source. Obviously there will be clones reusing everything, however you can avoid buying from these resellers anyway
Ah, sweet. Nobody's made a DSi mode capable cart in such a long time.
As for the second part, assuming they don't make any changes to the cart and just sell it as is, I don't really have an issue with clones. It makes it more accessible to the less technically inclined.
 

SylverReZ

GBATemp Sh*tposter Deluxe
Member
GBAtemp Patron
Joined
Sep 13, 2022
Messages
7,601
Trophies
3
Location
The Wired
Website
m4x1mumrez87.neocities.org
XP
21,691
Country
United Kingdom
I am part of a team by the name of Lost Nintendo History. For the past 3 years now, we've been working on an open-source flashcart targeting every system in the *DS line of products.

The flashcart is based on the rp2040, and we expect to release the project to the public soon(tm, very relative to how much progress we make over time).

The cartridge can boot titles, as well as homebrew. It will not be sold anywhere, instead users will be able to order a shell and a pcb from popular manufacturers like JLPCB or PCBWAY as we do not intend (or want) to make any money from this project.

Now, this project is not meant to be used as a "reproduction" cartridge, rather being a modern replacement for all the flashcarts on the market currently. the STM32 projet could be good leverage towards programmable cartridges, maybe.

We thought we would let people know here so no effort is wasted on another rp2040 cartridge (especially since everything will be made open source, and open to contributions)

Picture of the cartridge on our twitter account:

Do you know when or where it will be uploaded once its been finished?
 
  • Like
Reactions: kjhota123

XLuma

Pkmn Rom Hacker
Member
Joined
Feb 12, 2017
Messages
490
Trophies
0
Age
23
Location
Quebec
XP
659
Country
Canada
Ah, sweet. Nobody's made a DSi mode capable cart in such a long time.
As for the second part, assuming they don't make any changes to the cart and just sell it as is, I don't really have an issue with clones. It makes it more accessible to the less technically inclined.
We intend to make it as accessible to the people who arent that technical so its not a burden for them, as well as tutorials obviously. The only "DIY" part will be receiving the cartridge, setupping it, and clipping the case together (which tbf, most of that you have to do yourself with any flashcart)

Do you know when or where it will be uploaded once its been finished?
Github. An announcement will be made on our twitter, and most likely the DSi hacking server
 

Deleted member 698398

Well-Known Member
Newcomer
Joined
Mar 26, 2024
Messages
99
Trophies
0
XP
131
We intend to make it as accessible to the people who arent that technical so its not a burden for them, as well as tutorials obviously. The only "DIY" part will be receiving the cartridge, setupping it, and clipping the case together (which tbf, most of that you have to do yourself with any flashcart)
Lol. I'm just saying, love the project, but I've seen so many people struggle to drag the firmware for their card onto an SD. Having to order the card off of PCBWay (and the shell then snapping them together) will filter so many people right out of the gate. Not saying you shouldn't do it this way. It's a good idea. But you need to understand that even this is going to be too hard for a lot of people.
 
  • Like
Reactions: kjhota123

DSoryu

GBA/NDS Maniac
Member
Joined
May 5, 2010
Messages
2,383
Trophies
2
Location
In my house
XP
4,863
Country
Mexico
Lol. I'm just saying, love the project, but I've seen so many people struggle to drag the firmware for their card onto an SD. Having to order the card off of PCBWay (and the shell then snapping them together) will filter so many people right out of the gate. Not saying you shouldn't do it this way. It's a good idea. But you need to understand that even this is going to be too hard for a lot of people.

Hi, I'm also part of the team.

It will be as easy as ordering any R4 card clone from Aliexpress, we even expect third party sellers to offer ready-to-use DSpico cards in online stores (not ideal but we know it's going to happen, the best option will always be to build your own cards). The important part is that users can customize their card build as much as they want, ranging from PCB colors, to different brand components or peripherals.

TL;DR: Ordering a unit is as simple as buying anything on any online store.
 
  • Like
Reactions: ber71 and kjhota123

Deleted member 698398

Well-Known Member
Newcomer
Joined
Mar 26, 2024
Messages
99
Trophies
0
XP
131
Hi, I'm also part of the team.

It will be as easy as ordering any R4 card clone from Aliexpress, we even expect third party sellers to offer ready-to-use DSpico cards in online stores (not ideal but we know it's going to happen, the best option will always be to build your own cards). The important part is that users can customize their card build as much as they want, ranging from PCB colors, to different brand components or peripherals.

TL;DR: Ordering a unit is as simple as buying anything on any online store.
Let's just agree to disagree. Because I'm not going to argue about this. And the thing you were saying about third party sellers offering ready-to-use cards was entirely my point in the first place. So congrats we agree. PCBWay (etc) and ordering multiple separate parts is still going to be way above some people's head.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Congrats?