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

Add tests for critical section HAL API #5789

Merged
merged 1 commit into from Jan 26, 2018

Conversation

Projects
None yet
6 participants
@maciejbocianski
Member

maciejbocianski commented Jan 4, 2018

Description

This PR contains critical section HAL API tests.
Test were created based on documentation provided in PR #5346

Status

READY

Migrations

NO

Notes

in order to run these tests #5346 has to be merged first,

Todos

  • adopt test for NRF5X series
@maciejbocianski

This comment has been minimized.

Member

maciejbocianski commented Jan 4, 2018

@scartmell-arm
as discussed it would be good to have hal_in_critical_section function to cover NRF5x like targets which mask application interrupts rather than disable all interrupts

@maciejbocianski maciejbocianski force-pushed the maciejbocianski:hal_critical_section_tests branch 3 times, most recently from cc5630d to 182dca7 Jan 10, 2018

@maciejbocianski

This comment has been minimized.

Member

maciejbocianski commented Jan 12, 2018

support for NRF5x added

@maciejbocianski maciejbocianski force-pushed the maciejbocianski:hal_critical_section_tests branch 2 times, most recently from 92f0217 to f90759a Jan 17, 2018

@maciejbocianski maciejbocianski force-pushed the maciejbocianski:hal_critical_section_tests branch 2 times, most recently from cdf8ff8 to 4560558 Jan 18, 2018

{
// NRF5x targets don't disable interrupts when in critical section, instead they mask application interrupts this is due to BLE stack
// (BLE to be operational requires some interrupts to be always enabled)
#ifdef TARGET_NRF52_DK

This comment has been minimized.

@0xc0170

0xc0170 Jan 22, 2018

Member

wasn't there somewhere a request for having function to check if interrupts are enabled? Or even an implementation?

This comment has been minimized.

@maciejbocianski

maciejbocianski Jan 22, 2018

Member

indeed, there is function hal_in_critical_section(), but it would be nice to verify API functions by something form outside critical section API. us_ticker could be used to check interrupts but unfortunately it utilises core_util_critical_section_ (which also call HAL critical API ) and it brakes the test. Generly we should always use platform core_util_critical_section not HAL, in particular we cannot use both in the same time

This comment has been minimized.

@0xc0170

0xc0170 Jan 22, 2018

Member

I was concerned about the portability (how this function can grow in time).

Looks fine to test this here.

@0xc0170 0xc0170 requested a review from scartmell-arm Jan 22, 2018

@0xc0170 0xc0170 added needs: review and removed needs: work labels Jan 22, 2018

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Jan 22, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jan 22, 2018

/morph build

1 similar comment
@cmonr

This comment has been minimized.

Contributor

cmonr commented Jan 22, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Jan 22, 2018

Build : SUCCESS

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

Triggering tests

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

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jan 23, 2018

Jenkins didn't report abort.

/morph export-build

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@maciejbocianski maciejbocianski force-pushed the maciejbocianski:hal_critical_section_tests branch from 4560558 to 628f521 Jan 24, 2018

@maciejbocianski

This comment has been minimized.

Member

maciejbocianski commented Jan 24, 2018

@scartmell-arm @0xc0170
I have added fix for masked interrupts check on NRF52

It turned out that none of interrupts handled by ISER/ICER[1] is actually enabled(used)
and (NVIC->ISER[1] & __NRF_NVIC_APP_IRQS_1) != 0 always returns false.

I modified the checking code from:

return (((NVIC->ISER[0] & __NRF_NVIC_APP_IRQS_0) != 0) 
           && ((NVIC->ISER[1] & __NRF_NVIC_APP_IRQS_1) != 0));

to:

return (((NVIC->ISER[0] & __NRF_NVIC_APP_IRQS_0) != 0) 
           || ((NVIC->ISER[1] & __NRF_NVIC_APP_IRQS_1) != 0));

Now we check __NRF_NVIC_APP_IRQS_1 only when __NRF_NVIC_APP_IRQS_0 are masked

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jan 24, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Jan 24, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jan 25, 2018

/morph build

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Jan 25, 2018

@mbed-ci

This comment has been minimized.

mbed-ci commented Jan 25, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr cmonr merged commit 24859e9 into ARMmbed:master Jan 26, 2018

19 checks passed

ARM mbed CI Verification build successful.
Details
AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Local events testing has passed
Details
travis-ci/littlefs Local littlefs testing has passed
Details
travis-ci/mbed2-ATMEL Local mbed2-ATMEL testing has passed
Details
travis-ci/mbed2-MAXIM Local mbed2-MAXIM testing has passed
Details
travis-ci/mbed2-NORDIC Local mbed2-NORDIC testing has passed
Details
travis-ci/mbed2-NUVOTON Local mbed2-NUVOTON testing has passed
Details
travis-ci/mbed2-NXP Local mbed2-NXP testing has passed
Details
travis-ci/mbed2-RENESAS Local mbed2-RENESAS testing has passed
Details
travis-ci/mbed2-SILICON_LABS Local mbed2-SILICON_LABS testing has passed
Details
travis-ci/mbed2-STM Local mbed2-STM testing has passed
Details
travis-ci/tools Local tools testing has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment