Home › Forums › Mastering STM32 book support forum › LWIP with and without FreeRTOS
- This topic has 2 replies, 2 voices, and was last updated 8 years, 9 months ago by
ilco13.
-
AuthorPosts
-
January 30, 2017 at 10:35 pm #5903
ilco13
ParticipantHi Carmine,
Hi all,
It appears that I face a very strange problem on my Nucleo F429ZI board. I’m using Cube MX 4.19 on Mac and the last firmware update (1.14) for the STM32F4.
When I generate a project with LWIP and FreeRTOS (as you for the F7), I compile it, right out of CubeMX (no code modification), program the board, and than I can ping it from my Mac without any issue. It’s great ! Wow!
I do not set nor unset any special option, just use the default configuration with DHCP.
However, if I try to do the same with LWIP only (so without FreeRTOS, the simplest way so…), the board has no IP address, and I cannot ping it! The Ethernet port LEDs are blinking but it seems it cannot register on my network. I try to change DHCP to static IP, same problem.
Have you ever tries LWIP without FreeRTOS on CubeMX ?? Is there special option to setup in this case??
I’m a bit stuck.
-
This topic was modified 8 years, 9 months ago by
ilco13.
January 30, 2017 at 10:40 pm #5906Carmine Noviello
KeymasterDo you call the MX_LWIP_Process() function somewhere in the main() (or any other place at your convenience)?
January 30, 2017 at 11:01 pm #5915ilco13
ParticipantOh oops, I totally forget to do that. I’ve put it in my while(1) loop with a small delay before and it’s working now.
I read the commentary about what it does and realize my mistake.
However, no, with MX_LWIP_Process() running at each loop, I wonder how I can open a tcp socket and send data ? Can I integrate part of the tcp socket creation inside MX_LWIP_Process() function ?
123456789101112131415161718192021222324252627282930313233while (1){/* USER CODE END WHILE */Delay(2000000);MX_LWIP_Process();pcb = tcp_new();ret_val = tcp_connect(pcb, &dest, 1883, callback_Connected);if (ret_val != ERR_OK)printf("\tcp_connect(): Errors on return value, returned value is %d\n", ret_val);/* USER CODE BEGIN 3 */}err_t callback_Connected(void *arg, struct tcp_pcb *pcb, err_t err){err = tcp_write(pcb,buf,len,1);tcp_output(pcb); //to make it send the data immediatelytcp_close(pcb);return err;}thank you for you (fast) help.
-
This reply was modified 8 years, 9 months ago by
ilco13.
-
This topic was modified 8 years, 9 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.
