pub fn chip_for(
device_id: u16,
flash_bytes: Option<u32>,
) -> Result<&'static str, String>Expand description
Returns the probe-rs target name for a device, from its ID and the flash
size its image was linked for (__flash0_end__ - __flash0_base__).
The device ID does not give the flash size, and probe-rs’s flash layout and
chip erase depend on it (a KC target on a 128 KB KB would address flash
that is not there), so the caller supplies the size – from the tag’s
TagInfo.intflashsz or the image’s linker symbols – to choose the
variant:
| Device | flash_bytes | Target |
|---|---|---|
DEV_L432 | None or 256 KB | STM32L432KC |
DEV_L432 | 128 KB | STM32L432KB |
DEV_U375 | None or 1 MB | STM32U375RG |
DEV_U375 | 512 KB | STM32U375RE |
None (an image without the symbols, or no image at all) takes the larger
part.
§Errors
A message naming the device ID, and the size if one was given, for any other combination; nothing is guessed.