Giter Site home page Giter Site logo

cyclonetcp's People

Contributors

oryxembeddedadmin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cyclonetcp's Issues

TCP stack stops

When I run the standard "http_sever_demo" example on my ARTERY evaluation board, everything is stable.
But when I try to change the resources (I enter my WWW project), then in the case when some *.js file exceeds about 250 K bytes, the program freezes. The web page hangs waiting for such a file, which for some reason does not come.

Has anyone encountered such a problem and how to solve it?

RNDIS driver. Support USB HS/FS

Support for two USB interfaces (HS and FS), including simultaneously!
For example:

if(length < RNDIS_DATA_OUT_EP_MPS_FS)

It is better to use the device type to select the packet size
if(length < pdev->ep_out[epnum].maxpacket)

But I see a lot of work to be done to support two USB interfaces at the same time!

Best Regards, Aleksandr (aka bullitmaster)!

gethostname API in bsd_socket

I have a problem about the bsd sockets API
int_t gethostbyname(const char_t *name, hostent *info);
which is a different from my understanding.
hostent *gethostbyname(const char_t *name);
I think it would cause problem for migrating other network application.

[demos] clang-cl compile error

What is up with the state of the Windows code in the demos?
E.g. compiling http_server_demo/src/main.c using clang-cl v17.0.1 (for x64), gives me this error:

