On 08.03.21 20:46, Tommy Murphy wrote: > Is this of relevance to your query? > > https://www.mail-archive.com/[email protected]/msg12475.html > <https://www.mail-archive.com/[email protected]/msg12475.html> Thanks, seems I missed that. Patch #2 looks quite similar to my quick hack ... > > Are GD actually reusing STM IDCODEs (including manufacturer ID) > verbatim? :-o
The STM32F1 driver only looks at the partno field in the CPUID register to distinguish the variants. If I read the ARM docs right, the "implementor" field is fixed at 0x41 == ARM, so there is no way to distinguish different manufacturers that way - that is not GigaDevice's fault. That is the base of the problem: to cleanly support both families, we need to first distinguish the manufacturer, and then use a manufacturer-specific lookup for flash size etc.. Is there a documented way to get a *manufacturer* ID in some common register that can be accessed without prior knowledge about the part? If not, I would prefer to shift this decision to the configuration file. Looking at the code, I had a further idea: instead of a "flash bank" parameter, I could duplicate struct flash_driver stm32f1x_flash and enter different config/detect functions while keeping most of the implementation pointing at the existing stm32x_ functions. cu Michael
_______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
