Skip to content

Commit 4f3f38d

Browse files
committed
Porting header fixes
1 parent 3edbe9c commit 4f3f38d

File tree

6 files changed

+46
-47
lines changed

6 files changed

+46
-47
lines changed

docs/porting/porting_full_process/built_in_tests.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ It's important to test your port at the end of each module porting, rather than
99

1010
Read the following page to understand how tests are structured:
1111

12-
# Prerequisites
12+
## Prerequisites
1313

14-
## Minimum HAL module support
14+
### Minimum HAL module support
1515

1616
To run the Mbed OS built-in tests, you need to have ported and verified at least these HAL modules:
1717

@@ -23,7 +23,7 @@ To run the Mbed OS built-in tests, you need to have ported and verified at least
2323
You'll also need to have ported DAPLink or compatible interface firmware to your interface chip.
2424
<span class="notes">If DAPLink is still under development, you can still [run tests manually](../porting/manual-testing.html).</span>
2525

26-
## mbedls
26+
### mbedls
2727

2828
The platform under test needs to be supported in mbedls for automated tests to work.
2929

@@ -47,7 +47,7 @@ If an updated mbedls pip package including support for your platform hasn't been
4747
4848
Where `"33000000e062afa300000000000000000000000097969902"` is the correct target id.
4949
50-
# Compiling and running tests
50+
## Compiling and running tests
5151
5252
1. Compile the tests:
5353
- To compile all tests, run `mbed test --compile`.
@@ -115,7 +115,7 @@ mbedgt: test case results: 12 OK
115115
mbedgt: completed in 20.24 sec
116116
```
117117
118-
# Manual testing
118+
## Manual testing
119119
120120
You may want to run tests manually, for example if DAPLink is still under development. You will need to export your tests from Greentea and import them to your IDE. For example:
121121
@@ -157,7 +157,7 @@ You may want to run tests manually, for example if DAPLink is still under develo
157157
Customize the serial port path and baudrate as needed.
158158
159159
160-
# Mbed OS built-in tests - detailed procedure
160+
## Mbed OS built-in tests - detailed procedure
161161
162162
Whether you're using Greentea or performing manual tests, the procedure for using the built-in Mbed OS tests is the same.
163163

docs/porting/porting_full_process/demo_testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ You can use two applications to test your port:
55
1. When you've ported GPIO (and all preceeding modules), use `mbed-os-example-blinky`.
66
1. When you've ported all mandatory modules, use `mbed-cloud-client-example` (the Device Management Client runs on top of Mbed OS, and you don't need to manually port it). This test includes a reference bootloader for firmware update testing.
77

8-
# mbed-os-example-blinky
8+
## mbed-os-example-blinky
99

1010
1. Application repository: [https://github.com/ARMmbed/mbed-os-example-blinky](https://github.com/ARMmbed/mbed-os-example-blinky).
1111
1. Import the repo, if you haven't done this already while porting:
@@ -30,7 +30,7 @@ You can use two applications to test your port:
3030
1. Verify the designated LED flashes every 0.5 second. You can use an oscilloscope for accurate measurement.
3131
3232
33-
# mbed-cloud-client-example
33+
## mbed-cloud-client-example
3434
3535
Start with building the bootloader, which you will need for the firmware update portion of this test:
3636

docs/porting/porting_full_process/integration-tests.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Mbed OS provides a set of integration tests to help you identify integration issues around storage devices and connectivity devices. If you're using a custom board, these tests can also help you verify your board works well in your environment.
44

5-
# Test suites
5+
## Test suites
66

77
| **Test suite** | **Description** |
88
| ------------- | ------------- |
@@ -12,36 +12,36 @@ Mbed OS provides a set of integration tests to help you identify integration iss
1212
| `net-multi` | Network multithreaded test for 1, 2 and 3 download threads with 1kb receive buffer size. |
1313
| `stress-net-fs` | Network and file system single and multithreaded tests:<ul><li>memory allocation - 10k, 20k, 40k, 60k</li><li>1 thread (sequential) - 1 download (1kb buffer), 1 file thread (1kb buffer)</li><li>2 parallel threads - 1 download, 1 file thread (1kb buffer)</li><li>3 parallel threads - 1 download, 2 file (256 bytes, 1 kb buffer)</li><li>4 parallel threads - 1 download, 3 file (1 byte, 256 bytes, 1kb buffer)</li></ul> |
1414

15-
# Execute tests
15+
## Execute tests
1616

1717
The integration test requires you to configure both the connectivity and storage devices.
1818

19-
If a platform has both of them enabled by default (in `targets.json`), then you can compile the tests and run them from inside the `mbed-os` directory:
19+
If a platform has both of them enabled by default (in `targets.json`), then you can compile the tests and run them from inside the `mbed-os` directory:
2020

2121
```
2222
$ mbed test -t <toolchain> -m <platform> -n *integration-* -DINTEGRATION_TESTS -v
2323
```
24-
24+
2525
If a board doesn't have default connectivity and storage, it requires an extra shield to run the integration test. In this case, you can pass a `target_extended.json` file in the command-line to configure the target:
2626

2727
```
2828
$ mbed test -t <toolchain> -m <platform> -n *integration-* -DINTEGRATION_TESTS --app-config TESTS\integration\COMMON\target_extended.json -v
2929
```
30-
30+
3131
A preconfiguration file is defined in the COMMON folder, and that file covers some of the platform connectivity and storage combinations. However, this preconfiguration file might contain some compoments drivers not included in `mbed-os` (for example, `WIFI_WIZFI310` and `NUSD`). You must add those drivers manually. If you have your own platform or want to define your own configuration, please follow the [configuration guide](#tests-configuration).
3232

33-
# Tests configuration
33+
## Tests configuration
3434

3535
If required, edit the `target_extended.json` file, and create a new entry under `target_overrides` with the target name for your device:
3636

3737
- **Connectivity** - Specify the default connectivity type for your target. It's essential with targets that lack default connectivity set in `targets.json` or for targets that support multiple connectivity options. For example:
38-
38+
3939
```
4040
"target.network-default-interface-type" : "ETHERNET",
4141
```
42-
42+
4343
The possible options are `ETHERNET`, `WIFI` and `CELLULAR`.
44-
44+
4545
Depending on connectivity type, you might have to specify more configuration options. For an example, please see the defined `CELLULAR` targets in `mbed_app.json`.
4646

4747
- **Storage** - Specify the storage block device type, which dynamically adds the block device driver you specified at compile time. For example:
@@ -53,13 +53,12 @@ If required, edit the `target_extended.json` file, and create a new entry under
5353
Valid options are `SD`, `SPIF` and `QSPIF`. For more available options, please see the [block device components](https://github.com/ARMmbed/mbed-os/tree/master/components/storage/blockdevice).
5454

5555
You also have to specify the block device pin configuration, which may vary from one block device type to another. Here's an example for `SD`:
56-
56+
5757
```
5858
"sd.SPI_MOSI" : "PE_6",
5959
"sd.SPI_MISO" : "PE_5",
6060
"sd.SPI_CLK" : "PE_2",
6161
"sd.SPI_CS" : "PE_4",
6262
```
63-
63+
6464
If you are using SPI or QSPI flash, please make sure you have specified the correct SPI frequency by configuring `spif-driver.SPI_FREQ`. If it is not configured, 40Mhz is applied by default.
65-

docs/porting/porting_full_process/porting.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Getting a working baseline
22

3-
# Create forks
3+
## Create forks
44

55
Please fork or branch the following repositories:
66

@@ -12,7 +12,7 @@ Please fork or branch the following repositories:
1212
- [Blinky](https://github.com/armmbed/mbed-os-example-blinky).
1313
- [Device Management Cloud Client example](https://github.com/armmbed/mbed-cloud-client-example).
1414

15-
# Get the Mbed OS source code
15+
## Get the Mbed OS source code
1616

1717
The following Mbed CLI commands retrieve and fork the `mbed-os-example-blinky` code, and redirect `mbed-os` to point to the newly forked `mbed-os` repository:
1818

@@ -37,7 +37,7 @@ git remote add upstream https://github.com/ARMmbed/mbed-os
3737
git checkout -b <branch_name>
3838
```
3939

