Hello.
Were you able to create your library?
I'm trying to create a library with the SDK (for LFS Little Find System), a library that I want to use outside of the SDK because I'm programming in ARM assembly outside of the SDK.
Compilation and creation went well, but when linking with my non-SDK program, I got a bunch of errors because the linker couldn't find the routines in the standard library.
Example of the beginning of the rejections:
E:\Pico2\assembleurARM\projet14>make
E:\Pico2\tools\arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi\arm-none-eabi\bin\ld -T memmap.ld testpgm14.o routinesPicoARM.o routinespicoUSBARM.o liblittlefs-lib.a -o testpgm14.elf -M >testpgm14_map.txt
E:\Pico2\tools\arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi\arm-none-eabi\bin\ld: liblittlefs-lib.a(lfs.c.obj): in function `lfs_cache_zero':
E:\Pico2\assembleurARM\projet14A\littlefs-lib/lfs.c:25:(.text.lfs_init+0x26): undefined reference to `memset'
E:\Pico2\tools\arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi\arm-none-eabi\bin\ld: E:\Pico2\assembleurARM\projet14A\littlefs-lib/lfs.c:25:(.text.lfs_init+0x34): undefined reference to `memset'
Here is my CMakeList.txt to create the Library lfs :
cmake_minimum_required(VERSION 3.13)
set ( PICO_SDK_PATH "E:\\pico211\\pico-sdk")
set(PICO_BOARD pico2)
set(PICO_PLATFORM rp2350)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
project(example C CXX ASM)
pico_sdk_init()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPICO_USE_MALLOC_MUTEX=1")
add_subdirectory( littlefs-lib)
target_link_libraries(littlefs-lib pico_stdlib)
#target_link_libraries( example pico_stdlib littlefs-lib)
#include_directories(pico_stdlib )
#include_directories( <header-file-directories>)
#add_subdirectory(stdinit-lib)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
Does anyone have a solution to create this library?
Thanck.
Were you able to create your library?
I'm trying to create a library with the SDK (for LFS Little Find System), a library that I want to use outside of the SDK because I'm programming in ARM assembly outside of the SDK.
Compilation and creation went well, but when linking with my non-SDK program, I got a bunch of errors because the linker couldn't find the routines in the standard library.
Example of the beginning of the rejections:
E:\Pico2\assembleurARM\projet14>make
E:\Pico2\tools\arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi\arm-none-eabi\bin\ld -T memmap.ld testpgm14.o routinesPicoARM.o routinespicoUSBARM.o liblittlefs-lib.a -o testpgm14.elf -M >testpgm14_map.txt
E:\Pico2\tools\arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi\arm-none-eabi\bin\ld: liblittlefs-lib.a(lfs.c.obj): in function `lfs_cache_zero':
E:\Pico2\assembleurARM\projet14A\littlefs-lib/lfs.c:25:(.text.lfs_init+0x26): undefined reference to `memset'
E:\Pico2\tools\arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi\arm-none-eabi\bin\ld: E:\Pico2\assembleurARM\projet14A\littlefs-lib/lfs.c:25:(.text.lfs_init+0x34): undefined reference to `memset'
Here is my CMakeList.txt to create the Library lfs :
cmake_minimum_required(VERSION 3.13)
set ( PICO_SDK_PATH "E:\\pico211\\pico-sdk")
set(PICO_BOARD pico2)
set(PICO_PLATFORM rp2350)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
project(example C CXX ASM)
pico_sdk_init()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPICO_USE_MALLOC_MUTEX=1")
add_subdirectory( littlefs-lib)
target_link_libraries(littlefs-lib pico_stdlib)
#target_link_libraries( example pico_stdlib littlefs-lib)
#include_directories(pico_stdlib )
#include_directories( <header-file-directories>)
#add_subdirectory(stdinit-lib)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
Does anyone have a solution to create this library?
Thanck.
Statistics: Posted by VincentARM — Sun Jun 29, 2025 1:30 pm