fix some issues and test on hw

This commit is contained in:
2022-05-29 17:35:32 +02:00
parent eccf453415
commit ff3a95efa6
13 changed files with 94 additions and 137 deletions

View File

@ -98,7 +98,7 @@ a lot of data that needs to be copied, this should be set high. */
#define PBUF_POOL_SIZE 4
/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
#define PBUF_POOL_BUFSIZE 1528
#define PBUF_POOL_BUFSIZE 1536
/* LWIP_SUPPORT_CUSTOM_PBUF == 1: to pass directly MAC Rx buffers to the stack
no copy is needed */
@ -232,12 +232,12 @@ The STM32H7xx allows computing and verifying the IP, UDP, TCP and ICMP checksums
*/
#define TCPIP_THREAD_NAME "TCP/IP"
#define TCPIP_THREAD_STACKSIZE 1000
#define TCPIP_THREAD_STACKSIZE 2048
#define TCPIP_MBOX_SIZE 6
#define DEFAULT_UDP_RECVMBOX_SIZE 6
#define DEFAULT_TCP_RECVMBOX_SIZE 6
#define DEFAULT_ACCEPTMBOX_SIZE 6
#define DEFAULT_THREAD_STACKSIZE 500
#define DEFAULT_THREAD_STACKSIZE 1024
#define TCPIP_THREAD_PRIO osPriorityHigh
/*

View File

@ -8,7 +8,6 @@
#if OBSW_ADD_LWIP_COMPONENTS == 1
#include "example_common/stm32h7/networking/app_ethernet.h"
#include "example_common/stm32h7/networking/ethernetif.h"
#include <app_ethernet.h>
#include <lwip/init.h>
#include <lwip/ip_addr.h>
#include <lwip/netif.h>
@ -16,13 +15,13 @@
#endif
#include <boardconfig.h>
#include <stdio.h>
#include <cstdio>
/* Forward declarations */
void MPU_Config(void);
void SystemClock_Config(void);
void BSP_Config(void);
void CPU_CACHE_Enable(void);
void MPU_Config();
void SystemClock_Config();
void BSP_Config();
void CPU_CACHE_Enable();
void MX_USART3_UART_Init(uint32_t baudRate);
/**
@ -113,7 +112,7 @@ void MX_USART3_UART_Init(uint32_t baudRate) {
* @param None
* @retval None
*/
void SystemClock_Config(void) {
void SystemClock_Config() {
RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_OscInitTypeDef RCC_OscInitStruct;
HAL_StatusTypeDef ret = HAL_OK;
@ -176,7 +175,7 @@ value regarding system frequency refer to product datasheet. */
}
/*Configure the MPU attributes */
void MPU_Config(void) {
void MPU_Config() {
MPU_Region_InitTypeDef MPU_InitStruct;
/* Disable the MPU */
@ -219,7 +218,7 @@ for LwIP RAM heap which contains the Tx buffers */
}
/*CPU L1-Cache enable*/
void CPU_CACHE_Enable(void) {
void CPU_CACHE_Enable() {
/* Enable I-Cache */
SCB_EnableICache();
@ -227,7 +226,7 @@ void CPU_CACHE_Enable(void) {
SCB_EnableDCache();
}
void BSP_Config(void) {
void BSP_Config() {
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
@ -253,8 +252,8 @@ void Netif_Config(void) {
/* add the network interface */
struct netif *netif_valid =
netif_add(&gnetif, (ip4_addr_t *)&ipaddr, (ip4_addr_t *)&netmask,
(ip4_addr_t *)&gw, NULL, &ethernetif_init, &ethernet_input);
if (netif_valid == NULL) {
(ip4_addr_t *)&gw, nullptr, &ethernetif_init, &ethernet_input);
if (netif_valid == nullptr) {
printf("Error: netif initialization failed!\n\r");
return;
}