-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix CY8CPROTO_062_4343W baremetal build #12438
Fix CY8CPROTO_062_4343W baremetal build #12438
Conversation
targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_WHD/mbed_lib.json
Outdated
Show resolved
Hide resolved
@@ -23,7 +23,7 @@ | |||
* limitations under the License. | |||
*******************************************************************************/ | |||
|
|||
#if defined(CYBSP_WIFI_CAPABLE) | |||
#if MBED_CONF_CY_PSCOC6_WHD_PRESENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not valid to add Mbed-specific macros to cy_network_buffer.c and cybsp_wifi.c, this is common code shared across multiple ecosystems:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that both modules pull in WHD which depends on RTOS functionality. RTOS is not present with the bare metal profile. Adding the mbed_lib.json
file allows all files in targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_WHD
to not be included for the bare metal profile.
The alternative was to add #if MBED_CONF_RTOS_PRESENT
to all the files in the targets
directory that are dependent on RTOS functionality as I have shown here. I opted for the present PR as there are less file changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made changes to address the comment here.
@@ -0,0 +1,6 @@ | |||
{ | |||
"name": "cy_pscoc6csp_rtos", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The baremetal configuration does not have an RTOS. This Mbed library file has been added to make all files in targets/TARGET_Cypress/TARGET_PSOC6/psoc6csp/abstraction/rtos
part of a new library called cy_pscoc6csp_rtos
. With this, I am able to to exclude all files in this directory when building with the bare metal profile.
The alternative was to add #if MBED_CONF_RTOS_PRESENT
to all the files in that directory that are dependent on RTOS functionality as I have shown here.
Although the target supports all kinds of functionalities (specified in targets/targets/json
) not all functionalities are available when building with the bare metal profile.
@hugueskamba, thank you for your changes. |
b275c1b
to
6c0b80f
Compare
This force-push removes the changes made to Cypress files (in response to this comment). Instead the files that are dependent on RTOS are moved and used to create a new library that is automatically excluded when building with the bare metal profile. |
6c0b80f
to
f52597f
Compare
Make a Mbed library with Cypress WHD files so it is automatically excluded when building with the bare metal profile. Create another Mbed library to group network files that use WHD so they can also be excluded fro the bare metal profile.
f52597f
to
18193ab
Compare
To summarize - baremetal ignores whd, rtos and common network component and building full Mbed OS will include them, correct? This is important detail - we should cover this in our design guide (I dont recall seeing it there, is it there?). @ARMmbed/team-cypress Please review |
Yes. The PR CI tests should demonstrate that building with full Mbed OS works fine. |
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
@ARMmbed/team-cypress please review. this should be gated by your approval. |
I'm not too familiar with the bare metal profile and it's not clear from https://os.mbed.com/docs/mbed-os/v5.15/reference/mbed-os-bare-metal.html how you can change the components, macros etc when building under that profile. But I'm assuming that there is some fairly flexible mechanism given that Cypress-specific macro values and library names have been proposed in this PR.
|
@kyle-cypress, |
@hugueskamba |
The way the baremetal profile is built is by only selecting what it needs (as opposed to removing what it does not need). This is done by using the The macro
https://os.mbed.com/docs/mbed-os/v5.15/reference/configuration.html |
Hello @hugueskamba, I have just reviewed https://github.com/ARMmbed/mbed-os-example-blinky-baremetal/blob/master/mbed_app.json and now understand the application-defined I understand the goal to get the mbed-os-example-blinky-baremetal app working out-of-box for PSoC 6 targets - this is very good goal. Alternative would be to add custom target_overrides for PSoC 6 targets to exclude COMPONENT_WHD and COMPONENT_RTX - but this doesn't solve issue with common/network. Hence I approve this PR. @kyle-cypress do you see any issues? |
Summary of changes
Make a Mbed library with Cypress WHD files so it is automatically excluded when building with the bare metal profile. Create another Mbed library to group network files that use WHD so they can also be excluded from the bare metal profile.
Impact of changes
It is now possible to build the
CY8CPROTO_062_4343W
target with the baremetal profile.i.e It is now possible to build
mbed-os-example-blinky-baremetal
with$ mbed compile -t <TOOLCHAIN> -m CY8CPROTO_062_4343W
Migration actions required
Documentation
Pull request type
Test results
Reviewers
@evedon @bulislaw