Skip to main content
waclawek.jan
Super User
September 3, 2017
Solved

[OTG + CMSIS-mandated device headers] duplicate definitions

  • September 3, 2017
  • 4 replies
  • 929 views
Posted on September 03, 2017 at 16:05

In stm32f407xx.h  V2.6.1  14-February-2017 as seen in CubeF4 1.15 and 1.16, the definition section under

/********************  Bit definition for OTG register  ********************/

repeats twice (around 2x42 lines).

Moreover, these definitions are duplicating the USB_OTG_GRXSTSP definitions and contrary to the latter they don't appear to be used anywhere else in Cube at all, so IMO both copies can be removed with no consequences whatsoever.

JW

PS. My ever-repeating request for adding non-single-bit bitfield values definitions into the CMSIS-mandated device headers still stands.

    This topic has been closed for replies.
    Best answer by Khouloud GARSI
    Posted on November 21, 2017 at 11:30

    Hello Jan,

    /******************** Bit definition for OTG register ********************/

    repeats twice (around 2x42 lines).

    -> The duplicated lines are removed from stm32f407xx.h in

    http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef4.html

    .

    Moreover, these definitions are duplicating the USB_OTG_GRXSTSP definitions

    and contrary to the latter they don't appear to be used anywhere else in Cube at all,

    so IMO both copies can be removed with no consequences whatsoever.

    -> Correct! These definitions are duplicating the USB_OTG_GRXSTSP and are not used anywhere is Cube. However, they were used in previous drivers. Our customers who had started working when only those defines were present will be impacted if we remove them. For this reason, those defines will be kept.

    Khouloud.

    4 replies

    Khouloud GARSI
    ST Employee
    September 6, 2017
    Posted on September 06, 2017 at 18:51

    Hi Jan,

    • The bit definition for OTG register is repeated twice: The repeated section will be removed from the file on next releases.

    Moreover, these definitions are duplicating the USB_OTG_GRXSTSP definitions and contrary to the latter they don't appear to be used anywhere else in Cube at all

         -> Those definitions are used on 'stm32f4xx_hal_pcd.c' and 'stm32f4xx_hal_hcd.c' files: They should be kept.

    My ever-repeating request for adding non-single-bit bitfield values definitions into the CMSIS-mandated device headers still stands.

        -> Could you please give a brief explanation about this. What do you propose to add exactly?

    Khouloud.

    waclawek.jan
    Super User
    September 6, 2017
    Posted on September 06, 2017 at 19:17

    The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6tC&d=%2Fa%2F0X0000000bxO%2FqG7Mn4TO_t9B9DE6dp89oC56FVtHBAfGuqSAr2RVVKE&asPdf=false
    Khouloud GARSI
    ST Employee
    September 7, 2017
    Posted on September 07, 2017 at 10:54

    Hi Jan,

    • You're right. I will check if there's a reason for which they are defined. 

    It's slightly off-topic here, I'll start a new thread soon.

    -> Many thanks. This would be very helpful.

    Khouloud.

    Khouloud GARSI
    Khouloud GARSIBest answer
    ST Employee
    November 21, 2017
    Posted on November 21, 2017 at 11:30

    Hello Jan,

    /******************** Bit definition for OTG register ********************/

    repeats twice (around 2x42 lines).

    -> The duplicated lines are removed from stm32f407xx.h in

    http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef4.html

    .

    Moreover, these definitions are duplicating the USB_OTG_GRXSTSP definitions

    and contrary to the latter they don't appear to be used anywhere else in Cube at all,

    so IMO both copies can be removed with no consequences whatsoever.

    -> Correct! These definitions are duplicating the USB_OTG_GRXSTSP and are not used anywhere is Cube. However, they were used in previous drivers. Our customers who had started working when only those defines were present will be impacted if we remove them. For this reason, those defines will be kept.

    Khouloud.