Skip to content

Conversation

SenRamakri
Copy link
Contributor

Description

Mbed Fault Handler was originally placed under rtos folder because of its dependency on some of the RTX data structures for capturing the thread info. But with the new error handling in place thread info collection on hardfaults has been moved to Mbed_error handler. There is no point for fault handler implementation to exist under rtos and can be used for RTOS-less builds as well. So moving under platform folder. Also removing some references to RTX data structs like osRtxInfo from fault handler implementation.

Pull request type

[ ] Fix
[x] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change

@0xc0170 0xc0170 requested a review from a team October 5, 2018 09:09
0xc0170
0xc0170 previously requested changes Oct 5, 2018
Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

Changes look good. Refactor like this should contain more info in the commit msg

Mbed Fault Handler was originally placed under rtos folder because of its dependency on some of the RTX data structures for capturing the thread info. But with the new error handling in place thread info collection on hardfaults has been moved to Mbed_error handler. There is no point for fault handler implementation to exist under rtos and can be used for RTOS-less builds as well. So moving under platform folder. Also removing some references to RTX data structs like osRtxInfo from fault handler implementation.

Can this be added there?

Copy link
Contributor

@studavekar studavekar left a comment

Choose a reason for hiding this comment

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

LGTM

@SenRamakri SenRamakri force-pushed the sen_RefactorFaultHandler branch from 6b5539f to a873ef8 Compare October 5, 2018 18:54
@SenRamakri
Copy link
Contributor Author

@0xc0170 - Commit msg has been updated, please review.

Copy link

@deepikabhavnani deepikabhavnani left a comment

Choose a reason for hiding this comment

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

I am not sure if adding TARGET_ and TOOLCHAIN_ specific folders in platform is a good idea. I would rather move Cortex-M specific toolchain dependent code to CMSIS folder (if not dependent on RTOS)

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 17, 2018

I am not sure if adding TARGET_ and TOOLCHAIN_ specific folders in platform is a good idea. I would rather move Cortex-M specific toolchain dependent code to CMSIS folder (if not dependent on RTOS)

I would not expect to have these folders in platform or drivers. CMSIS sounds as a good place to have these in. What others think?

@SenRamakri
Copy link
Contributor Author

I don't mind moving these under CMSIS, but the exception handler is no longer RTOS specific or CMSIS-specific and can be used by RTOS-less or CMSIS-less builds as well. The only reason I can think of is usage of SCB struct which we can get rid of as well. Should we still move it out?

@deepikabhavnani
Copy link

deepikabhavnani commented Oct 17, 2018

Yes @SenRamakri though it is not Cmsis dependent but core specific code is in CMSIS..

Copy link
Contributor

@kjbracey kjbracey left a comment

Choose a reason for hiding this comment

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

I don't see any particular reason why we couldn't have TARGET_ folders under platform, and this code is more closely related to platform than anything in cmsis.

But then the start up code which calls mbed_main and main is over in there, and this exception stuff calling mbed_fault_handler probably belongs alongside it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just to save a couple of words, I'm wondering why

LDR R3,=mbed_fault_handler
BLX R3

and not just

BL mbed_fault_handler

(Actually, there are tons of potential savings in this assembler, but that's a straightforward de-obfustication.)

@SenRamakri SenRamakri force-pushed the sen_RefactorFaultHandler branch from a873ef8 to 0b41a28 Compare October 22, 2018 18:32
@cmonr cmonr dismissed deepikabhavnani’s stale review October 23, 2018 00:43

Changes addressed. Please re-review.

… its dependency on some of the RTX data structures for capturing the thread info. But with the new error handling in place thread info collection on hardfaults has been moved to Mbed_error handler. There is no point for fault handler implementation to exist under rtos and can be used for RTOS-less builds as well. So moving under platform folder. Also removing some references to RTX data structs like osRtxInfo from fault handler implementation.
@SenRamakri SenRamakri force-pushed the sen_RefactorFaultHandler branch from 0b41a28 to 230ba03 Compare October 23, 2018 18:06
@SenRamakri
Copy link
Contributor Author

Please review, I have addressed the review comments.

Copy link

@deepikabhavnani deepikabhavnani left a comment

Choose a reason for hiding this comment

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

Looks good to me

@cmonr
Copy link
Contributor

cmonr commented Oct 24, 2018

I don't see any particular reason why we couldn't have TARGET_ folders under platform, and this code is more closely related to platform than anything in cmsis.

I think the particular reason for that would be that it would require a tweak of the tools to handle the updated structure. In any case, it looks like your optimization comments have been addressed.

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 24, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Oct 24, 2018

@cmonr
Copy link
Contributor

cmonr commented Oct 24, 2018

New greentea tests should be complete within two hours.

@mbed-ci
Copy link

mbed-ci commented Oct 24, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 24, 2018

New greentea tests should be complete within two hours.

Yes not they are, waiting for CI !

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

Successfully merging this pull request may close these issues.

8 participants