Coder Social home page Coder Social logo

Compile target STM32L442 about solo1 HOT 8 CLOSED

solokeys avatar solokeys commented on May 28, 2024
Compile target STM32L442

from solo1.

Comments (8)

conorpp avatar conorpp commented on May 28, 2024 1

From targets/stm32l442, run

make cbor   # build cbor library
make           # build application

TODO:

  • document this better

from solo1.

nvti avatar nvti commented on May 28, 2024

I re-compiler tinycbor with arm-none-eabi-gcc

cd tinycbor
make CC=arm-none-eabi-gcc LDFLAGS="-specs=nosys.specs"

and rebuild targets/stm32l442

cd ../targets/stm32l442
make clean
make all

I got error:

arm-none-eabi-gcc src/main.o src/init.o src/redirect.o src/flash.o src/rng.o src/led.o src/device.o src/fifo.o src/crypto.o src/attestation.o src/startup_stm32l432xx.o src/system_stm32l4xx.o lib/stm32l4xx_ll_rng.o lib/stm32l4xx_ll_tim.o lib/stm32l4xx_ll_gpio.o lib/stm32l4xx_hal_pcd.o lib/stm32l4xx_ll_usb.o lib/stm32l4xx_hal_pcd_ex.o lib/stm32l4xx_ll_pwr.o lib/stm32l4xx_ll_rcc.o lib/stm32l4xx_ll_usart.o lib/stm32l4xx_ll_utils.o lib/usbd/usbd_hid.o lib/usbd/usbd_conf.o lib/usbd/usbd_core.o lib/usbd/usbd_ctlreq.o lib/usbd/usbd_ioreq.o lib/usbd/usbd_desc.o ../../fido2/util.o ../../fido2/u2f.o ../../fido2/test_power.o ../../fido2/stubs.o ../../fido2/log.o ../../fido2/ctaphid.o ../../fido2/ctap.o ../../fido2/ctap_parse.o ../../fido2/main.o ../../crypto/sha256/sha256.o ../../crypto/micro-ecc/uECC.o ../../crypto/tiny-AES-c/aes.o -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -L../../tinycbor/lib -specs=nano.specs  -specs=nosys.specs  -Wl,--gc-sections -u _printf_float -lnosys -Tstm32l432xx.ld -Wl,-Map=solo.map,--cref -ltinycbor -o solo.elf
/home/t-u/Tools/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: error: required section '.rel.plt' not found in the linker script
/home/t-u/Tools/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: final link failed: Invalid operation
collect2: error: ld returned 1 exit status
Makefile:65: recipe for target 'solo.elf' failed
make: *** [solo.elf] Error 1

from solo1.

nickray avatar nickray commented on May 28, 2024

I think you have to make clean at the parent level, and then make inside the stm32 target. It could definitely be improved :)

from solo1.

nvti avatar nvti commented on May 28, 2024

I think you have to make clean at the parent level, and then make inside the stm32 target. It could definitely be improved :)

I have done this but I still got same error. I delete solo folder and re-clone project

git clone --recurse-submodules https://github.com/SoloKeysSec/solo
cd solo/
git submodule init
git submodule update

cd targets/stm32l442
make all

but I got error

/home/t-u/Tools/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: cannot find -ltinycbor
collect2: error: ld returned 1 exit status
Makefile:65: recipe for target 'solo.elf' failed
make: *** [solo.elf] Error 1

because tinycbor is not builded
I build tinycbor with arm-none-eabi-gcc as I said above

cd ,,/,,/tinycbor
make CC=arm-none-eabi-gcc LDFLAGS="-specs=nosys.specs"

and rebuild targets/stm32l442

cd ../targets/stm32l442
make clean
make all

but still error

arm-none-eabi-gcc src/main.o src/init.o src/redirect.o src/flash.o src/rng.o src/led.o src/device.o src/fifo.o src/crypto.o src/attestation.o src/startup_stm32l432xx.o src/system_stm32l4xx.o lib/stm32l4xx_ll_rng.o lib/stm32l4xx_ll_tim.o lib/stm32l4xx_ll_gpio.o lib/stm32l4xx_hal_pcd.o lib/stm32l4xx_ll_usb.o lib/stm32l4xx_hal_pcd_ex.o lib/stm32l4xx_ll_pwr.o lib/stm32l4xx_ll_rcc.o lib/stm32l4xx_ll_usart.o lib/stm32l4xx_ll_utils.o lib/usbd/usbd_hid.o lib/usbd/usbd_conf.o lib/usbd/usbd_core.o lib/usbd/usbd_ctlreq.o lib/usbd/usbd_ioreq.o lib/usbd/usbd_desc.o ../../fido2/util.o ../../fido2/u2f.o ../../fido2/test_power.o ../../fido2/stubs.o ../../fido2/log.o ../../fido2/ctaphid.o ../../fido2/ctap.o ../../fido2/ctap_parse.o ../../fido2/main.o ../../crypto/sha256/sha256.o ../../crypto/micro-ecc/uECC.o ../../crypto/tiny-AES-c/aes.o -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -L../../tinycbor/lib -specs=nano.specs  -specs=nosys.specs  -Wl,--gc-sections -u _printf_float -lnosys -Tstm32l432xx.ld -Wl,-Map=solo.map,--cref -ltinycbor -o solo.elf
/home/t-u/Tools/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: error: required section '.rel.plt' not found in the linker script
/home/t-u/Tools/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: final link failed: Invalid operation
collect2: error: ld returned 1 exit status
Makefile:65: recipe for target 'solo.elf' failed
make: *** [solo.elf] Error 1

from solo1.

nvti avatar nvti commented on May 28, 2024

@conorpp Thank for your reply.
T follow your command but I still got error: error: required section '.rel.plt' not found in the linker script
I search this error on google and see many people got it (most expected in embedded projects, cross-compile) but I don't see any answer.
Do I miss something?

from solo1.

nvti avatar nvti commented on May 28, 2024

oh, I got a little error:

../../crypto/sha256/sha256.c:17:20: fatal error: memory.h: No such file or directory
 #include <memory.h>
                    ^
compilation terminated.

but I fix it by commend #include <memory.h> line in crypto/sha256/sha256.c file.
Does it have any effect to above error?

from solo1.

nvti avatar nvti commented on May 28, 2024

About my tool chain:
I download tool chain and use this

$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496]
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Have any mistake there?

from solo1.

nvti avatar nvti commented on May 28, 2024

Finally, I change my compiler to version 7.3.1 (download) and no more error

from solo1.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.