oryx-embedded / cyclonetcp Goto Github PK
View Code? Open in Web Editor NEWDual IPv4/IPv6 Stack
Home Page: https://www.oryx-embedded.com/products/CycloneTCP
License: GNU General Public License v2.0
Dual IPv4/IPv6 Stack
Home Page: https://www.oryx-embedded.com/products/CycloneTCP
License: GNU General Public License v2.0
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?
I cant install in Stm32CubeMX. Please help
Support for two USB interfaces (HS and FS), including simultaneously!
For example:
CycloneTCP/drivers/usb_rndis/usbd_rndis.c
Line 365 in 697d4f6
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)!
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.
Hi!
Maybe you should add a mask to the last byte if the number of coils is not a multiple of 8?
CycloneTCP/modbus/modbus_client_pdu.c
Line 286 in de53360
See document page 29: https://modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf
Quote: "Unused bits in the last data byte should be zero– filled."
Best regards,
Aleksandr (aka bullitmaster)!
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.
Are there any plans to add NAT capabilities to the stack ?
In this line
Line 331 in 1976f59
you are referencing to connection->serverContext in the else-path which gets assigned in the if-section.
did you mean this instead?
osReleaseSemaphore(&context->semaphore);
Hi Dev team,
From my view, it will be better if the stack supports default null drivers to prevent unexpected calling to uninitialized drivers.
Any plans to add DHCP option 42 ?
Do i understand this right that this code is bound to the tcp* and net* functions which are meant for bare metal builds?
this makes it hard to run on posix or win32 builds
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!
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
In this line
https://github.com/Oryx-Embedded/CycloneTCP/blob/1976f5905ef6817c2e8a60b10b04729e205ebae9/http/http_server_misc.c#L755C4-L755C48
you enable chunked encoding by default.
Why is it enabled by default, and later disable it in httpClientParseStatusLine() ?
Shouldn't it be FALSE bei default?
I have demo for gd32F4xx,how send to or commit for your's; email or other ?
Line 1086 in 21fb936
Can checking of address type be added here?
Can we expect the addition of the PSP protocol (IPSec alternative) from Google?
Do need to flush DHCP Server Context clientBinding[] after netInterface link is down?
Line 191 in 697d4f6
#define DHCP_SERVER_MAX_CLIENTS 3 // may be 1? )
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)!
Willing to use it with esp32.
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]
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:
CycloneTCP/drivers/usb_rndis/usbd_desc.c
Line 99 in 2325b88
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!
Can use a pointer instead of copying data?
Line 119 in 697d4f6
typedef struct {
DhcpServerSettings settings; ///<DHCP server settings
...
} DhcpServerContext;
Line 234 in 697d4f6
struct _DhcpClientContext {
DhcpClientSettings settings; ///<DHCP client settings
...
};
Line 580 in 697d4f6
struct _HttpServerContext {
HttpServerSettings settings; ///<User settings
...
};
use:
Line 131 in 697d4f6
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)!
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!
Building and running http_server.exe
on Windows with good-ol'e WinPcap works great:
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/
Hi!
No file, similar to file CycloneTCP/ipv6/ipv6_routing.c for ipv4!
Best Regards, bullitmaster!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.