Skip to content

CMake: Fix NRF52840_DK build failure with ARM toolchain #13446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

hugueskamba
Copy link
Collaborator

@hugueskamba hugueskamba commented Aug 17, 2020

Summary of changes

  • List missing CORDIO_LL source file in CMake source file.
  • Remove duplicated ARM toolchain directory
  • Link with archived cryptocell 310 libraries instead
    of adding them as source files
  • Provide default MBED_BOOT_STACK_SIZE definition
    in scatter file as is done for GCC_ARM linker file

Impact of changes

Migration actions required

Documentation

Pull request type

  • Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
  • Feature update (New feature / Functionality change / New API)
  • Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

  • No Tests required for this change (E.g docs only update)
  • Covered by existing mbed-os tests (Greentea or Unittest)
  • Tests / results supplied as part of this PR

Reviewers


@hugueskamba hugueskamba requested a review from 0xc0170 August 17, 2020 16:50
@ciarmcom ciarmcom requested a review from a team August 17, 2020 17:00
@ciarmcom
Copy link
Member

@hugueskamba, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should usptream changes to nrf52. I'll test these locally shortly

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 18, 2020

I am definitely sitting on this branch locally and still getting errors

mbed-os/CMakeFiles/mbed-os.dir/connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis_slave.o
C:\Keil_v5\ARM\ARMCLANG\bin\armclang.exe --target=arm-arm-none-eabi @mbed-os\CMakeFiles\mbed-os.dir\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr\lctr_main_cis_slave.o.rsp -MD -MT mbed-os\CMakeFiles\mbed-os.dir\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr\lctr_main_cis_slave.o -MF mbed-os\CMakeFiles\mbed-os.dir\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr\lctr_main_cis_slave.o.d -o mbed-os\CMakeFiles\mbed-os.dir\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr\lctr_main_cis_slave.o -c ..\mbed-os\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr\lctr_main_cis_slave.c
In file included from ..\mbed-os\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr\lctr_main_cis_slave.c:25:
..\mbed-os\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr/lctr_int_iso.h:28:10: fatal error: 'lctr_api_iso.h' file not found
#include "lctr_api_iso.h"

@hugueskamba
Copy link
Collaborator Author

I am definitely sitting on this branch locally and still getting errors

mbed-os/CMakeFiles/mbed-os.dir/connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis_slave.o
C:\Keil_v5\ARM\ARMCLANG\bin\armclang.exe --target=arm-arm-none-eabi @mbed-os\CMakeFiles\mbed-os.dir\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr\lctr_main_cis_slave.o.rsp -MD -MT mbed-os\CMakeFiles\mbed-os.dir\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr\lctr_main_cis_slave.o -MF mbed-os\CMakeFiles\mbed-os.dir\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr\lctr_main_cis_slave.o.d -o mbed-os\CMakeFiles\mbed-os.dir\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr\lctr_main_cis_slave.o -c ..\mbed-os\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr\lctr_main_cis_slave.c
In file included from ..\mbed-os\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr\lctr_main_cis_slave.c:25:
..\mbed-os\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO_LL\stack\controller\sources\ble\lctr/lctr_int_iso.h:28:10: fatal error: 'lctr_api_iso.h' file not found
#include "lctr_api_iso.h"

Why am I seeing Keil in your paths?

@hugueskamba hugueskamba force-pushed the hk_cmake_fix_build_failure branch from 58fe03c to 934a2df Compare August 18, 2020 11:44
@hugueskamba
Copy link
Collaborator Author

hugueskamba commented Aug 18, 2020

@0xc0170
With this branch, see below what I am getting at the end of the build:

