Skip to content

Cleanup TARGET_NRF5 and TARGET_NRF5x #6711

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 2 commits into from
May 12, 2018
Merged

Cleanup TARGET_NRF5 and TARGET_NRF5x #6711

merged 2 commits into from
May 12, 2018

Conversation

marcuschangarm
Copy link
Contributor

@marcuschangarm marcuschangarm commented Apr 23, 2018

Description

The unified NRF51 target and feature BLE directories have been
reorganized to follow the naming and directory structure of the
NRF52 implementation.

This reorganization does not include TARGET_MCU_NRF51822 and
derived targets.

Unused NRF52 files have been removed.

Pull request type

[ ] Fix
[x] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

@marcuschangarm
Copy link
Contributor Author

@0xc0170
I didn't touch targets/TARGET_NORDIC/TARGET_MCU_NRF51822/ since the structure is incompatible with TARGET_MCU_NRF51822_UNIFIED.

@donatieng
I had to split out the NRF51 and NRF52 BLE implementation into separate directories since they use different storage implementations.

@bulislaw @mprse
I had to split out the clocks into separate directories in targets/TARGET_NORDIC/TARGET_NRF5x/ in order to make the NRF52 work. However, I expect we can merge them again when #5629 has been rebased?

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 26, 2018

I had to split out the clocks into separate directories in targets/TARGET_NORDIC/TARGET_NRF5x/ in order to make the NRF52 work. However, I expect we can merge them again when #5629 has been rebased?

Which commit is this one, or reference on your branch to review?
I reviewed changes, looks fine to me.

Please rebase to resolve conflicts.

@marcuschangarm
Copy link
Contributor Author

Which commit is this one, or reference on your branch to review?

bd8dd20

Both TARGET_NRF51 and TARGET_NRF52 contain ticker implementations. With #5629 we can combine the two into the same implementation.

@adbridge
Copy link
Contributor

@bulislaw , @donatieng We are still awaiting your reviews on this PR, could you please do so asap.

@pan-
Copy link
Member

pan- commented Apr 30, 2018

I had to split out the NRF51 and NRF52 BLE implementation into separate directories since they use different storage implementations.

Could you detail this point ? Is it related to the peer manager used ?

@marcuschangarm
Copy link
Contributor Author

@pan-

There is a big mismatch between whether the header files should have nrf_ prefixed or not, but the main issue is the new softdevice header:

https://github.com/marcuschangarm/mbed-os/blob/cleanup-nrf5x/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF51/source/btle/btle.cpp#L49-L50

https://github.com/marcuschangarm/mbed-os/blob/cleanup-nrf5x/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/btle/btle.cpp#L59-L60

I'm also not familiar enough with the NRF51 to make too many changes in one go.

@marcuschangarm
Copy link
Contributor Author

@donatieng @bulislaw

Can you have a look please?

@0xc0170
Copy link
Contributor

0xc0170 commented May 3, 2018

It looks fine to me (SDK11 to SDK_11 change follows the rest of the naming ?)

There are conflicts to be resolved

@marcuschangarm
Copy link
Contributor Author

/morph build

@mbed-ci
Copy link

mbed-ci commented May 3, 2018

Build : SUCCESS

Build number : 1917
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6711/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@marcuschangarm
Copy link
Contributor Author

It looks fine to me (SDK11 to SDK_11 change follows the rest of the naming ?)

Yes, that was from external input.

There are conflicts to be resolved

Done.

@mbed-ci
Copy link

mbed-ci commented May 4, 2018

@mbed-ci
Copy link

mbed-ci commented May 4, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented May 7, 2018

One test fails for all toolchains, related to the changes?

We have a conflict

@cmonr
Copy link
Contributor

cmonr commented May 7, 2018

This also needs a rebase.

Superseded by new SDK 14.2 in #6547
@marcuschangarm
Copy link
Contributor Author

/morph build

@marcuschangarm
Copy link
Contributor Author

One test fails for all toolchains, related to the changes?

I only moved the file to a different folder, I didn't change it.

@mbed-ci
Copy link

mbed-ci commented May 7, 2018

Build : SUCCESS

Build number : 1938
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6711/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented May 8, 2018

@mbed-ci
Copy link

mbed-ci commented May 8, 2018

@mprse
Copy link
Contributor

mprse commented May 8, 2018

I checked tests-mbed_hal-critical_section test and it uses special logic for NRF boards to check if interrupts are locked. For NRF51_DK the logic is based on TARGET_NRF5 symbol.
The problem is that on marcuschangarm:cleanup-nrf5x branch TARGET_NRF5 symbol does not exist.
I compared targets.json file on master and marcuschangarm:cleanup-nrf5x branch and it looks like TARGET_NRF5 has been replaced by TARGET_NRF5x and TARGET_NRF51 symbols.

So, it looks like the test needs to be updated. In the code below TARGET_NRF5 should be replaced probably with TARGET_NRF5x (checked that this change solves the problem on NRF51_DK board):

#elif TARGET_NRF5
// check if APP interrupts are masked for other NRF5 boards
return ((NVIC->ISER[0] & __NRF_NVIC_APP_IRQS_0) != 0);
#else

@marcuschangarm
Copy link
Contributor Author

Good catch! Thank you!

The unified NRF51 target and feature BLE directories have been
reorganized to follow the naming and directory structure of the
NRF52 implementation.

This reorganization does not include TARGET_MCU_NRF51822 and
derived targets.
@marcuschangarm
Copy link
Contributor Author

/morph build

@mbed-ci
Copy link

mbed-ci commented May 8, 2018

Build : FAILURE

Build number : 1948
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6711/

@mbed-ci
Copy link

mbed-ci commented May 8, 2018

Build : SUCCESS

Build number : 1949
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6711/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented May 8, 2018

@mbed-ci
Copy link

mbed-ci commented May 9, 2018

@marcuschangarm
Copy link
Contributor Author

/morph export-build

@mbed-ci
Copy link

mbed-ci commented May 9, 2018

@marcuschangarm
Copy link
Contributor Author

/morph export-build

@mbed-ci
Copy link

mbed-ci commented May 9, 2018

@marcuschangarm
Copy link
Contributor Author

/morph export-build

@mbed-ci
Copy link

mbed-ci commented May 10, 2018

@marcuschangarm
Copy link
Contributor Author

@theotherjimmy Fourth time is indeed the charm! 😄

Copy link
Contributor

@cmonr cmonr left a comment

Choose a reason for hiding this comment

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

That was much less painful than I was expecting.

👍 on using git mv commands.

@cmonr cmonr merged commit 2104d8a into ARMmbed:master May 12, 2018
@marcuschangarm marcuschangarm deleted the cleanup-nrf5x branch May 25, 2018 18:00
adbridge pushed a commit that referenced this pull request Jun 15, 2018
Reintroduce PR #6021

#6021

which was accidentally removed by PR #6711

#6711
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.

7 participants