Buffer handling DHCP vs. Web server
General
No replies yet. Be the first to reply.
Join the discussion.
General
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: Buffer handling DHCP vs. Web server
by Kei ·
Hello, kschwi.
I did not understand what the meaning of the synchronization you were talking about was.
However, I reply to the contents that can be answered.
DHCP, WebServer sockets are separated and buffers are also separated. (In hardware)
Of course, the software also uses a different buffer for Send / Receive.
What’s better depends on how you use it.
In the case of DHCP, packets are sent and received only at a specific time, so it does not matter whether a polling method or a task method is used.
If you can optimize just about any way, that’s the best way.
Best regard,
Kei.
RE: Buffer handling DHCP vs. Web server
by kschwi ·
Hi Kel,
thanks for your reply. My problem based on misinterpretation of the main function. Based on the lot of #ifdef I did not realise that this is one big loop were in case of dynamic addresses the TX_BUF is used for DHCP and if an address is found later on the same storage is used for web-server. I had seen other implementations were DHCP was one thread and web-server was a separate thread. If these both use the same storage (TX_BUF) you need to synchronize it. My final implementation is one network thread in freeRTOS for DHCP and web in one loop using a port of the WIZ550web server and the WIZ550web DHCP client.
Cheers,
Knut
RE: Buffer handling DHCP vs. Web server
by Kei ·
Hi,
I gave the wrong answer. I apologize first and correct it.
It is true that the hardware buffers are separate, but the software uses TX_BUF together.
Therefore, to use two threads, it is safe to specify the S / W buffer separately.
If you do not have enough memory to allocate buffers, we recommend that you proceed polling inside a single thread as you have already implemented.
Can you tell me which MCU you are using?
Thanks
Best Regard,
Kei
RE: Buffer handling DHCP vs. Web server
by kschwi ·
Hi Kel,
I use an Atmel Xmega 128 a3u CPU which is 128kB flash and 8kByte RAM. So I have to be very careful with RAM usage. This board does not have any SD-Card, Flash, RAM extension because all Ports are in use and this special CPU does not have any pins able to handle external memory.
The port is not difficult. When I started I found 220% of RAM usage. This is based on avr-gcc. Each string has to be tagged as part of the flash. After tagging some *printf had been dropped and now with 1k for TX_BUF and RX_BUF everything fits into memory.
Cheers,
Knut
RE: Buffer handling DHCP vs. Web server
by Kei ·
Oh, it’s a very small RAM size.
If so, we recommend that you use one Task instead of dividing the Task.
It seems that you can use the one network thread method that you implemented.