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.

Topics - thamanjd

Pages: [1] 2
I was going to experiment using MCF52235 UARTs with RS485 but have just discovered that the only transmit interrupt available is effectively Transmit Data Register Empty (TXRDY).

But for RS485 you need to know when it is safe to switch the transmit enable bit on the RS485 driver. That is, you need to know when the byte has completely finished transmitting, stop bit and all. It would have been nice for there to be a transmit complete (TXEMP) interrupt but this seems to be lacking in the UART module. I considered setting some routine/timer to check the TXEMP flag(after reception of TXRDY interrupt) but this solution isn't fast or elegant.

Is it just me or is the UART module in some (all?) of the MCF522xx devices a bit clunky?

ideas? at the moment i'm thinking i should look at some other micros but 128K program plus 128k flash storage is attractive in devices like the MCF52235.

John Dowdell

I suspect this problem is arising from something strange that i have modified in my code that the comiler is not handling very well.

When i compile, the errors message screen shows:
could not find or load the file "uTasker_full.elf" for target "M52235EVB_ROM" for project "uTaskerV1.3.mcp"

Has anyone come across this happening?
Is it not the compiler/linker that actually create the elf & map files?
The error screen doesn't give me any clues as to what it was that i did that stuffed it up.

I've found i think that the compiler error message screen shows me a bunch of errors i have to fix up but if i then press the make button again, that is when it shows no erros except for this missing elf file message

Before i started modding code, it wasn't happening. There were a bunch of compiler error messages but none of them were to do with missing elf files.

Any insights/comments are welcome

John Dowdell

µTasker general / More HTTP sessions on a different port?
« on: November 22, 2009, 11:29:29 AM »
I've already done this and it works but it's pretty ugly and implemented in a bad way....

So now i'm going to see if it's already been done, asked for or on your to do list Mark.

I wanted to have a way to use http locally using port 80 and be able to access the same pages remotely. I could port forward port 80 at the router(that has world facing ip address) to port 80 at my uTasker device but i wanted to keep it free for something else.

Plus, if two of this utasker project were used on the same network, i can't port forward port 80 to two different devices wth two IPs.

So i decided i wanted to add 4 more http sessions that would listen for connections on another port number that was world facing using port fowarding at the router on the port number i had chosen. I am still keeping the original 4 sessions that are listening for port 80 connections.

I'm not really worried out data on the pagesbeing out of sync. It will likely be only used by one person who is either on the local network or remote elsewhere so i dont expect feedback on the webpages being out of sync with reality because two people are manipulating the web pages at the same time.

All i did was replicate all? (most) of the functions in HTTP.c and given them a slightly different name. The sessions and message pointer is also replicated.

static HTTP         *ptrALT_HTTP = 0;
static TCP_MESSAGE              *ALT_HTTP_Tx = 0;

Anyway.............thoughts? It works so i'm satisfied with that. But i'm happy to hear about a method that would have been easier, less code space wasting and more elegant. Also happy to hear of any side effects i haven't seen or thought about yet.


FreescaleTM MC9S12NE64 / Stack size / pointer setting recommendations
« on: August 22, 2008, 09:06:03 AM »
I think i need some advice for how i should be setting up the stack in the NE64.

I guess there's three settings im wondering about really.

Everything is working ok but i wonder if its just been luck so far.
I havn't yet used any of the stack/heap checking functions.

1. At what address should i be setting the stack pointer at initialisation?
2. In the PRM file should i leave room at the stack end of RAM indicating that the compiler should not try to allocate variables in a space set aside for the stack?
3. In the PRM file what size should STACKSIZE be?

 If i run the project on the debugger for a while and then stop it, can i look for some "untouched" memory pattern to make sure the stack and the heap didnt get too close to each other?

some of the settings in my prm file

      RAM = READ_WRITE 0x2602 TO 0x3D00;

      STACKSIZE 0x160

I'm using some of the buffer space normally used for ethernet buffers as ram at the bottom there. DHCP has been disabled. my name of "STACKSPACE" is only used in the above line and not referenced anywhere.

 i note in the demo program that STACKSIZE is 1 and RAM is allocated all the way:
RAM = READ_WRITE 0x2c00 TO 0x3FFF;


Can anybody point me to or like to share code for string to unsigned short (16bit) routine?  this will be for reading an edit box from a web page to configure a tcp port number.

I wonder if anyone has a step by step for setting up utasker for the P&EMicro colfire multilink bdm for codewarrior V7.0?
i'm not sure which initialisation file (.cfg) or flash settings file (.xml) i should be using. 

current settings:
flash settings file: MCF52235_INTFLASH.xml
Target processor: 52235
Connection: PEMICRO_USB
initialisation file:M52235EVB.cfg   (doesnt do anything without custom settings)

Trying to erase settings gets me:
 "Downloading Flash Device Driver ..."
--something flashes up too fast to read--
"Initializing...  "
 "Reading init return status   " 
"Run the target  "
"System clock check checking ... "
"Error:  System clock check failed  See Details for additional information."

 Flash driver reports the following error(s):  Operation Unsupported  Timed Out  Verify failed

Ideas anyone?

John Dowdell

FreescaleTM MC9S12NE64 / Activity LED timing
« on: April 28, 2008, 09:48:01 AM »
I'm letting the hardware do the activity (and other network) LEDs. Do you know a way of making the activity LED stay on for longer in this mode? I have used utasker to do the LEDs before and i see to remember the activity LED staying on for longer than it is in the hardware controlled mode. At the moment it blinks so fast you can hardly see it.
When uTasker is controlling the activity LED, can i control how long the "blink" lasts for?

does pulling the cat 5 cable out of a utasker project prompt a utasker TCP session to disconnect? I'd like to make this happen if it is not the case. What should i poll to see if link is still there?

µTasker general / Is it OK to add items to NETWORK_PARAMETERS struct?
« on: April 23, 2008, 09:41:50 AM »
ive added a few bits and pieces to struct PARS which hasn't caused me any problems yet. I wondered if there would be a problem memory wise with adding anything to NETWORK_PARAMETERS struct

i was playing with adding a multicast ip to the ip filter and thought the struct would be the most likely place to save it.

Code: [Select]
typedef struct stNETWORK_PARAMETERS
    unsigned short usNetworkOptions;                                     // Options passed to the network device on configuration
    unsigned char  ucOurMAC[MAC_LENGTH];                                 // when no other value can be read from parameters this will be used
    unsigned char  ucOurIP[IPV4_LENGTH];                                 // our default IP address
    unsigned char  ucNetMask[IPV4_LENGTH];                               // Our default network mask
    unsigned char  ucDefGW[IPV4_LENGTH];                                 // Our default gateway
    unsigned char  ucDNS_server[IPV4_LENGTH];                            // Our default DNS server
    unsigned char  ucOurMulticastIP[IPV4_LENGTH];                        // our default MulticastIP

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

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

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 / 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?

Pages: [1] 2