Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[ARM] STM32 LwIP with STM32CubeMX, is it the right way ?

Status
Not open for further replies.

bianchi77

Advanced Member level 4
Joined
Jun 11, 2009
Messages
1,313
Helped
21
Reputation
44
Reaction score
20
Trophy points
1,318
Location
California
Activity points
9,442
Is it the right way to define IP address 10.0.0.5 ??

Code:
void MX_LWIP_Init(void)
{
  IP_ADDRESS[0] = 10;
  IP_ADDRESS[1] = 000;
  IP_ADDRESS[2] = 000;
  IP_ADDRESS[3] = 5;
  NETMASK_ADDRESS[0] = 255;
  NETMASK_ADDRESS[1] = 255;
  NETMASK_ADDRESS[2] = 255;
  NETMASK_ADDRESS[3] = 000;
  GATEWAY_ADDRESS[0] = 10;
  GATEWAY_ADDRESS[1] = 000;
  GATEWAY_ADDRESS[2] = 000;
  GATEWAY_ADDRESS[3] = 1;
    /* Initilialize the LwIP stack */
  lwip_init();
  
  
  IP4_ADDR(&ipaddr, IP_ADDRESS[0], IP_ADDRESS[1], IP_ADDRESS[2], IP_ADDRESS[3]);
  IP4_ADDR(&netmask, NETMASK_ADDRESS[0], NETMASK_ADDRESS[1] , NETMASK_ADDRESS[2], NETMASK_ADDRESS[3]);
  IP4_ADDR(&gw, GATEWAY_ADDRESS[0], GATEWAY_ADDRESS[1], GATEWAY_ADDRESS[2], GATEWAY_ADDRESS[3]); 
   
 
  /* add the network interface */
  netif_add(&gnetif, &ipaddr, &netmask, &gw, NULL, ðernetif_init, ðernet_input);
  
  
  /*  Registers the default network interface */
  netif_set_default(&gnetif);
 
  if (netif_is_link_up(&gnetif))
  {
    /* When the netif is fully configured this function must be called */
    netif_set_up(&gnetif);
  }
  else
  {
    /* When the netif link is down this function must be called */
       netif_set_down(&gnetif);
  }
 

armembedded

Newbie level 1
Joined
Dec 26, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Iran
Activity points
9
HI
you can work with rl-arm and keil ide.
Rl-arm is software solution for arm microcontrollers and you can work the network ,file system,usb and so on . but if you want to work with that you should get the licsience for that.

keil website is : www.keil.com
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top