Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - thamanjd

Pages: 1 2 [3] 4
What's the relationship between TCP_EVENT_REGENERATE events with tcp listener and the return values APP_ACCEPT and APP_SENT_DATA?

On TCP_EVENT_REGENERATE I was setting a flag for myself, return APP_ACCEPT and resending outside of the listener but this does not appear to be the correct method (Ethereal shows a lot of RST,PREVIOUS SEGMENT LOST,DUP ACK packets going back and forward).

but if i set a flag for myself, return APP_SENT_DATA (even though i havn't sent anything yet) and then the resend it when my flag gets checked by another routine a short time later, Ethereal just shows the retransmission packet and then the "duplicate" ack.

it also works ok if i dont use my flag, resend inside the listener and then return APP_SENT_DATA.

Is TCP_FLAG_PUSH flag by itself correct for fnSendTCP in the case of retransmission?

John Dowdell

µTasker general / Re: about the udp use!
« on: April 04, 2008, 06:07:40 AM »
May we ask what language/compiler you were going to use for the PC software?

µTasker general / Re: Creating a new Task
« on: March 31, 2008, 12:43:06 AM »
Opps, sorry i forgot to add that when i posted.

#define TASK_MINE            'z'

So as Mark said, the Task name string in quotes as below should begin with the same letter you've defined for your task.

{ "zMine",       fnMINE,        MEDIUM_QUE,  (DELAY_LIMIT)(0.10 * SEC), 0, UTASKER_STOP},

Maybe i'm being impatient and not waiting long enough when i tried using fnStartDHCP without the FORCE_INIT. I'll play around with it without using FORCE_INIT.

OK. so the RETURN of -1 from fnSendUDP means NO_ARP_ENTRY. fnStartDHCP clears the arp cache i guess? Using ethereal i can now see ARP resolving for the IP after attempting that UDP Send.

So I dont need an incoming UDP to get it to work. Sending the first UDP prompts the ARP resolve and i i wait a bit and send another UDP packet, it goes that second time. 

Is there a way of prompting ARP to resolve for the IP sometime before i send the UDP?  The other method is to keep trying the fnSendUDP a couple of times between short intervals until arp has resolved.

With UDP, will the first transmission out to an ip (without having received anything from that ip) return with NO_ARP_ENTRY? Is this also the case with trying to make a TCP/IP connection to an IP for the first time?

John Dowdell

My project starts in static IP mode.
I need to change it to dhcp without resetting the board.
Firstly, i was using fnStartDHCP like this:
But using this method the task never picked up and interrupt_event_msg from dhcp

I had to follow the example from application.c to get the interrupt_event_msg.

What is it about the extra bits in there that make it work?

Secondly, I went to send a udp message after getting DHCP_SUCCESSFUL. The UDP message did not get sent and the function returned -1.
If i receive a UDP message in between that and attempting to send another UDP message, that second UDP transmission out is transmitted successfully.

Ive tried leaving three or four seconds in between getting DHCP_SUCCESSFUL and sending the UDP but that doesnt do anything.

I also tried releasing the socket then getting it again, also without success.

Any ideas?

John Dowdell

ouch. i guess the real lesson here is to read the bloody manual   :)

This may be a no brainer but it fooled me for a bit.

I was trying to change (via HTTP) the MAC address but leaving the default IP as it was.
 After pressing the save button i couldn't load the page again to validate the saved changes.

If I change both the MAC address and the IP at the same time i guess this is a new, very different entry in my PC's ARP table and i have no trouble reconnecting to validate the changes.

But to just change the MAC without changing the default IP, i had to flush my PC's ARP table at the command prompt:

netsh interface ip delete arpcache

(had to do this after "save changes" but before reloading the page to be able to press "modify")

I guess my PC gets muddled if it tries to add a second MAC for the one IP?

Does a UDP Listener wait for APP_ACCEPT to be returned before allowing reception of another UDP packet on that socket?

Ive got a UDP Listener listening for UDP packets on a socket. Inside the Listener i'm passing the pointer to the data and the data length to a subroutine and i think that subroutine in turn passes it to a couple of other subroutines. Eventually it comes back out of those subroutines and exists the listener with "return APP_ACCEPT;"

