I'm using Keil's RL_TCPnet HTTP server with an AT91SAM7XC512.
I'm trying to embed JQuery (jquery-1.4.2.min.js), however it appears that the FCARM tool is mangling the file. There are a number of characters (I'm guessing escapes of some sort) that are missing.
The original, uncompressed jquery-1.4.2.min.js is 72,174 bytes. When I download the file from the uC, the file size is 69,321 bytes.
Obviously, none of the jquery functions will work.
Any ideas?
What is your FCARM version number?
It seems you are using an outdated version. Current version is 2.28
It's version 2.20. Has this issue been resolved in 2.28?
That was an early FCARM version with compression. I have checked the current FCARM release and seen no problems.
Excellent!
I've just downloaded RL-ARM v4.12 from the file download area. The FCARM version appears to be v2.27.
I'll extract it and give this version a go.
Is v2.28 available for general release?
v2.27 resolves the issue with the '/*' and '*/' characters, however, there still appears to be an issue with spaces inside quoted strings in javascript.
For example,
Original: match = " " + match[1].replace(/\\/g, "") + " ";
After FCARM: match=""+match[1].replace(/\\/g,"")+"";
The first " " and last " " need to remain as-is for the expression to remain the same.
Hi, As for jQuery the better way for embedding in app. is to let the browser download from static high bandwidth host such as google rather than from web server itself (ajax.googleapis.com/.../jquery.min.js), since it consumes your internal flash image and hard to maintain an updated version of jQuery.
I hope keil solve the problem for web server in SD card also, since it appears unable to reference the file in subfolder of SD card (root only), therefore limits the number of file access in root directory and hard to maintain files in group.
kom.
I agree with your point about using the google link for the jQuery file, however, in my case the end user is unlikely to have an internet connection (they'll typically be on-board a ship at sea).
I've got 512KB of flash to play with, so there is plenty of space available to embed the library.
Along with some of the regular jQuery niceties, I'm using 'flot' to plot some runtime variables. http://code.google.com/p/flot/
This is not true. I have added your code:
match = " " + match[1].replace(/\\/g, "") + " ";
to your javascript file JQuerry.js (http://pastebin.com/vLkFL5UM)
and this is the FCARM output:
((function(A,w){function ma(){match=" "+match[1].replace(/\\/g,"")+" ";if(!c.isReady){try{s.documentElement
As you can see, the spaces inside a quoted strings are not removed.
What exactly did you do?
Keep in mind I'm using FCARM v2.27 - this is the version packaged with the latest release of RL-ARM (4.12) available on the Keil web site.
My process is as follows:
1. Use FCARM to convert the jQuery file.
2. Download to the uC.
3. Visually confirm proper functionality of the jQuery library by accessing the embedded web page. I'm using Firebug to view error messages. In my case, it's easy to see if things are working or not - if yes, there are 6 real-time charts on the page, if not, there is nothing.
4. Download the jQuery-1.4.2.min.js file directly from the embedded web server, and compare against the original file.
With version 2.27, the downloaded file differs by 16-bytes from the original.
Here is another example:
Original:
g[4]=" "+g[4]+" ";
After FCARM:
g[4]=""+g[4]+"";
.replace(/ /g,"&")}}
.replace(//g,"&")}
Here is the 'after FCARM v2.27' jQuery that I downloaded from the uC: http://pastebin.com/BctHu6sg
To resolve the issue, I have been replacing the FCARM-generated bytes (for the jQuery file) in 'Web.c' with a manually-generated byte array.
Thanks again for your assistance!
A quick update on this issue:
After contacting the folks at Keil tech support, I created a demo project illustrating the issues described above. On July 16th, 2010, I received this response:
--- Hello Trevor,
Thank you for using Keil software.
I recieved your project, and I reproduced the issue. I have forwarded this on to our engineers, and I will let you know as soon as I hear back.
Best Regards, Brian Clough Technical Support Analyst Keil, Tools by ARM 4965 Preston Park Blvd Suite 650 Plano, Texas 75093 USA ----
Today, I received the following update:
-- Hello Trevor,
Just a quick update. They intend to add a feature to the HTML converter, to turn off optimizations. This will leave strings like your javascript functions "unmolested".
Apparantly it is not a trivial matter to do a proper fix for this issue.
Best Regards, Brian Clough Technical Support Analyst Keil, Tools by ARM 4965 Preston Park Blvd Suite 650 Plano, Texas 75093 USA --