Issue with STM32 BSP 4.2

Sysprogs forums Forums VisualGDB Issue with STM32 BSP 4.2

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11199
    parsec67
    Participant

    Hi,

    After updating to BSP 4.2 my project does not compile anymore. The following errors are thrown (project name and initial parts of the path omitted for clarity):

    Error  undefined reference to `APBPrescTable'   [...]  [...]AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c  939    
    
    Error undefined reference to `APBPrescTable'    [...]   [...]\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c 951

    I rolled back to 4.1 and no problems compiling with that BSP version.

    #11200
    support
    Keymaster

    Hi,

    The STM32 software packages often break backward compatibility in minor ways (e.g. by introducing new configuration variables that the project needs to define). Usually this type of problem can be very easily fixed by creating a new project with the new BSP and checking where the missing entity is defined. Once you locate the definition, simply copy if to the old project and it should build again.

    #11203
    parsec67
    Participant

    That did the trick, thanks!

    For reference, APBPrescTable is in BSP4.2 defined in system_stm32f4xx.c whereas in BSP4.1 it is missing. Instead, in BSP4.1 the affected functions HAL_RCC_GetPCLK1Freq(), HAL_RCC_GetPCLK2Freq() and setting of global SystemCoreClock (all in stm32f4xx_hal_rcc.c) reference APBAHBPrescTable which is defined at the beginning of this file. So adding the below line to system_stm32f4xx.c fixed my problem:

    const uint8_t APBPrescTable[8] = { 0, 0, 0, 0, 1, 2, 3, 4 };

    I just read in the ST forums that someone using a different dev environment had been caught by this too.

    • This reply was modified 6 years, 11 months ago by parsec67.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.