STM32F746G CubeMx+FreeRTOS+Lwip Sorunu [ÇÖZÜLDÜ]

Başlatan volkanunal, 07 Ağustos 2017, 13:22:24

volkanunal

Herkese merhabalar , daha öncesinde cubemx ile birlikte gelen freertos+lwip uygulamasını kendime göre ayarlayıp internet üzerinden kontrol edebiliyordum.Başka çevre birimler ve third party eklentiler kuracağım için kemik kod yapısını kendim hazırlamam gerekti.Cubemx ile freertos , lwip gibi yapıları ve ayarlamaları yaptım.Ancak örnekte ki gibi bazı dosyalar gelmedi onları tekrar ekledim uygulamada gerekli ayarlamaları yapmaya çalıştım ancak örnekler ile birlikte gelen uygulamada ki çalıştıramadım.

Başlıca düşündüğüm sorunlar threadlar arasında bir problem var ,geçiş yapamıyorum.
#include "lwip/opt.h"
#include "lwip/arch.h"
#include "lwip/api.h"
#include "fs.h"
#include "string.h"
#include <stdio.h>
#include "httpserver-netconn.h"
#include "cmsis_os.h"
#include "stm32f7xx.h"                  // Device header




/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
#define WEBSERVER_THREAD_PRIO    ( tskIDLE_PRIORITY + 4 )

/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
u32_t nPageHits = 0;