Warning: L3912W: Option 'legacyalign' is deprecated.
Error: L6218E: Undefined symbol CC_AESCCM (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_crypto.o).
Error: L6218E: Undefined symbol CRYS_COMMON_ConvertLswMswWordsToMsbLsbBytes (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/ecdh_alt.o).
Error: L6218E: Undefined symbol CRYS_ECDH_SVDP_DH (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/ecdh_alt.o).
Error: L6218E: Undefined symbol CRYS_ECMONT_KeyPair (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/ecdh_alt.o).
Error: L6218E: Undefined symbol CRYS_ECMONT_Scalarmult (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/ecdh_alt.o).
Error: L6218E: Undefined symbol CRYS_ECPKI_BuildPrivKey (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/ecdh_alt.o).
Error: L6218E: Undefined symbol CRYS_ECPKI_ExportPublKey (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/ecdh_alt.o).
Error: L6218E: Undefined symbol CRYS_ECPKI_GenKeyPair (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/ecdh_alt.o).
Error: L6218E: Undefined symbol CRYS_ECPKI_GetEcDomain (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/ecdh_alt.o).
Error: L6218E: Undefined symbol _DX_ECPKI_BuildPublKey (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/ecdh_alt.o).
Error: L6218E: Undefined symbol CRYS_ECDSA_Sign (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/ecdsa_alt.o).
Error: L6218E: Undefined symbol CRYS_ECDSA_Verify (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/ecdsa_alt.o).
Error: L6218E: Undefined symbol CRYS_HASH_Finish (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/sha1_alt.o).
Error: L6218E: Undefined symbol CRYS_HASH_Free (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/sha1_alt.o).
Error: L6218E: Undefined symbol CRYS_HASH_Init (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/sha1_alt.o).
Error: L6218E: Undefined symbol CRYS_HASH_Update (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/sha1_alt.o).
Error: L6218E: Undefined symbol LLF_RND_GetTrngSource (referred from mbed-os/CMakeFiles/mbed-os.dir/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/source/trng.o).
Error: L6218E: Undefined symbol CRYS_RND_Instantiation (referred from ../mbed-os/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/TARGET_MCU_NRF52840/TOOLCHAIN_ARM/libcc_310_ext.ar(sns_silib.o)).
Error: L6218E: Undefined symbol CRYS_RND_UnInstantiation (referred from ../mbed-os/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/TARGET_MCU_NRF52840/TOOLCHAIN_ARM/libcc_310_ext.ar(sns_silib.o)).
Error: L6218E: Undefined symbol LLF_RND_RunTrngStartupTest (referred from ../mbed-os/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/TARGET_MCU_NRF52840/TOOLCHAIN_ARM/libcc_310_ext.ar(sns_silib.o)).
Error: L6218E: Undefined symbol ProcessBypass (referred from ../mbed-os/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/TARGET_MCU_NRF52840/TOOLCHAIN_ARM/libcc_310_trng.ar(ssi_rng_plat.o)).
Finished: 0 information, 1 warning and 21 error messages.
ninja: build stopped: subcommand failed.

@hugueskamba hugueskamba force-pushed the hk_cmake_fix_build_failure branch from 934a2df to bee2736 Compare August 18, 2020 12:03
@hugueskamba hugueskamba changed the title CMake: Fix NRF52840_DK build failure with ARM toolchain (WIP) CMake: Fix NRF52840_DK build failure with ARM toolchain Aug 18, 2020
@hugueskamba
Copy link
Collaborator Author

@0xc0170
This force-push fixes #13446 (comment).
The PR can be reviewed!

@hugueskamba hugueskamba requested a review from 0xc0170 August 18, 2020 12:08
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 18, 2020

armclang.exe --target=arm-arm-none-eabi @mbed-os\CMakeFiles\mbed-os.dir\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO\stack\ble-host\sources\hci\dual_chip\hci_cmd_bis.o.rsp -MD -MT mbed-os\CMakeFiles\mbed-os.dir\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO\stack\ble-host\sources\hci\dual_chip\hci_cmd_bis.o -MF mbed-os\CMakeFiles\mbed-os.dir\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO\stack\ble-host\sources\hci\dual_chip\hci_cmd_bis.o.d -o mbed-os\CMakeFiles\mbed-os.dir\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO\stack\ble-host\sources\hci\dual_chip\hci_cmd_bis.o -c ..\mbed-os\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO\stack\ble-host\sources\hci\dual_chip\hci_cmd_bis.c
..\mbed-os\connectivity\FEATURE_BLE\libraries\TARGET_CORDIO\stack\ble-host\sources\hci\dual_chip\hci_cmd_bis.c:24:10: fatal error: 'wsf_types.h' file not found
#include "wsf_types.h"

If fetched again and blinky does not build. I found only this header file in the error logs.

* Remove duplicated ARM toolchain directory
* Link with archived cryptocell 310 libraries instead
  of adding them as source files
* Provide default MBED_BOOT_STACK_SIZE definition
  in scatter file as is done for GCC_ARM linker file
List missing CORDIO_LL source file in CMake source file.
@hugueskamba hugueskamba force-pushed the hk_cmake_fix_build_failure branch from bee2736 to 170503b Compare August 18, 2020 13:25
@hugueskamba
Copy link
Collaborator Author

This force-push is to rename MBED_BOOT_STACK_SIZE to MBED_CONF_TARGET_BOOT_STACK_SIZE in preparation for the upcoming rebase from the master branch when the PR #13452 is merged.

@hugueskamba hugueskamba merged commit a57d101 into ARMmbed:feature-cmake Aug 18, 2020
@hugueskamba hugueskamba deleted the hk_cmake_fix_build_failure branch August 18, 2020 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants