Skip to content

STM32 : set all PinMap structures as weak #5936

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

Merged
merged 1 commit into from
Jan 30, 2018

Conversation

jeromecoutant
Copy link
Collaborator

Description

This allow custom overwrites.

Status

READY

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 25, 2018

We should use MBED_WEAK that toolchain header file provides. But first a question: What is the use case for having them over-writable ? They define all MCU pins, is there anything missing?

@jeromecoutant
Copy link
Collaborator Author

OK to use MBED_WEAK.

What is the use case for having them over-writable ?

I can see 2 cases:

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 25, 2018

For custom boards that might have more pins available, or some differencies. This might be a valid reason to extend API or provide functionality that instead of weak linking, set pinmap arrays, default ones provided? We shall think about it

@SenRamakri @bulislaw @c1728p9 Can you review this addition ?

@0xc0170 0xc0170 requested review from bulislaw and c1728p9 January 25, 2018 16:10
@helmut64
Copy link
Contributor

I believe declaring this as weak (as I started on the L433) series is a fair tradeoff. This is adding more flexibility for custom target boards. In general this allows to use more pins as GPIOs, however it is not perfect because special pin functionality e.g.: UART, SPI, Timer, interrupt vectors, etc are not enabled because the target device does not know about it. E.g.: See serial_device.c in the STM target folder.

My opinion is, that the weak solution is great for developers, they get access to more pins and can optimise their hardware pin design to use mbed for their target boards. Most engineers and students are can easily handle the mbed online system, however adding a new target is out of reach for most developers.

Making it perfect (with all features) is a super large task, and some MCU vendors (Atmel) don’t keep up their mbed support anyways. I recommend this little change with a great benefit.

@jeromecoutant
Copy link
Collaborator Author

Compilation issue should be solved
Thx

@cmonr
Copy link
Contributor

cmonr commented Jan 26, 2018

@jeromecoutant Could you rebase this PR so that we can start CI? Thanks!

This allow custom overwrites
@jeromecoutant
Copy link
Collaborator Author

Could you rebase this PR so that we can start CI?

Done

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 29, 2018

/morph build

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 29, 2018

@helmut64 Thanks for details 👍

LGTM. Be aware that for all these platforms, if mbed 2 lib is used, it wont be functional until we make these peripheral pins definitions into own object file.

@mbed-ci
Copy link

mbed-ci commented Jan 29, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Jan 29, 2018

@mbed-ci
Copy link

mbed-ci commented Jan 29, 2018

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.

7 participants