Hi,
I am using HTTP server based on Keil TCP/IP stack. It is very slow downloading my CSS, JS and HTML files.
I can see in Wireshark logs Keil stack is causing Retransmission of TCP packets that is why it is slow download files. some files are taking 3 seconds to download.
As compare Apache server. It very fast download only takes few milliseconds for same set of files.
Can we ask browser to cache some of the files.
Thanks, Naeem
I found out Keil Embedded File system does not support opening more than 2 files at the same file.
I have unit test to prove it now.
Is this limitation with Embedded File system?
We have more than 2 HTTP sessions. these HTTP session trying to open more than 2 files simultaneous using fopen. then browser HTTP Get request fails for some files.
I try setting File : File_config.c Embedded File System Number of Files > 3
If I try opening more than 3 files at same time. fopen hangs.
I am using External NOR Flash memory with SPI driver.
If I have only 2 HTTP sessions and Number of Files =2 then it works but browser load very slowly first time if no cache for any files.
I have few html, JS and css files.
Have Keil test their HTTP server with Embedded File System or we need to use SD card with FAT File system.
We found issue and solve it.
fopen was acquiring mutex. If It already have more than OS_MUTEXTCNT. It loop forever ( Keil better improve this code and put debug logging for any error instead of hanging thread and loop forever)
Keil functions/API are thread-safe. We had OS_MUTEXTCNT=8 in out config for RTOS. Now we put it to 26. Other settings We have HTTP session =10 and Number of files opened=16
fopen can open multiples files at the same time max to 16 now.
We better have ARM provide us source for Keil RTOS and MDK. It will easier for us to debug and give you feedback. We can give feedback to improve your code base.
I am not sure we need thread-safe version of all functions. for example in our case, we are opening files from same thread, so we do not need mutex. Is there way to use Keil non-thread function to speed up performance more.
We better have ARM provide us source for Keil RTOS and MDK
Source for the RTX is already supplied. From what your describing, you probably mean you expect the source to the flash file system. If you were to think about it you should realize that source for MDK is not a particularly sensible item to ask for. The MDK is the name of the whole package (IDE, compilers, linkers etc).
If you expect someone to supply something, the first sensible step is to know and specify exactly what you really want.
Hi Peter,
Thanks for clarification.
Sorry for not very clear in term of asking source code. Yes I meant source code for RTX RTOS and their components such as network and file system.
For example, I did try to step into fopen C function, however I could not.
Keil can supply source code - but some parts will require $$$ or €€€ to change hands first. I think earlier they wanted €5000 per seat for the networking source code.
I am now using latest Keil MDK for FileSystem and Network component.
netHTTPs_fopen file_name='xmlHttp.cgx' Start Task='GenerateApplicationSettingsFileTask' execute 7628 bytes in 2 free blocks (avge size 3814) 1 blocks 2^8+1 to 2^9 1 blocks 2^11+1 to 2^12 netHTTPs_fclose file
When from my web page JavaScript ajax call and during ajax call in seperate thread I do fopen in GenerateApplicationSettingsFileTask which hangs wait for mutex because mutex is acquired by netHTTPs_fopen. It does not release.
Am I doing something. It used to work few months back . could be previews version of MDK.