2018-01-08 15:19:48 +00:00
|
|
|
# Cortex-M3 Design Start Eval package example on MPS2+ board
|
|
|
|
|
2018-03-10 01:06:39 +00:00
|
|
|
This folder includes the port of Mbed OS on the example system of the Cortex-M3
|
2018-01-08 15:19:48 +00:00
|
|
|
Design Start Eval package. This example is implemented in FPGA on the MPS2+
|
2018-03-10 01:06:39 +00:00
|
|
|
board. Please see this target's [Mbed page](https://os.mbed.com/platforms/ARM-CM3DS/)
|
|
|
|
for more information.
|
2018-01-08 15:19:48 +00:00
|
|
|
For convenience, this target is called **CM3DS**.
|
|
|
|
|
2018-03-01 01:48:36 +00:00
|
|
|
## Compiling
|
2018-01-08 15:19:48 +00:00
|
|
|
|
2018-03-10 01:06:39 +00:00
|
|
|
The target name is `ARM_CM3DS_MPS2`. You can compile Mbed OS
|
2018-01-08 15:19:48 +00:00
|
|
|
projects for CM3DS with:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
mbed compile -t COMPILER -m ARM_CM3DS_MPS2
|
|
|
|
```
|
|
|
|
|
2018-03-10 01:06:39 +00:00
|
|
|
Mbed OS supports the following compilers (replace `COMPILER` with):
|
2018-01-08 15:19:48 +00:00
|
|
|
|
2018-03-01 01:48:36 +00:00
|
|
|
* `ARM` for Arm Compiler version 5.
|
|
|
|
* `GCC_ARM` for GNU Compiler for Arm.
|
|
|
|
* `IAR` for IAR compiler.
|
2018-01-08 15:19:48 +00:00
|
|
|
|
2018-03-01 01:48:36 +00:00
|
|
|
## Running
|
2018-01-08 15:19:48 +00:00
|
|
|
|
|
|
|
Because of the new memory configuration introduced in commit `CM3DS: switch to
|
2018-03-01 01:48:36 +00:00
|
|
|
larger memories for code and data`, it
|
2018-03-10 01:06:39 +00:00
|
|
|
has become easier (and portable among all compilers) to use `.elf` files
|
|
|
|
instead of `.bin`. `.elf` files are now the default for CM3DS projects, and compilation
|
|
|
|
generates only them.
|
2018-03-01 01:48:36 +00:00
|
|
|
For `.elf` files to work, you need **at least version 2.2.5** of the MPS2+
|
|
|
|
firmware. For more information, please see the [firmware version 2.2.6 and instructions on how to put it
|
|
|
|
in the MPS2+ board](https://community.arm.com/processors/designstart/f/discussions/9727/mps2-firmware-for-mbed).
|
2018-01-08 15:19:48 +00:00
|
|
|
|
2018-03-01 01:48:36 +00:00
|
|
|
## Testing
|
2018-01-08 15:19:48 +00:00
|
|
|
|
2018-03-01 01:48:36 +00:00
|
|
|
If you want to execute the Mbed OS greentea tests on CM3DS, you need
|
2018-01-08 15:19:48 +00:00
|
|
|
**at least firmware version 2.2.6**.
|
|
|
|
|
|
|
|
* `mbedls` does not automatically recognize which serial port is linked to the
|
2018-03-01 01:48:36 +00:00
|
|
|
board. Check it manually, and create a file named `mbedls.json` containing
|
2018-01-08 15:19:48 +00:00
|
|
|
(at the same level than where you execute all commands):
|
2018-03-10 01:06:39 +00:00
|
|
|
|
2018-01-08 15:19:48 +00:00
|
|
|
```bash
|
|
|
|
{
|
|
|
|
"50040200074D652F3828F333": {
|
|
|
|
"serial_port": "/dev/ttyUSB0"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
2018-03-10 01:06:39 +00:00
|
|
|
|
2018-01-08 15:19:48 +00:00
|
|
|
Replace `/dev/ttyUSB0` with your correct serial port
|
|
|
|
(something like `COM6` on Windows).
|
|
|
|
|
2018-03-01 01:48:36 +00:00
|
|
|
* `mbedls` does not link CM3DS target ID with its name, so execute the command:
|
2018-03-10 01:06:39 +00:00
|
|
|
|
2018-01-08 15:19:48 +00:00
|
|
|
```bash
|
|
|
|
mbedls --mock 5004:ARM_CM3DS_MPS2
|
|
|
|
```
|
|
|
|
|
2018-03-10 01:06:39 +00:00
|
|
|
* You can now compile and run the tests:
|
|
|
|
|
2018-01-08 15:19:48 +00:00
|
|
|
```bash
|
|
|
|
mbed test -m ARM_CM3DS_MPS2 -t COMPILER
|
|
|
|
```
|