MCU User Forum
  Data Logger using CP2201 EB

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   Data Logger using CP2201 EB
nikhilmuley7
Member
posted August 03, 2010 01:55 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi,
i am developing a application (data logger) using CP2201 EB the aim of the project is to generate a text file which take the samples at 1sec interval when i hit ipaddress of embedded server.
so for the initial stage i am using the code provided with the Kit.
I am finding problem to modify CGI script.

my first question is is this possible?
if yes ....... then please guide me.

thank you
nikhilmuley7

IP: Logged

Tsuneo
Member
posted August 03, 2010 03:36 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
> I am finding problem to modify CGI script.

For pure CGI, the embedded server has to make up entire web page. It's heavy for the embedded server with limited resources.

I recommend you to apply Javascript and XMLHttpRequest on the browser side. In this approach, embedded server provides just the data over CGI. Browser requests the data to the server, and it redraws the display. Visit to this post for the details.

Dynamic HTML using JavaScript, DOM and XMLHttpRequest (= Ajax?)
http://www.cygnal.org/ubb/Forum1/HTML/002227.html

To run the refresh function every 1 second on Javascript,
At the end of the the refresh function, call window.setTimeout() to run itself again after delay. This function is called first by body tag.

<body onload="your_refresh_function()">


Either CGI or Javascript, the timebase of data measurement is placed on the PC side. And then, the command is sent to the embedded server over the network on this timebase. In this approach, delay over network affects to the periodicity of data sampling.

If you need more periodic data sampling,
place the timebase (timer) on the embedded server side. The server regularly samples data on this timer. The data is stored to a buffer, which can hold multiple samples until PC reads them out. The server exposes a TCP port for the PC. When PC accesses to the port, the server sends the entire data on the buffer.

Tsuneo

[This message has been edited by Tsuneo (edited August 03, 2010).]

IP: Logged

nikhilmuley7
Member
posted August 03, 2010 05:33 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
Tsuneo,
thanks for guiding me again.
in my opinion you are the best person who has solution for every problem.
as i searched the forum i found taht you have helped each and every people.i think because of people like you this forum is alive.

if i stuck at some point i will let you know .....
if i successed with this project you will be major contributor in this project.

thanks again,
nikhil

[This message has been edited by nikhilmuley7 (edited August 03, 2010).]

[This message has been edited by nikhilmuley7 (edited August 04, 2010).]

IP: Logged

nikhilmuley7
Member
posted August 04, 2010 06:05 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi,
CGI script is a new concept for me so when read the post "Dynamic HTML using JavaScript, DOM and XMLHttpRequest (= Ajax?)".
i thought that the example 1 provided in this post should be good starting point.
scince i have only CP2201 EK kit.so i have done following modification in example 1 .i took the following steps:
first i generate the project using TCP/IP configuration wizard ticking the content {8051f340,cp220x,http,tcp,ethernet}
and in second step i followed the guideline provided in post "what to modify for the CP2201-EK " ..........
than i load the hex file in kit.but it wont work.................. ping is also not working ...............cable is ok ...........
i think that i am missing some thing ......... what ?????????????????????

if any body knows how to modify program to work with CP2201 eb from strach.

Tsuneo your suggestion/comments are valauble to me.

thanks
nikhil


[This message has been edited by nikhilmuley7 (edited August 04, 2010).]

IP: Logged

Tsuneo
Member
posted August 04, 2010 06:52 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
> first i generate the project using TCP/IP configuration wizard ticking the content {8051f340,cp220x,http,tcp,ethernet}

Maybe, you would miss to change some parameters on TCP/IP config wizard.
Use the downloaded project as is, without generating new one, until you become familiar with the wizard.
F340_CGI_DHTML.wsp is the project file to start with.
Modify the routines in main.c, following "what to modify for the CP2201-EK ".

As of TCP/IP config wizard,
The parameters change on the wizard are reflected to the constants in mn_userconst.h
Also, the library number - which is determined by the combination of supported protocols (DHCP, HTTP, TCP, etc)

Compare mn_userconst.h of yours and the downloaded one using "diff" utility, like WinMerge. And then, you'll identify the parameter difference on the wizard.

WinMerge
http://winmerge.org/

Tsuneo

[This message has been edited by Tsuneo (edited August 04, 2010).]

IP: Logged

