2025-09-19 7:16 AM
Apologies if this is the wrong group for this query.
I have implemented a library from scratch which performs the host side of a DFU upgrade (avoids the dependencies in CubeProgrammer_API.dll, for which I could not find source). The code works just fine but I have a question about the expected values of bAlternateSetting across the whole range of STM32 devices.
For the STM32U575, there are three DFU Interface Descriptors with bAlternateSetting values of 0, 1 and 2. These correspond to 0=Internal Flash, 1=Option Bytes, 2=OTP Memory. [This is very clear from the memory descriptor string corresponding to the iInterface value of each interface.]
My question is: are these values consistent across the range of STM32s, or might some devices have (say) 1=Internal Flash or whatever?
Is there any available documentation for this? I've spent quite a bit of time trawling various UMxxxx and ANxxxx as part of creating this library, but have not found much about bAlternateSetting.
The behaviour of DFU_DNLOAD is a little different between Internal Flash and Option Bytes, so I wondered if I could switch on the value of bAlternateSetting to tailor what my code does. For example, the device immediately resets after writing the Option Bytes.
Thanks.