/* Format of dynamic web page: the page header */
static const unsigned char PAGE_START[] = {
0x3c,0x21,0x44,0x4f,0x43,0x54,0x59,0x50,0x45,0x20,0x68,0x74,0x6d,0x6c,0x20,0x50,
0x55,0x42,0x4c,0x49,0x43,0x20,0x22,0x2d,0x2f,0x2f,0x57,0x33,0x43,0x2f,0x2f,0x44,
0x54,0x44,0x20,0x48,0x54,0x4d,0x4c,0x20,0x34,0x2e,0x30,0x31,0x2f,0x2f,0x45,0x4e,
0x22,0x20,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,
0x2e,0x6f,0x72,0x67,0x2f,0x54,0x52,0x2f,0x68,0x74,0x6d,0x6c,0x34,0x2f,0x73,0x74,
0x72,0x69,0x63,0x74,0x2e,0x64,0x74,0x64,0x22,0x3e,0x0d,0x0a,0x3c,0x68,0x74,0x6d,
0x6c,0x3e,0x0d,0x0a,0x3c,0x68,0x65,0x61,0x64,0x3e,0x0d,0x0a,0x20,0x20,0x3c,0x74,
0x69,0x74,0x6c,0x65,0x3e,0x53,0x54,0x4d,0x33,0x32,0x46,0x37,0x78,0x78,0x54,0x41,
0x53,0x4b,0x53,0x3c,0x2f,0x74,0x69,0x74,0x6c,0x65,0x3e,0x0d,0x0a,0x20,0x20,0x3c,
0x6d,0x65,0x74,0x61,0x20,0x68,0x74,0x74,0x70,0x2d,0x65,0x71,0x75,0x69,0x76,0x3d,
0x22,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x54,0x79,0x70,0x65,0x22,0x0d,0x0a,
0x20,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x3d,0x22,0x74,0x65,0x78,0x74,0x2f,0x68,
0x74,0x6d,0x6c,0x3b,0x20,0x63,0x68,0x61,0x72,0x73,0x65,0x74,0x3d,0x77,0x69,0x6e,
0x64,0x6f,0x77,0x73,0x2d,0x31,0x32,0x35,0x32,0x22,0x3e,0x0d,0x0a,0x20,0x20,0x3c,
0x6d,0x65,0x74,0x61,0x20,0x68,0x74,0x74,0x70,0x2d,0x65,0x71,0x75,0x69,0x76,0x3d,
0x22,0x72,0x65,0x66,0x72,0x65,0x73,0x68,0x22,0x20,0x63,0x6f,0x6e,0x74,0x65,0x6e,
0x74,0x3d,0x22,0x31,0x22,0x3e,0x0d,0x0a,0x20,0x20,0x3c,0x6d,0x65,0x74,0x61,0x20,
0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x3d,0x22,0x4d,0x53,0x48,0x54,0x4d,0x4c,0x20,
0x36,0x2e,0x30,0x30,0x2e,0x32,0x38,0x30,0x30,0x2e,0x31,0x35,0x36,0x31,0x22,0x20,
0x6e,0x61,0x6d,0x65,0x3d,0x22,0x47,0x45,0x4e,0x45,0x52,0x41,0x54,0x4f,0x52,0x22,
0x3e,0x0d,0x0a,0x20,0x20,0x3c,0x73,0x74,0x79,0x6c,0x65,0x20,0x3d,0x22,0x66,0x6f,
0x6e,0x74,0x2d,0x77,0x65,0x69,0x67,0x68,0x74,0x3a,0x20,0x6e,0x6f,0x72,0x6d,0x61,
0x6c,0x3b,0x20,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,0x79,0x3a,0x20,
0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x3b,0x22,0x3e,0x3c,0x2f,0x73,0x74,0x79,0x6c,
0x65,0x3e,0x0d,0x0a,0x3c,0x2f,0x68,0x65,0x61,0x64,0x3e,0x0d,0x0a,0x3c,0x62,0x6f,
0x64,0x79,0x3e,0x0d,0x0a,0x3c,0x68,0x34,0x3e,0x3c,0x73,0x6d,0x61,0x6c,0x6c,0x20,
0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,
0x6c,0x79,0x3a,0x20,0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x3b,0x22,0x3e,0x3c,0x73,
0x6d,0x61,0x6c,0x6c,0x3e,0x3c,0x62,0x69,0x67,0x3e,0x3c,0x62,0x69,0x67,0x3e,0x3c,
0x62,0x69,0x67,0x0d,0x0a,0x20,0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,0x66,0x6f,0x6e,
0x74,0x2d,0x77,0x65,0x69,0x67,0x68,0x74,0x3a,0x20,0x62,0x6f,0x6c,0x64,0x3b,0x22,
0x3e,0x3c,0x62,0x69,0x67,0x3e,0x3c,0x73,0x74,0x72,0x6f,0x6e,0x67,0x3e,0x3c,0x65,
0x6d,0x3e,0x3c,0x73,0x70,0x61,0x6e,0x0d,0x0a,0x20,0x73,0x74,0x79,0x6c,0x65,0x3d,
0x22,0x66,0x6f,0x6e,0x74,0x2d,0x73,0x74,0x79,0x6c,0x65,0x3a,0x20,0x69,0x74,0x61,
0x6c,0x69,0x63,0x3b,0x22,0x3e,0x53,0x54,0x4d,0x33,0x32,0x46,0x37,0x78,0x78,0x20,
0x4c,0x69,0x73,0x74,0x20,0x6f,0x66,0x20,0x74,0x61,0x73,0x6b,0x73,0x20,0x61,0x6e,
0x64,0x0d,0x0a,0x74,0x68,0x65,0x69,0x72,0x20,0x73,0x74,0x61,0x74,0x75,0x73,0x3c,
0x2f,0x73,0x70,0x61,0x6e,0x3e,0x3c,0x2f,0x65,0x6d,0x3e,0x3c,0x2f,0x73,0x74,0x72,
0x6f,0x6e,0x67,0x3e,0x3c,0x2f,0x62,0x69,0x67,0x3e,0x3c,0x2f,0x62,0x69,0x67,0x3e,
0x3c,0x2f,0x62,0x69,0x67,0x3e,0x3c,0x2f,0x62,0x69,0x67,0x3e,0x3c,0x2f,0x73,0x6d,
0x61,0x6c,0x6c,0x3e,0x3c,0x2f,0x73,0x6d,0x61,0x6c,0x6c,0x3e,0x3c,0x2f,0x68,0x34,
0x3e,0x0d,0x0a,0x3c,0x68,0x72,0x20,0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,0x77,0x69,
0x64,0x74,0x68,0x3a,0x20,0x31,0x30,0x30,0x25,0x3b,0x20,0x68,0x65,0x69,0x67,0x68,
0x74,0x3a,0x20,0x32,0x70,0x78,0x3b,0x22,0x3e,0x3c,0x73,0x70,0x61,0x6e,0x0d,0x0a,
0x20,0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,0x66,0x6f,0x6e,0x74,0x2d,0x77,0x65,0x69,
0x67,0x68,0x74,0x3a,0x20,0x62,0x6f,0x6c,0x64,0x3b,0x22,0x3e,0x0d,0x0a,0x3c,0x2f,
0x73,0x70,0x61,0x6e,0x3e,0x3c,0x73,0x70,0x61,0x6e,0x20,0x73,0x74,0x79,0x6c,0x65,
0x3d,0x22,0x66,0x6f,0x6e,0x74,0x2d,0x77,0x65,0x69,0x67,0x68,0x74,0x3a,0x20,0x62,
0x6f,0x6c,0x64,0x3b,0x22,0x3e,0x0d,0x0a,0x3c,0x74,0x61,0x62,0x6c,0x65,0x20,0x73,
0x74,0x79,0x6c,0x65,0x3d,0x22,0x77,0x69,0x64,0x74,0x68,0x3a,0x20,0x39,0x36,0x31,
0x70,0x78,0x3b,0x20,0x68,0x65,0x69,0x67,0x68,0x74,0x3a,0x20,0x33,0x30,0x70,0x78,
0x3b,0x22,0x20,0x62,0x6f,0x72,0x64,0x65,0x72,0x3d,0x22,0x31,0x22,0x0d,0x0a,0x20,
0x63,0x65,0x6c,0x6c,0x70,0x61,0x64,0x64,0x69,0x6e,0x67,0x3d,0x22,0x32,0x22,0x20,
0x63,0x65,0x6c,0x6c,0x73,0x70,0x61,0x63,0x69,0x6e,0x67,0x3d,0x22,0x32,0x22,0x3e,
0x0d,0x0a,0x20,0x20,0x3c,0x74,0x62,0x6f,0x64,0x79,0x3e,0x0d,0x0a,0x20,0x20,0x20,
0x20,0x3c,0x74,0x72,0x3e,0x0d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x74,0x64,
0x0d,0x0a,0x20,0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,0x66,0x6f,0x6e,0x74,0x2d,0x66,
0x61,0x6d,0x69,0x6c,0x79,0x3a,0x20,0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x3b,0x20,
0x66,0x6f,0x6e,0x74,0x2d,0x77,0x65,0x69,0x67,0x68,0x74,0x3a,0x20,0x62,0x6f,0x6c,
0x64,0x3b,0x20,0x66,0x6f,0x6e,0x74,0x2d,0x73,0x74,0x79,0x6c,0x65,0x3a,0x20,0x69,
0x74,0x61,0x6c,0x69,0x63,0x3b,0x20,0x62,0x61,0x63,0x6b,0x67,0x72,0x6f,0x75,0x6e,
0x64,0x2d,0x63,0x6f,0x6c,0x6f,0x72,0x3a,0x20,0x72,0x67,0x62,0x28,0x35,0x31,0x2c,
0x20,0x35,0x31,0x2c,0x20,0x32,0x35,0x35,0x29,0x3b,0x20,0x74,0x65,0x78,0x74,0x2d,
0x61,0x6c,0x69,0x67,0x6e,0x3a,0x20,0x63,0x65,0x6e,0x74,0x65,0x72,0x3b,0x22,0x3e,
0x3c,0x73,0x6d,0x61,0x6c,0x6c,0x3e,0x3c,0x61,0x0d,0x0a,0x20,0x68,0x72,0x65,0x66,
0x3d,0x22,0x2f,0x53,0x54,0x4d,0x33,0x32,0x46,0x37,0x78,0x78,0x2e,0x68,0x74,0x6d,
0x6c,0x22,0x3e,0x3c,0x73,0x70,0x61,0x6e,0x20,0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,
0x63,0x6f,0x6c,0x6f,0x72,0x3a,0x20,0x77,0x68,0x69,0x74,0x65,0x3b,0x22,0x3e,0x48,
0x6f,0x6d,0x65,0x0d,0x0a,0x70,0x61,0x67,0x65,0x3c,0x2f,0x73,0x70,0x61,0x6e,0x3e,
0x3c,0x2f,0x61,0x3e,0x3c,0x2f,0x73,0x6d,0x61,0x6c,0x6c,0x3e,0x3c,0x2f,0x74,0x64,
0x3e,0x0d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x74,0x64,0x0d,0x0a,0x20,0x73,
0x74,0x79,0x6c,0x65,0x3d,0x22,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,
0x79,0x3a,0x20,0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x3b,0x20,0x66,0x6f,0x6e,0x74,
0x2d,0x77,0x65,0x69,0x67,0x68,0x74,0x3a,0x20,0x62,0x6f,0x6c,0x64,0x3b,0x20,0x66,
0x6f,0x6e,0x74,0x2d,0x73,0x74,0x79,0x6c,0x65,0x3a,0x20,0x69,0x74,0x61,0x6c,0x69,
0x63,0x3b,0x20,0x62,0x61,0x63,0x6b,0x67,0x72,0x6f,0x75,0x6e,0x64,0x2d,0x63,0x6f,
0x6c,0x6f,0x72,0x3a,0x20,0x72,0x67,0x62,0x28,0x35,0x31,0x2c,0x20,0x35,0x31,0x2c,
0x20,0x32,0x35,0x35,0x29,0x3b,0x20,0x74,0x65,0x78,0x74,0x2d,0x61,0x6c,0x69,0x67,
0x6e,0x3a,0x20,0x63,0x65,0x6e,0x74,0x65,0x72,0x3b,0x22,0x3e,0x3c,0x61,0x0d,0x0a,
0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x53,0x54,0x4d,0x33,0x32,0x46,0x37,0x78,0x78,
0x41,0x44,0x43,0x2e,0x68,0x74,0x6d,0x6c,0x22,0x3e,0x3c,0x73,0x70,0x61,0x6e,0x20,
0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,0x66,0x6f,0x6e,0x74,0x2d,0x77,0x65,0x69,0x67,
0x68,0x74,0x3a,0x20,0x62,0x6f,0x6c,0x64,0x3b,0x22,0x3e,0x3c,0x2f,0x73,0x70,0x61,
0x6e,0x3e,0x3c,0x2f,0x61,0x3e,0x3c,0x73,0x6d,0x61,0x6c,0x6c,0x3e,0x3c,0x61,0x0d,
0x0a,0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x2f,0x53,0x54,0x4d,0x33,0x32,0x46,0x37,
0x78,0x78,0x54,0x41,0x53,0x4b,0x53,0x2e,0x68,0x74,0x6d,0x6c,0x22,0x3e,0x3c,0x73,
0x70,0x61,0x6e,0x20,0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,0x63,0x6f,0x6c,0x6f,0x72,
0x3a,0x20,0x77,0x68,0x69,0x74,0x65,0x3b,0x22,0x3e,0x4c,0x69,0x73,0x74,0x0d,0x0a,
0x6f,0x66,0x20,0x74,0x61,0x73,0x6b,0x73,0x3c,0x2f,0x73,0x70,0x61,0x6e,0x3e,0x3c,
0x2f,0x61,0x3e,0x3c,0x2f,0x73,0x6d,0x61,0x6c,0x6c,0x3e,0x3c,0x2f,0x74,0x64,0x3e,
0x0d,0x0a,0x20,0x20,0x20,0x20,0x3c,0x2f,0x74,0x72,0x3e,0x0d,0x0a,0x20,0x20,0x3c,
0x2f,0x74,0x62,0x6f,0x64,0x79,0x3e,0x0d,0x0a,0x3c,0x2f,0x74,0x61,0x62,0x6c,0x65,
0x3e,0x0d,0x0a,0x3c,0x62,0x72,0x3e,0x0d,0x0a,0x3c,0x2f,0x73,0x70,0x61,0x6e,0x3e,
0x3c,0x73,0x70,0x61,0x6e,0x20,0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,0x66,0x6f,0x6e,
0x74,0x2d,0x77,0x65,0x69,0x67,0x68,0x74,0x3a,0x20,0x62,0x6f,0x6c,0x64,0x3b,0x22,
0x3e,0x3c,0x2f,0x73,0x70,0x61,0x6e,0x3e,0x3c,0x73,0x6d,0x61,0x6c,0x6c,0x3e,0x3c,
0x73,0x70,0x61,0x6e,0x0d,0x0a,0x20,0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,0x66,0x6f,
0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,0x79,0x3a,0x20,0x56,0x65,0x72,0x64,0x61,
0x6e,0x61,0x3b,0x22,0x3e,0x4e,0x75,0x6d,0x62,0x65,0x72,0x20,0x6f,0x66,0x20,0x70,
0x61,0x67,0x65,0x20,0x68,0x69,0x74,0x73,0x3a,0x0d,0x0a,0x00};

/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

/**
  * @brief serve tcp connection  
  * @param conn: pointer on connection structure 
  * @retval None
  */
const static char http_html_hdr[] = "HTTP/1.1 200 OK\r\nContent-type: text/html\r\n\r\n";
const static char http_index_html[] = "<html><head><title>Deneme!</title></head><body><h1>Welcome to Volkan's Space!</h1><p></body></html>";
const static char http_led_html[]="<br><a href=\"led1\"><button type='button'>ON</button></a>";
const static char http_led2_html[]="<br><a href=\"led2\"><button type='button'>OFF</button></a>";
const static char http_text_html[]="<FORM ACTION='/' method=get ><input type=""text"" name=""textbox"" size=""25"" value="">";
const static char http_text_button_html[]="<input type='submit' value='Bir sey gonder!'></FORM>";

void http_server_serve(struct netconn *conn) 
{
  struct netbuf *inbuf;
  err_t recv_err;
  char* buf;
  u16_t buflen;
  
  
  /* Read the data from the port, blocking if nothing yet there. 
   We assume the request (the part we care about) is in one netbuf */
  recv_err = netconn_recv(conn, &inbuf);

  if (recv_err == ERR_OK)
  {

    if (netconn_err(conn) == ERR_OK) 
    {
      netbuf_data(inbuf, (void**)&buf, &buflen);
      /* Is this an HTTP GET command? (only check the first 5 chars, since
      there are other formats for GET, and we're keeping it very simple )*/
      if ((buflen >=5) && (strncmp(buf, "GET /", 5) == 0))
      {
				      netconn_write(conn, http_html_hdr, sizeof(http_html_hdr)-1, NETCONN_NOCOPY);
							netconn_write(conn, http_index_html, sizeof(http_index_html)-1, NETCONN_NOCOPY);
							netconn_write(conn, http_led_html,sizeof(http_led_html)-1,NETCONN_NOCOPY);
							netconn_write(conn, http_led2_html,sizeof(http_led2_html)-1,NETCONN_NOCOPY);
							netconn_write(conn,http_text_html,sizeof(http_text_html)-1,NETCONN_NOCOPY);
							netconn_write(conn,http_text_button_html,sizeof(http_text_button_html)-1,NETCONN_NOCOPY);

         if (strncmp((char const *)buf,"GET /led1", 9) == 0)
				 {

				 }
				 else if(strncmp((char const *)buf,"GET /led2",9)==0)
				 {
				 }
				   
				 

				 
      }      
    }
  }
								

  /* Close the connection (server closes in HTTP) */
  netconn_close(conn);
  
  /* Delete the buffer (netconn_recv gives us ownership,
   so we have to make sure to deallocate the buffer) */
  netbuf_delete(inbuf);
}