nikhilmuley7
Member
posted August 05, 2010 02:03 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
Tsuneo,
it worked........
as you said i done the same thing with "F340_CGI_DHTML.wsp" and after modification i downloaded the hex file.the project is working fine.

.....now i am finding error in my project comparing with F340_CGI_DHTML.wsp using utility winmerge.

thanks,
nikhil

IP: Logged

nikhilmuley7
Member
posted August 07, 2010 06:38 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
Tsuneo,
hi ......... i am now moving further the previous problem was sort out.
now i am implementing html page to see the temp data on webpage so i refered "CP2201EK_AB4_STD" example ........ while compiling i got this error

"*** ERROR C200 IN LINE 488 OF MAIN.C: left side of '.' requires struct/union"

is that mean that i have to define structure ........... i dont think so...?

thanks,
nikhil

IP: Logged

Tsuneo
Member
posted August 07, 2010 07:57 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
Umm..
LINE 488 OF CP2201EK_AB4_STD\MAIN.C is

if(LED_blink_counter == 4*T2_OVERFLOW_RATE/10){
YELLOW_LED = 0;
} <------ LINE 488

I can't realize why the error occurs here, just seeing the source code.
So, I compiled the example for confirmation.

Found that the project sets the tool chain as a mixture of full and eval,

'Project' menu > Tool chain integration
- compiler path: full KEIL version (C:\Keil\C51\BIN\c51.exe)
- assembler and linker path: SiLabs' eval version.

Fixed it and I got compile/link without any error.

Tsuneo

IP: Logged

nikhilmuley7
Member
posted August 08, 2010 12:23 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
Tsuneo,
you said it correctly i have keil full and eval versoin supplied by silab both installed.
but the error
"*** ERROR C200 IN LINE 488 OF MAIN.C: left side of '.' requires struct/union"

was on this line. given below

"sprintf(HTML_BUFFER, "

%.% /span>
",TEMPERATURE_INTEGER, TEMPERATURE_FRACTION);"

i have also checked tool chain setting. i have given correct path.

sorry the above content are missing because of html tag:

i think you will got my point.

thanks,
nikhil

[This message has been edited by nikhilmuley7 (edited August 08, 2010).]

[This message has been edited by nikhilmuley7 (edited August 08, 2010).]

IP: Logged

Tsuneo
Member
posted August 08, 2010 08:34 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
Is this line?

C:\SiLabs\MCU\Examples\C8051F34x\Ethernet\CP2201EK_SOURCE\CP2201EK_AB4_STD\main.c

void get_data(PSOCKET_INFO socket_ptr) cmx_reentrant {
...
...
    // User has requested temperature data in HTML format:
    EA = 0;
    sprintf(HTML_BUFFER, "<html><body bgcolor=blue text=yellow><center><span style=\"font-family: sans-serif; font-size: 28pt; font-weight: bold;\">%bd.%bd</span></center></body></html>", // <---- Line 854
    TEMPERATURE_INTEGER, TEMPERATURE_FRACTION);
    EA = 1;


I don't see any compile error on the original example.
The line number is different from the original. You've edited the source for CP2201EK.
The problem seems to lie in the modification.
Do you see any compile error on the original one?

Tsuneo

IP: Logged

nikhilmuley7
Member
posted August 08, 2010 11:45 PM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
Tsuneo,
you are right when i compile original example it dosent give any error.the orginal source code is fully functional.

i have only remove/commented the (telnet, dhcp, netfinder, LED blink)in main.c

keeping only html server working.i donot touch other files i have only done modification in main .c

i think that "HTML_BUFFER" is causing the problem. when i commented spintf line the code dosent give any error.

now i am pasting the main.c that i have modified

errrrrrrrr


when i pasted the code my browser start refressing every second.

some how i manage to edit this post.

how can i upload here zip file?


thanks,
nikhil


[This message has been edited by nikhilmuley7 (edited August 08, 2010).]

[This message has been edited by nikhilmuley7 (edited August 09, 2010).]

IP: Logged

Tsuneo
Member
posted August 09, 2010 12:48 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
> how can i upload here zip file?

Unfortunately, this forum doesn't accept zip file attached.
Your options are,

a) Your internet provider may offer free space for your home page.
Upload the zip file to your home page on the provider's server. Post the URL of the zip file.

b) 8052.com offers 512KB free space for you, after registration.

CREATE 8052.COM ACCOUNT
http://www.8052.com/newacct
8052.COM: my home page
http://www.8052.com/myhomepage.phtml

