In interested in learning why say, a device would be much more expensive if we use 1GiB of DRAM chips instead of 32MB. The chips themselves have the same physical footprint, power requirements, and as long as you pick one that is compatible with your µC or SoC you don't need to change that either. That leaves the cost of the chip, where you might need to spend a few cents more. I'm pretty sure the consumer doesn't care if the widget costs $21.55 or $21.59. The same would apply to NAND flash storage.
I do get that if you have to produce millions of widgets that a few cents here and there might add up, but if you just exchange one part for a physically similar but higher capacity part, and the list price difference is really small, why would that be such a hurdle? I'm not talking about redesigning all the power supplies, adding a PMIC or building an entire computer, but even in the WRT54G days you could just solder replacement DRAM and NOR chips and be done for a few cents for a 500% increase in capacity. In later models you could still do that but the NOR became NAND and BGAs are harder, but it's still pretty easy and cost-effective.
In the EE world, designing for manufacture does try to squeeze every fraction of a cent out of everything, while in the software world using 10MB of RAM instead of 1MB is fine as long as you decode your PNGs correctly (via an earlier libpng reference implementation comment a few days ago). Even at volume, I doubt that saving a tenth of a cent really matters until you hit some extreme production numbers. (even 10 million units would at best save you $10k)
Mechanically there would be something to consider, i.e. connectors vs screws vs solder vs glue etc, those all have a direct impact on how reliable a connection is, how long it will last, and how easy it is to manufacture (and how easy it is to take apart later). But fractions of a cent when compared to all the other aspects?
Well, there's two issues here. The first one is the obvious one: BoM cost.
> In interested in learning why say, a device would be much more expensive if we use 1GiB of DRAM chips instead of 32MB.
Those are different product categories. The IoT devices tend to range from ~400KB of RAM to around 1MB of RAM. Most have the RAM in package, not external, so putting more RAM is expensive because it is done during fabrication.
The most recent IoT product I delivered for a client was based on a esp32-C3 (RISC-V) module with under 300KB of usable RAM and 4MB of flash, of which exactly 1MB can be used for the program code.
It cost $5. The one which allows you to have slightly over double the program code (around 2MB in flash, out of 8MB) is $7.50, but it has the same RAM in-package.
At those differences, that extra $2.50 is literally more than the client would make off each device sold!
And, of course, it's a $5 component. Using 32MB/1GiB as a reference point is basically entering the lower end of rpi territory; basically a different product for a different use.
The second issue is product differentiation. Products are priced based on what the market will bear. The actual cost of production matters very little once a developed product hits the market.
Something with 1GiB of RAM is intended for a very different market than something with 32MB of RAM. A manufacturer who simply goes ahead and places the extra RAM in (and adjusts the sales price to ensure that it balances out) is:
a) Leaving money on the table for those use-cases where the customer is willing to pay twice as much,
b) Missing out on sales because that $5 increase in price moved it out of consideration in the market it was in.
What you'll mostly find if you go ahead and replace 32MB with 1GB (or 1GiB, which is close enough) on some product is that no one uses it for the higher-spec use-case[1] and you've lost some sales on the low end.
[1] Because RAM is not the only upgraded component in the higher-level use-case products. I'm not too familiar with products in the > 512KB ram class, so take the following with a pinch of salt (i.e. I might be wrong). Typically the 1GB RAM products are used for a specific use-case. Those use-cases can't be done on the ~200MHz cores that come with the 16MB/32MB SBCs. It's cheaper to simply switch to a rpi-class of computer that comes with all matching components.
A quick search shows that there really aren't many sub-1GB devices anymore, anyway, other than industrial components.
I do get that if you have to produce millions of widgets that a few cents here and there might add up, but if you just exchange one part for a physically similar but higher capacity part, and the list price difference is really small, why would that be such a hurdle? I'm not talking about redesigning all the power supplies, adding a PMIC or building an entire computer, but even in the WRT54G days you could just solder replacement DRAM and NOR chips and be done for a few cents for a 500% increase in capacity. In later models you could still do that but the NOR became NAND and BGAs are harder, but it's still pretty easy and cost-effective.
In the EE world, designing for manufacture does try to squeeze every fraction of a cent out of everything, while in the software world using 10MB of RAM instead of 1MB is fine as long as you decode your PNGs correctly (via an earlier libpng reference implementation comment a few days ago). Even at volume, I doubt that saving a tenth of a cent really matters until you hit some extreme production numbers. (even 10 million units would at best save you $10k)
Mechanically there would be something to consider, i.e. connectors vs screws vs solder vs glue etc, those all have a direct impact on how reliable a connection is, how long it will last, and how easy it is to manufacture (and how easy it is to take apart later). But fractions of a cent when compared to all the other aspects?