Code changes needed for drop in replacement of MCU's with more flash
Say, I have a STM32L431RB (128k,64k) on a board design.
This is the lowest flash size on the 6 chips on the STM32L4x1Rx 64pin variety.
It certainty looks like I can drop-in any of the larger flash/ram chips as the pin outs all look the same.
But do I need to actually rebuild the binary for each variant?
For example the STM32L431RC is exactly the same, but with more flash, while the 451 and 471 variants seem. Can it take the binary for for a STM32L431RB.
Has anyone tried this?
I ask this mostly to see if I can be a bit better protected against supply chain shortages in the future.
One tricky area for me might be in-field upgrades and tracking of which variants are going into which boards.

