Skip to content

Update of RTC HAL API specification and tests. #5306

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

Conversation

mprse
Copy link
Contributor

@mprse mprse commented Oct 12, 2017

Description

This patch provides updates of artefacts provided in PR #5226.

This patch provides the following updates:

  • description of RTC HAL API tests in given/when/then format,
  • minor fixes in existing test cases,
  • additional test cases.

Status

READY

Migrations

NO

Related PRs

feature-hal-spec-rtc | #5226
master | #5363

Todos

Provided additional test case rtc_enabled_test() is in conflict with rtc_persist_test() test case.

Documentation describes rtc_isenabled() function as follows:

RTC has the time set and is counting

I assume that some test should be created for this function, but its behaviour is unclear. I understand this description as follows:
"RTC is counting" - RTC has been initialised by means of rtc_init() function.
"RTC has the time set" - RTC time value has been set by means of rtc_write() function.
Since rtc_isenabled() can not be called before rtc_init(), test case which checks if rtc_isenabled() returns:

  • 0 after initialisation and before time has been set,
  • 1 after initialisation and time set operation,
    has been created.
    This case is inconsistent with test case which checks RTC persistence, which assumes that rtc_isenabled() returns 1 after rtc_init() call (if time has been set earlier).

@mprse mprse force-pushed the feature-hal-spec-rtc_tests-update branch from cf1a596 to 38566b7 Compare October 12, 2017 11:47
@mbed-ci
Copy link

mbed-ci commented Oct 12, 2017

Build : FAILURE

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

@mprse mprse force-pushed the feature-hal-spec-rtc_tests-update branch 2 times, most recently from ae871bf to b8b1416 Compare October 12, 2017 13:16
@mprse
Copy link
Contributor Author

mprse commented Oct 12, 2017

Build : FAILURE

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

Added conditional compilation: sleep/deep-sleep tests available only for boards with low power timers.

@mbed-ci
Copy link

mbed-ci commented Oct 12, 2017

Build : SUCCESS

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

Triggering tests

/test mbed-os

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 12, 2017

cc @c1728p9 @bulislaw

@mprse
Copy link
Contributor Author

mprse commented Oct 13, 2017

I'm not sure if this is failure reason, but in Travis log I have found only this error:

W: GPG error: http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 Release: The following signatures were invalid: KEYEXPIRED 1507497109

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 13, 2017

@mprse I can see in the logs that doxygen check is red, that would be the failure, can you confirm?

@mprse mprse force-pushed the feature-hal-spec-rtc_tests-update branch from b8b1416 to 1ea37cd Compare October 13, 2017 07:20
@mprse
Copy link
Contributor Author

mprse commented Oct 13, 2017

can see in the logs that doxygen check is red, that would be the failure, can you confirm?

Thanks for the tip. It looks like there is some problem with doxygen formatting.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 19, 2017

Travis still fails $ find "(" -name "*.a" -or -name "*.ar" ")" -and -not -name "lib*" | tee BUILD/badlibs | sed -e "s/^/Bad library name found: /" && [ ! -s BUILD/badlibs ] . Please fix

@mprse mprse force-pushed the feature-hal-spec-rtc_tests-update branch 2 times, most recently from a6b2b8f to a95d01a Compare October 19, 2017 13:37
@mbed-ci
Copy link

mbed-ci commented Oct 19, 2017

Build : SUCCESS

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

Skipping test trigger, missing label 'NEED CI'

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 19, 2017

@mprse I restarted travis but we saw the failure regarding doxygen as previously reported.

@mprse mprse force-pushed the feature-hal-spec-rtc_tests-update branch 2 times, most recently from a0bc0f8 to 2aad555 Compare October 20, 2017 08:49
@mprse
Copy link
Contributor Author

mprse commented Oct 20, 2017

@mprse I restarted travis but we saw the failure regarding doxygen as previously reported.

Provided fix.

@theotherjimmy
Copy link
Contributor

cc @c1728p9 @bulislaw review please.

