Skip to content

Commit 47b164b

Browse files
committed
Merge remote-tracking branch 'ARMmbed/master'
2 parents 9101ea4 + 29cfee4 commit 47b164b

File tree

151 files changed

+2485
-10564
lines changed

Some content is hidden

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

151 files changed

+2485
-10564
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ script:
55
- make -C events/equeue test clean
66
- PYTHONPATH=. python tools/test/config_test/config_test.py
77
- PYTHONPATH=. python tools/test/build_api/build_api_test.py
8+
- PYTHONPATH=. python tools/test/targets/target_test.py
89
- python tools/test/pylint.py
910
- py.test tools/test/toolchains/api.py
1011
- python tools/test/memap/memap_test.py

docs/build_profiles.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Build Profiles
2-
Mbed 5.0 supports three primary build profiles, *default*, *debug* and *small*. When using
3-
the online compiler the *default* profile is used. When building from the command line
2+
Mbed 5.0 supports three primary build profiles, *develop*, *debug* and *release*. When using
3+
the online compiler the *develop* profile is used. When building from the command line
44
the desired profile can be can be selected by adding the ```--profile <profile>```
5-
command line flag. Custom user defined profiles can also be specific by giving the path
5+
command line flag, but `develop` will be used by default. Custom user defined profiles can also be specific by giving the path
66
the the profile.
77

8-
## Default profile
8+
## Develop profile
99
* Small and fast code
1010
* Full error information - e.g. asserts have filename and line number
1111
* Hard to follow code flow when using a debugger
@@ -15,7 +15,7 @@ the the profile.
1515
* Full error information - e.g. asserts have filename and line number
1616
* Largest and slowest profile
1717

18-
## Small profile
18+
## Release profile
1919
* Smallest profile and still fast
2020
* Minimal error information
2121
* Chip is put to sleep when going idle:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#include "stm32f7xx_hal.h"
2+
3+
/**
4+
* Override HAL Eth Init function
5+
*/
6+
void HAL_ETH_MspInit(ETH_HandleTypeDef* heth)
7+
{
8+
GPIO_InitTypeDef GPIO_InitStructure;
9+
if (heth->Instance == ETH) {
10+
/* Disable DCache for STM32F7 family */
11+
SCB_DisableDCache();
12+
13+
/* Enable GPIOs clocks */
14+
__HAL_RCC_GPIOA_CLK_ENABLE();
15+
__HAL_RCC_GPIOB_CLK_ENABLE();
16+
__HAL_RCC_GPIOC_CLK_ENABLE();
17+
__HAL_RCC_GPIOG_CLK_ENABLE();
18+
19+
/** ETH GPIO Configuration
20+
RMII_REF_CLK ----------------------> PA1
21+
RMII_MDIO -------------------------> PA2
22+
RMII_MDC --------------------------> PC1
23+
RMII_MII_CRS_DV -------------------> PA7
24+
RMII_MII_RXD0 ---------------------> PC4
25+
RMII_MII_RXD1 ---------------------> PC5
26+
RMII_MII_RXER ---------------------> PG2
27+
RMII_MII_TX_EN --------------------> PG11
28+
RMII_MII_TXD0 ---------------------> PG13
29+
RMII_MII_TXD1 ---------------------> PB13
30+
*/
31+
/* Configure PA1, PA2 and PA7 */
32+
GPIO_InitStructure.Speed = GPIO_SPEED_HIGH;
33+
GPIO_InitStructure.Mode = GPIO_MODE_AF_PP;
34+
GPIO_InitStructure.Pull = GPIO_NOPULL;
35+
GPIO_InitStructure.Alternate = GPIO_AF11_ETH;
36+
GPIO_InitStructure.Pin = GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_7;
37+
HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
38+
39+
/* Configure PB13 */
40+
GPIO_InitStructure.Pin = GPIO_PIN_13;
41+
HAL_GPIO_Init(GPIOB, &GPIO_InitStructure);
42+
43+
/* Configure PC1, PC4 and PC5 */
44+
GPIO_InitStructure.Pin = GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5;
45+
HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);
46+
47+
/* Configure PG2, PG11 and PG13 */
48+
GPIO_InitStructure.Pin = GPIO_PIN_2 | GPIO_PIN_11 | GPIO_PIN_13;
49+
HAL_GPIO_Init(GPIOG, &GPIO_InitStructure);
50+
51+
/* Enable the Ethernet global Interrupt */
52+
HAL_NVIC_SetPriority(ETH_IRQn, 0x7, 0);
53+
HAL_NVIC_EnableIRQ(ETH_IRQn);
54+
55+
/* Enable ETHERNET clock */
56+
__HAL_RCC_ETH_CLK_ENABLE();
57+
}
58+
}
59+
60+
/**
61+
* Override HAL Eth DeInit function
62+
*/
63+
void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
64+
{
65+
if (heth->Instance == ETH) {
66+
/* Peripheral clock disable */
67+
__HAL_RCC_ETH_CLK_DISABLE();
68+
69+
/** ETH GPIO Configuration
70+
RMII_REF_CLK ----------------------> PA1
71+
RMII_MDIO -------------------------> PA2
72+
RMII_MDC --------------------------> PC1
73+
RMII_MII_CRS_DV -------------------> PA7
74+
RMII_MII_RXD0 ---------------------> PC4
75+
RMII_MII_RXD1 ---------------------> PC5
76+
RMII_MII_RXER ---------------------> PG2
77+
RMII_MII_TX_EN --------------------> PG11
78+
RMII_MII_TXD0 ---------------------> PG13
79+
RMII_MII_TXD1 ---------------------> PB13
80+
*/
81+
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_7);
82+
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_13);
83+
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5);
84+
HAL_GPIO_DeInit(GPIOG, GPIO_PIN_2 | GPIO_PIN_11 | GPIO_PIN_13);
85+
86+
/* Disable the Ethernet global Interrupt */
87+
NVIC_DisableIRQ(ETH_IRQn);
88+
}
89+
}

