STM32CubeIdeでStatic Libraryを作る方法
STM32 Projectを選択する
Boardを選ぶ
Static Libraryを選ぶ
DefaultのStatic Libraryのプロジェクトができる
デフォルトのファイル
/** ****************************************************************************** * @file lib.c * @author Auto-generated by STM32CubeIDE * @version V1.0 * @brief Default under dev library file. ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ /** Functions ----------------------------------------------------------------*/ void myFunction(void) { int i = 0; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; for(;;); }
プロジェクトのビルド
16:03:42 **** Build of configuration Debug for project testLib **** make -j4 all arm-none-eabi-gcc "../Src/syscalls.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DSTM32 -DSTM32F429ZITx -DSTM32F4 -DDEBUG -DNUCLEO_F429ZI -c -I../Inc -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/syscalls.d" -MT"Src/syscalls.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Src/syscalls.o" arm-none-eabi-gcc "../Src/sysmem.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DSTM32 -DSTM32F429ZITx -DSTM32F4 -DDEBUG -DNUCLEO_F429ZI -c -I../Inc -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/sysmem.d" -MT"Src/sysmem.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Src/sysmem.o" arm-none-eabi-gcc "../Src/testLib.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DSTM32 -DSTM32F429ZITx -DSTM32F4 -DDEBUG -DNUCLEO_F429ZI -c -I../Inc -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Src/testLib.d" -MT"Src/testLib.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Src/testLib.o" arm-none-eabi-ar -r "libtestLib.a" @"objects.list" arm-none-eabi-ar: creating libtestLib.a Finished building target: libtestLib.a 16:03:42 Build Finished. 0 errors, 0 warnings. (took 904ms)