stm32f407vg上的httpd Web服务器

时间:2020-06-22 11:24:18

标签: webserver httpd.conf stm32f4discovery

/* Includes ------------------------------------------------------------------*/
                    #include "main.h"
                    #include "lwip.h"

                    /* Private includes ----------------------------------------------------------*/
                    /* USER CODE BEGIN Includes */

                    #include "lwip/apps/httpd.h"

                    /* USER CODE END Includes */

                    /* Private typedef -----------------------------------------------------------*/
                    /* USER CODE BEGIN PTD */

                    /* USER CODE END PTD */

                    /* Private define ------------------------------------------------------------*/
                    /* USER CODE BEGIN PD */
                    /* USER CODE END PD */

                    /* Private macro -------------------------------------------------------------*/
                    /* USER CODE BEGIN PM */

                    /* USER CODE END PM */

                    /* Private variables ---------------------------------------------------------*/

                    UART_HandleTypeDef huart3;

                    PCD_HandleTypeDef hpcd_USB_OTG_FS;

                    /* USER CODE BEGIN PV */

                    /* USER CODE END PV */

                    /* Private function prototypes -----------------------------------------------*/
                    void SystemClock_Config(void);
                    static void MX_GPIO_Init(void);
                    static void MX_USART3_UART_Init(void);
                    static void MX_USB_OTG_FS_PCD_Init(void);
                    /* USER CODE BEGIN PFP */

                    /* USER CODE END PFP */

                    /* Private user code ---------------------------------------------------------*/
                    /* USER CODE BEGIN 0 */

                    /* USER CODE END 0 */

                    /**
                    * @brief  The application entry point.
                    * @retval int
                    */
                    int main(void) {
                        /* USER CODE BEGIN 1 */

                        /* USER CODE END 1 */

                        /* MCU Configuration--------------------------------------------------------*/

                        /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
                        HAL_Init();

                        /* USER CODE BEGIN Init */

                        /* USER CODE END Init */

                        /* Configure the system clock */
                        SystemClock_Config();

                        /* USER CODE BEGIN SysInit */

                        /* USER CODE END SysInit */

                        /* Initialize all configured peripherals */
                        MX_GPIO_Init();
                        MX_USART3_UART_Init();
                        MX_USB_OTG_FS_PCD_Init();
                        MX_LWIP_Init();
                        /* USER CODE BEGIN 2 */

                        // initializing the HTTPd
                        httpd_init();

                        /* USER CODE END 2 */

                        /* Infinite loop */
                        /* USER CODE BEGIN WHILE */
                        while (1) {

                            // starting the LWIP process
                            MX_LWIP_Process();
                            /* USER CODE END WHILE */

                            /* USER CODE BEGIN 3 */
                        }
                        /* USER CODE END 3 */
                    }

我想显示一个静态的HTML页面。
我已经使用makefsdata实用工具生成了fsdata_custom.c。
我正在使用USB将stm32f4(连接到具有以太网端口的stm32扩展板的stm32f4)连接到PC。另外,将以太网电缆连接到stm32f4和PC。我正在使用stmcubeide。
我已经在板上载了代码,但是未显示该网页。无法访问该网页。 IP地址拒绝连接。
DHCP已启用。 Ping显示网络可以访问。
我不知道问题出在哪里?还有什么配置吗?

0 个答案:

没有答案