japaric-archived / photon-hal

Low level Rust bindings to particle's HAL (Hardware Abstraction Layer)
Apache License 2.0
9 stars 8 forks source link

WIP: Add socket #20

Open rnestler opened 7 years ago

rnestler commented 7 years ago

This does not yet work, but is intended to fix #17.

As soon as I actually try to use the socket_send function from an executable (see https://github.com/rnestler/photon-quickstart/blob/socket_example/examples/socket.rs#L45) I get a linker error:

error: linking with `arm-none-eabi-g++` failed: exit code: 1
  |
  = note: "arm-none-eabi-g++" "-g3" "-gdwarf-2" "-Os" "-mcpu=cortex-m3" "-mthumb" "-ffunction-sections" "-fdata-sections" "-fno-builtin-malloc" "-fno-builtin-free" "-fno-builtin-realloc" "build/target/user-part/platform-6-m/src/user_module.o" "build/target/user-part/platform-6-m/src/module_info.o" "build/target/user-part/platform-6-m/src/user_export.o" "build/target/user-part/platform-6-m/src/newlib_stubs.o" "-Wl,--whole-archive" "hal/src/photon/lib/STM32F2xx_Peripheral_Libraries.a" "-Wl,--no-whole-archive" "-nostartfiles" "-Xlinker" "--gc-sections" "-L" "/home/roughl/.xargo/lib/rustlib/thumbv7m-none-eabi/lib" "/home/roughl/projects/rustfest_zurich_2017/impl_days/embedded/my-app/target/thumbv7m-none-eabi/debug/examples/socket-10cbf31a55c3ae7f.0.o" "-o" "/home/roughl/projects/rustfest_zurich_2017/impl_days/embedded/my-app/target/thumbv7m-none-eabi/debug/examples/socket-10cbf31a55c3ae7f" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "/home/roughl/projects/rustfest_zurich_2017/impl_days/embedded/my-app/target/thumbv7m-none-eabi/debug/deps" "-L" "/home/roughl/projects/rustfest_zurich_2017/impl_days/embedded/my-app/target/debug/deps" "-L" "/home/roughl/projects/rustfest_zurich_2017/impl_days/embedded/my-app/target/thumbv7m-none-eabi/debug/build/photon-42b90ede45cf9044/out" "-L" "/home/roughl/projects/rustfest_zurich_2017/impl_days/embedded/my-app/target/thumbv7m-none-eabi/debug/build/photon-42b90ede45cf9044/out/photon/system-part1" "-L" "/home/roughl/.xargo/lib/rustlib/thumbv7m-none-eabi/lib" "-Wl,--whole-archive" "-lhal-dynalib" "-lservices-dynalib" "-lsystem-dynalib" "-lrt-dynalib" "-lwiring" "-lcommunication-dynalib" "-lplatform" "-lwiring_globals" "-Wl,--no-whole-archive" "-lc" "-lnosys" "-Tlinker.ld" "--specs=nano.specs" "-Wl,--defsym,USER_FIRMWARE_IMAGE_SIZE=0x20000" "-Wl,--defsym,USER_FIRMWARE_IMAGE_LOCATION=0x80A0000"
  = note: /usr/lib/gcc/arm-none-eabi/7.2.0/../../../../arm-none-eabi/bin/ld: Dynalib location not correct
          /usr/lib/gcc/arm-none-eabi/7.2.0/../../../../arm-none-eabi/bin/ld: Dynalib location not same as exported location
          collect2: error: ld returned 1 exit status
rnestler commented 7 years ago

I tried rebuilding the the photon library in https://github.com/rnestler/photon/tree/build_all but it didn't really help.