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

UBLOX_C027: init us_ticker in the target initialization #7060

Merged
merged 1 commit into from Jun 4, 2018

Conversation

Projects
None yet
8 participants
@ithinuel
Member

ithinuel commented May 30, 2018

Description

A hardfault for this target has been reported.

Crash Info:
	Crash location = us_ticker_read [0x0001BAFA] (based on PC value)
	Caller location = ublox_mdm_init [0x0001B0AD] (based on LR value)
	Stack Pointer at the time of crash = [10007FB0]
	Target and Fault Info:
		Processor Arch: ARM-V7M or above
		Processor Variant: C23
		Forced exception, a fault with configurable priority has been escalated to HardFault
		A precise data access error has occurred. Faulting address: 40094008

Pull request type

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

@ithinuel ithinuel changed the title from Attempt to an hardfault on c027 to Attempt to an hardfault on UBLOX_C027 May 30, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented May 30, 2018

@ARMmbed/mbed-os-wan Can you please review and test if this fixes the issue was reported earlier?

cc @ARMmbed/team-ublox

@ithinuel ithinuel force-pushed the ithinuel:fix-c027 branch from 62d2c1a to 1c7b91a May 30, 2018

@0xc0170 0xc0170 changed the title from Attempt to an hardfault on UBLOX_C027 to UBLOX_C027: init us_ticker in the target initialization May 30, 2018

@kimlep01

This comment has been minimized.

kimlep01 commented May 30, 2018

Tested locally and I can verify that this fixes the hardfault issue.

@bulislaw

This comment has been minimized.

Member

bulislaw commented May 30, 2018

That should go into RC2.

@@ -42,6 +42,7 @@ void ublox_mdm_init(void)
// Can't use wait_ms() as RTOS isn't initialised yet

This comment has been minimized.

@sg-

sg- May 30, 2018

Member

Can you clean up the comments to describe what is actually happening? For example, would using wait_us have solved the problem?

This comment has been minimized.

@ithinuel

ithinuel May 30, 2018

Member

Sorry I don't know what is happening and why there is a delay here.

This comment has been minimized.

@bulislaw

bulislaw May 30, 2018

Member

This board needs yet to be ported by Ublox to the new APIs (ticker mandates us_ticker_init needs to be called before any other us ticker calls).

This comment has been minimized.

@RobMeades

RobMeades May 30, 2018

Contributor

Hadn't spotted that this was a requirement of the new ticker API, had kinda assumed that any changes were backwards compatible. Obviously not. Are there any other things of this nature that we have missed? Note that, for reasons I've never understood, you don't run C027 on your test farms.

This comment has been minimized.

@bulislaw

bulislaw May 30, 2018

Member

Hi Rob, right now C027 does not support us ticker, lp ticker and RTC. Porting guides are here:
https://os.mbed.com/docs/v5.8/reference/microsecond-ticker.html
https://os.mbed.com/docs/v5.8/reference/low-power-ticker.html
https://os.mbed.com/docs/v5.8/reference/rtc-port.html

Please note they need to be updated to reflect that the changes are live on master right now and will be part of 5.9, not longer on feature branches.

This comment has been minimized.

@RobMeades

RobMeades May 30, 2018

Contributor

Apologies, I might be confused; the us_ticker_read() call has been there for a long time, hence should work with the old usTicker API but it seems that's not the case as this error has occurred. I can see what we should move to the new one, am wondering what happened to the old one...?

This comment has been minimized.

@bulislaw

bulislaw May 30, 2018

Member

The old API is not longer there, we don't maintain two versions at the same time. The calls are for most part the same, just some additional requirements are in place.

This comment has been minimized.

@sg-

sg- May 30, 2018

Member

Looking at this closer, us_ticker_read seems to be a device hal API where the platform API seems to be ticker_read_us which starts the ticker if not already started. wait_us still yields to the RTOS so not a good option for where this needing to be called from.

This comment has been minimized.

@RobMeades

RobMeades May 31, 2018

Contributor

I think I see at least one of my sources of confusion: C027 defines the macro TARGET_LPC1768 but doesn't actually inherit the target LPC1768, just the target LPCTarget, which doesn't do much of interest; hence the C027 target needs to add any "device_has" macros all by it's little 'ole self (I'm used to the STM targets which are much more hierarchical). We will add support for USTICKER.

Now to my other source of confusion: since there is a ticker_api and a us_ticker_api in HAL, both of which serve our purpose for this case (since we can read microseconds from them), which would be the correct one to use in this "mid-boot" state, or doesn't it matter?

This comment has been minimized.

@bulislaw

bulislaw May 31, 2018

Member

ticker_api is just a "parent" to us_ticker_api and lp_ticker_api. The whole timers/tickers abstraction is a bit complicated, but basically it's your standard object oriented abstract/virtual inheritance. You can use all of the high level classes with any ticker that inherits from ticker_api. So to instantiate us ticker in terms of ticker_api you use get_us_ticker_data and then interact with that using ticker_api.

@0xc0170

0xc0170 approved these changes Jun 4, 2018

LGTM

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jun 4, 2018

/morph build

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Jun 4, 2018

@mbed-ci

This comment has been minimized.

mbed-ci commented Jun 4, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Jun 4, 2018

@cmonr cmonr merged commit abed3df into ARMmbed:master Jun 4, 2018

13 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build 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/astyle Passed, 918 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9577 cycles
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/littlefs Passed, code size is 9964B
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details

@cmonr cmonr removed the ready for merge label Jun 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment