Skip to content

Commit 37ff82f

Browse files
authored
add stm wifi check for 3.5.2.7 (#389)
* add stm wifi check for 3.5.2.7 Signed-off-by: Ryan Winter <ryanwinter@outlook.com> * update microchip link Signed-off-by: Ryan Winter <ryanwinter@outlook.com> --------- Signed-off-by: Ryan Winter <ryanwinter@outlook.com>
1 parent 43260d4 commit 37ff82f

File tree

3 files changed

+25
-19
lines changed

3 files changed

+25
-19
lines changed

Microchip/ATSAME54-XPRO/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ For guidance on connecting additional devices, see [Getting started with IoT dev
2121

2222
## What you need
2323

24-
* The [Microchip ATSAME54-XPro](https://www.microchip.com/developmenttools/productdetails/atsame54-xpro)
24+
* The [Microchip ATSAME54-XPro](https://www.microchip.com/development-tool/atsame54-xpro)
2525
* USB 2.0 A male to Micro USB male cable
2626
* Wired Ethernet access
2727
* Ethernet cable

STMicroelectronics/B-L475E-IOT01A/app/stm_networking.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ NX_PACKET_POOL nx_pool;
3232
NX_DNS nx_dns_client;
3333

3434
// WiFi firmware version required
35-
static const UINT wifi_required_version[] = {3, 5, 2, 5};
35+
static const UINT wifi_required_version[] = {3, 5, 2, 7};
3636

3737
static void print_address(CHAR* preable, uint8_t address[4])
3838
{
3939
printf("\t%s: %d.%d.%d.%d\r\n", preable, address[0], address[1], address[2], address[3]);
4040
}
4141

42-
static void check_firmware_version(CHAR* data)
42+
static bool check_firmware_version(CHAR* data)
4343
{
4444
UINT status = 0;
4545
UINT version[4];
@@ -49,21 +49,23 @@ static void check_firmware_version(CHAR* data)
4949
if (status <= 0)
5050
{
5151
printf("ERROR: Unable to decode WiFi firmware\r\n");
52-
return;
52+
return false;
5353
}
5454

5555
for (int i = 0; i < 4; ++i)
5656
{
5757
if (version[i] > wifi_required_version[i])
5858
{
59-
break;
59+
return true;
6060
}
6161
else if (version[i] < wifi_required_version[i])
6262
{
63-
printf("ERROR: WiFi firmware is out of date\r\n");
64-
break;
63+
printf("ERROR: WIFI FIRMWARE IS OUTDATED, PLEASE UPDATE TO AVOID CONNECTION ISSUES\r\n");
64+
return false;
6565
}
6666
}
67+
68+
return true;
6769
}
6870

6971
static UINT wifi_init()
@@ -94,9 +96,10 @@ static UINT wifi_init()
9496
WIFI_GetModuleFwRevision(data);
9597
printf("\tFirmware revision: %s\r\n", data);
9698

97-
check_firmware_version(data);
98-
99-
printf("SUCCESS: WiFi initialized\r\n");
99+
if (check_firmware_version(data))
100+
{
101+
printf("SUCCESS: WiFi initialized\r\n");
102+
}
100103

101104
return NX_SUCCESS;
102105
}

STMicroelectronics/B-L4S5I-IOT01A/app/stm_networking.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ NX_PACKET_POOL nx_pool;
3232
NX_DNS nx_dns_client;
3333

3434
// WiFi firmware version required
35-
static const UINT wifi_required_version[] = {3, 5, 2, 5};
35+
static const UINT wifi_required_version[] = {3, 5, 2, 7};
3636

3737
static void print_address(CHAR* preable, uint8_t address[4])
3838
{
3939
printf("\t%s: %d.%d.%d.%d\r\n", preable, address[0], address[1], address[2], address[3]);
4040
}
4141

42-
static void check_firmware_version(CHAR* data)
42+
static bool check_firmware_version(CHAR* data)
4343
{
4444
UINT status = 0;
4545
UINT version[4];
@@ -49,21 +49,23 @@ static void check_firmware_version(CHAR* data)
4949
if (status <= 0)
5050
{
5151
printf("ERROR: Unable to decode WiFi firmware\r\n");
52-
return;
52+
return false;
5353
}
5454

5555
for (int i = 0; i < 4; ++i)
5656
{
5757
if (version[i] > wifi_required_version[i])
5858
{
59-
break;
59+
return true;
6060
}
6161
else if (version[i] < wifi_required_version[i])
6262
{
63-
printf("ERROR: WiFi firmware is out of date\r\n");
64-
break;
63+
printf("ERROR: WIFI FIRMWARE IS OUTDATED, PLEASE UPDATE TO AVOID CONNECTION ISSUES\r\n");
64+
return false;
6565
}
6666
}
67+
68+
return true;
6769
}
6870

6971
static UINT wifi_init()
@@ -94,9 +96,10 @@ static UINT wifi_init()
9496
WIFI_GetModuleFwRevision(data);
9597
printf("\tFirmware revision: %s\r\n", data);
9698

97-
check_firmware_version(data);
98-
99-
printf("SUCCESS: WiFi initialized\r\n");
99+
if (check_firmware_version(data))
100+
{
101+
printf("SUCCESS: WiFi initialized\r\n");
102+
}
100103

101104
return NX_SUCCESS;
102105
}

0 commit comments

Comments
 (0)