- This topic has 2 replies, 2 voices, and was last updated 7 years, 9 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Home › Forums › Mastering STM32 book support forum › LWIP with and without FreeRTOS
Hi 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.
Do you call the MX_LWIP_Process() function somewhere in the main() (or any other place at your convenience)?
Oh 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 ?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
while (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 immediately tcp_close(pcb); return err; } |
thank you for you (fast) help.