features/unsupported/USBDevice/USBAudio/USBAudio.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ bool USBAudio::readWrite(uint8_t * buf_read, uint8_t * buf_write) {
8585
SOF_handler = false;
8686
writeIN = false;
8787
if (interruptIN) {
88-
USBDevice::writeNB(EP3IN, buf_write, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
88+
USBDevice::writeNB(EPISO_IN, buf_write, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
8989
} else {
9090
buf_stream_out = buf_write;
9191
}
@@ -102,7 +102,7 @@ bool USBAudio::write(uint8_t * buf) {
102102
writeIN = false;
103103
SOF_handler = false;
104104
if (interruptIN) {
105-
USBDevice::writeNB(EP3IN, buf, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
105+
USBDevice::writeNB(EPISO_IN, buf, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
106106
} else {
107107
buf_stream_out = buf;
108108
}
@@ -115,13 +115,13 @@ bool USBAudio::write(uint8_t * buf) {
115115

116116
void USBAudio::writeSync(uint8_t *buf)
117117
{
118-
USBDevice::writeNB(EP3IN, buf, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
118+
USBDevice::writeNB(EPISO_IN, buf, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
119119
}
120120

121121
uint32_t USBAudio::readSync(uint8_t *buf)
122122
{
123123
uint32_t size = 0;
124-
USBDevice::readEP(EP3OUT, (uint8_t *)buf, &size, PACKET_SIZE_ISO_IN);
124+
USBDevice::readEP(EPISO_OUT, (uint8_t *)buf, &size, PACKET_SIZE_ISO_IN);
125125
return size;
126126
}
127127

@@ -134,15 +134,15 @@ bool USBAudio::EPISO_OUT_callback() {
134134
uint32_t size = 0;
135135
interruptOUT = true;
136136
if (buf_stream_in != NULL) {
137-
readEP(EP3OUT, (uint8_t *)buf_stream_in, &size, PACKET_SIZE_ISO_IN);
137+
readEP(EPISO_OUT, (uint8_t *)buf_stream_in, &size, PACKET_SIZE_ISO_IN);
138138
available = true;
139139
buf_stream_in = NULL;
140140
}
141141
else {
142142
if (rxDone)
143143
rxDone.call();
144144
}
145-
readStart(EP3OUT, PACKET_SIZE_ISO_IN);
145+
readStart(EPISO_OUT, PACKET_SIZE_ISO_IN);
146146
return false;
147147
}
148148

@@ -164,10 +164,10 @@ void USBAudio::SOF(int frameNumber) {
164164
if (!interruptOUT) {
165165
// read the isochronous endpoint
166166
if (buf_stream_in != NULL) {
167-
if (USBDevice::readEP_NB(EP3OUT, (uint8_t *)buf_stream_in, &size, PACKET_SIZE_ISO_IN)) {
167+
if (USBDevice::readEP_NB(EPISO_OUT, (uint8_t *)buf_stream_in, &size, PACKET_SIZE_ISO_IN)) {
168168
if (size) {
169169
available = true;
170-
readStart(EP3OUT, PACKET_SIZE_ISO_IN);
170+
readStart(EPISO_OUT, PACKET_SIZE_ISO_IN);
171171
buf_stream_in = NULL;
172172
}
173173
}
@@ -177,7 +177,7 @@ void USBAudio::SOF(int frameNumber) {
177177
if (!interruptIN) {
178178
// write if needed
179179
if (buf_stream_out != NULL) {
180-
USBDevice::writeNB(EP3IN, (uint8_t *)buf_stream_out, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
180+
USBDevice::writeNB(EPISO_IN, (uint8_t *)buf_stream_out, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
181181
buf_stream_out = NULL;
182182
}
183183
}
@@ -194,11 +194,11 @@ bool USBAudio::USBCallback_setConfiguration(uint8_t configuration) {
194194
}
195195

196196
// Configure isochronous endpoint
197-
realiseEndpoint(EP3OUT, PACKET_SIZE_ISO_IN, ISOCHRONOUS);
198-
realiseEndpoint(EP3IN, PACKET_SIZE_ISO_OUT, ISOCHRONOUS);
197+
realiseEndpoint(EPISO_OUT, PACKET_SIZE_ISO_IN, ISOCHRONOUS);
198+
realiseEndpoint(EPISO_IN, PACKET_SIZE_ISO_OUT, ISOCHRONOUS);
199199

200200
// activate readings on this endpoint
201-
readStart(EP3OUT, PACKET_SIZE_ISO_IN);
201+
readStart(EPISO_OUT, PACKET_SIZE_ISO_IN);
202202
return true;
203203
}
204204

features/unsupported/USBDevice/USBDevice/TARGET_STM/USBHAL_STM32.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@
1515
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1616
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1717
*/
18-
#if (defined (USB_STM_HAL) && defined(TARGET_STM32F4)) \
19-
|| defined(TARGET_STM32F2) || defined (TARGET_STM32F7) || defined (TARGET_STM32F3) || defined (TARGET_STM32L4)
18+
/* TARGET NOT STM does not support this HAL */
19+
#ifndef TARGET_STM
20+
#define USBSTM_HAL_UNSUPPORTED
21+
#endif
22+
/* F4 famlily wihtout USB_STM_HAL use another HAL*/
23+
#if defined(TARGET_STM) && defined(TARGET_STM32F4) && !defined(USB_STM_HAL)
24+
#define USBSTM_HAL_UNSUPPORTED
25+
#endif
2026

27+
#ifndef USBSTM_HAL_UNSUPPORTED
2128
#include "USBHAL.h"
2229
#include "pinmap.h"
2330
/* mbed endpoint definition to hal definition */

features/unsupported/USBDevice/USBDevice/USBEndpoints.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ typedef enum {
4545
#include "USBEndpoints_KL25Z.h"
4646
#elif !defined(USB_STM_HAL) && defined(TARGET_STM32F4)
4747
#include "USBEndpoints_STM32F4.h"
48-
#elif defined (TARGET_STM32F4) || defined (TARGET_STM32F2) || defined (TARGET_STM32F7) || defined (TARGET_STM32F3) || defined(TARGET_STM32L4)
48+
#elif defined (TARGET_STM32F4) || defined (TARGET_STM32F2) || defined (TARGET_STM32F7) || defined (TARGET_STM32F3) || defined(TARGET_STM32L4) || defined(TARGET_STM32F1)
4949
#include "USBEndpoints_STM32.h"
5050
#elif defined (TARGET_RZ_A1H) || defined (TARGET_VK_RZ_A1H)
5151
#include "USBEndpoints_RZ_A1H.h"

features/unsupported/USBDevice/USBDevice/USBHAL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class USBHAL {
130130
bool (USBHAL::*epCallback[10 - 2])(void);
131131
#elif (defined(TARGET_STM32F4) && !defined(USB_STM_HAL)) || defined(TARGET_NUMAKER_PFM_M453)
132132
bool (USBHAL::*epCallback[8 - 2])(void);
133-
#elif defined(TARGET_STM32F4) || defined(TARGET_STM32F3) || defined (TARGET_STM32F2)|| defined(TARGET_STM32L4) || defined(TARGET_STM32F7)
133+
#elif defined(TARGET_STM)
134134
PCD_HandleTypeDef hpcd;
135135
#elif defined(TARGET_NUMAKER_PFM_NUC472)
136136
bool (USBHAL::*epCallback[14 - 2])(void);

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/device/TOOLCHAIN_GCC_ARM/MK64FN1M0xxx12.ld

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,15 @@ ENTRY(Reset_Handler)
5353

5454
__ram_vector_table__ = 1;
5555

56-
/* Heap 1/4 of ram and stack 1/8 */
57-
__stack_size__ = 0x8000;
58-
__heap_size__ = 0x10000;
56+
/* With the RTOS in use, this does not affect the main stack size. The size of
57+
* the stack where main runs is determined via the RTOS. */
58+
__stack_size__ = 0x400;
59+
60+
/* This is the guaranteed minimum available heap size for an application. When
61+
* uVisor is enabled, this is also the maximum available heap size. The
62+
* HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
63+
* heap and the page heap in uVisor applications. */
64+
__heap_size__ = 0x6000;
5965

6066
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
6167
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;

targets/TARGET_NXP/TARGET_LPC82X/TARGET_LPC824/device/TOOLCHAIN_GCC_CR/startup_LPC824_CR.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
//*****************************************************************************
3131

3232
#if defined (__cplusplus)
33-
#ifdef __REDLIB__
34-
#error Redlib does not support C++
35-
#else
3633
//*****************************************************************************
3734
//
3835
// The entry point for the C++ library startup
@@ -42,7 +39,6 @@ extern "C" {
4239
extern void __libc_init_array(void);
4340
}
4441
#endif
45-
#endif
4642

4743
#define WEAK __attribute__ ((weak))
4844
#define ALIAS(f) __attribute__ ((weak, alias (#f)))
@@ -53,10 +49,8 @@ extern "C" {
5349
#endif
5450

5551
//*****************************************************************************
56-
#if defined (__USE_CMSIS) || defined (__USE_LPCOPEN)
5752
// Declaration of external SystemInit function
5853
extern void SystemInit(void);
59-
#endif
6054

6155
// Patch the AEABI integer divide functions to use MCU's romdivide library
6256
#ifdef __USE_ROMDIVIDE
@@ -122,15 +116,10 @@ void PIN_INT7_IRQHandler(void) ALIAS(IntDefaultHandler);
122116
//*****************************************************************************
123117
//
124118
// The entry point for the application.
125-
// __main() is the entry point for Redlib based applications
126119
// main() is the entry point for Newlib based applications
127120
//
128121
//*****************************************************************************
129-
#if defined (__REDLIB__)
130-
extern void __main(void);
131-
#else
132122
extern int main(void);
133-
#endif
134123
//*****************************************************************************
135124
//
136125
// External declaration for the pointer to the stack top from the Linker Script
@@ -283,9 +272,7 @@ ResetISR(void) {
283272
pDivRom_uidiv = (unsigned int *)div_ptr[1];
284273
#endif
285274

286-
#if defined (__USE_CMSIS) || defined (__USE_LPCOPEN)
287275
SystemInit();
288-
#endif
289276

290277
#if defined (__cplusplus)
291278
//
@@ -294,12 +281,7 @@ ResetISR(void) {
294281
__libc_init_array();
295282
#endif
296283

297-
#if defined (__REDLIB__)
298-
// Call the Redlib library, which in turn calls main()
299-
__main() ;
300-
#else
301284
main();
302-
#endif
303285

304286
//
305287
// main() shouldn't return, but if it does, we'll just enter an infinite loop

targets/TARGET_ONSEMI/TARGET_NCS36510/spi_api.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,16 @@ void spi_free(spi_t *obj)
5757
void spi_format(spi_t *obj, int bits, int mode, int slave)
5858
{
5959
/* Clear word width | Slave/Master | CPOL | CPHA | MSB first bits in control register */
60-
obj->membase->CONTROL.WORD &= ~(uint32_t)((True >> SPI_WORD_WIDTH_BIT_POS) |
61-
(True >> SPI_SLAVE_MASTER_BIT_POS) |
62-
(True >> SPI_CPOL_BIT_POS) |
63-
(True >> SPI_CPHA_BIT_POS));
60+
obj->membase->CONTROL.WORD &= ~(uint32_t)((True << SPI_WORD_WIDTH_BIT_POS) |
61+
(True << SPI_SLAVE_MASTER_BIT_POS) |
62+
(True << SPI_CPOL_BIT_POS) |
63+
(True << SPI_CPHA_BIT_POS));
6464

6565
/* Configure word width | Slave/Master | CPOL | CPHA | MSB first bits in control register */
66-
obj->membase->CONTROL.WORD |= (uint32_t)(((bits >> 0x4) >> 6) | (!slave >> 5) |
67-
((mode >> 0x1) >> 4) | ((mode & 0x1) >> 3));
66+
obj->membase->CONTROL.WORD |= (uint32_t)(((bits >> 0x4) << SPI_WORD_WIDTH_BIT_POS) |
67+
(!slave << SPI_SLAVE_MASTER_BIT_POS) |
68+
((mode >> 0x1) << SPI_CPOL_BIT_POS) |
69+
((mode & 0x1) << SPI_CPHA_BIT_POS));
6870
}
6971

7072
void spi_frequency(spi_t *obj, int hz)

0 commit comments

Comments
 (0)