Skip to content

Commit e7a4658

Browse files
authored
Merge pull request #10180 from AriParkkila/fix-wise-1570
Fix SPIF speed for MTB_ADV_WISE_1570 and max packet size for BC95
2 parents 6f40321 + a6c44f8 commit e7a4658

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

components/storage/blockdevice/COMPONENT_SPIF/mbed_lib.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
"SPI_MOSI": "PA_7",
5555
"SPI_MISO": "PA_6",
5656
"SPI_CLK": "PA_5",
57-
"SPI_CS": "PB_12"
57+
"SPI_CS": "PB_12",
58+
"SPI_FREQ": "20000000"
5859
}
5960
}
6061
}

features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95_CellularStack.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include "CellularUtil.h"
2020
#include "CellularLog.h"
2121

22+
#define PACKET_SIZE_MAX 1358
23+
2224
using namespace mbed;
2325
using namespace mbed_cellular_util;
2426

@@ -174,6 +176,10 @@ nsapi_size_or_error_t QUECTEL_BC95_CellularStack::socket_sendto_impl(CellularSoc
174176
{
175177
int sent_len = 0;
176178

179+
if (size > PACKET_SIZE_MAX) {
180+
return NSAPI_ERROR_PARAMETER;
181+
}
182+
177183
char *hexstr = new char[size * 2 + 1];
178184
int hexlen = char_str_to_hex_str((const char *)data, size, hexstr);
179185
// NULL terminated for write_string
@@ -220,7 +226,7 @@ nsapi_size_or_error_t QUECTEL_BC95_CellularStack::socket_recvfrom_impl(CellularS
220226

221227
_at.cmd_start("AT+NSORF=");
222228
_at.write_int(socket->id);
223-
_at.write_int(size);
229+
_at.write_int(size <= PACKET_SIZE_MAX ? size : PACKET_SIZE_MAX);
224230
_at.cmd_stop();
225231
_at.resp_start();
226232
// receiving socket id

0 commit comments

Comments
 (0)