Skip to content

NRF5x: Fix baremetal linker error #12151

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
merged 1 commit into from
Jan 8, 2020

Conversation

hugueskamba
Copy link
Collaborator

Summary of changes

DEBUG_NRF_USER gets defined for build profiles (develop, debug)
which do not define NDEBUG (see nrf_assert.h). Therefore the definition
of the function should be visible if DEBUG_NRF_USER is defined.

Impact of changes

It is now possible to build NRF5x targets with the baremetal profile using the debug and develop build profiles.
i.e It is now possible to build mbed-os-example-blinky-baremetal with $ mbed compile -t <TOOLCHAIN> -m NRF51_DONGLE

Migration actions required

Documentation


Pull request type

[X] 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)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@pan-


@ciarmcom
Copy link
Member

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

@ciarmcom ciarmcom requested review from pan- and a team December 20, 2019 14:00
@bulislaw
Copy link
Member

@pan- @desmond-blue @linlingao can one of you please have a look

@@ -40,7 +40,7 @@
#include "app_error.h"
#include "nordic_common.h"

#if defined(DEBUG_NRF)
#if defined(DEBUG_NRF_USER)
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it should be #if defined(DEBUG_NRF) || defined(DEBUG_NRF_USER)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this way it is used in nordic files as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, done.

@hugueskamba hugueskamba force-pushed the hk-nrf-fix-baremetal-build branch from 51fe2c2 to dfe0a58 Compare January 3, 2020 07:28
@mbed-ci
Copy link

mbed-ci commented Jan 3, 2020

Test run: FAILED

Summary: 3 of 4 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-IAR

@hugueskamba
Copy link
Collaborator Author

Test run: FAILED

Summary: 3 of 4 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-IAR

@0xc0170 I do not think the failure is related to the change on the PR.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 3, 2020

They don't look related but only some nrf targets failed, suspicious. I restarted the tests

@mbed-ci
Copy link

mbed-ci commented Jan 3, 2020

Test run: FAILED

Summary: 3 of 4 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-IAR

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 3, 2020

I could find one possibly related issue in the build:

[DEBUG] Errors: Error[Li006]: duplicate definitions for "assert_nrf_callback"; in "/builds/ws/m
[DEBUG] Errors:           bed-os-ci_build-IAR@2/examples/mbed-os-example-blinky/BUILD/TY51822R3
[DEBUG] Errors:           /IAR/mbed-os/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC
[DEBUG] Errors:           _SOFTDEVICE/TARGET_NRF51/source/btle/btle.o"
[DEBUG] Errors:           , and "/builds/ws/mbed-os-ci_build-IAR@2/examples/mbed-os-example-bli
[DEBUG] Errors:           nky/BUILD/TY51822R3/IAR/mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TA
[DEBUG] Errors:           RGET_SDK_11/libraries/util/nrf_assert.o"

DEBUG_NRF_USER gets defined for build profiles (develop, debug)
which do not define NDEBUG (see nrf_assert.h). Therefore the definition
of the function should also be visible if DEBUG_NRF_USER is defined.
@hugueskamba hugueskamba force-pushed the hk-nrf-fix-baremetal-build branch from dfe0a58 to 6afca24 Compare January 3, 2020 15:14
@hugueskamba
Copy link
Collaborator Author

I could find one possibly related issue in the build:

[DEBUG] Errors: Error[Li006]: duplicate definitions for "assert_nrf_callback"; in "/builds/ws/m
[DEBUG] Errors:           bed-os-ci_build-IAR@2/examples/mbed-os-example-blinky/BUILD/TY51822R3
[DEBUG] Errors:           /IAR/mbed-os/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC
[DEBUG] Errors:           _SOFTDEVICE/TARGET_NRF51/source/btle/btle.o"
[DEBUG] Errors:           , and "/builds/ws/mbed-os-ci_build-IAR@2/examples/mbed-os-example-bli
[DEBUG] Errors:           nky/BUILD/TY51822R3/IAR/mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TA
[DEBUG] Errors:           RGET_SDK_11/libraries/util/nrf_assert.o"

This should fix it.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 3, 2020

CI restarted

@mbed-ci
Copy link

mbed-ci commented Jan 3, 2020

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 3
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_cloud-client-pytest

@hugueskamba
Copy link
Collaborator Author

hugueskamba commented Jan 6, 2020

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 3
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_cloud-client-pytest

Hi @0xc0170, @adbridge ,

I got a confirmation that the issue is due to instability in the CI. There is no work to be done,. The CI needs to be re-run.
Thanks

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 8, 2020

Cloud client restarted

@0xc0170 0xc0170 added needs: CI release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0 and removed needs: work needs: CI labels Jan 8, 2020
@0xc0170 0xc0170 merged commit c42125f into ARMmbed:master Jan 8, 2020
@hugueskamba hugueskamba deleted the hk-nrf-fix-baremetal-build branch June 30, 2020 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants