Skip to main content
BCarl.1
Associate
February 1, 2020
Question

I have a error related to APBPrescTable. It is in the .h file but no table. Have I loaded the IDE incorrectly?

  • February 1, 2020
  • 12 replies
  • 4208 views

..

    This topic has been closed for replies.

    12 replies

    berendi
    Principal
    February 2, 2020

    And we are supposed to...

    1. Guess what the error message was?
    2. Guess which .h file?
    3. Guess which package?
    4. Guess which IDE?
    5. All of the above?
    6. Invest no more effort in solving your problem than you invested in describing your problem?
    BCarl.1
    BCarl.1Author
    Associate
    February 3, 2020

    0690X00000By1OcQAJ.png0690X00000By1OSQAZ.png0690X00000By1O8QAJ.png​Here is the information you have asked for.

    If you need anything else let me know.

    Piranha
    Principal III
    February 2, 2020

    It's not STM32 specific question, but a lack of understanding of basic C and compilers! The actual table definition is in a respective .c file and it must be added to a project.

    BCarl.1
    BCarl.1Author
    Associate
    February 3, 2020

    As I stated there is a declaration in the .h file. But there is no table in any .c file loaded when loading the IDE.

    This is code generated from loading the STM32CubeIDE version 1.2.1

    I am concerned that the versions. The ICON that was generated shows 1.2.0, when opening the splash screen shows 1.2.1, the about shows 1.0.0.201904021149. All I have done is down load the IDE and installed it.

    I have provided several screen shots that will explain in more detail see response to berendi

    Can you help?

    Tesla DeLorean
    Guru
    February 3, 2020

    The linker can't get closure because you're missing source files.

    The array in question is in system_stm32f4xx.c , isn't it?

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    BCarl.1
    BCarl.1Author
    Associate
    February 3, 2020

    No it is not.

    That is the issue I stated. It is in the .h (declared) but no table (the table is not in any .C file) of what the IDE loaded.

    All the information of which file the error is, the error it self, the project search of the table is in the reply to berendi.

    So is it a down load and install of the IDE problem? Or is it something else.

    Where can I get a correct .c file since it is ST code that has the error?

    Tesla DeLorean
    Guru
    February 3, 2020

    The include file lays the groundwork, it is not where the variable is defined. The error you posted is most definitely from the linker.

    Find where you put the Repository and fish it out (alternatively download and unpack CubeF4 package)

    STM32Cube_FW_F4_V1.24.2\Projects\STM32446E-Nucleo\Examples\GPIO\GPIO_IOToggle\Src\system_stm32f4xx.c

    ...
    /** @addtogroup STM32F4xx_System_Private_Variables
     * @{
     */
     /* This variable is updated in three ways:
     1) by calling CMSIS function SystemCoreClockUpdate()
     2) by calling HAL API function HAL_RCC_GetHCLKFreq()
     3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
     Note: If you use this function to configure the system clock; then there
     is no need to call the 2 first functions listed above, since SystemCoreClock
     variable is updated automatically.
     */
    uint32_t SystemCoreClock = 16000000;
    const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
    const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
    ...

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    BCarl.1
    BCarl.1Author
    Associate
    February 3, 2020

    Yes it is from the linker. Yes the variable declaration is normally in the include file (.h). And Yes I have the system_stm32f4xx.c loaded by the ST install.

    However, this "system_stm32f4xx.c" that was loaded by the standard install does not define the table as I stated. There is only the AHBPrescTable[16] table defined in "system_stm32f4xx.c" the APBPrescTable[8] is not defined in the file loaded by the ST auto install. The linker is looking for APBPrescTable[8]. Can you tell me why the standard install did not get the correct .c file. I can not remember that I did anything other than tell it to install the IDE.

    I have another version issue with the repository generated by ST standard install. The standard install has downloaded several zip files. The zip file I believe would be the latest is ...v1242.zip. Inside this zip the folder has the name ...v1240. So which version would that be?

    Do you think I should start completely over with the install or is this normal with ST installs and you need to dig out the right files once the install is done. I believe someone else has had this problem. You can see it on the WEB, but it looked like he was using some other device than me so I wanted better confirmation of what is going on.

    I believe I found the "system_stm32f4xx.c" file that has both the AHBP... and APBP... tables defined. It was in the v1242.zip which only has a v1240 folder bad versioning by ST. I am not sure about just replacing the file with the same name into the project since it is ST code and it should have loaded correctly. What do you suggest I do.

    Tesla DeLorean
    Guru
    February 4, 2020

    I'm not using CubeMX / CubeIDE, so really can't speak to their efficacy, or the best course forward. I'm using Keil

    Clearly it has picked a mismatched set of files.

    Some of the HAL subversions are patches to the primary fork, so v1.24.0 might contain the bulk of the code.

    v1.24.0 is about 700MB, the delta for v1.24.1 is about 122MB

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    BCarl.1
    BCarl.1Author
    Associate
    February 4, 2020

    Thank you for your help. I will continue trying to get the IDE to load properly to the correct version. I did find that AHBP table was not defined in version 1.24.2 of the .c file. The v1242 zip has the .c file with AHBP and APBP defined. I keep trying to get it to install this version but having a hard time getting it to select that .c file. I will keep trying.

    Hans T
    Associate III
    February 17, 2020

    I have added this to system_stm32f4xx.c

    /** @addtogroup STM32F4xx_System_Private_Variables

     * @{

     */

     /* This variable is updated in three ways:

       1) by calling CMSIS function SystemCoreClockUpdate()

       2) by calling HAL API function HAL_RCC_GetHCLKFreq()

       3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency 

         Note: If you use this function to configure the system clock; then there

            is no need to call the 2 first functions listed above, since SystemCoreClock

            variable is updated automatically.

     */

     uint32_t SystemCoreClock = 16000000;

    const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};

    //Iam

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

    wojtekdera
    Associate
    January 11, 2024

    creating new project helped. i also copied:

    uint32_t SystemCoreClock = 16000000;
    const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
    const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};

     

    to system_stm32f7xx.c (or system_stm32f4xx.c in your case)