2018-02-20 01:12 AM
Hello evry body , i need to install ethernet in my project so im using the board nucleo stm32f429ZI ,
the repository ethernet example works good .:
RMII_REF_CLK ----------------------> PA1
RMII_MDIO -------------------------> PA2 RMII_MDC --------------------------> PC1 RMII_MII_CRS_DV -------------------> PA7 RMII_MII_RXD0 ---------------------> PC4 RMII_MII_RXD1 ---------------------> PC5 RMII_MII_RXER ---------------------> PG2 RMII_MII_TX_EN --------------------> PG11 RMII_MII_TXD0 ---------------------> PG13 RMII_MII_TXD1 ---------------------> PB13now i need to create my project :
but when enabling the ethernet and ipwl in cube mx RMII with PHY ADRESS 0 i dont enable any rtos or interrupt :
i dont get PG11 PG13 like the demo ???!! BUT PB11 AND PB
because i create my project i guess it is one of the reasonsthat i dont detect my cart tftpd64 software or modbuspoll..
plz help needed
Note: this post was migrated and contained many threaded conversations, some content may be missing.2018-02-20 02:06 AM
you can edit those pins in CubeMx. Just click on PB13 and select ETH_TXD1. same for PG11
2018-02-20 04:12 AM
thanks much i didnt know this option in cube ill chek it , and i have a question someone said it is a condition to add a thread for the tcpip , is it really necessary in nucleo 144 , or i can use without rtos ?
2018-02-20 05:23 AM
I don't think you have to use FreeRTOS. I always use it with LWIP as it is easier to implement you app in parallel.
Here are some examples of LWIP without FreeROTS:
STM32Cube_FW_H7_V1.2.0\Projects\STM32H743I_EVAL\Applications\LwIP\LwIP_TCP_Echo_Server
That you can download from here:
2018-03-09 08:40 AM
We are trying to establish and send and receive Project through an ethernet connection .we use Nucleo f429ZI,
We have our nucleo with
static ip 10.1.1.2 mask 255.255.255.0 gateway 10.1.1.1 using cubemx ,PHY 0,
pc is used az destination having adress 10.1.1.3 using Hercules application
tcpip like a transport protocol.
i can ping my cart using comand mode no prblm.
-i can send by
/* init code for LWIP */
MX_LWIP_Init();
nc=netconn_new(NETCONN_TCP);//create new network connection TCP TYPE
res=netconn_bind(nc,&local_ip,0); //ASSCOCIATE STM MAC ADRESS TO AN IP.--->10.1.1.2 here 0 means any port number so we can accept any port
res=netconn_connect(nc,&remote_ip,23); //connect to remote ip remote port--->our pc server application wireshark for exmple 139
sprintf(send_buffer,'hello from STM32f429 port 23\n\r');
res=netconn_write(nc,send_buffer,strlen(send_buffer),NETCONN_COPY)
-Ä° can receive by
netconn_accept(nc,&in_nc);
res=netconn_recv(in_nc,&nb);//nc the network connection from which to receive data, nb network buffer
netbuf_copy(nb,buffer,len);
len=netbuf_len(nb);
printf('Received %d bytes:\r\n %s\r\n',len,buffer);
netbuf_delete(nb);//delete data buffer
buffer[len]=0;
but if i put both of them send and receive my prgm bugs and i dont have any reaction
im using FRTOS default task for the moment .i also tried withous frtos. No improvement and also tried to increase the mem size reserved to the thread no difference.
osThreadDef(defaultTask, StartDefaultTask, osPriorityIdle, 0,256);---Ã 1000
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
so:
-should i use different ports one for receiving one for sending or i can use one port for both?.
-should i create two connections nc , two bindings one sending one for receiving , or one is enough?
-demos are done in a complex way so that i decided to find a simplest way is there a good example or doc using LWÄ°P /netconn functions ?
-serverdemos Works with both straight and cross cable which one is the right ??
-is Ethernet fullduplex ? is there an option i need to add in cubemx to have data both sides going?
Thanks
2018-03-10 03:22 AM
Yes, TCP is duplex.
But you seem to be confusing the 2 types of TCP connection.
The only difference here is in which end (local or remote) initiates the connection - in both cases, you get a duplex connection.
Perhaps you need to study some basic books/tutorials on TCP/IP networking ?
2018-03-12 05:46 AM
Thanks mıiter Andrew , my stm needs to send data to a software on pc connected to a dtatabase and recieve from pc its aknowlege or other data to write to lcd , like recieve data then send ackowlegde via frames of maximum 30 bytes ,
pc (data base) <---------------send/receive-----------------> stm32
so i dont know if my stm device is server or client , but for me my device is both of them ,
yes im confusing thats why i need help to clarify things , so how i should i configure my self ,
i tried this config i listen then when there is an incoomimg connection anyip i send to it , but i couldnt succeed .
2018-03-12 05:56 AM
TARHAN SAMAH wrote:
i dont know if my stm device is server or client
So that is clearly something that you need to find out!
This has nothing specifically to do with STM32 - so, again, it seems like you need to spend some time understanding the basics of TCP/IP.
The whole point of TCP/IP and related internet protocols is that they are standard and do not change depending on what target hardware you are using.
It would probably be worth getting this going first on a PC before adding the complications of a small embedded microcontroller ...
2018-03-13 04:53 AM
Hello Mister Andrew i thought about what u told me about ,
for me pc is server it has a database , me im 'client' i need to send data and got an answer from pc ack for example,
If im client so ill connect to a remote server :
/* init code for LWIP */
MX_LWIP_Init();
nc=netconn_new(NETCONN_TCP);//create new network connection TCP TYPE
res=netconn_bind(nc,&local_ip,0); //ASSCOCIATE STM MAC ADRESS TO AN IP.--->1.1.2 here 0 means any port number so we can accept any port
res=netconn_connect(nc,&remote_ip,23); //connect to remote ip remote port--->our pc server application wireshark for exmple 139
while(1)
{
sprintf(send_buffer,'hello from STM32f429 port 23\n\r');
res=netconn_write(nc,send_buffer,strlen(send_buffer),NETCONN_COPY)
}
so how can i receive server answers ???just guide me little i coudlnt find good simple example i need to solve this issue thankks