This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

AES example in SDK version 17.0.0 does not compile out of the box

Hello.

Trying to compile the AES CBC MAC example out of the box, we get the ferror below.

Your help would be appreciated.

Many thanks,

Andrew

Building ‘nrf_crypto_aes_cbc_mac_pca10040’ from solution ‘nrf_crypto_aes_cbc_mac_pca10040’ in configuration ‘Release’

....

Linking nrf_crypto_aes_cbc_mac_pca10040.elf
    cannot find ../../../../../../../../external/micro-ecc/nrf52hf_armgcc/armgcc/micro_ecc_lib_nrf52.a: No such file or directory
Build failed

Parents
  • Thanks.

    I am afraid make will conflict with another compiler we have and we don't have the gss arm compiler installed. Is it feasible just to obtain the missing library file  to drop into the relevant  folder ?

  • Hi Hakon.

    OK, so in desperation I avae take your advice:

    1, I loaded  the 2019 gcc ARM distribution to my Win7 development platform

    2. Also the the corresponding gcc make

    3. I made sure the binaries for both of the above are in the current path, with make having precedence over the path to any other installed make (designed to stop a clash with Embarcadero C++ Builder make)

    3. I went into the micor_ecc folder and edited build_al.bal to just make  rf52nf_armgcc

    4. I executed build_all.bat from the command line

    5. Make seems to start, but then gives the error below which I have been unable  resolve (full error report at the end of this missive  but the key report is :

    Process_begin: CreateProcess(NULL, mkdir _build, ...) failed.
    make (e=2): The system cannot find the file specified.

    Note that when I ran build_all the first time, git seemed to do its expected downloads.

    Any help would be gratefully received.

    Many thanks,

    Andrew

    C:\Projects\Bluetooth Communicator\Tools\Nordic\SDK\nRF5_SDK_17.0.0_9d13099\external\micro-ecc>build_all
    make: Entering directory `C:/Projects/Bluetooth Communicator/Tools/Nordic/SDK/nRF5_SDK_17.0.0_9d13099/external/micro-ecc/nrf52nf_armgcc/armgcc'
    mkdir _build
    process_begin: CreateProcess(NULL, mkdir _build, ...) failed.
    make (e=2): The system cannot find the file specified.
    make: *** [_build] Error 2
    make: Leaving directory `C:/Projects/Bluetooth Communicator/Tools/Nordic/SDK/nRF5_SDK_17.0.0_9d13099/external/micro-ecc/nrf52nf_armgcc/armgcc'
    C:\Projects\Bluetooth Communicator\Tools\Nordic\SDK\nRF5_SDK_17.0.0_9d13099\external\micro-ecc>

  • Hi,

     

    As long as micro-ecc is present, this example, nRF5_SDK_17.0.0_9d13099\examples\crypto\nrf_crypto\aes\aes_cbc_mac\pca10040\blank\ses, shall compile without any issues. I did a clean install of SDK v17, cloned and built micro-ecc, and I cannot reproduce the error you are seeing. Have you added/changed something in the example?

     

    Kind regards,

    Håkon

  • Hello Hakon,

    it is a real mystery.

    Per my last post, with a clean reinstall for 17.0.0 I didn't touch/change anything. I have made no changes to the Segger compiler either.

    Oddly, the micro-ecc thing seems to be sorted and there are no errors regarding that - OK, so let us assume  I had accidentally modified something.

    However now, without making any code mods whatsover,  both the uart and aes mac examples (Segger) give the same link-time error related to RTT as follows:

    Output/ble_app_uart_pca10040_s132 Release/Obj/nrf_log_default_backends.o:C:\Projects\Bluetooth Communicator\Tools\Nordic\SDK\nRF5_SDK_17.0.0_9d13099\components\libraries\log\src/nrf_log_default_backends.c:50: undefined reference to `nrf_log_backend_rtt_api'

    When I go to line 50 in nrf_log_default_backends.c I find NRF_LOG_BACKEND_RTT_DEF(rtt_log_backend);

    When I right click to go to the definition of NRF_LOG_BACKEND_RTT_DEF or  rtt_log_backend, Segger takes me to the first line of the nrf_log_backend_rtt.h so I am guessing that is wehat happens when it cannot find what it is looking for.

    A solution search for NRF_LOG_BACKEND_RTT_DEF returns just the one reference on line 50. There doesn't seem to be a macro definition in the solution.

    So whatever the linker wants. I just don't seem to be able to supply it.

    Many thanks,

    Andrew

  • Thanks Hakon.

    The problem with mico-ecc went a way after a clean install. I'll just have to assume I had introduced the error during setup. Mea culpa.

    The remaining problem with the uart  aes_mac examples has also been tracked down to a missing declaration in nrf_log_backend_rtt.c in the 17.0.0 distribution as follows:

            const nrf_log_backend_api_t nrf_log_backend_rtt_api;

    Only the .h file reference to the strcuture was found in the distribution:

           extern const nrf_log_backend_api_t nrf_log_backend_rtt_api.

    Naturally the linker was complaining, and assoon as  we added the declaration to the the .c file, we got a clean compile.

    Regards,

    Andrew

  • Hello.

    The micro-ecc problem has resurfaced at linker level now.

    What I didn't realise when I got the clean compile above was that mcro-ecc was disabled. When I enable it and disable all the other backends, it runs trhough to the linking stage but I get the error below which from what I can see means there is a  floating point clash between the snRF2K target (supporting VFP register usage) and the library .a file you provided (the one I have been unable to compile) which does not.

    Can you please advise how to resolve this ?

    Regards,

    Andrew

    ++++++++++++++++++++++++

    Here is the error:

    Building ‘nrf_crypto_aes_cbc_mac_pca10040’ from solution ‘nrf_crypto_aes_cbc_mac_pca10040’ in configuration ‘Release’
      Linking nrf_crypto_aes_cbc_mac_pca10040.elf
        Output/Release/Exe/nrf_crypto_aes_cbc_mac_pca10040.elf uses VFP register arguments, ../../../../../../../../external/micro-ecc/nrf52nf_armgcc/armgcc/micro_ecc_lib_nrf52.a(uECC.c.o) does not
        failed to merge target specific data of file ../../../../../../../../external/micro-ecc/nrf52nf_armgcc/armgcc/micro_ecc_lib_nrf52.a(uECC.c.o)
    Build failed

  • Did you ever get this issue resolved?

    FWIW, I think it is due to inconsistent use of the floating point ABI between the library build and your project build.

Reply Children
No Data
Related