Maybe this sounds dumb but... none of the parameters being passed by the Listener function are being overwritten by another udp packet coming in while i'm analysing the last one are there? I imagine uTasker waits for the APP_ACCEPT from the Listener before allowing another packet to be received.

I havn't had any problems. Just want to make sure.

John Dowdell

µTasker general / Re: Problems with FTP using Filezilla
« on: March 25, 2008, 04:23:20 AM »
FileZilla needs both of the settings that Mark pointed out to be changed.

You'll need to change two settings in the "Transfer Settings" in the Site Manager setup for your "site".

1.  Change Transfer Mode to Active

2.  Check the "Limit number of Simultaneous Connections" box and set the number of simultaneous connections to 1.

When you transfer a file, it will show the long file name on the remote file tree until you refresh the file tree and it will then show the name that UTasker has set it to.


ok. that was my gut feeling.
in the NE64 an int is 16bit so only two bytes.
I've now stepped through the code with the debugger and it does in fact pass a value of 2 into uMemcpy.

The sizeof(IPV4_LENGTH) only appears in those few lines that restore a couple of the flash values into the working values (default gateway, mask and ip. And only if dhcp is active) from the webpage (Admin:restore or Admin:Reset) and maybe also from telnet?.

So at the moment, in NE64 which i guess is the only 16 bit target for utasker? only the top two octets of those i.p. numbers are being copied.


FreescaleTM MC9S12NE64 / Re: empty file system
« on: March 18, 2008, 09:29:47 AM »
Windows file explorer isnt much chop and  had minor problems with windows command prompt ftp (drag and drop is much easier anyway). I use AceFTP - free full use with registration. Has a small advertisement box in the corner.

Transfers:use incoming port connections (as opposed to outgoing (pasv))

and although by default the ftp server has a long timeout 120s? i also use a keep alive of around 3 seconds.

i get the same proxy message you mention in windows explorer.
i can see the directory and its files in ie7.

also using ne64


µTasker general / is sizeof(IPV4_LENGTH) and IPV4_LENGTH the same?
« on: March 18, 2008, 08:59:59 AM »
This is probably more of a general ansi c question but for something like:
uMemcpy(network.ucOurIP, network_back.ucOurIP, sizeof(IPV4_LENGTH));
which appears in application.c...

where IPV4_LENGTH is a define in tcpip.h :

#define IPV4_LENGTH             4

Is the size passed into uMemcpy in fact 4?

Is the following just as valid?
uMemcpy(network.ucOurIP, network_back.ucOurIP, IPV4_LENGTH);

and in this case is the size passed into uMemcpy also 4?

I understand sizeof being used for strings or arrays but for a define this confused me.

after enabling the network indicator option in NE64 version of the project, the complier compained about this line:

    #define LINK_DOWN_LEDS()       PTL |= (LNKLED | ACTLED);       \
                                       PTL = ~(COLLED | SPDLED | DUPLED);

i assume the backslash somehow is supposed to indicated that the second line shoulds also be included in the define but my CW doesnt like it. Anybody know a way to make it work?

I use the NE64
It sounds similar to when i had accidentally set page 0x3C aside for flash and 0x3D for code in the memory setup in codewarrior compiler.
Whereas 0x3D should be set aside for flash file and 0x3C should be used for code.

FTP and the file system was getting completely stuffed up. FTP thought it was writing files but reading them back showed them to be gibberish.
I've never used GCC for this project. Make sure you disallow the compiler from trying to write code to page 0x3D?
Make sure the file system section gets put in the start of 0x4000?.

Ive never compiled with the serial interface option turned on so i cant compare compile sizes in CW atm.
I'll do this some time and post back here

I was going to write some sort of small serial<->ethernet app at some point. when i do i'll post snippets here.
Like Mark said you could disable the serial interface altogether if you wanted to, redirect the serial vectors to your own code and set up the serial port in your own code.

There are definately advantages with the other processors.
NE64 as part of the s12 family is attractive for some when spending a few grand on a commercial compiler because the compiler supports the rest of the diverse s12 family micros as well.
I found the little ne64 modules from technological arts in Canada very useful during experimenting with the hardware.



Pages: 1 2 [3] 4