c) Free file share servers on the internet.

etc.

Tsuneo

IP: Logged

nikhilmuley7
Member
posted August 09, 2010 01:38 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
Tsuneo,
hi again,
i have uploaded the project. below is the link.
http://www.8052.com/users/zip/test.zip

what i am trying to do here is to read temperature and light data and display it using html server.

i think the problem is in web2.h
"#define HTML_BUFFER dhcp_info.sname"

please give more insight on above line.

thanks,
nikhil

[This message has been edited by nikhilmuley7 (edited August 09, 2010).]

IP: Logged

Tsuneo
Member
posted August 09, 2010 01:43 PM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
> i think the problem is in web2.h
> "#define HTML_BUFFER dhcp_info.sname"

Ya.
When DHCP is enabled, the TCP/IP wiz adds DHCP_INFO_T structure definition and dhcp_info variable to mn_defs.h.
But you didn't check the DHCP option on the wiz, this variable is not added.

Make a global byte array for HTML_BUFFER, instead of dhcp_info.sname. Tune its size so as to fit to the greatest among three sprintf's format.

Tsuneo

[This message has been edited by Tsuneo (edited August 09, 2010).]

IP: Logged

nikhilmuley7
Member
posted August 10, 2010 07:15 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi Tsuneo,
i have made global byte array for HTML_BUFFER and it worked.
thanks again,

now in the project i am adding 2 more virtual files.one for light intensity and another for control pannel ie two switches.
what care should i take so that memory usuage should not exceed the limt for "cp2201ek".

thanks,
nikhil

IP: Logged

Tsuneo
Member
posted August 10, 2010 07:51 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
> now in the project i am adding 2 more virtual files.one for light intensity and another for control pannel ie two switches.
what care should i take so that memory usuage should not exceed the limt for "cp2201ek".

Virtual files go to the code memory (63KB) of the 'F340 on the CP2201EK.
I believe you have enough room on the code space.

Tsuneo

IP: Logged

nikhilmuley7
Member
posted August 11, 2010 04:38 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi Tsuneo,
of course the Virtual files go to the code memory (63KB)which is not a problem.

my point to ask memory management is that how to modify the program so that multi user can access the data at same time.

in our project it should not be more than 5 person.

thanks,
nikhil


IP: Logged

Tsuneo
Member
posted August 11, 2010 05:49 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
> my point to ask memory management is that how to modify the program so that multi user can access the data at same time.
in our project it should not be more than 5 person.

For five or so over LAN, this embedded HTML (web) server will work smoothly, though it supports just single connection at a time.
Web browser keeps connection to server just while it downloads a web page. When download finishes, browser closes the connection immediately. And then, another user gets a chance to connect to the server.
CGI also works like so. In this way, this web server serves multiple users in turn over single connection.

But when the users access to the server over internet of slow speed, the server connection is occupied so long while it serves one user. Also, even over LAN, too many users (a couple of tens) will suffer from delay of the service. In these cases, the HTML server should support mutiple connections at a time.

Unfortunately, this TCP/IP stack doesn't support multiple connections of HTML server, mainly because of limited resource of the MCU. If it is the case, move to 32bit MCU.

For simple TCP server, instead of HTML server, the stack can keep track over multiple connections at a time.

tcp server: How to listen the port
http://www.cygnal.org/ubb/Forum1/HTML/002483.html

Socket time out
http://www.cygnal.org/ubb/Forum1/HTML/003114.html

Tsuneo

[This message has been edited by Tsuneo (edited August 11, 2010).]

IP: Logged

nikhilmuley7
Member
posted August 13, 2010 01:49 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
Tsuneo,
thanks for valuable information.

regards,
nikhil

[This message has been edited by nikhilmuley7 (edited August 13, 2010).]

IP: Logged

nikhilmuley7
Member
posted August 16, 2010 12:07 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi,
i dont think this is right forum to put this question?.............. but some body interested should help me.


i am planning out to build a embedded tcp/ip stack from scratch with feature of multiuser interface.but unable to find a starting point.
or any other tutorial link for above question.................

this stack will be implemented in cp2201ek.

thanks in advance
nikhil

IP: Logged

Tsuneo
Member
posted August 16, 2010 08:54 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
> i am planning out to build a embedded tcp/ip stack from scratch with feature of multiuser interface.

