Skip to content

Commit 4c7393e

Browse files
committed
increase socket number
1 parent 264de24 commit 4c7393e

File tree

7 files changed

+30
-14
lines changed

7 files changed

+30
-14
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ To install ARM build tools, use the `Boards Manager` option in the Arduino IDE t
4949

5050
The backbone of the packaging process is the https://github.com/arduino/ArduinoCore-mbed/blob/master/mbed-os-to-arduino script. It basically compiles a blank Mbed OS project for any supported target board, recovering the files that will be needed at compile time and copying them to the right location. This script is compatible only with Linux. If you are using macOS, use the https://github.com/arduino/ArduinoCore-mbed/blob/master/mbed-os-to-arduino-macos script.
5151

52+
macos example:
53+
```
54+
rm -rf /private/tmp/mbed-os-program
55+
./mbed-os-to-arduino-macos -a -c OPTA:OPTA
56+
```
57+
5258
It can be used for a variety of tasks including:
5359

5460
### Recompiling libmbed with source level debug support

libraries/SocketWrapper/src/MbedClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void arduino::MbedClient::readSocket() {
1818
uint8_t data[SOCKET_BUFFER_SIZE];
1919

2020
while (sock != nullptr) {
21-
event->wait_any(0xFF, 100);
21+
2222
int ret = NSAPI_ERROR_WOULD_BLOCK;
2323
do {
2424
mutex->lock();

variants/OPTA/conf/mbed_app.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
"METAL_MAX_DEVICE_REGIONS=2",
2222
"RPMSG_BUFFER_SIZE=512"
2323
]
24+
},
25+
"OPTA": {
26+
"lwip.socket-max": 8,
27+
"lwip.tcp-socket-max": 8,
28+
"lwip.udp-socket-max": 8
2429
}
2530
}
2631
}

variants/OPTA/defines.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11

22
-DARM_MATH_CM7
33
-DCM4_BOOT_BY_APPLICATION
4-
-D__CMSIS_RTOS
54
-DCOMPONENT_4343W_FS=1
65
-DCOMPONENT_CYW43XXX=1
76
-DCOMPONENT_FLASHIAP=1
87
-DCOMPONENT_QSPIF=1
98
-DCOMPONENT_WHD=1
109
-DCORE_CM7
11-
-D__CORTEX_M7
1210
-DCYW43XXX_UNBUFFERED_UART
1311
-DDEVICE_ANALOGIN=1
1412
-DDEVICE_ANALOGOUT=1
@@ -17,8 +15,8 @@
1715
-DDEVICE_EMAC=1
1816
-DDEVICE_FLASH=1
1917
-DDEVICE_I2C=1
20-
-DDEVICE_I2C_ASYNCH=1
2118
-DDEVICE_I2CSLAVE=1
19+
-DDEVICE_I2C_ASYNCH=1
2220
-DDEVICE_INTERRUPTIN=1
2321
-DDEVICE_LPTICKER=1
2422
-DDEVICE_MPU=1
@@ -33,22 +31,19 @@
3331
-DDEVICE_SERIAL_FC=1
3432
-DDEVICE_SLEEP=1
3533
-DDEVICE_SPI=1
36-
-DDEVICE_SPI_ASYNCH=1
3734
-DDEVICE_SPISLAVE=1
35+
-DDEVICE_SPI_ASYNCH=1
3836
-DDEVICE_STDIO_MESSAGES=1
3937
-DDEVICE_TRNG=1
4038
-DDEVICE_USBDEVICE=1
4139
-DDEVICE_USTICKER=1
4240
-DDEVICE_WATCHDOG=1
4341
-DEXTRA_IDLE_STACK_REQUIRED
4442
-DFEATURE_BLE=1
45-
-D__FPU_PRESENT=1
46-
-D__MBED__=1
47-
-DMBED_BUILD_TIMESTAMP=1751296112.1474662
48-
-D__MBED_CMSIS_RTOS_CM
49-
-DMBED_TICKLESS
5043
-DMBEDTLS_FS_IO
5144
-DMBEDTLS_SHA1_C
45+
-DMBED_BUILD_TIMESTAMP=1761840996.070056
46+
-DMBED_TICKLESS
5247
-DMETAL_INTERNAL
5348
-DMETAL_MAX_DEVICE_REGIONS=2
5449
-DNO_ATOMIC_64_SUPPORT
@@ -79,6 +74,11 @@
7974
-DUSE_FULL_LL_DRIVER
8075
-DUSE_HAL_DRIVER
8176
-DVIRTIO_DRIVER_ONLY
77+
-D__CMSIS_RTOS
78+
-D__CORTEX_M7
79+
-D__FPU_PRESENT=1
80+
-D__MBED_CMSIS_RTOS_CM
81+
-D__MBED__=1
8282
-DMBED_NO_GLOBAL_USING_DIRECTIVE=1
8383
-DCORE_MAJOR=
8484
-DCORE_MINOR=

