Skip to content

Tutorial on creating a bare metal application #1305

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 10 commits into from
May 14, 2020

Conversation

LDong-Arm
Copy link
Contributor

@LDong-Arm LDong-Arm commented Apr 28, 2020

This PR adds a new page for creating bare metal applications.

@LDong-Arm LDong-Arm requested review from iriark01 and evedon April 28, 2020 17:08
@iriark01 iriark01 self-assigned this Apr 29, 2020
@LDong-Arm
Copy link
Contributor Author

@iriark01 Many thanks for the detailed review, I will take the suggestions on wordings. As for what to include in the guide, the Core team is in progress of discussion.

Copy link
Contributor

@hugueskamba hugueskamba left a comment

Choose a reason for hiding this comment

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

Regarding docs/program-setup/bare_metal/baremetal_usage.md

  • The recommended workflow has always been to use a mbed-os.lib file to get Mbed OS, not to use git clone.
  • Perhaps mention the relationship between mbed_app.json and platform/bare_metal/mbed_lib.json when the bare metal profile is used. This is so users can have a look at (if they so wish) what is included.
  • Have the Mbed 2 to Mbed OS 6 porting guide link to this page section on running the Greentea test for baremetal rather than the porting guide repeating these instructions.
  • List the tests that will not fit in ultra constrained devices. This could go at the end when we talk about using the release profile.

@LDong-Arm
Copy link
Contributor Author

@hugueskamba Thanks for the review, I'll fix everything together once we've clarified the part regarding greentea tests

@evedon
Copy link
Contributor

evedon commented May 1, 2020

  • List the tests that will not fit in ultra constrained devices. This could go at the end when we talk about using the release profile.

Rather than list (which required maintenance or goes out-of-date), explain that a limited set of tests won't fit and show the compilation error. All other tests that were compiled shoud either pass or be slipped (typically because some HW is not present on the target)

@LDong-Arm LDong-Arm changed the title Bare metal tutorial (application, Greantea) WIP: Bare metal tutorial (application, Greantea) May 7, 2020
@iriark01
Copy link
Contributor

Is this ready for review?

@LDong-Arm
Copy link
Contributor Author

Is this ready for review?

We're still working on it, will let you know, thanks!

@LDong-Arm LDong-Arm force-pushed the bare_metal_usage branch 2 times, most recently from a8d1668 to 3ae0b66 Compare May 11, 2020 11:34
@LDong-Arm
Copy link
Contributor Author

I’ve made some major changes:

  • Use the EventQueue example as a step-by-step example
  • Remove the existing baremetal_example.md - it requires nothing other than ["bare-metal"], bringing even less value than the EventQueue example in the guide in my opinion.
  • Leave the Greentea section in the porting guide rather than the application guide, because we cannot use the app's mbed_app.json and mbed-os/TESTS/configs/baremetal.json at the same time for now.
  • Explain that Greentea tests that fail due to memory limit should be ignored for now, as agreed with @evedon

@LDong-Arm
Copy link
Contributor Author

  • Perhaps mention the relationship between mbed_app.json and platform/bare_metal/mbed_lib.json when the bare metal profile is used. This is so users can have a look at (if they so wish) what is included.

@hugueskamba Well, platform/bare_metal/mbed_lib.json is

{
  "name": "bare-metal",
  "requires": ["platform", "drivers", "rtos-api"]
}

which doesn't provide much detail in my opinion. Now we have APIs with bare metal compatibilities listed here which I've linked in the guide.

@LDong-Arm LDong-Arm requested a review from iriark01 May 12, 2020 10:57
@LDong-Arm LDong-Arm requested review from evedon and hugueskamba May 12, 2020 10:57
@LDong-Arm
Copy link
Contributor Author

@iriark01 @evedon @hugueskamba I've addressed your comments, please review again.

@LDong-Arm LDong-Arm changed the title WIP: Bare metal tutorial (application, Greantea) Tutorial on creating a bare metal application May 12, 2020
region `FLASH' overflowed by 792 bytes
```

Please ignore tests with similar errors for now.
Copy link
Contributor

Choose a reason for hiding this comment

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

What does "for now" mean? Until later in the document? Later in the year?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll remove "for now" to avoid confusion.
(If we have worked around those errors sometime in the future, we will then remove this line in my opinion.)

called every 1 seconds
```

To exit the serial terminal, press Ctrl + C.
Copy link
Contributor

Choose a reason for hiding this comment

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

What if I don't get that output? What does it mean and what should I do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There can be different causes of not getting the expected output - issues with serial communication, target drivers, the application itself, etc. In my opinion it may not be feasible to have a troubleshooting guide wherever some output is quoted.

In https://os.mbed.com/docs/mbed-os/v5.15/tutorials/the-eventqueue-api.html for example, it just says "This is the output of the above program on an FRDM-K64F board." So I'll replace "You should get the following output" which seems to hint users they may or may not get it.

Copy link
Contributor Author

@LDong-Arm LDong-Arm left a comment

Choose a reason for hiding this comment

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

@iriark01 Thanks a lot for the detailed review and suggestions, I'll make an update soon.

region `FLASH' overflowed by 792 bytes
```

Please ignore tests with similar errors for now.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll remove "for now" to avoid confusion.
(If we have worked around those errors sometime in the future, we will then remove this line in my opinion.)

called every 1 seconds
```

To exit the serial terminal, press Ctrl + C.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There can be different causes of not getting the expected output - issues with serial communication, target drivers, the application itself, etc. In my opinion it may not be feasible to have a troubleshooting guide wherever some output is quoted.

In https://os.mbed.com/docs/mbed-os/v5.15/tutorials/the-eventqueue-api.html for example, it just says "This is the output of the above program on an FRDM-K64F board." So I'll replace "You should get the following output" which seems to hint users they may or may not get it.

@LDong-Arm LDong-Arm requested a review from iriark01 May 13, 2020 10:40
@LDong-Arm
Copy link
Contributor Author

@iriark01 Could you please review again

Copy link
Contributor

@evedon evedon left a comment

Choose a reason for hiding this comment

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

Good tutorial. I am fine with the content.

@LDong-Arm
Copy link
Contributor Author

@iriark01 We need a one-liner update to the list of APIs that support bare metal, may I do it in this PR?

@iriark01
Copy link
Contributor

Since this is a fork, I can't preview it on the docs site. I'm therefore going to merge for final checks. Please ping me if you want to change anything.

@iriark01 iriark01 merged commit 04bc942 into ARMmbed:development May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants