Skip to content

Commit c727740

Browse files
committed
Apply changes needed for USB MSC and DaynaPORT
Made necessary changes to tsub_config.h and files that support the cyw43 library for DaynaPORT support.
1 parent 4de3ea9 commit c727740

40 files changed

+207
-13
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
url = https://github.com/earlephilhower/ArduinoCore-API.git
44
[submodule "pico-sdk"]
55
path = pico-sdk
6-
url = https://github.com/raspberrypi/pico-sdk.git
6+
url = https://github.com/rabbitholecomputing/pico-sdk.git
77
[submodule "system/pyserial"]
88
path = tools/pyserial
99
url = https://github.com/pyserial/pyserial.git

include/rp2040/tusb_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
#define CFG_TUD_CDC_RX_BUFSIZE (256)
8080
#define CFG_TUD_CDC_TX_BUFSIZE (256)
8181

82-
#define CFG_TUD_MSC_EP_BUFSIZE (64)
82+
#define CFG_TUD_MSC_EP_BUFSIZE (1024*4)
8383

8484
// HID buffer size Should be sufficient to hold ID (if any) + Data
8585
#define CFG_TUD_HID_EP_BUFSIZE (64)

include/rp2350-riscv/btstack_config.h

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#pragma once
2+
3+
// BTstack features that can be enabled
4+
#define ENABLE_LOG_INFO
5+
#define ENABLE_LOG_DEBUG
6+
#define ENABLE_LOG_ERROR
7+
#define ENABLE_PRINTF_HEXDUMP
8+
#define ENABLE_SCO_OVER_HCI
9+
10+
#ifdef ENABLE_CLASSIC
11+
#define ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE
12+
#endif
13+
14+
#ifdef ENABLE_BLE
15+
#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE
16+
#define ENABLE_LE_PERIPHERAL
17+
#define ENABLE_LE_CENTRAL
18+
#endif
19+
20+
// BTstack configuration. buffers, sizes, ...
21+
#define HCI_OUTGOING_PRE_BUFFER_SIZE 4
22+
#define HCI_ACL_PAYLOAD_SIZE (1691 + 4)
23+
#define HCI_ACL_CHUNK_SIZE_ALIGNMENT 4
24+
#define MAX_NR_AVDTP_CONNECTIONS 1
25+
#define MAX_NR_AVDTP_STREAM_ENDPOINTS 1
26+
#define MAX_NR_AVRCP_CONNECTIONS 2
27+
#define MAX_NR_BNEP_CHANNELS 1
28+
#define MAX_NR_BNEP_SERVICES 1
29+
#define MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES 2
30+
#define MAX_NR_GATT_CLIENTS 1
31+
#define MAX_NR_HCI_CONNECTIONS 2
32+
#define MAX_NR_HID_HOST_CONNECTIONS 1
33+
#define MAX_NR_HIDS_CLIENTS 1
34+
#define MAX_NR_HFP_CONNECTIONS 1
35+
#define MAX_NR_L2CAP_CHANNELS 4
36+
#define MAX_NR_L2CAP_SERVICES 3
37+
#define MAX_NR_RFCOMM_CHANNELS 1
38+
#define MAX_NR_RFCOMM_MULTIPLEXERS 1
39+
#define MAX_NR_RFCOMM_SERVICES 1
40+
#define MAX_NR_SERVICE_RECORD_ITEMS 4
41+
#define MAX_NR_SM_LOOKUP_ENTRIES 3
42+
#define MAX_NR_WHITELIST_ENTRIES 16
43+
#define MAX_NR_LE_DEVICE_DB_ENTRIES 16
44+
45+
// Limit number of ACL/SCO Buffer to use by stack to avoid cyw43 shared bus overrun
46+
#define MAX_NR_CONTROLLER_ACL_BUFFERS 3
47+
#define MAX_NR_CONTROLLER_SCO_PACKETS 3
48+
49+
// Enable and configure HCI Controller to Host Flow Control to avoid cyw43 shared bus overrun
50+
#define ENABLE_HCI_CONTROLLER_TO_HOST_FLOW_CONTROL
51+
#define HCI_HOST_ACL_PACKET_LEN 1024
52+
#define HCI_HOST_ACL_PACKET_NUM 3
53+
#define HCI_HOST_SCO_PACKET_LEN 120
54+
#define HCI_HOST_SCO_PACKET_NUM 3
55+
56+
// Link Key DB and LE Device DB using TLV on top of Flash Sector interface
57+
#define NVM_NUM_DEVICE_DB_ENTRIES 16
58+
#define NVM_NUM_LINK_KEYS 16
59+
60+
// We don't give btstack a malloc, so use a fixed-size ATT DB.
61+
#define MAX_ATT_DB_SIZE 512
62+
63+
// BTstack HAL configuration
64+
#define HAVE_EMBEDDED_TIME_MS
65+
66+
// map btstack_assert onto Pico SDK assert()
67+
#define HAVE_ASSERT
68+
69+
// Some USB dongles take longer to respond to HCI reset (e.g. BCM20702A).
70+
#define HCI_RESET_RESEND_TIMEOUT_MS 1000
71+
72+
#define ENABLE_SOFTWARE_AES128
73+
#define ENABLE_MICRO_ECC_FOR_LE_SECURE_CONNECTIONS
74+
75+
#undef HAVE_BTSTACK_STDIN
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// AUTOGENERATED FROM PICO_CONFIG_HEADER_FILES and then PICO_<PLATFORM>_CONFIG_HEADER_FILES
2+
// DO NOT EDIT!
3+
4+
5+
// based on PICO_CONFIG_HEADER_FILES:
6+
7+
#include "../../pico-sdk/src/boards/include/boards/solderparty_rp2350_stamp_xl.h"
8+
9+
// based on PICO_RP2350_RISCV_CONFIG_HEADER_FILES:
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
// ---------------------------------------
8+
// THIS FILE IS AUTOGENERATED; DO NOT EDIT
9+
// ---------------------------------------
10+
11+
#ifndef _PICO_VERSION_H
12+
#define _PICO_VERSION_H
13+
14+
#define PICO_SDK_VERSION_MAJOR 2
15+
#define PICO_SDK_VERSION_MINOR 1
16+
#define PICO_SDK_VERSION_REVISION 2
17+
#define PICO_SDK_VERSION_STRING "2.1.2-develop"
18+
19+
#endif