40-
# Build the Blinky program for an existing target
40+
## Build the Blinky program for an existing target
4141

4242
To verify that you have a working fork, please build Blinky to a supported target:
4343

@@ -55,7 +55,7 @@ You now have a working baseline and are ready to add a new target.
5555

5656
# Adding a new target
5757

58-
# Add a new target to FlashAlgo
58+
## Add a new target to FlashAlgo
5959

6060
DAPlink requires FlashAlgo to program a target. You need to either write FlashAlgo source code yourself, or use the one provided with your MCU.
6161

@@ -76,7 +76,7 @@ Repo: [https://github.com/mbedmicro/flashalgo](https://github.com/mbedmicro/flas
7676

7777
1. In Keil MDK, open the project file for your target in `\projectfiles\uvision<target>`, and build it. The build directory of a successful build will have the files `c_blob.c` and `c_blob_mbed.c`; save both files. You will use them in the next step (`c_blob.c` in `flash_blob.c`, and `c_blob_mbed.c` in Flash API).
7878

79-
# Add your new target to DAPLink
79+
## Add your new target to DAPLink
8080

8181
<span class="notes">This step requires a Windows PC.</span>
8282

@@ -91,7 +91,7 @@ Repo: [https://github.com/armmbed/daplink](https://github.com/armmbed/daplink).
9191
- One PR against the DAPLink repository.
9292
- One PR against the FlashAlgo repository.
9393

94-
# Add your new target to pyOCD
94+
## Add your new target to pyOCD
9595

9696
To be able to debug your port:
9797

@@ -104,7 +104,7 @@ Wait for your target support to be merged into pyOCD's master branch and release
104104
# Setting up to debug Mbed OS programs
105105

106106

107-
# Update DAPLink interface firmware
107+
## Update DAPLink interface firmware
108108

109109
You need to update the new DAPLink interface firmware, which includes the new target support, on your interface MCU.
110110

@@ -118,7 +118,7 @@ To include the new target support:
118118
1. Plug the USB cable to the host.
119119
1. Drag-n-drop the interface firmware.
120120

121-
# Create GDB pyOCD debug configuration
121+
## Create GDB pyOCD debug configuration
122122

123123
1. Install pyOCD. You need the version with the new target support. If you contributed to PyOCD and an updated version hasn't been released yet, you can invoke the local copy:
124124

@@ -152,7 +152,7 @@ To include the new target support:
152152
153153
# Porting HAL modules
154154
155-
# Recommended porting order
155+
## Recommended porting order
156156
157157
Based on criticality and dependency of Mbed OS software stack, we recommend the following order:
158158
@@ -173,13 +173,13 @@ Based on criticality and dependency of Mbed OS software stack, we recommend the
173173
174174
Detailed instructions for porting each module are given in the module-specific sections of this documentation.
175175
176-
# Create the bare metal mbed-os-example-blinky
176+
## Create the bare metal mbed-os-example-blinky
177177
178178
The official `mbed-os-example-blinky` uses the RTOS, a DigitalOut object and timers. The bare metal version of the example doesn't rely on RTOS, GPIO and timers; LED toggling is done directly by accessing hardware registers. Modify the Blinky program you checked out earlier to not use the timer and DigitalOut object:
179179
180180
[![View code](https://www.mbed.com/embed/?url=https://github.com/ARMmbed/mbed-os-examples-docs_only/blob/master/Porting_process/Direct-Register-Blinky)](https://github.com/ARMmbed/mbed-os-examples-docs_only/blob/master/Porting_process/Direct-Register-Blinky/main.cpp)
181181
182-
# Bootstrap and entry point
182+
## Bootstrap and entry point
183183
184184
[Bootstrap porting instructions](../reference/bootstrap.html).
185185
@@ -215,13 +215,13 @@ mbed compile --target <target_name> --toolchain ARM
215215
mbed compile --target <target_name> --toolchain IAR
216216
```
217217
218-
# Serial Port (synchronous transfer)
218+
## Serial Port (synchronous transfer)
219219
220220
[Serial port porting instructions](../porting/serial-port.html).
221221
222222
Serial port porting can be done in two stages: synchronous UART and asynchronous UART. We recommend porting synchronous UART as early as possible, because the HAL Greentea tests require it, and because `printf()` is a powerful debugging tool.
223223
224-
# Low power ticker
224+
## Low power ticker
225225
226226
<span class="notes">**Note**: Low power ticker is mandatory for any platform that supports it.</span>
227227
@@ -235,39 +235,39 @@ When you finish porting low power ticker:
235235
The [Mbed OS doxygen describes LowPowerTicker tests](https://os.mbed.com/docs/latest/mbed-os-api-doxy/group__hal__lp__ticker__tests.html).
236236
237237
238-
# Microsecond Ticker
238+
## Microsecond Ticker
239239
240240
[Microsecond ticker porting instructions](../porting/microsecond-ticker.html).
241241
242242
When you finish porting the microsecond ticker, the `wait` API should work, and the intervals should be exact. You can verify this with `printf`.
243243
244-
# GPIO (write and read) and IRQ
244+
## GPIO (write and read) and IRQ
245245
246246
[GPIO porting instructions](../porting/gpio.html).
247247
248248
The vanilla Blinky program uses GPIO, which is a great tool for debugging with an oscilloscope or logic analyzer. It's a good idea to port GPIO before any other peripherals.
249249
250250
You can now try [using the normal Blinky application](../porting/testing-with-the-demo-applications.html).
251251
252-
# RTC
252+
## RTC
253253
254254
[RTC porting instructions](../porting/rtc-port.html).
255255
256256
RTC is a dependency of SPI (master) tests.
257257
258258
On some targets, RTC is shared with low power ticker and you can only use one of them. On these targets, you must use low power ticker instead of RTC.
259259
260-
# SPI (master)
260+
## SPI (master)
261261
262262
SPI (master) is used to communicate with storage devices that have an SPI interface, such as SD cards. The CI test shield supports an SD card as a slave device, so you can use it to test SPI (master) implementations on evaluation boards that don't have an SPI slave.
263263
264-
# TRNG
264+
## TRNG
265265
266266
[True random number generator entropy source (TRNG) porting instructions](../porting/entropy-sources.html).
267267
268268
If the hardware supports TRNG, you must port it before running Device Management Client, because the client uses TLS, which in turn requires an entropy source.
269269
270-
# Connectivity
270+
## Connectivity
271271
272272
[Porting instructions for all connectivity options](../porting/porting-connectivity.html).
273273
@@ -279,24 +279,24 @@ You can now try running the example applications for your connectivity methods.
279279
- [https://github.com/ARMmbed/mbed-os-example-cellular](https://github.com/ARMmbed/mbed-os-example-cellular).
280280
- [https://github.com/ARMmbed/mbed-os-example-sockets](https://github.com/ARMmbed/mbed-os-example-sockets).
281281
282-
# Flash
282+
## Flash
283283
284284
[Flash porting instructions](../porting/flash.html).
285285
286286
Flash drivers are required by Device Management Client.
287287
288288
There are two ways to implement flash API: using CMSIS flash algorithms or vanilla C source code. We recommend using vanilla C source code, because it's easier to maintain and upgrade. It's also more portable across different platforms.
289289
290-
# Bootloader
290+
## Bootloader
291291
292292
[Bootloader porting instructions](../porting/bootloader.html).
293293
294294
The bootloader is a separate application, which needs to be created and integrated into Device Management Client to allow firmware updates.
295295
296-
# Device Management Client
296+
## Device Management Client
297297
298298
You do not need to manually port Device Management Client; when the above modules are ported, you should be ready to [demo the Connect and Update functionalities of the Device Management Client](https://cloud.mbed.com/guides/connect-device-to-pelion).
299299
300-
# Other HAL modules (Optional)
300+
## Other HAL modules (Optional)
301301
302302
You are now ready to port any other HAL modules that your use case and MCU require. These modules are covered in the rest of this document, with the exception of [Mbed Cordio, which has its own porting documentation](https://os.mbed.com/docs/mbed-cordio/latest/porting-pal/index.html).

docs/porting/porting_full_process/porting_reqs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Setting up
22

3-
# Hardware setup
3+
## Hardware setup
44

55
Porting Mbed OS requires the following hardware:
66

@@ -23,14 +23,14 @@ The following items might help you test SPI, I2C and pins:
2323

2424
<span class="tips">Check the user guide of the evaluation board to see if anything needs to be done prior to using a debug probe and running Mbed OS programs.</span>
2525

26-
# Software setup
26+
## Software setup
2727

2828
Please install the following:
2929

3030
- [Python](https://www.python.org/downloads).
3131
- [Git](https://git-scm.com/downloads).
3232
- [Mbed CLI](../tools/installation-and-setup.html).
33-
- Choose an IDE and debugger. The three commonly used IDEs are [Eclipse](https://www.eclipse.org/ide/), [IAR Embedded Workbench](https://www.iar.com/iar-embedded-workbench/) and [Keil MDK](http://www.keil.com/).
33+
- Choose an IDE and debugger. The three commonly used IDEs are [Eclipse](https://www.eclipse.org/ide/), [IAR Embedded Workbench](https://www.iar.com/iar-embedded-workbench/) and [Keil MDK](http://www.keil.com/).
3434

3535
Limitations:
3636

docs/porting/porting_full_process/porting_start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This document provides guidelines for adding a new MCU target to Mbed OS and the
88

99
These guidelines use pyOCD, our debugger, and DAPLink, our interface firmware, in the porting process because they are free and open source. Please note that you can use other debuggers and interface firmware, but that is outside the scope of this document.
1010

11-
# Scope and milestones
11+
## Scope and milestones
1212

1313
You will usually need to go through all of these steps to port Mbed OS:
1414

0 commit comments

Comments
 (0)