variants/OPTA/libs/libmbed.a

-1.57 KB
Binary file not shown.

variants/OPTA/linker_script.ld

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ SECTIONS
9494
__bss_end__ = .;
9595
_ebss = .;
9696
} > RAM
97-
.pdm_section 0x3800FC00 (NOLOAD): {
97+
.openamp_section (NOLOAD) : {
98+
. = ABSOLUTE(0x38000000);
99+
*(.resource_table)
100+
} >RAM_D3 AT > FLASH
101+
.pdm_section (NOLOAD) : {
102+
. = ABSOLUTE(0x3800FC00);
98103
*(.pdm_buffer)
99104
} > RAM_D3
100105
_dtcm_lma = __etext + SIZEOF(.data);

variants/OPTA/mbed_config.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
#define MBED_CONF_LWIP_PPP_THREAD_STACKSIZE 768 // set by library:lwip
228228
#define MBED_CONF_LWIP_PRESENT 1 // set by library:lwip
229229
#define MBED_CONF_LWIP_RAW_SOCKET_ENABLED 1 // set by application[*]
230-
#define MBED_CONF_LWIP_SOCKET_MAX 4 // set by library:lwip
230+
#define MBED_CONF_LWIP_SOCKET_MAX 8 // set by application[OPTA]
231231
#define MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY osPriorityNormal // set by library:lwip
232232
#define MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE 1200 // set by library:lwip
233233
#define MBED_CONF_LWIP_TCP_CLOSE_TIMEOUT 1000 // set by library:lwip
@@ -236,10 +236,10 @@
236236
#define MBED_CONF_LWIP_TCP_MSS 536 // set by library:lwip
237237
#define MBED_CONF_LWIP_TCP_SERVER_MAX 4 // set by library:lwip
238238
#define MBED_CONF_LWIP_TCP_SND_BUF (2 * TCP_MSS) // set by library:lwip
239-
#define MBED_CONF_LWIP_TCP_SOCKET_MAX 4 // set by library:lwip
239+
#define MBED_CONF_LWIP_TCP_SOCKET_MAX 8 // set by application[OPTA]
240240
#define MBED_CONF_LWIP_TCP_SYNMAXRTX 6 // set by library:lwip
241241
#define MBED_CONF_LWIP_TCP_WND (4 * TCP_MSS) // set by library:lwip
242-
#define MBED_CONF_LWIP_UDP_SOCKET_MAX 4 // set by library:lwip
242+
#define MBED_CONF_LWIP_UDP_SOCKET_MAX 8 // set by application[OPTA]
243243
#define MBED_CONF_LWIP_USE_MBED_TRACE 0 // set by library:lwip
244244
#define MBED_CONF_MCR20A_PROVIDE_DEFAULT 0 // set by library:mcr20a
245245
#define MBED_CONF_NANOSTACK_LIBSERVICE_NSDYNMEM_TRACKER_ENABLED 0 // set by library:nanostack-libservice

0 commit comments

Comments
 (0)