Skip to content

Commit f190402

Browse files
authored
Merge pull request stm32duino#1027 from fpistm/UpdateCubeFw
Update to latest F4, F7 firmware and USB host/device middleware
2 parents ce7e3e1 + 2790e61 commit f190402

File tree

270 files changed

+110727
-87802
lines changed

Some content is hidden

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

270 files changed

+110727
-87802
lines changed

Diff for: cores/arduino/stm32/LL/stm32yyxx_ll.h

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "stm32yyxx_ll_exti.h"
2323
#include "stm32yyxx_ll_fmac.h"
2424
#include "stm32yyxx_ll_fmc.h"
25+
#include "stm32yyxx_ll_fmpi2c.h"
2526
#include "stm32yyxx_ll_fsmc.h"
2627
#include "stm32yyxx_ll_gpio.h"
2728
#include "stm32yyxx_ll_hrtim.h"

Diff for: cores/arduino/stm32/LL/stm32yyxx_ll_fmpi2c.h

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef _STM32YYXX_LL_FMPI2C_H_
2+
#define _STM32YYXX_LL_FMPI2C_H_
3+
/* LL raised several warnings, ignore them */
4+
#pragma GCC diagnostic push
5+
#pragma GCC diagnostic ignored "-Wunused-parameter"
6+
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
7+
8+
#ifdef STM32F4xx
9+
#include "stm32f4xx_ll_fmpi2c.h"
10+
#endif
11+
#pragma GCC diagnostic pop
12+
#endif /* _STM32YYXX_LL_FMPI2C_H_ */

Diff for: cores/arduino/stm32/usb/cdc/usbd_cdc.c

+356-391
Large diffs are not rendered by default.

Diff for: cores/arduino/stm32/usb/cdc/usbd_cdc.h

+6-13
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* This software component is licensed by ST under Ultimate Liberty license
1313
* SLA0044, the "License"; You may not use this file except in compliance with
1414
* the License. You may obtain a copy of the License at:
15-
* http://www.st.com/SLA0044
15+
* www.st.com/SLA0044
1616
*
1717
******************************************************************************
1818
*/
@@ -95,8 +95,7 @@ typedef struct _USBD_CDC_Itf {
9595
int8_t (* DeInit)(void);
9696
int8_t (* Control)(uint8_t cmd, uint8_t *pbuf, uint16_t length);
9797
int8_t (* Receive)(uint8_t *Buf, uint32_t *Len);
98-
int8_t (* Transferred)(void);
99-
98+
int8_t (* TransmitCplt)(uint8_t *Buf, uint32_t *Len, uint8_t epnum);
10099
} USBD_CDC_ItfTypeDef;
101100

102101

@@ -111,8 +110,7 @@ typedef struct {
111110

112111
__IO uint32_t TxState;
113112
__IO uint32_t RxState;
114-
}
115-
USBD_CDC_HandleTypeDef;
113+
} USBD_CDC_HandleTypeDef;
116114

117115

118116

@@ -140,17 +138,12 @@ extern USBD_ClassTypeDef USBD_CDC;
140138
uint8_t USBD_CDC_RegisterInterface(USBD_HandleTypeDef *pdev,
141139
USBD_CDC_ItfTypeDef *fops);
142140

143-
uint8_t USBD_CDC_SetTxBuffer(USBD_HandleTypeDef *pdev,
144-
uint8_t *pbuff,
145-
uint16_t length);
146-
147-
uint8_t USBD_CDC_SetRxBuffer(USBD_HandleTypeDef *pdev,
148-
uint8_t *pbuff);
141+
uint8_t USBD_CDC_SetTxBuffer(USBD_HandleTypeDef *pdev, uint8_t *pbuff,
142+
uint32_t length);
149143

144+
uint8_t USBD_CDC_SetRxBuffer(USBD_HandleTypeDef *pdev, uint8_t *pbuff);
150145
uint8_t USBD_CDC_ReceivePacket(USBD_HandleTypeDef *pdev);
151-
152146
uint8_t USBD_CDC_ClearBuffer(USBD_HandleTypeDef *pdev);
153-
154147
uint8_t USBD_CDC_TransmitPacket(USBD_HandleTypeDef *pdev);
155148
/**
156149
* @}

Diff for: cores/arduino/stm32/usb/cdc/usbd_cdc_if.c

+29-14
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* This software component is licensed by ST under Ultimate Liberty license
1313
* SLA0044, the "License"; You may not use this file except in compliance with
1414
* the License. You may obtain a copy of the License at:
15-
* http://www.st.com/SLA0044
15+
* www.st.com/SLA0044
1616
*
1717
******************************************************************************
1818
*/
@@ -67,14 +67,14 @@ static int8_t USBD_CDC_Init(void);
6767
static int8_t USBD_CDC_DeInit(void);
6868
static int8_t USBD_CDC_Control(uint8_t cmd, uint8_t *pbuf, uint16_t length);
6969
static int8_t USBD_CDC_Receive(uint8_t *pbuf, uint32_t *Len);
70-
static int8_t USBD_CDC_Transferred(void);
70+
static int8_t USBD_CDC_TransmitCplt(uint8_t *pbuf, uint32_t *Len, uint8_t epnum);
7171