/**
  * @brief  http server thread 
  * @param arg: pointer on argument(not used here) 
  * @retval None
  */
static void http_server_netconn_thread(void *arg)
{  struct netconn *conn, *newconn;
  err_t err, accept_err;
  
  /* Create a new TCP connection handle */
  conn = netconn_new(NETCONN_TCP);
  
  if (conn!= NULL)
  {
    /* Bind to port 80 (HTTP) with default IP address */
    err = netconn_bind(conn, NULL, 80);
    
    if (err == ERR_OK)
    {
      /* Put the connection into LISTEN state */
      netconn_listen(conn);
  
      while(1) 
      {
        /* accept any icoming connection */
        accept_err = netconn_accept(conn, &newconn);

        if(accept_err == ERR_OK)
        {
          /* serve connection */
          http_server_serve(newconn);

          /* delete connection */
          netconn_delete(newconn);
        }
      }
    }
		else { 					HAL_GPIO_WritePin(GPIOI,GPIO_PIN_1,GPIO_PIN_RESET);
		}
  }
}

/**
  * @brief  Initialize the HTTP server (start its thread) 
  * @param  none
  * @retval None
  */
void http_server_netconn_init()
{
  sys_thread_new("HTTP", http_server_netconn_thread, NULL, DEFAULT_THREAD_STACKSIZE, WEBSERVER_THREAD_PRIO);
	
}


