Skip to content

DISCO_F746NG: add usp_speed configuration #5580

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 2 commits into from
Nov 30, 2017

Conversation

bcostm
Copy link
Contributor

@bcostm bcostm commented Nov 24, 2017

Description

Add a new usb_speed configuration in targets.json in order to select between the FS or HS USB connectors present on the board.

Status

READY

Migrations

NO

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 24, 2017

One note, as this is global scope macro, using short names like this might clash with libraries. I would rather skip the macro name set in the config and use the full name that config would do MBED_CONF_TARGET_USP_SPEED would be by default? What is the reason for defining macro USB_SPEED and not using default generated name?

@bcostm
Copy link
Contributor Author

bcostm commented Nov 24, 2017

OK no problem it will be better but I don't know how to do it ? I wanted to do the same as CLOCK_SOURCE configuration...

When I build the target, the automatically generated mbed_config.h file contains:

// Configuration parameters
#define MBED_CONF_PLATFORM_FORCE_NON_COPYABLE_ERROR 0                            // set by library:platform
#define MBED_CONF_PLATFORM_STDIO_BAUD_RATE          9600                         // set by library:platform
#define CLOCK_SOURCE                                USE_PLL_HSE_XTAL|USE_PLL_HSI // set by target:DISCO_F746NG
#define MBED_CONF_PLATFORM_STDIO_CONVERT_NEWLINES   0                            // set by library:platform
#define MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE 9600                         // set by library:platform
#define MBED_CONF_PLATFORM_STDIO_FLUSH_AT_EXIT      1                            // set by library:platform
#define USB_SPEED                                   1                            // set by target:DISCO_F746NG

How do I generate the MBED_CONF_TARGET_USB_SPEED macro ?

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 24, 2017

If you remove macro_name from the config, that would do the trick.

@bcostm
Copy link
Contributor Author

bcostm commented Nov 24, 2017

OK.

I have removed the line "macro_name": "USB_SPEED" in targets.json and the mbed_config.h file contains effectively the desired macro:

#define MBED_CONF_TARGET_USB_SPEED 1 // set by target:DISCO_F746NG

@bcostm bcostm force-pushed the dev_usb_speed_disco-f746ng branch from aa5940e to b1073c1 Compare November 24, 2017 15:54
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 27, 2017

@bcostm Thanks, looks good now

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 27, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Nov 27, 2017

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Nov 27, 2017

@mbed-ci
Copy link

mbed-ci commented Nov 27, 2017

@0xc0170 0xc0170 merged commit 221b8a8 into ARMmbed:master Nov 30, 2017
@bcostm bcostm deleted the dev_usb_speed_disco-f746ng branch December 1, 2017 09:56
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.

3 participants