include/rp2350-riscv/tusb_config.h

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2019 Ha Thach (tinyusb.org)
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*
24+
*/
25+
26+
#ifndef _TUSB_CONFIG_H_
27+
#define _TUSB_CONFIG_H_
28+
29+
#ifdef __cplusplus
30+
extern "C" {
31+
#endif
32+
33+
//--------------------------------------------------------------------
34+
// COMMON CONFIGURATION
35+
//--------------------------------------------------------------------
36+
37+
#ifndef CFG_TUSB_MCU
38+
#define CFG_TUSB_MCU OPT_MCU_RP2040
39+
#endif
40+
41+
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
42+
#define CFG_TUSB_OS OPT_OS_PICO
43+
44+
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
45+
#ifndef CFG_TUSB_DEBUG
46+
#define CFG_TUSB_DEBUG 0
47+
#endif
48+
49+
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
50+
* Tinyusb use follows macros to declare transferring memory so that they can be put
51+
* into those specific section.
52+
* e.g
53+
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
54+
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
55+
*/
56+
#ifndef CFG_TUSB_MEM_SECTION
57+
#define CFG_TUSB_MEM_SECTION
58+
#endif
59+
60+
#ifndef CFG_TUSB_MEM_ALIGN
61+
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
62+
#endif
63+
64+
//--------------------------------------------------------------------
65+
// DEVICE CONFIGURATION
66+
//--------------------------------------------------------------------
67+
68+
#ifndef CFG_TUD_ENDPOINT0_SIZE
69+
#define CFG_TUD_ENDPOINT0_SIZE 64
70+
#endif
71+
72+
//------------- CLASS -------------//
73+
#define CFG_TUD_HID (2)
74+
#define CFG_TUD_CDC (1)
75+
#define CFG_TUD_MSC (1)
76+
#define CFG_TUD_MIDI (0)
77+
#define CFG_TUD_VENDOR (0)
78+
79+
#define CFG_TUD_CDC_RX_BUFSIZE (256)
80+
#define CFG_TUD_CDC_TX_BUFSIZE (256)
81+
82+
#define CFG_TUD_MSC_EP_BUFSIZE (1024*4)
83+
84+
// HID buffer size Should be sufficient to hold ID (if any) + Data
85+
#define CFG_TUD_HID_EP_BUFSIZE (64)
86+
87+
#ifdef __cplusplus
88+
}
89+
#endif
90+
91+
#endif /* _TUSB_CONFIG_H_ */

include/rp2350/tusb_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
#define CFG_TUD_CDC_RX_BUFSIZE (256)
8080
#define CFG_TUD_CDC_TX_BUFSIZE (256)
8181

82-
#define CFG_TUD_MSC_EP_BUFSIZE (64)
82+
#define CFG_TUD_MSC_EP_BUFSIZE (1024*4)
8383

8484
// HID buffer size Should be sufficient to hold ID (if any) + Data
8585
#define CFG_TUD_HID_EP_BUFSIZE (64)

lib/core_inc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_platform_compiler/include
5858
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_platform_sections/include
5959
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_platform_panic/include
60+
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_platform_common/include
6061
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_printf/include
6162
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_runtime/include
6263
-iwithprefixbefore/pico-sdk/src/rp2_common/pico_runtime_init/include

lib/core_wrap.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,4 @@
6161
-Wl,--wrap=netif_add
6262
-Wl,--wrap=netif_remove
6363

64-
-Wl,--wrap=cyw43_cb_process_ethernet
65-
-Wl,--wrap=cyw43_cb_tcpip_set_link_up
66-
-Wl,--wrap=cyw43_cb_tcpip_set_link_down
67-
-Wl,--wrap=cyw43_tcpip_link_status
68-
-Wl,--wrap=cyw43_cb_tcpip_init
69-
-Wl,--wrap=cyw43_cb_tcpip_deinit
70-
7164
-Wl,--wrap=__stack_chk_fail

0 commit comments

Comments
 (0)