7272
USBD_CDC_ItfTypeDef USBD_CDC_fops = {
7373
USBD_CDC_Init,
7474
USBD_CDC_DeInit,
7575
USBD_CDC_Control,
7676
USBD_CDC_Receive,
77-
USBD_CDC_Transferred
77+
USBD_CDC_TransmitCplt
7878
};
7979

8080
USBD_CDC_LineCodingTypeDef linecoding = {
@@ -100,7 +100,7 @@ static int8_t USBD_CDC_Init(void)
100100
receivePended = true;
101101
USBD_CDC_SetRxBuffer(&hUSBD_Device_CDC, CDC_ReceiveQueue_ReserveBlock(&ReceiveQueue));
102102

103-
return (USBD_OK);
103+
return ((int8_t)USBD_OK);
104104
}
105105

106106
/**
@@ -111,7 +111,7 @@ static int8_t USBD_CDC_Init(void)
111111
*/
112112
static int8_t USBD_CDC_DeInit(void)
113113
{
114-
return (USBD_OK);
114+
return ((int8_t)USBD_OK);
115115
}
116116

117117

@@ -201,7 +201,7 @@ static int8_t USBD_CDC_Control(uint8_t cmd, uint8_t *pbuf, uint16_t length)
201201
break;
202202
}
203203

204-
return (USBD_OK);
204+
return ((int8_t)USBD_OK);
205205
}
206206

207207
/**
@@ -211,7 +211,7 @@ static int8_t USBD_CDC_Control(uint8_t cmd, uint8_t *pbuf, uint16_t length)
211211
*
212212
* @note
213213
* This function will issue a NAK packet on any OUT packet received on
214-
* USB endpoint untill exiting this function. If you exit this function
214+
* USB endpoint until exiting this function. If you exit this function
215215
* before transfer is complete on CDC interface (ie. using DMA controller)
216216
* it will result in receiving more data while previous ones are still
217217
* not sent.
@@ -237,16 +237,31 @@ static int8_t USBD_CDC_Receive(uint8_t *Buf, uint32_t *Len)
237237
if (!CDC_resume_receive()) {
238238
USBD_CDC_ClearBuffer(&hUSBD_Device_CDC);
239239
}
240-
return USBD_OK;
240+
return ((int8_t)USBD_OK);
241241
}
242242

243243

244-
static int8_t USBD_CDC_Transferred(void)
244+
/**
245+
* @brief USBD_CDC_TransmitCplt
246+
* Data transmited callback
247+
*
248+
* @note
249+
* This function is IN transfer complete callback used to inform user that
250+
* the submitted Data is successfully sent over USB.
251+
*
252+
* @param Buf: Buffer of data to be received
253+
* @param Len: Number of data received (in bytes)
254+
* @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL
255+
*/
256+
static int8_t USBD_CDC_TransmitCplt(uint8_t *Buf, uint32_t *Len, uint8_t epnum)
245257
{
258+
UNUSED(Buf);
259+
UNUSED(Len);
260+
UNUSED(epnum);
246261
transmitStart = 0;
247262
CDC_TransmitQueue_CommitRead(&TransmitQueue);
248263
CDC_continue_transmit();
249-
return (USBD_OK);
264+
return ((int8_t)USBD_OK);
250265
}
251266

252267
void CDC_init(void)
@@ -284,9 +299,9 @@ bool CDC_connected()
284299
if (transmitTime) {
285300
transmitTime = HAL_GetTick() - transmitTime;
286301
}
287-
return hUSBD_Device_CDC.dev_state == USBD_STATE_CONFIGURED
288-
&& transmitTime < USB_CDC_TRANSMIT_TIMEOUT
289-
&& lineState;
302+
return ((hUSBD_Device_CDC.dev_state == USBD_STATE_CONFIGURED)
303+
&& (transmitTime < USB_CDC_TRANSMIT_TIMEOUT)
304+
&& lineState);
290305
}
291306

292307
void CDC_continue_transmit(void)
@@ -296,7 +311,7 @@ void CDC_continue_transmit(void)
296311
USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef *) hUSBD_Device_CDC.pClassData;
297312
/*
298313
* TS: This method can be called both in the main thread
299-
* (via USBSerial::write) and in the IRQ stream (via USBD_CDC_Transferred),
314+
* (via USBSerial::write) and in the IRQ stream (via USBD_CDC_TransmistCplt),
300315
* BUT the main thread cannot pass this condition while waiting for a IRQ!
301316
* This is not possible because TxState is not zero while waiting for data
302317
* transfer ending! The IRQ thread is uninterrupted, since its priority

Diff for: cores/arduino/stm32/usb/cdc/usbd_cdc_if.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* This software component is licensed by ST under Ultimate Liberty license
1313
* SLA0044, the "License"; You may not use this file except in compliance with
1414
* the License. You may obtain a copy of the License at:
15-
* http://www.st.com/SLA0044
15+
* www.st.com/SLA0044
1616
*
1717
******************************************************************************
1818
*/

0 commit comments

Comments
 (0)