-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Description
- Type: Bug
- Priority: Blocker
Bug
Target
STM32L476
Toolchain:
GCC_ARM
mbed-cli version:
1.0.0
Hardware
Firefly 6LoWPAN shield + STM32L476ZG
Expected behavior
We are using the last version of mbed-os and tried to run a simple easy-connect example using 6LoWPAN. It worked well on the K64F, we can create a NetworkInterface, open a TCPSocket, connect to a website ("linkedin.com") and send a simple HTTP GET request.
But we did not achieve to make this work on any other MCU. Our main target is a STM32L476ZG.
With the same program, it connects sucessfully to the 6LoWPAN network, we can create a socket but we cant connect to any website as the DNS requests are not working.
Both the K64F and the STM32L476 have the same main:
#include "mbed.h"
#include "easy-connect.h"
nsapi_error_t ret;
TCPSocket socket;
NetworkInterface* LoWPAN;
int main()
{
LoWPAN = easy_connect(true);
ret = socket.open(LoWPAN);
if (ret != NSAPI_ERROR_OK) {
printf("Error opening socket : %d", ret);
}
//ret = socket.connect("2620:109:c002::6cae:a0a",80);
ret = socket.connect("linkedin.com",80);
printf("nsapi_error : %d \n", ret);
if (ret == 0) {
printf("It's OK ! \n");
}
else {
printf("Failed ! \n");
}
}
K64F output:
[EasyConnect] Using Mesh
[EasyConnect] Connecting to Mesh..
[EasyConnect] Connected to Network successfully
[EasyConnect] IP address 2001:470:1f13:af3:fec2:3d00:4:583
[EasyConnect] MAC address fc:c2:3d:00:00:04:05:83
nsapi_error : 0
It's OK !
STM32 Output:
[EasyConnect] Using Mesh
[EasyConnect] Connecting to Mesh..
[EasyConnect] Connected to Network successfully
[EasyConnect] IP address 2001:470:1f13:af3:fec2:3d00:4:583
[EasyConnect] MAC address fc:c2:3d:00:00:04:05:83
nsapi_error : -3009
Failed
The -3009 error is a DNS error. We debugged the program and the DNS packet seems to be built correctly but never sent by the firefly 6LoWPAN shield.
err = socket.sendto(SocketAddress(dns_servers[i], 53), packet, DNS_BUFFER_SIZE);
indicate us that the DNS packet has been transmitted (size 512), but it seems it hasnt as we cant see it with whireshark sniffing our IPv6 network.
If we use socket.connect() with an IPV6 address instead of a website address it is working both on K64F and STM32L476..
Finally we used mbed-trace both on the K64F and on the STM32L476. On the K64F there is no error reported by mbed trace during all the process, but on the STM32 we have this ERROR occuring several times:
[ERR ][mMCp]: MAC tx fail
[DBG ][rplc]: Triggering parent selection due to ETX change on fc:c2:3d:00:00:04:df:8b
[ERR ][6lAd]: MCPS Data fail by status 233
How to fix it ? Have you any idea ?
We tried to use the same 6LoWPAN shied on NUCLEO_F401RE and NUCLEO_L152RE to try DNS resolution but we cant get it working. EasyConnect return -3012 error which is NSAPI_ERROR_DEVICE_ERROR.