Skip to content

TARGET_NRF5: A few corrections in HAL implementation. #2865

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 9 commits into from
Oct 13, 2016

Conversation

anangl
Copy link
Contributor

@anangl anangl commented Sep 29, 2016

Corrections made to address the following issues:
Mbed 2 - Mbed OS 5 : Sleep incorrect for Nordic target
TARGET_NRF5(NRF52_DK):Can't use A5(P0_31) as DigitalOut mode.
And enabled changing of flow control settings in runtime.

@anangl anangl changed the title TARGET_NRF: A few corrections in HAL. TARGET_NRF5: A few corrections in HAL implementation. Sep 29, 2016
@mazimkhan
Copy link

retest uvisor

@bridadan
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 998

All builds and test passed!

@pan-
Copy link
Member

pan- commented Sep 30, 2016

@sg- Please, do not merge it until I've tested it with BLE.

Copy link
Member

@pan- pan- left a comment

Choose a reason for hiding this comment

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

@@ -1986,7 +1986,7 @@
"supported_form_factors": ["ARDUINO"],
"inherits": ["MCU_NRF51_32K_UNIFIED"],
"progen": {"target": "nrf51-dk"},
"device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"],
"device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"],
Copy link
Member

Choose a reason for hiding this comment

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

What is SERIAL_FC ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Serial Flow Control I believe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's flow control.


// look if exceptions are enabled or not, if they are, it is possible to make an SVC call
// and check if the soft device is running
if ((__get_PRIMASK() == 0) && (sd_softdevice_is_enabled(&sd_enabled) == NRF_SUCCESS) && (sd_enabled == 1)) {
Copy link
Member

Choose a reason for hiding this comment

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

maybe it would be better to use softdevice_handler_isEnabled which a simple function call and not an SVC call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I took the code from mbedOS 3 and only corrected it, so it would run on nRF52. But indeed, it should be refactored a bit more.

@bridadan
Copy link
Contributor

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=ALL
TARGETS=LPC1768,K64F,NRF51_DK,NRF51_MICROBIT

@mbed-bot
Copy link

[Build 1006]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@nvlsianpu
Copy link
Contributor

Flow control sett interface implementation (https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_NORDIC/TARGET_NRF5/serial_api.c#L527) needs additional work in order to be comply with API description.

anangl added 3 commits October 5, 2016 07:54
# Conflicts:
#	hal/targets.json
… used the new implementation in legacy HAL for NRF51822.
This reverts commit 1f208f6.

# Conflicts:
#	hal/targets.json
@anangl
Copy link
Contributor Author

anangl commented Oct 5, 2016

I reverted the changes done to targets.json (enabling the flow control interface), since our current implementation of 'serial_set_flow_control()' is not fully consistent with API description (as @nvlsianpu spotted). It needs rework before it can be enabled.

anangl added 2 commits October 5, 2016 14:51
…oved the new one to FEATURE_BLE, so it is picked only when SoftDevice is in use.
@0xc0170
Copy link
Contributor

0xc0170 commented Oct 7, 2016

@pan- Tested and approved?

@pan-
Copy link
Member

pan- commented Oct 7, 2016

@0xc0170 reviewed, yes; tested, not yet!

@nvlsianpu
Copy link
Contributor

related to #2894 as well

@pan-
Copy link
Member

pan- commented Oct 13, 2016

@0xc0170 Thoroughly tested, LGTM.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 13, 2016

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 0

All builds and test passed!

@c1728p9
Copy link
Contributor

c1728p9 commented Oct 14, 2016

Removed the "backport 5.2.0-rc3" tag since this was causing problems for the release script. Created a PR #3032 to bring in the changes.

@pan-
Copy link
Member

pan- commented Oct 17, 2016

@c1728p9 What kind of problem ?

@c1728p9
Copy link
Contributor

c1728p9 commented Oct 17, 2016

@pan- since this pr was merged with master multiple times rather than being rebased, the script used to generate the release tried to pull in the same commits multiple times causing it to fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants