This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil ingnores function when compiling

Hi!

I am implementing new features in an old project. It uses the LL driver, but I programmed this new feature in the newest HAL driver using STMCUBEIDE, my code worked there...

My code compiles without erros but when I debug the code Keil does not allow me to place breakpoints inside the function.

I appreciate the help!

Parents
  • The compiler removes some of your functions because they are not used (at least what I can see from your code snippets). All C-source lines which generate executable code are marked with a dark grey block on the very left side in the editor window. The functions HAL_UARTEx_RxEventCallback() and SN75176A_Callback() are not used and have only a light-grey block on the very left. You can also check the map file of your application. You will find a section "Removing Unused input sections from the image" in it that will list all these functions. Because of this, the debugger cannot set breakpoints in this area.

    So in other words, there seems to be no reference to function HAL_UARTEx_RxEventCallback(). Since the only reference to function SN75176A_Callback() is in HAL_UARTEx_RxEventCallback(), the function SN75176A_Callback() also gets removed.

Reply
  • The compiler removes some of your functions because they are not used (at least what I can see from your code snippets). All C-source lines which generate executable code are marked with a dark grey block on the very left side in the editor window. The functions HAL_UARTEx_RxEventCallback() and SN75176A_Callback() are not used and have only a light-grey block on the very left. You can also check the map file of your application. You will find a section "Removing Unused input sections from the image" in it that will list all these functions. Because of this, the debugger cannot set breakpoints in this area.

    So in other words, there seems to be no reference to function HAL_UARTEx_RxEventCallback(). Since the only reference to function SN75176A_Callback() is in HAL_UARTEx_RxEventCallback(), the function SN75176A_Callback() also gets removed.

Children