Bu internet üzerinden basitçe kontrol ettiğim kısım. Bu kod içerisinde
static void http_server_netconn_thread(void *arg) kısmında  conn != ya da conn == NULL kısmına hiç bir şekilde girmiyor. Ama fonksiyondan hemen sonrasını test ettğim de giriyor.

Sorunu tam anlatamamış olabilirim , sorunu anlamak adına soracağınız sorulara cevap vererek sorunu anlatabilirim belki
Primum nil nocere

volkanunal

Sorunu çözdüm , faydalı olması açısında CubeMx  üzerinden freertos +lwip +web server içeren bir uygulama hazırladım.
https://engineeringvolkan.wordpress.com/2017/08/08/1600/
Primum nil nocere

M_B

@volkanunal hocam bilgi ve paylaşım icin teşekkürler.
Hocam Lwip de
• Raw API
• Netconn API
• Socket API
apilerin acilimi nedir.
Sizin ornekte Netconn kullanmıssınız.
İncelediğim bir başka ornek kodlarda ise Raw api kullanılmış.
Farkları nedir ?

Teşekkürler.
İmkanın sınırlarını görmek için imkansızı denemek lazım.                                                             Fatih Sultan Mehmet

volkanunal

Merhabalar konu üzerinde  yeni çalışıyorum ancak user manulden anladığım kadarını aktarıyım , netconn apiyi seçme nedenim , inceledeğim bir çok örnekte onun kullanılmasıydı ve kullanımının diğerlerine nazaran daha zahmetsiz oluşuydu.Netconn api genel olarak şu şekilde çalışıyor
BAĞLAN-DİNLE-GÖNDER-KAPAT şeklinde.Aynı zamanda farklı threadlerde çağırabiliyorsunuz.Raw apinin ise geri çağırma mantığı ile çalıştığı yazıyor internette.Dediğim gibi tam hakim değilim şurada ki kaynak yardımcı olabilir.

