Associate III
June 28, 2018
Question
disco/nucleo board ultra low speed ethernet
- June 28, 2018
- 1 reply
- 4727 views
Posted on June 28, 2018 at 15:04
Hello, im generating default ethernet codes from CubeMX. im using freertos+lwip and i set static ip. All other lwip settings are default. My clock config:
My default lwIP settings:
My default FreeRtos settings:
And i use simple below iperf codes for test.
void iperfthread(void *arg) { ethernetif_input(&gnetif); } void iperf_test_start(void) { sys_thread_new(''iperfthread'', iperfthread, NULL, 128, osPriorityRealtime ); } static err_t iperf_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) { LWIP_UNUSED_ARG(arg); if (err == ERR_OK && p != NULL) { tcp_recved(pcb, p->tot_len); pbuf_free(p); } else if (err != ERR_OK && p != NULL) { pbuf_free(p); } if (err == ERR_OK && p == NULL) { tcp_arg(pcb, NULL); tcp_sent(pcb, NULL); tcp_recv(pcb, NULL); tcp_close(pcb); } return ERR_OK; } static err_t iperf_accept(void *arg, struct tcp_pcb *pcb, err_t err) { LWIP_UNUSED_ARG(arg); LWIP_UNUSED_ARG(err); tcp_arg(pcb, NULL); tcp_sent(pcb, NULL); tcp_recv(pcb, iperf_recv); return ERR_OK; } void iperf_init(void) { struct tcp_pcb *pcb; pcb = tcp_new(); tcp_bind(pcb, IP_ADDR_ANY, 5001); // bind to iperf port pcb = tcp_listen(pcb); tcp_accept(pcb, iperf_accept); } �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�? im creating simple thread for iperf task. And this is my main
int main(void) { /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_RTC_Init(); MX_TIM1_Init(); /* USER CODE BEGIN 2 */ MX_LWIP_Init(); iperf_init(); iperf_test_start(); /* USER CODE END 2 */ /* Start scheduler */ osKernelStart(); /* We should never get here as control is now taken by the scheduler */ /* USER CODE BEGIN WHILE */ while (1) { } }�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�? Test results are so bad. 11-12Mbits/sec.
For nucleo board the speed is 15 Mbps
How can i fix and increase it ?
#cubemx #ethernet #lwip #iperf #discovery Note: this post was migrated and contained many threaded conversations, some content may be missing.