Skip to content

Commit 4bfab30

Browse files
authored
Merge pull request #1139 from hathach/release-0.12.0
update changelog and increase version for 0.12.0
2 parents e927359 + 3485c82 commit 4bfab30

File tree

9 files changed

+89
-22
lines changed

9 files changed

+89
-22
lines changed

CONTRIBUTORS.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ Notable contributors
177177
- Add new DCD port for Synopsys DesignWare for STM32 L4, F2, F4,
178178
F7, H7 etc ...
179179
- Add new DCD port for TI MSP430
180-
- Board support for STM32F407 Discovery, STM32H743 Nucleo, pyboard
181-
v1.1, msp\_exp430f5529lp etc ...
180+
- Board support for STM32F407 Discovery, STM32H743 Nucleo, pyboard v1.1, msp\_exp430f5529lp etc ...
182181

183182

184183
`Zixun Li <https://github.com/HiFiPhile>`__

docs/info/changelog.rst

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,37 @@
22
Changelog
33
*********
44

5+
0.12.0
6+
======
7+
8+
- add CFG_TUSB_OS_INC_PATH for os include path
9+
10+
Device Controller Driver (DCD)
11+
------------------------------
12+
13+
- Getting device stack to pass USB Compliance Verification test (chapter9, HID, MSC). Ports are tested:
14+
nRF, SAMD 21/51, rp2040, stm32f4, Renesas RX, iMXRT, ESP32-S2/3, Kinetic KL25/32, DA146xx
15+
- Added dcd_edpt_close_all() for switching configuration
16+
- [Transdimension] Support dcd_edpt_xfer_fifo() with auto wrap over if fifo buffer is 4K aligned and size is multiple of 4K.
17+
- [DA146xx] Improve vbus, reset, suspend, resume detection, and remote wakeup.
18+
19+
Device Stack
20+
------------
21+
22+
- Add new network driver Network Control Model (CDC-NCM), update net_lwip_webserver to work with NCM (need re-configure example)
23+
- Add new USB Video Class UVC 1.5 driver and video_capture example ((work in progress)
24+
- Fix potential buffer overflow for HID, bluetooth drivers
25+
26+
Host Controller Driver (HCD)
27+
----------------------------
28+
29+
No notable changes
30+
31+
Host Stack
32+
----------
33+
34+
No notable changes
35+
536
0.11.0 (2021-08-29)
637
===================
738

@@ -26,7 +57,7 @@ Synopsys
2657
^^^^^^^^
2758

2859
- Fix Synopsys set address bug which could cause re-enumeration failed
29-
- Fix for dcd_synopsys driver integer overflow in HS mode (issue #968)
60+
- Fix dcd_synopsys driver integer overflow in HS mode (issue #968)
3061

3162
nRF5x
3263
^^^^^

docs/reference/getting_started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Logger
122122
By default log message is printed via on-board UART which is slow and take lots of CPU time comparing to USB speed. If your board support on-board/external debugger, it would be more efficient to use it for logging. There are 2 protocols:
123123

124124

125-
* `LOGGER=rtt`: use [Segger RTT protocol](https://www.segger.com/products/debug-probes/j-link/technology/about-real-time-transfer/)
125+
* `LOGGER=rtt`: use `Segger RTT protocol <https://www.segger.com/products/debug-probes/j-link/technology/about-real-time-transfer/>`_
126126

127127
* Cons: requires jlink as the debugger.
128128
* Pros: work with most if not all MCUs

hw/bsp/rp2040/family.cmake

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
7777
${TOP}/src/class/video/video_device.c
7878
)
7979

80-
8180
# Base config for host mode; wrapped by SDK's tinyusb_host
8281
add_library(tinyusb_host_base INTERFACE)
8382
target_sources(tinyusb_host_base INTERFACE
@@ -153,4 +152,28 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
153152
enable_language(C CXX ASM)
154153
pico_sdk_init()
155154
endfunction()
155+
156+
# This method must be called from the project scope to suppress known warnings in TinyUSB source files
157+
function(suppress_tinyusb_warnings)
158+
set_source_files_properties(
159+
${PICO_TINYUSB_PATH}/src/tusb.c
160+
PROPERTIES
161+
COMPILE_FLAGS "-Wno-conversion")
162+
set_source_files_properties(
163+
${PICO_TINYUSB_PATH}/src/common/tusb_fifo.c
164+
PROPERTIES
165+
COMPILE_FLAGS "-Wno-conversion -Wno-cast-qual")
166+
set_source_files_properties(
167+
${PICO_TINYUSB_PATH}/src/device/usbd.c
168+
PROPERTIES
169+
COMPILE_FLAGS "-Wno-conversion -Wno-cast-qual -Wno-null-dereference")
170+
set_source_files_properties(
171+
${PICO_TINYUSB_PATH}/src/device/usbd_control.c
172+
PROPERTIES
173+
COMPILE_FLAGS "-Wno-conversion")
174+
set_source_files_properties(
175+
${PICO_TINYUSB_PATH}/src/class/cdc/cdc_device.c
176+
PROPERTIES
177+
COMPILE_FLAGS "-Wno-conversion")
178+
endfunction()
156179
endif()

src/device/dcd.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,14 @@ typedef struct TU_ATTR_ALIGNED(4)
106106
void dcd_init (uint8_t rhport);
107107

108108
// Interrupt Handler
109+
#if __GNUC__
110+
#pragma GCC diagnostic push
111+
#pragma GCC diagnostic ignored "-Wredundant-decls"
112+
#endif
109113
void dcd_int_handler(uint8_t rhport);
114+
#if __GNUC__
115+
#pragma GCC diagnostic pop
116+
#endif
110117

111118
// Enable device interrupt
112119
void dcd_int_enable (uint8_t rhport);

src/osal/osal.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ typedef void (*osal_task_func_t)( void * );
6767
// OSAL Porting API
6868
//--------------------------------------------------------------------+
6969

70+
#if __GNUC__
71+
#pragma GCC diagnostic push
72+
#pragma GCC diagnostic ignored "-Wredundant-decls"
73+
#endif
7074
//------------- Semaphore -------------//
7175
static inline osal_semaphore_t osal_semaphore_create(osal_semaphore_def_t* semdef);
7276
static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr);
@@ -84,6 +88,9 @@ static inline osal_queue_t osal_queue_create(osal_queue_def_t* qdef);
8488
static inline bool osal_queue_receive(osal_queue_t qhdl, void* data);
8589
static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr);
8690
static inline bool osal_queue_empty(osal_queue_t qhdl);
91+
#if __GNUC__
92+
#pragma GCC diagnostic pop
93+
#endif
8794

8895
#if 0 // TODO remove subtask related macros later
8996
// Sub Task

src/portable/raspberrypi/rp2040/dcd_rp2040.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static struct hw_endpoint *hw_endpoint_get_by_addr(uint8_t ep_addr)
7070
static void _hw_endpoint_alloc(struct hw_endpoint *ep, uint8_t transfer_type)
7171
{
7272
// size must be multiple of 64
73-
uint16_t size = tu_div_ceil(ep->wMaxPacketSize, 64) * 64u;
73+
uint size = tu_div_ceil(ep->wMaxPacketSize, 64) * 64u;
7474

7575
// double buffered Bulk endpoint
7676
if ( transfer_type == TUSB_XFER_BULK )
@@ -88,7 +88,7 @@ static void _hw_endpoint_alloc(struct hw_endpoint *ep, uint8_t transfer_type)
8888
pico_info(" Alloced %d bytes at offset 0x%x (0x%p)\r\n", size, dpram_offset, ep->hw_data_buf);
8989

9090
// Fill in endpoint control register with buffer offset
91-
uint32_t const reg = EP_CTRL_ENABLE_BITS | (transfer_type << EP_CTRL_BUFFER_TYPE_LSB) | dpram_offset;
91+
uint32_t const reg = EP_CTRL_ENABLE_BITS | ((uint)transfer_type << EP_CTRL_BUFFER_TYPE_LSB) | dpram_offset;
9292

9393
*ep->endpoint_control = reg;
9494
}
@@ -177,7 +177,7 @@ static void hw_handle_buff_status(void)
177177
uint32_t remaining_buffers = usb_hw->buf_status;
178178
pico_trace("buf_status = 0x%08x\n", remaining_buffers);
179179
uint bit = 1u;
180-
for (uint i = 0; remaining_buffers && i < USB_MAX_ENDPOINTS * 2; i++)
180+
for (uint8_t i = 0; remaining_buffers && i < USB_MAX_ENDPOINTS * 2; i++)
181181
{
182182
if (remaining_buffers & bit)
183183
{
@@ -365,19 +365,19 @@ void dcd_init (uint8_t rhport)
365365
dcd_connect(rhport);
366366
}
367367

368-
void dcd_int_enable(uint8_t rhport)
368+
void dcd_int_enable(__unused uint8_t rhport)
369369
{
370370
assert(rhport == 0);
371371
irq_set_enabled(USBCTRL_IRQ, true);
372372
}
373373

374-
void dcd_int_disable(uint8_t rhport)
374+
void dcd_int_disable(__unused uint8_t rhport)
375375
{
376376
assert(rhport == 0);
377377
irq_set_enabled(USBCTRL_IRQ, false);
378378
}
379379

380-
void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
380+
void dcd_set_address (__unused uint8_t rhport, __unused uint8_t dev_addr)
381381
{
382382
assert(rhport == 0);
383383

@@ -386,22 +386,22 @@ void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
386386
hw_endpoint_xfer(0x80, NULL, 0);
387387
}
388388

389-
void dcd_remote_wakeup(uint8_t rhport)
389+
void dcd_remote_wakeup(__unused uint8_t rhport)
390390
{
391391
pico_info("dcd_remote_wakeup %d\n", rhport);
392392
assert(rhport == 0);
393393
usb_hw_set->sie_ctrl = USB_SIE_CTRL_RESUME_BITS;
394394
}
395395

396396
// disconnect by disabling internal pull-up resistor on D+/D-
397-
void dcd_disconnect(uint8_t rhport)
397+
void dcd_disconnect(__unused uint8_t rhport)
398398
{
399399
(void) rhport;
400400
usb_hw_clear->sie_ctrl = USB_SIE_CTRL_PULLUP_EN_BITS;
401401
}
402402

403403
// connect by enabling internal pull-up resistor on D+/D-
404-
void dcd_connect(uint8_t rhport)
404+
void dcd_connect(__unused uint8_t rhport)
405405
{
406406
(void) rhport;
407407
usb_hw_set->sie_ctrl = USB_SIE_CTRL_PULLUP_EN_BITS;
@@ -423,7 +423,7 @@ void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * re
423423
}
424424
}
425425

426-
bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
426+
bool dcd_edpt_open (__unused uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
427427
{
428428
assert(rhport == 0);
429429
hw_endpoint_init(desc_edpt->bEndpointAddress, desc_edpt->wMaxPacketSize.size, desc_edpt->bmAttributes.xfer);
@@ -438,7 +438,7 @@ void dcd_edpt_close_all (uint8_t rhport)
438438
reset_non_control_endpoints();
439439
}
440440

441-
bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
441+
bool dcd_edpt_xfer(__unused uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
442442
{
443443
assert(rhport == 0);
444444
hw_endpoint_xfer(ep_addr, buffer, total_bytes);

src/portable/raspberrypi/rp2040/rp2040_usb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const char *ep_dir_string[] = {
3838
"in",
3939
};
4040

41-
static inline void _hw_endpoint_lock_update(struct hw_endpoint *ep, int delta) {
41+
static inline void _hw_endpoint_lock_update(__unused struct hw_endpoint * ep, __unused int delta) {
4242
// todo add critsec as necessary to prevent issues between worker and IRQ...
4343
// note that this is perhaps as simple as disabling IRQs because it would make
4444
// sense to have worker and IRQ on same core, however I think using critsec is about equivalent.
@@ -107,7 +107,7 @@ void _hw_endpoint_buffer_control_update32(struct hw_endpoint *ep, uint32_t and_m
107107
static uint32_t prepare_ep_buffer(struct hw_endpoint *ep, uint8_t buf_id)
108108
{
109109
uint16_t const buflen = tu_min16(ep->remaining_len, ep->wMaxPacketSize);
110-
ep->remaining_len -= buflen;
110+
ep->remaining_len = (uint16_t)(ep->remaining_len - buflen);
111111

112112
uint32_t buf_ctrl = buflen | USB_BUF_CTRL_AVAIL;
113113

@@ -214,15 +214,15 @@ static uint16_t sync_ep_buffer(struct hw_endpoint *ep, uint8_t buf_id)
214214
// sent some data can increase the length we have sent
215215
assert(!(buf_ctrl & USB_BUF_CTRL_FULL));
216216

217-
ep->xferred_len += xferred_bytes;
217+
ep->xferred_len = (uint16_t)(ep->xferred_len + xferred_bytes);
218218
}else
219219
{
220220
// If we have received some data, so can increase the length
221221
// we have received AFTER we have copied it to the user buffer at the appropriate offset
222222
assert(buf_ctrl & USB_BUF_CTRL_FULL);
223223

224224
memcpy(ep->user_buf, ep->hw_data_buf + buf_id*64, xferred_bytes);
225-
ep->xferred_len += xferred_bytes;
225+
ep->xferred_len = (uint16_t)(ep->xferred_len + xferred_bytes);
226226
ep->user_buf += xferred_bytes;
227227
}
228228

@@ -242,7 +242,7 @@ static void _hw_endpoint_xfer_sync (struct hw_endpoint *ep)
242242
// Update hw endpoint struct with info from hardware
243243
// after a buff status interrupt
244244

245-
uint32_t buf_ctrl = _hw_endpoint_buffer_control_get_value32(ep);
245+
uint32_t __unused buf_ctrl = _hw_endpoint_buffer_control_get_value32(ep);
246246
TU_LOG(3, " Sync BufCtrl: [0] = 0x%04u [1] = 0x%04x\r\n", tu_u32_low16(buf_ctrl), tu_u32_high16(buf_ctrl));
247247

248248
// always sync buffer 0

src/tusb_option.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define _TUSB_OPTION_H_
2929

3030
#define TUSB_VERSION_MAJOR 0
31-
#define TUSB_VERSION_MINOR 11
31+
#define TUSB_VERSION_MINOR 12
3232
#define TUSB_VERSION_REVISION 0
3333
#define TUSB_VERSION_STRING TU_STRING(TUSB_VERSION_MAJOR) "." TU_STRING(TUSB_VERSION_MINOR) "." TU_STRING(TUSB_VERSION_REVISION)
3434

0 commit comments

Comments
 (0)