Dangerous Prototypes

Other projects => Past projects => Web platform => Topic started by: medamarko on December 02, 2010, 07:40:05 am

Title: SDcardserver with TCPIP Stack 5.31
Post by: medamarko on December 02, 2010, 07:40:05 am
I cannot compile SDcard server with new tcp/ip stack...
This is the output when i try to build:
Code: [Select]
CustomHTTPApp.c: In function 'HTTPExecutePost':
CustomHTTPApp.c:321: warning: unused variable 'cwdPathPtr'
CustomHTTPApp.c:320: warning: unused variable 'cwdPath'
CustomHTTPApp.c:689:29: error: macro "SaveAppConfig" passed 1 arguments, but takes just 0
CustomHTTPApp.c: In function 'HTTPPostConfig':
CustomHTTPApp.c:689: error: 'SaveAppConfig' undeclared (first use in this function)
CustomHTTPApp.c:689: error: (Each undeclared identifier is reported only once
CustomHTTPApp.c:689: error: for each function it appears in.)
Is there any solution for this?

Regards
Marko
Title: Re: SDcardserver with TCPIP Stack 5.31
Post by: ian on December 02, 2010, 08:44:24 am
Hi medamarko -

It looks like the SaveAppConfig function has changed, either in the way it is declared, or overall. I have not looked at the 5.31 stack, but I would recommend searching all files (an option in MPLAB) for SaveAppConfig and seeing what it expects in CustomHTTPApp, and what is given. It might be a minor change in the declaration in main.h.
Title: Re: SDcardserver with TCPIP Stack 5.31
Post by: cstrutton on December 05, 2010, 02:13:23 am
Hi Medamarko

I had the same problems and found a solution.  The 5.31 firmware defines SaveAppConfig as

Code: [Select]
#if defined(EEPROM_CS_TRIS) || defined(SPIFLASH_CS_TRIS)
void SaveAppConfig(const APP_CONFIG *AppConfig);
#else
#define SaveAppConfig(a)
#endif

so it expects one parameter

the web platform demo defines it in MainDemo.h as

Code: [Select]
//we made custom files so we can distribute them
//we don't all have same functions as the orig. This file was required
//so MPFS would compile without a custom SaveAppConfig function.
#define SaveAppConfig() NOP()

changing the define to :
Code: [Select]
#define SaveAppConfig(a) Nop() 

worked for me.  Note the change in the NOP() to Nop()

Chris
Title: Re: SDcardserver with TCPIP Stack 5.31
Post by: serenavv on February 27, 2011, 05:46:30 pm
Hello, I'm new: I have just received the web platform...

I have tried successfully to load the precompiled hex of sd card server and it works well.
After I try to compile it myself following instructions in Maindemo.c:
1) I replace files original files of microchip stack 5.31 Maindemo.c/.h, HardwareProfile.h, TCPIPConfig.h, TCPIP MDD SD Card Demo App-C30.mcw/.mcp as reported on readme.txt
2) I open workspace TCPIP MDD SD Card Demo App-C30.mcw in MPLAB 8.63
3) I change on ENC28J60.c ENC_SPICON1bits.CKE = 1; to ENC_SPICON1bits.CKE = 0; (on line 223 and 229)
4) I change MainDemo.h #define SaveAppConfig() NOP to #define SaveAppConfig(a) Nop() (thank you cstrutton!)
5) I copile successfully but it doesn't work....

(I have only two warnings:)
Code: [Select]
CustomHTTPApp.c: In function 'HTTPExecutePost':
CustomHTTPApp.c:321: warning: unused variable 'cwdPathPtr'
CustomHTTPApp.c:320: warning: unused variable 'cwdPath'

I can ping the board but I can't open web page on web browser (is stored on sd).
After tried to open with web browser, is impossible to ping successfully the board, is necessary to reset the board.
(the sd is not the problem: it is correctly formatted and sd works well with precopiled dangerousprototypes svn firmware)

Any suggestion?
Thank you
Title: Re: SDcardserver with TCPIP Stack 5.31
Post by: RonZ on February 28, 2011, 09:54:52 am
You don't whether or not the LD1 led was still flashing or not after you tried to get the web page displayed on your browser. It should remain flashing on and off all the time. If it doesn't keeping flashing the software has locked up or crashed. Also please advise which version of the C30 compiler you are using.
Title: Re: Re: SDcardserver with TCPIP Stack 5.31
Post by: RonZ on February 28, 2011, 09:58:15 am
Reading your post again I say the application crashed locked up. Please advise which C30 compiler you are using
Title: Re: Re: SDcardserver with TCPIP Stack 5.31
Post by: serenavv on February 28, 2011, 01:03:52 pm
[quote author="RonZ"]Reading your post again I say the application crashed locked up. Please advise which C30 compiler you are using[/quote]

Probably it crashes! Infacts Ld1 stops blinking..
I use C30 3.25 lite, Trev sugget my by emal to try with 3.23. this evening or tomorrow I will try.
After I tell you if is solved.
Title: Re: Re: SDcardserver with TCPIP Stack 5.31
Post by: serenavv on February 28, 2011, 08:02:49 pm
Solved using C30 v3.23!!

After i try to put microchip exaple files on sd (+ 'DynRcrd.bin' and 'FileRcrd.bin')
but i obtain this:
download/file.php?id=439&mode=view (http://dangerousprototypes.com/forum/download/file.php?id=439&mode=view)

I solved whit a Trev suggestion:
Eureka moment! Armed with this new found nugget of knowledge, I think the correct solution to the issue is to remove the second occurrence of:
Code: [Select]
{TCP_PURPOSE_HTTP_SERVER, TCP_ETH_RAM, 200, 200},
(of post viewtopic.php?t=475 (http://dangerousprototypes.com/forum/viewtopic.php?t=475))

I haven't enough time to study it now, but seems ok!

I can see only a little problem, stack version is not shown correctly..
http://img38.imageshack.us/img38/1997/screenshotba.jpg (http://img38.imageshack.us/img38/1997/screenshotba.jpg)

For now it's all, but i will came with new issues!
Thank you!
Title: Re: SDcardserver with TCPIP Stack 5.31
Post by: ian on March 12, 2011, 09:01:03 am
Hi serenavv,

If you can please give a quick step-by-step (or even just point me to all the posts that document what you did), I will update the demos and demo code to work with the latest stack. I'm sorry about all the issues you had getting it going.
Title: Re: Re: SDcardserver with TCPIP Stack 5.31
Post by: serenavv on March 28, 2011, 11:55:07 am
Yes, of course!
I can give you a list of modification to make to solve compilation problems but I try only for few time (I have another project to develop for the moment) and I think there are some other issue that i haven't seen... (I haven't tested well the platform yet).
I'm going to make the step-by-step document soon.
(sorry for the late but i didn't check the forum recently)

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01072073736session_write_close ( )...(null):0
20.01102205312ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01102206088Database_MySQL->query( ).../DatabaseHandler.php:119
40.05612344808Database_MySQL->error( ).../Db-mysql.class.php:273