You don't need to make it from scratch. Make it on uIP.

uIP
http://www.sics.se/~adam/uip/index.php/Main_Page

uIP implementation on CP2201EK for SDCC, by Maarten (vanmierlo)
http://www.8052.com/users/maarten/CP2201EK.7z

Tsuneo

IP: Logged

nikhilmuley7
Member
posted August 17, 2010 12:00 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi Tsuneo,

uIP implementation on CP2201EK for SDCC, by Maarten is an interesting project and good way to learn/understand uip.


thanks,

IP: Logged

nikhilmuley7
Member
posted September 20, 2010 01:12 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi,
when i open uip project it say that "locate main.mem and main.map" i am unable to find those files.
dose any body know where to find ?


thanks in advance
nikhil

IP: Logged

apemberton
Member
posted September 20, 2010 03:20 AM     Click Here to See the Profile for apemberton   Click Here to Email apemberton     Edit/Delete Message
Those files are generated by SDCC and if the project hasn't been built yet, don't worry, just ignore it. You may need to modify the project parameters to suit your needs, especially if using a different compiler.

The .mem and .map files show the memory usage and the linked object and are very useful (with SDCC) for finding out where things have been placed. For example, I found that passing parameters to the 'sprintf' function gobbled 'data' and 'idata' memory and caused me to break up the parameters passed so that 'sprinf' reused precious memory bytes.

------------------
Tony Pemberton

IP: Logged

nikhilmuley7
Member
posted September 20, 2010 04:00 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi Tony,

thanks for your response.i will try to build the project.

thanks,
nikhil

IP: Logged

nikhilmuley7
Member
posted September 20, 2010 05:10 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi,
when i build the project it gives an error


C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>rem Date: Wed May 3 17:59:30 2006

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>rem cd "C:\Program files\SDCC\source\embedded_ethernet_complete_code\CP2200\

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -v
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>rem SDCC -c --debug --model-large --std-sdcc99 _startup.c

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>rem copy _startup.rel "C:\Program files\SDCC\lib\large\_startup.rel

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>rem copy _startup.asm "C:\Program files\SDCC\lib\large\_startup.asm

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm main.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm Flash.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm CP2200.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm config.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm uip\uip.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm uip\uip_arp.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm uip\uip_arch.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm apps\dhcpc\dhcpc.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm apps\sntp\sntp.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm apps\httpd\httpd.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm apps\httpd\cgi.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm apps\httpd\fsdata.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm apps\httpd\fs.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm apps\telnetd\telnetd.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm IUart.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm IET_temp.c
'SDCC' is not recognized as an internal or external command,
operable program or batch file.

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6\apps\httpd>SDCC --debug --model-large --code-size 0xF800 --xram-size 0x0f80 main.rel uip_arp.rel uip_arch.rel uip.rel CP2200.rel Flash.rel dhcpc.rel sntp.rel httpd.rel cgi.rel fsdata.rel fs.rel telnetd.rel IUart.rel IET_temp.rel config.rel
'SDCC' is not recognized as an internal or external command,
operable program or batch file.
..............
................
.....................
i think it is not taking any command.

IP: Logged

apemberton
Member
posted September 20, 2010 02:58 PM     Click Here to See the Profile for apemberton   Click Here to Email apemberton     Edit/Delete Message
I assume you are trying to use the SDCC compiler but it seems that the IDE cannot find the right path to the compiler or linker. I have the feeling that you havn't configured the IDE for SDCC or SDCC itself is not configured properly.

What happens if you open a command prompt window and type 'sdcc --version'? Does it return the SDCC version number? Mine displays:-

SDCC : mcs51/gbz80/z80/ds390/pic16/pic14/TININative/ds400/hc08 2.9.7 #5873 (Jul 6 2010) (MINGW32)

If not, reinstall SDCC. If you do get a good version, SDCC must be configured in the IDE from the 'project' - 'tool chain integration' menu. I believe there is a Silabs Application Note (the number escapes me right now) describing SDCC integration.

Have fun

------------------
Tony Pemberton

IP: Logged

nikhilmuley7
Member
posted September 20, 2010 11:34 PM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi,
you are wright sdcc is not installed properly .... it is not showing the version

thanks,
nikhil

IP: Logged

nikhilmuley7
Member
posted September 20, 2010 11:48 PM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi,
i am new to sdcc compiler what i have done here is i interface it with silab ide ...... for uip project.
is there any more changes to do?
.....
...........
.....

