Skip to content

Feedback on porting guide #857

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 20 commits into from
Dec 13, 2018

Conversation

bridadan
Copy link
Contributor

I've included quite a bit of comments and corrections here. This PR isn't intended to be merged as is, its more like a starting point of feedback that can be referenced.

I only covered the "Porting process" section in the porting guide. The guide is quite extensive and has lots of potential!

@iriark01 iriark01 requested a review from donatieng November 29, 2018 14:02
@iriark01
Copy link
Contributor

Adding Don, as it'll be easier if everything's in the same PR rather than clashing ones.

@@ -31,7 +31,7 @@ The following items might help you test SPI, I2C and Pins:

Please install the following:

- [Python 2.7](https://www.python.org/downloads/release/python-2715/).
- [Python](https://www.python.org/downloads).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Context: tools should work with Python 3 now as well and Python 2.7.x will be unsupported in 2020


- A storage device (SD or external flash).
- A micro SD card for the CI test shield.<!--are these the same thing?-->

- A micro USB cable to connect the evaluation board to your development PC.
- A USB cable to connect the evaluation board to your development PC.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Context: may not necessarily be a micro usb cable. Just a bit too specific

vi mbed-os.lib
mbed deploy
mbed compile --target <new_target> --toolchain GCC_ARM
mbed compile -m <new_target> -t gcc_arm
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Context: Trying to keep the arguments to Mbed CLI consistent with the other guides.

@@ -211,6 +227,7 @@ mbed compile --target <target_name> --toolchain IAR
```

Tweak your code until your build succeeds.
<!-- Little bit hand-wavy here. We should give common failure modes (and solutions) here, an email for folks to contact us (if we want to), or just leave this out -->
Copy link
Contributor

Choose a reason for hiding this comment

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

I just merged a PR from @SenRamakri that deleted this line.

@AnotherButler
Copy link
Contributor

@aashishc1988 Could you please review and coordinate with @bridadan ?

Copy link
Contributor

@donatieng donatieng left a comment

Choose a reason for hiding this comment

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

I feel that this doc really need some re-organisation. It's not clear to me here:

  • What's the goal
  • What are the high-level steps
  • Are we trying to cover getting something to sort of work, or reliably? Some sections of the doc mention running tests, other mention trying out examples instead
  • How do we go faster if we're deriving from an existing platform?
  • What are the success criteria? Definition of Done?

As a side-note some of these instructions are quite rigid in terms of which tools to use (pyOCD, Eclipse, etc) although the porter might prefer to use other tools.

@@ -32,7 +32,7 @@ To run the Mbed OS built-in tests, you need to have ported and verified at least

Copy link
Contributor

Choose a reason for hiding this comment

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

Above: these shouldn't be called components; maybe HAL modules or platform prerequisites

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Done

@@ -32,7 +32,7 @@ To run the Mbed OS built-in tests, you need to have ported and verified at least

- DAPLink.
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK, DAPLink itself is not required as we also support STLink etc?

Copy link
Contributor

Choose a reason for hiding this comment

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

DAPLink or compatible interface firmware.

@@ -32,7 +32,7 @@ To run the Mbed OS built-in tests, you need to have ported and verified at least

- DAPLink.

<span class="notes">If DAPLink is still under development, please [use manual tests](#manual-testing).</span>
<span class="notes">If DAPLink is still under development, please [use manual tests](#manual-testing)<!-- This link doesn't work -->.</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

What feature in DAPLink do I need? What are "manual tests" (we need to flash the board manually but that's not clear here)

Copy link
Contributor

@AnotherButler AnotherButler Dec 3, 2018

Choose a reason for hiding this comment

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

For testing, you need mass storage device and serial.

If your hardware/software isn't far enough to support automated testing, you'll use manual testing. In that case, you'll use the IDE (use the debugger to flash).

@@ -48,10 +48,11 @@ The board under test needs to be supported in mbedls for automated tests to work
If the official mbedls pip package hasn't been released yet, you need to direct pip to use your local directory (which includes the code changes to support the new board):
Copy link
Contributor

Choose a reason for hiding this comment

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

--> If an updated mbedls pip package...

Copy link
Contributor

Choose a reason for hiding this comment

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

Done 👍

@@ -61,17 +62,20 @@ If the official mbedls pip package hasn't been released yet, you need to direct
}
```

Where `"33000000e062afa300000000000000000000000097969902"` is the correct target id.

### Compiling and running tests

1. Compile your tests:
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests are not yours :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Done 👍

@@ -134,17 +138,16 @@ You may want to run manual tests, for example if DAPLink is still under developm
1. Find the test directory:
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, what does manual testing mean

@@ -158,8 +161,11 @@ You may want to run manual tests, for example if DAPLink is still under developm
```
mbed export -i gcc_arm -m <new_target>
```

<!-- gcc_arm is not a valid exporter. A list of valid exporters are here: https://github.com/ARMmbed/mbed-os/blob/master/tools/export/__init__.py#L36-L60 -->
<!-- If this is actually meant to use Eclipse, a valid eclipse exporter needs to be used (and ensure that the exporter is working before committing it to the docs) -->
1. Open the project with pyOCD (using the same configuration you used [when you initially set up pyOCD]( Creating GDB pyOCD debug configuration).
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 my target is not supported by pyOCD?

Copy link
Contributor

Choose a reason for hiding this comment

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

Configure your IDE and/or debugger to program your device [only for manual tests/examples]
Note: Update throughout doc to show pyOCD is not required

```
mbed test --compile -m <new_target> -t gcc_arm -c
mbed test -m <new_target> -t gcc_arm --compile -c
```

You'll see some build errors. These errors should reduce and eventually disappear as more HAL components are ported.
Copy link
Contributor

Choose a reason for hiding this comment

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

This sends the wrong message. Should be rephrased as: If you see some build errors, it means that some HAL modules required to run the tests are missing and need porting.

Copy link
Contributor

Choose a reason for hiding this comment

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

Done 👍

```

In this example:

- The `common_tickers` test image is at `mbed-os-example-blinky/BUILD/tests/<new_target>/gcc_arm/mbed-os/TESTS/mbed_hal/common_tickers`.
- The `common_tickers_freq` test image is at `mbed-os-example-blinky/BUILD/tests/<new_target>/gcc_arm/mbed-os/TESTS/mbed_hal/common_tickers_freq.`

1. You need to flash the test image to the board. You can use either DAPLink or Eclipe IDE. You may also be able to use IAR and Keil (if they already support the new target).
1. You need to flash the test image to the board. You can use either pyOCD or the Eclipe IDE. You may also be able to use IAR and Keil (if they already support the new target).
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, we probably support other methods? And Eclipse is an IDE so don't get why it's an option. On the other hand, Open-OCD, J-Link software, or even uVision and EW Workbench (as they provide this functionality under the hood) are options.

Copy link
Contributor

Choose a reason for hiding this comment

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

"You need to flash the test image to the board."

Consider moving paragraph toward top of guide, as flashing test image is important to concept.


The easiest method is using the pyOCD flash tool:

```
pyocd-flashtool BUILD/mbed-os-example-blinky.bin or
pyocd-flashtool BUILD/mbed-os-example-blinky.hex
pyocd-flashtool BUILD/mbed-os-example-blinky.bin # Use the .hex file if appropriate
Copy link
Contributor

Choose a reason for hiding this comment

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

... if you're using pyOCD

@AnotherButler
Copy link
Contributor

@bridadan @linlingao Do y'all have time this afternoon to sit with me to resolve the comments from @donatieng ?

@AnotherButler
Copy link
Contributor

@donatieng I've added clarification that this document shows how to port a new MCU target with pyOCD and DAPLink. Porting instructions for existing targets and other methods can come in another document after 5.11.

@iriark01
Copy link
Contributor

iriark01 commented Dec 6, 2018

@donatieng and @bridadan I think it's best to close this PR and start a fresh review - everything here is out of date.
Any chance we can finish this today?

@bridadan
Copy link
Contributor Author

bridadan commented Dec 6, 2018

@iriark01 @AnotherButler I can resolve the conflicts with a rebase if you like. Once I do that would you like me to go over the changes one last time?

@iriark01
Copy link
Contributor

iriark01 commented Dec 6, 2018

Yes please

1 similar comment
@iriark01
Copy link
Contributor

iriark01 commented Dec 6, 2018

Yes please

@donatieng
Copy link
Contributor

Cool, give me a ping when it's ready for re-review!

bridadan and others added 10 commits December 6, 2018 10:45
Add note about using debuggers.
Address comments to fix phrasing and for product positioning.
Update wording for precise language to avoid confusion.
Add content about how to know you're finished, remove pyOCD as a requirement and fix phrasing for consistent language.
Update wording to show you don't have to use pyOCD and DAPLink.
Fix phrasing.
Fix file to remove incorrect dependencies.
Add DAPLink content back in.
Clarify that this documentation uses pyOCD and DAPLink.
@bridadan bridadan force-pushed the porting_guide_feedback branch from 23b3a84 to 72d6840 Compare December 6, 2018 16:51
@bridadan
Copy link
Contributor Author

bridadan commented Dec 6, 2018

Ok rebased!

Amanda Butler added 2 commits December 6, 2018 15:04
Replace link to personal repo with transcluded example in public repo.
Amanda Butler added 4 commits December 6, 2018 15:07
Revert changes incorrectly changed during rebase.
Address remaining comments.
@AnotherButler
Copy link
Contributor

ping @donatieng Ready for rereview

Amanda Butler added 4 commits December 12, 2018 06:29
Add comments from engineering.
Add changes from engineering.
Add comments from engineering.
Add changes from engineering.
@iriark01
Copy link
Contributor

@donatieng and @AnotherButler I'm merging this so I can make the 5.11 branch for testing; please finish your edits on 5.11 this week and then, at your leisure, copy them to development.

@iriark01 iriark01 merged commit 2214c95 into ARMmbed:development Dec 13, 2018
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