Skip to content

Commit a1c0840

Browse files
authored
Merge pull request #3227 from ARMmbed/release-candidate
Release candidate for mbed-os-5.2.2
2 parents e2617cc + 639bd4f commit a1c0840

File tree

616 files changed

+127193
-2240
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

616 files changed

+127193
-2240
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ script:
77
- python tools/test/pylint.py
88
- py.test tools/test/toolchains/api.py
99
- python tools/test/memap/memap_test.py
10+
- python tools/project.py -S
1011
- python tools/build_travis.py
1112
before_install:
1213
- sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded
@@ -16,9 +17,7 @@ before_install:
1617
- arm-none-eabi-gcc --version
1718
- python --version
1819
install:
19-
- sudo pip install colorama
20-
- sudo pip install prettytable
21-
- sudo pip install jinja2
20+
- sudo pip install -r requirements.txt
2221
- sudo pip install pytest
2322
- sudo pip install pylint
2423
- sudo pip install hypothesis

TESTS/mbed_drivers/lp_timeout/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void lp_timeout_500us(void)
118118

119119
}
120120

121-
status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
121+
utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
122122
greentea_case_failure_abort_handler(source, reason);
123123
return STATUS_CONTINUE;
124124
}
@@ -134,7 +134,7 @@ Case cases[] = {
134134
#endif /* DEVICE_SLEEP */
135135
};
136136

137-
status_t greentea_test_setup(const size_t number_of_cases) {
137+
utest::v1::status_t greentea_test_setup(const size_t number_of_cases) {
138138
GREENTEA_SETUP(20, "default_auto");
139139
return greentea_test_setup_handler(number_of_cases);
140140
}

TESTS/mbed_hal/lp_ticker/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void lp_ticker_5s(void)
133133
lp_ticker_delay_us(5000000, LONG_TIMEOUT);
134134
}
135135

136-
status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
136+
utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) {
137137
greentea_case_failure_abort_handler(source, reason);
138138
return STATUS_CONTINUE;
139139
}
@@ -149,7 +149,7 @@ Case cases[] = {
149149
#endif /* DEVICE_SLEEP */
150150
};
151151

