cancel
Showing results for 
Search instead for 
Did you mean: 

UDP connection between STM32 and MATLAB

abbas
Associate II
Posted on July 31, 2016 at 22:42

Hello everyone,

I am using stm32f746 discovery board and I am sending 10 bytes of data in UDP protocol to PC.

I can trace the data coming through LAN using WireShark application. for example

No.   Time           Source             Destination       Protocol  Len    Info

14    1.300032    192.168.1.5    192.168.1.42    UDP       60    49153 ? 64701  Len=10

that 192.168.1.5 is STM32 board and 192.168.1.42 is PC

the data is sent to Port 64701  by STM32 Board

I used this code in matlab :

    u = udp ('192.168.1.5', 'LocalPort', 64701);

    fopen(u);

    x = fread(u, 10);

    disp(x)

    fclose(u)

But I can't get data and timeout in reading occurs. unfortunately the internet space is getting so complicated and is full of too detailed notes, related to the topic though, so I couldn't find what the problem is. within couple of hours.

can anyone help me and get me out of this trap?

thanks in advance

#stm32f746
1 REPLY 1
abbas
Associate II
Posted on October 23, 2016 at 08:48

Solved...

The problem was in windows firewall. it must be turned off for MATLAB program. that's it!