when i comile it gives following error..

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm Flash.c
Flash.c:73: error 78: incompatible types
from type 'volatile-struct NIC_params xdata-xdata* '
to type 'unsigned-int generic* '
Flash.c:74: error 78: incompatible types
..
...
..
..
C:\SiLabs\MCU\Examples\my_demo\one\my_test_6>SDCC -c --debug --model-large --std-sdcc99 --fverbose-asm IET_temp.c

C:\SiLabs\MCU\Examples\my_demo\one\my_test_6>SDCC --debug --model-large --code-size 0xF800 --xram-size 0x0f80 main.rel uip_arp.rel uip_arch.rel uip.rel CP2200.rel Flash.rel dhcpc.rel sntp.rel httpd.rel cgi.rel fsdata.rel fs.rel telnetd.rel IUart.rel IET_temp.rel config.rel
Flash.rel: cannot open

IP: Logged

apemberton
Member
posted September 21, 2010 02:37 AM     Click Here to See the Profile for apemberton   Click Here to Email apemberton     Edit/Delete Message
SDCC is nowadays very picky (as it should be) about data types. As I know the uIP code was originally built for a less restrictive exchange of data types, the source is probably in need of updating.

Unfortunately I cannot see the last message with the precise error. If I remember correctly it looks as if data type on the right is a code/const flash mem pointer and the left is an integer pointer. Casting from right to left needs the correct cast. Look carefully at the data types that are giving the error and cast the data type as appropriate.

------------------
Tony Pemberton

IP: Logged

nikhilmuley7
Member
posted September 21, 2010 03:03 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi,
please can you guide me how to do correct cast ......
i will try but still i need your help.

thanks for helping,
nikhil

IP: Logged

nikhilmuley7
Member
posted September 21, 2010 11:34 PM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi ,
are you the same guy who has modified code of uip to run in cp2201ek.yesterday just while reading (understanding) the code i saw the name of author it is written there "A.Pemberton" and you are "Tony Pemberton"
...
.......
..........
...

usually i ignore the starting comments for saving time.if you are the same guy "hatsoff" to you work.
what i am trying to do in your code is i wanted it to make access for multiuser at same time.
my first question is :
is this possible ?

if you have some nice tutorials about uip can you provide me?

thanks,
nikhil

IP: Logged

apemberton
Member
posted September 22, 2010 02:09 AM     Click Here to See the Profile for apemberton   Click Here to Email apemberton     Edit/Delete Message
Yes, I did a conversion of uIP 0.9 for SDCC and the C8051F120/AB4 (Ethernet DK) some years ago. (That was in turn developed from a module using the C8051F020/Davicom DM9000E.) Maarten's version was adapted for the Ethernet EK (C8051F340/CP2201) and that is the publicly accessable on 8052.com - thanks Maarten. I am no longer working with uIP and am using ARM's for ethernet stuff.

As for type casting, methodology should be available in a 'C' manual of choice. You should be able to see what you have to cast from and to from the error messages. It helps (for me) to try and imagine the type of physical memory that is being used on the left and right side of the equation. The error message shows passing of a pointer from one type to another. I can't tell you what would put that right.

ETA: I used the uIP manual from the uIP site. Quite comprehensive but necessarily thare has to be small modifications to suit 8051/SDCC.

------------------
Tony Pemberton

[This message has been edited by apemberton (edited September 22, 2010).]

IP: Logged

nikhilmuley7
Member
posted September 22, 2010 03:48 AM     Click Here to See the Profile for nikhilmuley7   Click Here to Email nikhilmuley7     Edit/Delete Message
hi,
do you have Maarten's version source code .... because i have to use it in cp2201 -EK

thanks for your guidance,
nikhil

IP: Logged

England90
New Member
posted November 22, 2010 09:30 AM     Click Here to See the Profile for England90   Click Here to Email England90     Edit/Delete Message
Thanks for sharing this information!

------------------
Vietnam travel-Vietnam holiday-Cambodia tours

IP: Logged

erikm
Member
posted November 22, 2010 10:19 AM     Click Here to See the Profile for erikm   Click Here to Email erikm     Edit/Delete Message
please do not post such in old threads you have not initiated, it leads to unnecessary views

Erik

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | MCU User Forum

Have you seen our MCU Knowledge Base?


Ultimate Bulletin Board 5.47b