hal/rtc_api.h Outdated
@@ -30,37 +30,147 @@ extern "C" {
#endif

/**
* \defgroup hal_rtc RTC hal functions
* \defgroup hal_rtc RTC hal
Copy link
Member

Choose a reason for hiding this comment

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

We are duplicating or even triplicating(?) if we count PG. I don't think this information should be in test header: defined/undefined behaviour + potential bugs could be only here.

Copy link
Contributor Author

@mprse mprse Oct 24, 2017

Choose a reason for hiding this comment

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

This form has been provided here:
0a68abd PR #5226

And this PR has only extended provided test list.
I understand that we have the same information provided in both files:
rtc_api_tests.h and rtc_api.h (defined/undefined behaviour, potential bugs and list of test cases which verifies each requirement). You suggest to leave here "defined/undefined behaviour + potential bugs" - so only names of test cases should be removed? Additionally what PG means ?

Edit:
Example fix has been provided.

Copy link
Member

Choose a reason for hiding this comment

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

Ok so your PR has changes that are not yet on branch but will arrive in #5226? In this case lets not do that before the other PR is merged somewhere cause we don't know what we are reviewing.

hal/rtc_api.h Outdated
* @{
*/

/**
* \defgroup hal_rtc_tests RTC hal tests
Copy link
Member

Choose a reason for hiding this comment

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

That's already defined in test header, i don't think we need this block here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

hal/rtc_api.h Outdated
*
* @note This function is safe to call repeatedly - Tested by ::rtc_init_test
*
* Pseudo Code:
Copy link
Member

Choose a reason for hiding this comment

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

Can we comment on each of the example code, that's example implementation pseudo code, just to make it clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

hal/rtc_api.h Outdated
/** Initialize the RTC peripheral
*
* Powerup the RTC in perpetration for access. This function must be called
* before any other RTC functions ares called. This does not change the state
Copy link
Member

Choose a reason for hiding this comment

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

Do we test that that actually does not change the state? Eg does not reset the counter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rtc_persist_test() test case verifies if counter value is valid after free and re-initialisation (still counts).

@mprse mprse force-pushed the feature-hal-spec-rtc_tests-update branch from 2aad555 to 08734f1 Compare October 24, 2017 07:55
@adbridge
Copy link
Contributor

@bulislaw can you take a look at the update please ?

@bulislaw
Copy link
Member

bulislaw commented Nov 1, 2017

@mprse the #5226 was merged to the branch, can you rebase this PR please

@mprse mprse force-pushed the feature-hal-spec-rtc_tests-update branch from 08734f1 to afb2d5c Compare November 2, 2017 09:21
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 3, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Nov 3, 2017

Build : SUCCESS

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

Triggering tests

/morph test
/morph uvisor-test

@mbed-ci
Copy link

mbed-ci commented Nov 4, 2017

@mbed-ci
Copy link

mbed-ci commented Nov 4, 2017

@mprse
Copy link
Contributor Author

mprse commented Nov 6, 2017

Exporter Build : FAILURE

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

There was a problem only on K66F platform/make_iar. It looks like this is some kind of environment configuration issue.
Log provided below:

00:48:48 Extracting sources done..
00:48:52 [mbed] WARNING: Could not find mbed program in current path "/builds/ws/exporter-build-matrix/78/K66F_make_iar/sources/examples/mbed-os-example-blinky".
00:48:52 [mbed] WARNING: You can fix this by calling "mbed new ." in the root of your program.
00:48:52 ---
00:49:39 [mbed] WARNING: Could not find mbed program in current path "/builds/ws/exporter-build-matrix/78/K66F_make_iar/sources/examples/mbed-os-example-sockets".
00:49:39 [mbed] WARNING: You can fix this by calling "mbed new ." in the root of your program.
00:49:39 ---
00:50:17 [mbed] WARNING: Could not find mbed program in current path "/builds/ws/exporter-build-matrix/78/K66F_make_iar/sources/examples/nanostack-border-router".
00:50:17 [mbed] WARNING: You can fix this by calling "mbed new ." in the root of your program.
00:50:17 ---
00:51:00 Completed 256.0 KiB/514.0 KiB (1.1 MiB/s) with 1 file(s) remaining
Completed 512.0 KiB/514.0 KiB (2.1 MiB/s) with 1 file(s) remaining
Completed 514.0 KiB/514.0 KiB (2.0 MiB/s) with 1 file(s) remaining
upload: ../../afb2d5c2f8e178461fe0fe53faa843b82de761ff_exporter_build_log_K66F_make_iar.txt to s3://mbed-os/builds/exporter/5306/FAIL/K66F/make_iar/afb2d5c2f8e178461fe0fe53faa843b82de761ff_exporter_build_log_K66F_make_iar.txt
00:51:01 upload of example bin failed
00:51:01 Build failed !!!
00:51:01 Build step 'Execute shell' marked build as failure
00:51:01 [BFA] Scanning build for known causes...
00:51:01 [BFA] No failure causes found
00:51:01 [BFA] Done. 0s
00:51:01 [WS-CLEANUP] Deleting project workspace...[WS-CLEANUP] done
00:51:01 Finished: FAILURE

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 6, 2017

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Nov 6, 2017

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 6, 2017

I reviewed the 2 failures from exporters. This is the error reported from IAR: [mbed-os/rtos/TARGET_CORTEX/rtx5/TARGET_RTOS_M4_M7/TOOLCHAIN_IAR/irq_cm4f.o] Segmentation fault (core dumped) . As this patch does not changes anything in RTX, and the fault does not produce more information. I am suspicios it might be more generic problem than this PR.

I'll run one exporter in another PR and do a local as well.

@mprse If you can test locally also if you can reproduce the failure with IAR here. I haven't seen this report in any other PR so far.

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 6, 2017

FYI, https://mbed-os.mbedcloudtesting.com/job/exporter-build-matrix/86/ - latest run on another PR that is going to master and all OK.

@studavekar
Copy link
Contributor

@0xc0170 fix for IAR failure #5415 is on master and probably not on branch feature-hal-spec-rtc because of which exporter test failed ?

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 7, 2017

@0xc0170 fix for IAR failure #5415 is on master and probably not on branch feature-hal-spec-rtc because of which exporter test failed ?

Good catch, that is correct. @mprse the RTC branch needs an update, can you please?

@mprse
Copy link
Contributor Author

mprse commented Nov 7, 2017

Good catch, that is correct. @mprse the RTC branch needs an update, can you please?

Rebase to master: PR #5447

@studavekar
Copy link
Contributor

/morph export-build

@studavekar
Copy link
Contributor

Aborting the exporter test for this PR.

@c1728p9 c1728p9 force-pushed the feature-hal-spec-rtc branch from d312da9 to 5e6c46e Compare November 9, 2017 21:44
Provide minor fixes for existing test cases.
Add additional test cases.
@mprse mprse force-pushed the feature-hal-spec-rtc_tests-update branch from afb2d5c to df26cab Compare November 10, 2017 12:57
@mprse
Copy link
Contributor Author

mprse commented Nov 10, 2017

Rebased mprse:feature-hal-spec-rtc_tests-update branch to ARMmbed:feature-hal-spec-rtc.

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 10, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Nov 10, 2017

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Nov 10, 2017

@mbed-ci
Copy link

mbed-ci commented Nov 10, 2017

@theotherjimmy theotherjimmy merged commit e4b78b3 into ARMmbed:feature-hal-spec-rtc Nov 13, 2017
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.

8 participants