Skip to main content
tm3341
Associate III
October 30, 2014
Question

Read stm32f4 device

  • October 30, 2014
  • 2 replies
  • 521 views
Posted on October 30, 2014 at 13:31

Hi.

How can I read device ID with software?

Is there any register that stores this value?

I would like to detect device on which program is running.

Or at least size of flash.

I'm using stm32f4 devices.
    This topic has been closed for replies.

    2 replies

    chen
    Associate II
    October 30, 2014
    Posted on October 30, 2014 at 14:00

    Hi

    ''How can I read device ID with software?

    Is there any register that stores this value?''

    There are not any ST peripheral registers that say which device it is.

    However, I have found in the reference manual - in the debug support, there is

    register : ''DBGMCU_IDCODE

    Address: 0xE004 2000''

    (for a STM32F405 at least).

    Tesla DeLorean
    Guru
    October 30, 2014
    Posted on October 30, 2014 at 14:07

    unsigned short flashkb = *((unsigned short *)0x1FFF7A22);

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..