2022-05-27 07:16 AM
I'm working on a project with a STM32F407 using the STM32Cube Ide.
I'm trying to add a new library (coded in ANSI C) that manages Zigbee frame encapsulation https://github.com/digidotcom/xbee_ansic_library.
My problem is that in some files of that library there are includes such as
#include <endian.h>
that are not present in the GNU tools for STM32. From what I see, this kind of system libraries are in the following path:
STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127\tools\arm-none-eabi\include
What I'm trying to do to fix this is to download the original GNU endian.h library and add it to this path, but I have 2 problems arising from that:
1) There are conflicting declarations between the GNU libraries and the IDE libraries, because, the GNU libraries are not exactly the same as the GNU tools for STM32. This throws hundreds of compile errors.
2) This way of fixing it will only work in my current working computer, if I wanted to compile this in another PC I would have to do this same work again.
Is there any update or any way I can add more STM32 compatible GNU tools (like endian.h or ioctl.h) into the IDE effectively?
Best Regards,
Bruno
Solved! Go to Solution.
2022-05-27 02:58 PM
Of course you can add any number of any libraries and include files to your projects, just like you've added that zigbee library.
Please look in the CubeIDE user guide how to add an include directory to a project. (spoiler: just as in any other Eclipse CDT).
> There are conflicting declarations between the GNU libraries and the IDE libraries
What is IDE libraries? Does this mean the "HAL" or CMSIS includes?
The GNU tools for STM32 do not bring any C includes, they are executables (make, busybox, and so on). The C includes in Cube IDE come from the C runtime (newlib) and from the ST "HAL" library + ARM CMSIS library.
2022-05-27 02:58 PM
Of course you can add any number of any libraries and include files to your projects, just like you've added that zigbee library.
Please look in the CubeIDE user guide how to add an include directory to a project. (spoiler: just as in any other Eclipse CDT).
> There are conflicting declarations between the GNU libraries and the IDE libraries
What is IDE libraries? Does this mean the "HAL" or CMSIS includes?
The GNU tools for STM32 do not bring any C includes, they are executables (make, busybox, and so on). The C includes in Cube IDE come from the C runtime (newlib) and from the ST "HAL" library + ARM CMSIS library.