Skip to main content
dsjnews
Associate II
Dec 19, 2017 7:59 PM UTC
Solved

Determine CPU Type at Run-time

Posted on December 19, 2017 at 20:59

Hi,

I am developing an application that will be targetted at a number of STM32F/STM32L hardware platforms and wondered if it was possible to determine the CPU type at run-time. CPUID is useful to determine ARM core details etc. and thought there would be an equivalent register for the STM stuff.

Regards

FarmerJo

#determine-cpu-type #stm32
    This topic has been closed for replies.
    dsjnews
    dsjnewsBest answer
    Associate II
    Dec 20, 2017 12:12 AM UTC
    Posted on December 20, 2017 at 00:12

    Thank you Andrew for that. I even searched the TRM for 'device ID' and must have missed it somehow.

    Anyway this is just what I am looking for.

    Regards

    FarmerJo

    3 replies

    Tesla DeLorean
    Guru
    Dec 19, 2017 8:04 PM UTC
    Posted on December 19, 2017 at 21:04

    Like DEV_ID in DBGMCU_IDCODE?

    Use that to auto-speed F4 parts, ie optimum PLL setting and AHB/APB dividers.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Andrew Neil
    Super User
    Dec 19, 2017 9:51 PM UTC
    Posted on December 19, 2017 at 21:51

    Clive One wrote:

    Like DEV_ID in DBGMCU_IDCODE?

    Should be good - but doesn't always work:

    https://community.st.com/0D50X00009XkbSHSAZ

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    dsjnews
    dsjnewsAuthorBest answer
    Associate II
    Dec 20, 2017 12:12 AM UTC
    Posted on December 20, 2017 at 00:12

    Thank you Andrew for that. I even searched the TRM for 'device ID' and must have missed it somehow.

    Anyway this is just what I am looking for.

    Regards

    FarmerJo