Skip to main content
Uwe Bonnes
Chief
February 20, 2017
Question

USB bootloader serial number

  • February 20, 2017
  • 2 replies
  • 1234 views
Posted on February 20, 2017 at 12:37

Hello,

can the information be made available how the on-chip USB bootloader generates the serial number?

This would be helpfull when an application provides a DFU endpoint to jump to the built-in USB bootloader.  As long as the application  does not know how to generate the same serial number as the bootloader, the DFU application needs to know both serial numbers and both numbers need to be provides by the user.

Thanks

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    February 23, 2017
    Posted on February 23, 2017 at 17:48

    Hello

    Bonnes.Uwe

    ‌,

    The serial number is generated from the UID (3 words) of the chip combined as following:

    • Sum of first and third words used

    • Second word not modified

    • Convert the first and second words into Char.

    It will be better to provide more details about your casein order

    to help you achieve your goal:

    What you want to do ? Do you want

    enumerate DFU from flash then jumps to Bootloader ?

    Regards

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    Uwe Bonnes
    Chief
    February 24, 2017
    Posted on February 24, 2017 at 16:02

     ,

     ,

    Hello,

    with appended code I can reproduce the Bootloader Serial for F3 and F4:

    extern char serial_no[13],

    ♯ if defined(UID_BASE)

     ,

    uint16_t *uid_base = (uint16_t *)UID_BASE,

     ,

    sprintf(serial_no, '%04X%04X%04X', uid_base[1] + uid_base[5], uid_base[0] + uid_base[4],

     ,

    ♯ if defined(MCU_STM32F3)

     ,

     , , , uid_base[5]), /* 5 fits for F3*/

     ,

    ♯ else

     ,

     , , , uid_base[3]), /* 3 fits for F4*/

     ,

    ♯ endif

     ,

    ♯ else

     ,

    serial_no[0] = 0,

     ,

    ♯ endif

    It seems F3 and F4 have slight differences!

    alyoshin
    Visitor II
    March 16, 2017
    Posted on March 16, 2017 at 08:38

    DFU serial number

    STM32F2, STM32F4: 8 hex digits of (UID0 + UID2) followed by 4 hex MSB digits of (UID1)

    UID 012: 002d0030 3334510b 32313533

    SerialNumber: 325E35633334

    STM32F3:                   8 hex digits of (UID0 + UID2) followed by 4 hex MSB digits of (UID2)

    UID 012: 003b0041 50335706 20333333

    SerialNumber: 206E33742033