http://lwip.wikia.com/wiki/Application_API_layers

Farklı denemeler yapıp sonucu burada paylaşacağım.
Primum nil nocere

volkanunal

LwIP has three application programming interfaces (APIs):
• Raw API is the native LwIP API. It enables the development of applications using event
callbacks. This API provides the best performance and optimized code size, but adds
some complexity to application development.
• Netconn API is a high-level sequential API that requires a real-time operating system
(RTOS). The Netconn API enables multithreaded operations.
• BSD Socket API: Berkeley-like Socket API (developed on top of the Netconn API)

Primum nil nocere

volkanunal

Şöyle bir sorum olacak deneyimli arkadaşlar cevaplar ise sevinirim , uygulamada birden fazla iş yapacağımı varsayalım sd kart , uart , gpio kontrolleri gibi gibi , bunların her biri için ayrı bir task tanımlamak ve öncelik belirlemek mi yapmalı yoksa başka bir yol mevcut mu
Primum nil nocere

muhittin_kaplan


ogy

@volkanunal hocam,

Elimde STM32F769I-EVAL kiti var.

C:\Users\PC\STM32Cube\Repository\STM32Cube_FW_F7_V1.7.0\Projects\STM32F769I_EVAL\Applications\LwIP\LwIP_HTTP_Server_Netconn_RTOS