152-
status_t greentea_test_setup(const size_t number_of_cases) {
152+
utest::v1::status_t greentea_test_setup(const size_t number_of_cases) {
153153
GREENTEA_SETUP(20, "default_auto");
154154
lp_ticker_data->interface->init();
155155
return greentea_test_setup_handler(number_of_cases);

TESTS/mbedmicro-mbed/cpp/main.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ class Test {
99
const int pattern;
1010

1111
public:
12-
Test(const char* _name) : name(_name), pattern(PATTERN_CHECK_VALUE) {
13-
print("init");
12+
Test(const char* _name, bool print_message=true) : name(_name), pattern(PATTERN_CHECK_VALUE) {
13+
if (print_message) {
14+
print("init");
15+
}
1416
}
1517

1618
void print(const char *message) {
@@ -39,7 +41,7 @@ class Test {
3941
};
4042

4143
/* Check C++ startup initialisation */
42-
Test s("Static");
44+
Test s("Static", false);
4345

4446
/* EXPECTED OUTPUT:
4547
*******************
@@ -59,6 +61,7 @@ int main (void) {
5961
bool result = true;
6062
for (;;)
6163
{
64+
s.print("init");
6265
// Global stack object simple test
6366
s.stack_test();
6467
if (s.check_init() == false)

TESTS/mbedmicro-rtos-mbed/threads/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#define STACK_SIZE 512
2626
#elif defined(TARGET_XDOT_L151CC)
2727
#define STACK_SIZE 1024
28+
#elif defined(TARGET_HI2110)
29+
#define STACK_SIZE 512
2830
#else
2931
#define STACK_SIZE DEFAULT_STACK_SIZE
3032
#endif

docs/exporters.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# About the exporters
2+
3+
The mbed exporters are used to export your code to various 3rd party tools and IDEs. Each exporter implements a `generate` function that produces an IDE specific project file. Exporters benefit from [mbed build tools](https://github.com/ARMmbed/mbed-os/blob/master/docs/BUILDING.md#build-mbed-sdk-library-from-sources). However, instead of using your source and [config data](https://github.com/ARMmbed/mbed-os/blob/master/docs/config_system.md) to create an executable, we use that information to populate an IDE project file that will be configured to build, flash, and debug your code. You can find exporter implementations [here](https://github.com/ARMmbed/mbed-os/tree/master/tools/export).
4+
5+
## mbed-cli command
6+
7+
`mbed export -m [target] -i [IDE]`
8+
9+
# Adding export support for a target
10+
11+
If you have added new target to the mbed SDK, exporting will allow users to transition from mbed source code to the offline development environment of their choice. This functionality activates the use of your device for larger number of users.
12+
13+
## Eclipse and Make
14+
15+
Eclipse project export utilizes a generated Makefile for building. Other than target configuration within the [config system](https://github.com/ARMmbed/mbed-os/blob/master/docs/mbed_targets.md) for mbed build system support, there is no additional work to provide Make export.
16+
17+
### Available mbed-cli commands
18+
19+
`mbed export -m [target] -i [make_gcc_arm, make_iar, make_armc5, eclipse_gcc_arm, eclipse_iar, eclipse_armc5]`
20+
21+
## UVision and IAR
22+
23+
### CMSIS Packs
24+
25+
UVision and IAR both utilize [CMSIS packs](http://www.keil.com/pack/doc/CMSIS/Pack/html/index.html) to find target information necessary to create a valid project file.
26+
27+
We utilize the tool [ArmPackManager](https://github.com/ARMmbed/mbed-os/tree/master/tools/arm_pack_manager) to scrape [MDK5 Software Packs](https://www.keil.com/dd2/Pack/) for target information. This is achieved by parsing [http://www.keil.com/pack/index.idx](http://sadevicepacksprod.blob.core.windows.net/idxfile/index.idx). The relevant information in the [PDSC (Pack Description)](http://www.keil.com/pack/doc/CMSIS/Pack/html/_pack_format.html) retrieved from each URL in the index is stored in [index.json](https://github.com/ARMmbed/mbed-os/blob/master/tools/arm_pack_manager/index.json). A `.pdsc` file typically describes a family of devices. Each device is uniquely identified by its [device name](https://github.com/ARMmbed/mbed-os/blob/master/docs/mbed_targets.md#device_name). Thus, this name makes a natural key to associate a device with its information in `index.json`.
28+
29+
#### What's in a device name?
30+
There is no reliable way to map an mbed alias like [NUCLEO_F030R8](https://github.com/ARMmbed/mbed-os/blob/master/targets/targets.json#L603) to its unique identifier, [STM32F030R8](https://github.com/ARMmbed/mbed-os/blob/master/targets/targets.json#L615), as it is listed in a CMSIS pack (and subsequently `index.json`). So, we added a [device name](https://github.com/ARMmbed/mbed-os/blob/master/docs/mbed_targets.md#device_name) field in `targets.json`. **This field is required for IAR or UVision exporter support**.
31+
32+
#### Code Usage
33+
http://www.keil.com/pack/Keil.Kinetis_K20_DFP.pdsc is the PDSC that contains TEENSY_31 device (MK20DX256xxx7). It has been parsed by ArmPackManager and stored in `index.json`. The device information begins on line 156:
34+
```xml
35+
<device Dname="MK20DX256xxx7">
36+
<processor Dfpu="0" Dmpu="0" Dendian="Little-endian" Dclock="72000000"/>
37+
<compile header="Device\Include\MK20D7.h" define="MK20DX256xxx7"/>
38+
<debug svd="SVD\MK20D7.svd"/>
39+
<memory id="IROM1" start="0x00000000" size="0x40000" startup="1" default="1"/>
40+
<memory id="IROM2" start="0x10000000" size="0x8000" startup="0" default="0"/>
41+
<memory id="IRAM1" start="0x20000000" size="0x8000" init ="0" default="1"/>
42+
<memory id="IRAM2" start="0x1FFF8000" size="0x8000" init ="0" default="0"/>
43+
<algorithm name="Flash\MK_P256.FLM" start="0x00000000" size="0x40000" default="1"/>
44+
<algorithm name="Flash\MK_D32_72MHZ.FLM" start="0x10000000" size="0x8000" default="1"/>
45+
<book name="Documents\K20P100M72SF1RM.pdf" title="MK20DX256xxx7 Reference Manual"/>
46+
<book name="Documents\K20P100M72SF1.pdf" title="MK20DX256xxx7 Data Sheet"/>
47+
</device>
48+
```
49+
50+
##### Uvision
51+
The dname (device name) field on line 156 directly corresponds to that in the Uvision5 IDE target selection window. [`tools/export/uvision/uvision.tmpl`](https://github.com/ARMmbed/mbed-os/blob/master/tools/export/uvision/uvision.tmpl#L15), uses target information from these packs is used to generate valid Uvision5 projects. If the device name is not found, we use a generic ARM CPU target in Uvision5.
52+
53+
##### IAR
54+
[`tools/export/iar/iar_definitions.json`](https://github.com/ARMmbed/mbed-os/blob/master/tools/export/iar/iar_definitions.json) utilizes this device name to store information necessary to set the target in an IAR project.
55+
56+
57+
58+
59+
60+

docs/mbed_targets.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,5 @@ The hook code can look quite different between different targets. Take a look at
164164

165165
This property is used to pass necessary data for exporting the mbed code to various 3rd party tools and IDEs.
166166

167-
This is possible because the device name corresponds to a field in publicly hosted CMSIS packs. These packs hold target properties. [This](http://www.keil.com/pack/Keil.Kinetis_K20_DFP.pdsc) is the pdsc that contains TEENSY_31 device (MK20DX256xxx7). The device information begins on line 156. The dname (device name) field on line 156 directly corresponds to that in the Uvision5 IDE target selection window. Beginning on line 15 of `tools/export/uvision/uvision.tmpl`, target information from these packs is used to generate valid Uvision5 projects. If the device name is not found, we use a generic ARM CPU target in Uvision5.
168-
`tools/export/iar/iar_definitions.json` utilizes this device name to store information necessary to set the target in an IAR project.
167+
Please see [exporters.md](exporters.md) for information about this field.
169168

docs/testing_mbed_OS_5.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ The full build process is:
7878

7979
When building an mbed application, the presence of a `mbed_app.json` file allows you to set or override different config settings from libraries and targets. However, because the tests share a common build, this can cause issues when tests have different configurations that affect the OS.
8080

81-
If you need to use app config, this must be set via the `--app-config` option when calling `mbed test`. **If this option is not specified, the build system will ignore all `mbed_app.json` files and use the default config values.**
81+
The build system will look for an `mbed_app.json` file in your shared project files (any directory not inside of a `TESTS` folder). If this is found, this configuration file will be used for both the non-test code as well as each test case inside your project's source tree. If there is more than one `mbed_app.json` files in the source tree, the config system will error.
82+
83+
If you need to test with multiple configurations, then you can use the `--app-config` option. This will override the search for an `mbed_app.json` file and use the config file you specify for the build.
8284

8385
### Running tests
8486

features/FEATURE_LWIP/lwip-interface/EthernetInterface.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,30 @@ EthernetInterface::EthernetInterface()
2424
{
2525
}
2626

27-
int EthernetInterface::set_network(const char *ip_address, const char *netmask, const char *gateway)
27+
nsapi_error_t EthernetInterface::set_network(const char *ip_address, const char *netmask, const char *gateway)
2828
{
2929
_dhcp = false;
3030
strncpy(_ip_address, ip_address ? ip_address : "", sizeof(_ip_address));
3131
strncpy(_netmask, netmask ? netmask : "", sizeof(_netmask));
3232
strncpy(_gateway, gateway ? gateway : "", sizeof(_gateway));
33-
return 0;
33+
return NSAPI_ERROR_OK;
3434
}
3535

36-
int EthernetInterface::set_dhcp(bool dhcp)
36+
nsapi_error_t EthernetInterface::set_dhcp(bool dhcp)
3737
{
3838
_dhcp = dhcp;
39-
return 0;
39+
return NSAPI_ERROR_OK;
4040
}
4141

42-
int EthernetInterface::connect()
42+
nsapi_error_t EthernetInterface::connect()
4343
{
4444
return mbed_lwip_bringup(_dhcp,
4545
_ip_address[0] ? _ip_address : 0,
4646
_netmask[0] ? _netmask : 0,
4747
_gateway[0] ? _gateway : 0);
4848
}
4949

50-
int EthernetInterface::disconnect()
50+
nsapi_error_t EthernetInterface::disconnect()
5151
{
5252
return mbed_lwip_bringdown();
5353
}
@@ -63,7 +63,7 @@ const char *EthernetInterface::get_ip_address()
6363
return _ip_address;
6464
}
6565

66-
return 0;
66+
return NULL;
6767
}
6868

6969
const char *EthernetInterface::get_netmask()

features/FEATURE_LWIP/lwip-interface/EthernetInterface.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ class EthernetInterface : public EthInterface
4646
* @param gateway Null-terminated representation of the local gateway
4747
* @return 0 on success, negative error code on failure
4848
*/
49-
virtual int set_network(const char *ip_address, const char *netmask, const char *gateway);
49+
virtual nsapi_error_t set_network(
50+
const char *ip_address, const char *netmask, const char *gateway);
5051

5152
/** Enable or disable DHCP on the network
5253
*
@@ -55,17 +56,17 @@ class EthernetInterface : public EthInterface
5556
* @param dhcp False to disable dhcp (defaults to enabled)
5657
* @return 0 on success, negative error code on failure
5758
*/
58-
virtual int set_dhcp(bool dhcp);
59+
virtual nsapi_error_t set_dhcp(bool dhcp);
5960

6061
/** Start the interface
6162
* @return 0 on success, negative on failure
6263
*/
63-
virtual int connect();
64+
virtual nsapi_error_t connect();
6465

6566
/** Stop the interface
6667
* @return 0 on success, negative on failure
6768
*/
68-
virtual int disconnect();
69+
virtual nsapi_error_t disconnect();
6970

7071
/** Get the local MAC address
7172
*

0 commit comments

Comments
 (0)