Skip to content
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

BLENano/RTC Implementation #52

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

dhofstetter
Copy link

Maybe in interest with others. I added the changes that have to be done manually if I want to compile for the blenano (see here) device.

Think the impact is not big, but makes creating a new project for this device much easier.

BR

@@ -25,14 +25,17 @@
"mbed-hal-nrf51822-mcu"
],
"dependencies": {
"mbed-hal": "^1.0.0",
"mbed-hal": "*",
Copy link

@nvlsianpu nvlsianpu May 6, 2016

Choose a reason for hiding this comment

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

We still need requirement ^1.0.0. Requested changes were not associated with this requirement . mbed-hal required version 1.0.0 or compatible one. if mbed-hal-blenano requires lower version - then mbed-hal-blenano should be upgrades.

Choose a reason for hiding this comment

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

According to the @dhofstetter explanation, "any version" is the valid requirement.

@dhofstetter
Copy link
Author

dhofstetter commented May 6, 2016

Yes but have a look at #49 and #50 there I already made a description why the dependency on mbed-hal Version 1.0.0 is not sufficient due to circular dependency problems.

But I'm sorry that my pull request have this commit in there, as it was already targeted with another pull request.

BR

@dhofstetter
Copy link
Author

dhofstetter commented May 7, 2016

Some of my tests to implement the rtc functionality ended up here :( the corresponding discussion to rtc can be found at #51

I think that the file rtc_int.c won't get compiled, or is not linked for compilation as expected. Do I have to make some special assignments in any file to make sure the file is included as expected?

@dhofstetter dhofstetter changed the title Added blenano to supported devices BLENano/RTC Implementation May 7, 2016
@dhofstetter
Copy link
Author

dhofstetter commented May 7, 2016

I finally got everything to compile, think the code is ready for testing and review.

Are their hints how to test? Is the handbook here the correct way?

Edit: By testing with a small sample application, I have the problem that every five seconds the time jumps for five minutes. But I think as the periodic callbacks are triggered in correct intervals the problem might be within my rtc update calculation.

Edit2: I finally managed to correct my time calculation, but i was expecting an interrupt on timer overflow, to trigger my rtc_update latest with timer overflow, but I'm never getting this event anymore.

I thought the EVTEN bits have to be 0 while the INTEN Bits have to be set. Here are my register values during execution

EVTEN<0x00000000>
INTEN<0x00020002>

I don't know why the overflow event never occurs, altough I'm sure that there have been an overflow (If I trigger my rtc calculation with a frequency lower than the overflow time (512 seconds) then the calculation is totally messed up.

@dhofstetter
Copy link
Author

I have fixed all issues and commited them into my fork. It's available here for review and testing.

Would be great to hear your opinions about my implementation

  • us_ticker.c is now using the rtc_int.c functions to access rtc1
  • lp_ticker.c is now using the rtc_int.c functions to access rtc1
  • rtc_api.c is using the rtc_int.c functions and is at least updating the rtc value on rtc1 overflow interrupt

Testing locally everything seemed to be fine, but I'm not able to use mbed test environment, to perform this I need more informations.

BR Daniel

@dhofstetter dhofstetter mentioned this pull request May 8, 2016
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.

2 participants