Yukarıdaki örnek uygulamayı derleyip yükledim çalışıyor. Sizin yaptığınız gibi cubemx üzerinden sade bir uygulama yapmaya çalıştım. Bloğunuzdaki yazıda bütün adımları yaptım. Ethernet konektöründeki ledler kırpışıyor fakat sayfa görüntüleyemedim bir türlü.

Aklıma takılan birkaç şey var.

1- Bendeki kitin datasheet inde phy çipinin işlemciye MII modunda bağlı olduğu yazıyor. RMII ve MII olarak ikisini de denedim çalışmadı. Acaba diğer MII half dublex yada MII full dublex modları kullanmam gerekir mi? Bu modların anlamı nedir?

2- Cubemx - SYS - Timbase Source kısmında Systick seçili olursa "code generate" dediğimde bu tavsiye edilmez şeklinde uyarı veriyor. Hem Systick hem TIM1 olarak denedim yine sonuç yok.

3- main.c içindeki StartDefaultTask fonksiyonunda default olarak "osDelay(1);" geliyor. Siz "osThreadTerminate(NULL);" yapmışsınız. Hangisi olmalı?


volkanunal

Alıntı yapılan: ogy - 12 Kasım 2017, 17:39:52
@volkanunal hocam,

Elimde STM32F769I-EVAL kiti var.

C:\Users\PC\STM32Cube\Repository\STM32Cube_FW_F7_V1.7.0\Projects\STM32F769I_EVAL\Applications\LwIP\LwIP_HTTP_Server_Netconn_RTOS

Yukarıdaki örnek uygulamayı derleyip yükledim çalışıyor. Sizin yaptığınız gibi cubemx üzerinden sade bir uygulama yapmaya çalıştım. Bloğunuzdaki yazıda bütün adımları yaptım. Ethernet konektöründeki ledler kırpışıyor fakat sayfa görüntüleyemedim bir türlü.

Aklıma takılan birkaç şey var.

1- Bendeki kitin datasheet inde phy çipinin işlemciye MII modunda bağlı olduğu yazıyor. RMII ve MII olarak ikisini de denedim çalışmadı. Acaba diğer MII half dublex yada MII full dublex modları kullanmam gerekir mi? Bu modların anlamı nedir?

2- Cubemx - SYS - Timbase Source kısmında Systick seçili olursa "code generate" dediğimde bu tavsiye edilmez şeklinde uyarı veriyor. Hem Systick hem TIM1 olarak denedim yine sonuç yok.

3- main.c içindeki StartDefaultTask fonksiyonunda default olarak "osDelay(1);" geliyor. Siz "osThreadTerminate(NULL);" yapmışsınız. Hangisi olmalı?



RMII İLE MII arasında clock speed farkı var diye biliyorum rmii -> 50mhz , mii->25mhz 
evet tavsiye edilmez uyarısını bende almıştım ancak çok aldırış etmedim deneme yanılma yaptığım için
osThreadTerminate(NULL)  ifadesi generate ettiğim de gelmiş olabilir net olarak hatırlamıyorum o kısmı.

Adrese ping attığınız vakit , aldığınız cevap ne oluyor acaba hocam ?
Primum nil nocere

ogy

Hocam sizden de cevap gelmeyince pes etmiştim. Az önce en baştan tekrar denedim ve çalıştı. Fakat o kadar çok şey denemiştim ki bu sefer neyi doğru yaptım da çalıştı anlamadım. Bu arada benim DP83848 çipinde 25 mhz kristal var. Yani MII modda çalıştırdım.

Şimdi tcp client olarak ayarlayıp server'a data göndermeye çalışıcam. Bunun için hangi api uygun acaba?

volkanunal

Hocam açıkcası ben de çok uğraşmadım uygulamadan sonra :)
Primum nil nocere