2025-04-27 10:27 PM - last edited on 2025-05-08 1:11 AM by Andrew Neil
Hello,
I am implementing a WEB Server with my STM32H743 board.
(AzureRTOS, NetXDuo, FileX using microSD)
I have referenced the example implemented in STM32H735G-DK board.
Refer to the below
The webpage opens the index.html file and the delays by more 10 seconds before opening other files.
Does it take a long time to open large files( 65 kbytes ) from SD Card?
I wonder how I can improve this.
2025-04-27 11:05 PM
2025-04-28 5:38 PM
Hello,
I write down some things I checked.
<Condition>
System Clock : 400MHz
Systick Cycle : 100Hz
// tx_initialize_low_level.S
SYSTEM_CLOCK = 400000000
SYSTICK_CYCLES = ((SYSTEM_CLOCK / 100) -1)
<Some things confirmed>
The callback function below will be called after 10 seconds.
_nx_web_http_server_get_process()
`
<Modified Source Code>
Uncomment this constant value and change it from 100 to 1000. (in tx_user.h)
#define TX_TIMER_TICKS_PER_SECOND 100
The delay time was increased from 10 seconds to 1.7 minutes.
And I changed the TX_TIMER_TICKS_PER_SECOND value from 1000 to 10.
The delay time was decreased from 10 seconds to 1.6 seconds.
2025-04-28 10:20 PM
The problem can be mitigated only with more resources (sessions, sockets, packets in pool and in descriptors) but otherwise you have to edit source code and force the tcp server to accept new connections.
Changing TX timer, is not a good practice, as all other threads will have problems, under or over executing system and user tasks.
Connect to o6.mb-international.net,
turn on developer tools (F12) on your browser
and look at network timing; this is a Nucleo-H743 board;
try IPv6 o6.mb-international.net/root.html, o6.mb-international.net/, IPv4 a.mb-international.net:9743/ and push any command, there is no real hw attched, you cannot do any harm.
We have a mix of files closed after downloading and session always open.
Stress the system opening multiple browser instances, mixing IPv4 and IPv6 sessions.
Put a managed switch before your device, set switch to duplicate received and sent packets to a port with some minicomputer or netbook connected, execute only wireshark to have a clean image of network traffic to and from your device without any need to set filters.
As last, define how your server must handle connections and then you can start looking at TCP server scheduling.
2025-05-07 1:40 PM
I am facing the same problem especially when loading my website's homepage. Sometimes page expires before displaying. What's a problem and how can I solve?
2025-05-08 12:11 AM
If you want more help, post ethernet flow from power on to page loaded with above procedure + more details on your hw and sw (type, version, environment ..)
Glass ball is broken, unfortunately!
2025-05-08 12:47 AM - edited 2025-05-08 1:54 AM
Hello,
I'd like to share some additional test results.
1) modified html : change image file
old : STM32H735_DK.jpg : 59KB
new : background.jpg : 927KB
<-- this code is in about.html -->
<img src="assets/STM32H735_DK.jpg" class="txt-wrap" style="width: 680px; height: 320px;">
to
<img src="assets/background.jpg" class="txt-wrap" style="width: 680px; height: 320px;">
- In this case, it displays normally without delay.
2) request the image file directly.
I just typed it into the browser address bar.
http://192.168.10.10/assets/STM32H735_DK.jpg
; display directly without delay but sometimes delayed
http://192.168.10.10/assets/background.jpg
; display directly without delay
best regards,
2025-05-08 1:37 AM
That is because different mime type !
2025-05-08 1:44 AM
Dear mbarg.1
Thanks for your reply.
I am so sorry, I don't understand your reply.
Could you give me a hint to help me understand this?
2025-05-08 2:03 AM
You have to go back to basic of HTTP/browser interaction.
If you agree to grab the packets flow with wireshark or other tools, i can comment it.
On some mime types (MIME types (IANA media types) - HTTP | MDN) browser set keepalive true, on other is false (Request: keepalive property - Web APIs | MDN).
If you want to troubleshoot a web server, do what is at the end of my post april 28, and add suggested details on sw.
If you want only to run your server without modifying source code, you have to get something more than a library (as it are ThreadX, NetXDuo..) like paid distributions that have all the flexibilities you can need.