demo/http_server_demo/src/main.c(80,42): error: conflicting types for 'WaitForSingleObject'
   80 | __declspec(dllimport) uint32_t __stdcall WaitForSingleObject(
      |                                          ^
f:\gv\WinKit\Include\10.0.22621.0\um\synchapi.h(346,1): note: previous declaration is here
  346 | WaitForSingleObject(
      | ^
1 error generated.

There should be no need to prototype this OS-function (since <windows.h> should have been included already).
But pre-processing this files gives:

// From <synchapi.h>
__declspec (dllimport) DWORD __stdcall WaitForSingleObject (HANDLE hHandle, DWORD dwMilliseconds);

// From http_server_demo/src/main.c:
__declspec (dllimport) uint32_t __stdcall WaitForSingleObject (void *hHandle, uint32_t dwMilliseconds);

See, not really the same due to the typedefs according to clag-cl. But the same in practice.

With cl, there is only a warning:

demo/http_server_demo/src/main.c(81): warning C4028: formal parameter 2 different from declaration
demo/http_server_demo/src/main.c(81): warning C4142: 'WaitForSingleObject': benign redefinition of type
f:\gv\WinKit\Include\10.0.22621.0\um\synchapi.h(346): note: see declaration of 'WaitForSingleObject'

There is this same issue with all demo/*/main.c files.

NAT

Are there any plans to add NAT capabilities to the stack ?

Null Driver support

Hi Dev team,

From my view, it will be better if the stack supports default null drivers to prevent unexpected calling to uninitialized drivers.

Add drivers/switch/lan9353

Hi!

I made a lan9353 driver based on lan9303. lan9353 has several changes in the bit structure. I checked a little, but I can not give any guarantees! Also I tested with RSTP.
Main bit difference LAN9353_SWE_ALR_RD_DAT_1_END_OF_TABLE
9303 - 13.4.3.5 Switch Engine ALR Read Data 1 Register (SWE_ALR_RD_DAT_1)
9353 - 10.7.3.5 Switch Engine ALR Read Data 1 Register (SWE_ALR_RD_DAT_1)
lan9353.zip

I have saved the entire file, including your copyright!
I do not claim any rights to these files! You can use them!

Thanks for your project! This is a cool code!

Best regards, bullitmaster!

enc28j60 problem

I have problem with enc28j60, in some network it does not work.

Link is up (eth0)...
  Link speed = 10 Mbps
  Duplex mode = Full-Duplex
1s 272ms: DHCP client SELECTING state

and not happen

PSP protocol

Can we expect the addition of the PSP protocol (IPSec alternative) from Google?

DHCP Server. Flush binding after link is down?

Do need to flush DHCP Server Context clientBinding[] after netInterface link is down?

void netProcessLinkChange(NetInterface *interface)

My config:
#define DHCP_SERVER_MAX_CLIENTS 3 // may be 1? )
RNDIS Driver

After 3 connections (USB plug unplug), the host does not receive the IP address! No free clientBinding[].

Now my decision:
add in void rndisDriverEventHandler(NetInterface *interface)

...
else {
        //Link is down
        interface->linkState = FALSE;
        //Clean DHCP clientBinding
        for(uint16_t i = 0; i< DHCP_SERVER_MAX_CLIENTS; i++){  
            memset(&interface->dhcpServerContext->clientBinding[i], 0 , sizeof(DhcpServerBinding));  
        }
...

May be use callback:error_t netAttachLinkChangeCallback(NetInterface *interface, NetLinkChangeCallback callback, void *param) ?

Best Regards,
Aleksandr (aka bullitmaster)!

CycloneTCP HTTP Web Server Demo For STM32F207 using ATWINC1500 WiFi not working

I am using STM32F207 Microcontroller for Ethernet and Wifi(ATWINC1500) Interface with ide Keil Uv5, I have installed the CycloneTCP Tcp/Ip stack version CycloneTCP_SSL_SSH_CRYPTO_Open_2_0_2 on top of it and everything compiles fine.

However, when I try one of the examples included with CycloneTCP for STM32F207, Compiled Fine, Access Point Successfully Created, also DHCP Server Working fine and able to connect my lappy to that Access Point. But HTTP Server not Working.

But My Http Server Using LAN Interface(DP83848) Working fine, I am not getting the point where the piece of code misbehave.
I am not able to atach my workspace, you can ask for it at [email protected]
Capture
Capture2
Capture3
Capture4
Capture5
Capture6
Capture7
Capture8

[contradiction/bug] Flash area access (const). STM32. USB RNDIS. ST USB Device Lib

Hi!

Target STM32f. USB RNDIS.
I have turned on the MPU with checking access to address 0 and Flash area.
In the code of the file third_party/st/drivers/stm32_usb_device_library/core/src/usbd_ctrlreq.c:
Function:
static void USBD_GetDescriptor(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
Line 413:

  case USB_DESC_TYPE_CONFIGURATION:  
  if (pdev->dev_speed == USBD_SPEED_HIGH)  
  {  
  pbuf = pdev->pClass->GetHSConfigDescriptor(&len);  
  pbuf[1] = USB_DESC_TYPE_CONFIGURATION; 
  }  
  else
  {
    pbuf = pdev->pClass->GetFSConfigDescriptor(&len);
    pbuf[1] = USB_DESC_TYPE_CONFIGURATION;  <<<< Line 413
  }
  break;

Writing to the second element of the array that is located on the flash: Mem_Fault!

Descriptor is const:

const UsbConfigDescriptors usbdConfigDescriptors =

Link to official repository:
https://github.com/STMicroelectronics/stm32_mw_usb_device/blob/5af065de854f4573511e023aa76c3462c60a0a21/Core/Src/usbd_ctlreq.c#L414

In examples from st.com, descriptors are always not constants!

/* USB CDC device Configuration Descriptor */
__ALIGN_BEGIN static uint8_t USBD_CDC_CfgFSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =

and

/* USB CDC_RNDIS device Configuration Descriptor */
__ALIGN_BEGIN static uint8_t USBD_CDC_RNDIS_CfgHSDesc[] __ALIGN_END =

etc.

There is also no alignment!

Thanks!

Optimization of memory usage

Can use a pointer instead of copying data?

DhcpServerSettings settings; ///<DHCP server settings

typedef struct {
   DhcpServerSettings settings;                              ///<DHCP server settings
   ...
} DhcpServerContext;

DhcpClientSettings settings; ///<DHCP client settings

struct _DhcpClientContext {
   DhcpClientSettings settings; ///<DHCP client settings
  ...
};

HttpServerSettings settings; ///<User settings

struct _HttpServerContext {
   HttpServerSettings settings;                                  ///<User settings
...
};

use:

context->settings = *settings;

error_t dhcpClientInit(DhcpClientContext *context, const DhcpClientSettings *settings) ...
error_t dhcpServerInit(DhcpServerContext *context, const DhcpServerSettings *settings) ...
error_t httpServerInit(HttpServerContext *context, const HttpServerSettings *settings) {
...
   //Save user settings
   context->settings = *settings;

and etc(?).
Change type settings to pointer(?)!

Best regards,
Aleksandr (aka bullitmaster)!

How to add new demo with AT32F437

We plan to port this protocol stack to AT32F437ZMT7 chip (AT32-START-F437 board), but after re-creating mac and phy(DM9162, copy with DM9161 chips) drivers, only 10Mbps can be recognized. In addition, only IGMPv2 packets can be sent and cannot be pinged through. I hope that the official can provide migration guidance. Thank you very much!

https://www.arterytek.com/cn/product/AT32F437.jsp

[Windows] osDeleteTask() problem

Building and running http_server.exe on Windows with good-ol'e WinPcap works great:
cyclonetcp

But pressing q to quit the program does not work. Adding some trace-code,
I see that WaitforSingleObject() in main() never returns!

I modified userTask():

        static int user_task_deleted = 0;
        ....
         else if(toupper(ch) == 'Q')
         {
            //Kill ourselves
            TRACE_INFO ("calling 'osDeleteTask()'\n");
            user_task_deleted = 1;
            osDeleteTask(OS_SELF_TASK_ID);
         }

and main():

  #define WAIT_TIMEOUT 258
 
   //Wait until the user task has terminated
   while (1)
   {
     TRACE_INFO ("user_task_deleted: %d\n", user_task_deleted);
     if (WaitForSingleObject(taskId, 10000) != WAIT_TIMEOUT)
        break;
   }

The while (1) loop never quits and the trace never shows a user_task_deleted: 1.

The only fix for me was to replace osDeleteTask(OS_SELF_TASK_ID); with ExitProcess(0);.

Someone please explain this.

PS. I built everything with bare minimum of features from git master some days ago (with cl and clang-cl) and
      the latest CycloneTCP_SSL_*.zip from https://www.oryx-embedded.com/download/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.