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 - alager

Pages: 1 ... 3 4 [5] 6 7
µTasker general / Re: Linked list in CW7.1
« on: June 12, 2009, 09:38:22 PM »
I think I got it figured out, I needed some explicit casts.
Code: [Select]
fnAddNode((unsigned long *)&pList, RXBuffer);and
Code: [Select]
pTmpNode = (unsigned long **)*pTmpNode;
This still works in the simulator and now CW compiles it just fine.


µTasker general / Linked list in CW7.1
« on: June 12, 2009, 09:18:41 PM »
I'm trying to make a buffer that grows as the size of the data does, and so I'm trying  a linked list.  The code I have compiles and works fine in MSVC and the simulator, but CW won't compile it. 
It says:
Code: [Select]
Error   : illegal implicit conversion from 'unsigned long **' to 'unsigned long *' my_uart.c line 245     fnAddNode(&pList, RXBuffer); 
Error   : illegal implicit conversion from 'unsigned long *' to 'unsigned long **' my_util.c line 107      pTmpNode = *pTmpNode; 
I've following the examples from

Here is my code:
Code: [Select]
unsigned long *pList=NULL;
void fnProcessRx(CHAR *RXBuffer, QUEUE_TRANSFER length){
    fnAddNode(&pList, RXBuffer);  //this line fails in the compiler (line 245)

Code: [Select]
//take an array and allocate a chunk of ram for it on the heap
//then copy the array into the data section
//structure is an array: |ptr|string data|
void fnAddNode(unsigned long** pNode, CHAR * data){
unsigned long * pTmp;
unsigned long **pTmpNode;

pTmpNode = pNode;

pTmp = uMalloc(uStrlen(data)+1+4); //extra bytes added, one for the NULL string terminator and 4 for the address pointer
if (pTmp == NULL) {
//return NULL;
*pTmp=NULL; //make sure that the new pointer is NULL

uStrcpy((CHAR*)(pTmp+1),data); //copy the data into the new link node

//go to the end of the list to add
if (pTmpNode != NULL) {
while (*pTmpNode != NULL) {
pTmpNode = *pTmpNode;  //this line fails to compile in CW
*pTmpNode = pTmp;
//the list appears to be empty
//*pNode = pTmp;
*pNode = pTmp;

If anyone has any pointers (no pun intended) that would be great!


µTasker general / user file guide
« on: May 27, 2009, 12:47:39 AM »

I have two things I'd like to do.  One is to create a file in RAM, that is accessible by file name in a web browser.  The reason for RAM is that its contents will be changing a lot, and I don't want to wear out the flash.  I'm going to be updating a web page in near real time using Ajax techniques.

The other thing is how do I go about accessing a file (read & parse it) that has been ftp'ed or posted to the uTasker file system?  I want to put a file in the file system that will contain parameters that direct the system what to do.  The name will be a known constant. 


µTasker general / Re: Multiple telnet connections
« on: May 26, 2009, 04:16:00 PM »

Okay, thanks for the info about needing to duplicate the buffers and what not.  Can you point me to the mechanism that is causing the connection to be refused?  I'm sure there is a flag somewhere, I just haven't been able to locate it.


µTasker general / Multiple telnet connections
« on: May 22, 2009, 10:42:16 PM »
I'm trying to get multiple telnet connections into to the telnet server, but uTasker is only allowing 1.
The second client sends the [SYN], and the server responds with [RST][ACK].

I have one automated telnet client in the uTasker project that is calling out every 10 seconds.
And I need to let two clients call into the device.

With one client connected my heap and stack are:
HEAP   Free 0x0c9c from 0x6400
STACK   Unused 0x09cb
Which should be plenty to allow the second incomming session.

What else do I need to check?


You are right, I can not rely on the order nor the existence of the '\r\n' sequence.
I could get all of these:
I was hoping that there would be some uber elegant solution, but that code works too.


The messages coming from my interface hardware on uart0 always (for now) end with <CR><LF>
When a message is sent:
fnRead read gives a length of 5 and will read the 5 characters

But the second message:
the buffer 'ucInputMessage' shows:
Code: [Select]
The <LF> from the first message is leftover and is now at the start of message two.
My message terminator is set to '\r' aka <CR>.

How can I get this leftover 0x0a to be read during the initial message, so the pointers are in the correct spots?
Here is the code section from application.c where I'm running into this issue:
Code: [Select]
    while (fnMsgs(SerialPortID) != 0) {
        unsigned char ucLength;
        fnRead( SerialPortID, &ucLength, 1);                     // get message length
        Length = fnRead( SerialPortID, ucInputMessage, ucLength);


NXPTM M522XX, KINETIS and i.MX RT / Re: fnRandom() not changing
« on: April 29, 2009, 09:54:10 PM »
Thanks Mark!  I too looked on wikipedia, but wasn't into the math...


NXPTM M522XX, KINETIS and i.MX RT / Re: fnRandom() not changing
« on: April 28, 2009, 07:01:36 PM »

What I can see is usRandomNumber is started with 0xffff in fnRandom().  This gets put into usShifter and shifter to the right by 1. => uShifter now has 0x7fff
Then if
#define FEEDBACK1         0x0001                                         // feedback pattern for 16 bit shift register
#define FEEDBACK2         0x0002
are both set or both not set, then set
#define FEEDBACKIN        0x4000                                         // 15 bits used
which takes us back to 0x7fff.

On the next loop through, we start at 0x7fff, shift to 0x3fff, the if is true so OR in the feedback and end up at 0x7fff again.

I traced back to *ptrSeed, which is starting this off at 0xffff after fnInitialiseRND()


PS. This all happens regardless if I call the fnInitialiseRND() or not.  I just did it both ways.

NXPTM M522XX, KINETIS and i.MX RT / Re: fnRandom() not changing
« on: April 28, 2009, 06:23:58 PM »

These two lines are located in the TCP_EVENT_CONNECTED case:
Code: [Select]
rnd = fnRandom(); //rnd is an unsigned short

So yes it is called repetitively.  I read the comments in that function and tried the reset button, to see if it would induce a change, but it didn't.
My stack and heap seem okay:
HEAP   Free 0x061c from 0x5400
STACK   Unused 0x1aff

I'll see what I can see in the hardware...I'm using a reduced pin package, so sometimes I can't see what I want.


NXPTM M522XX, KINETIS and i.MX RT / fnRandom() not changing
« on: April 28, 2009, 04:52:36 PM »
When I run my code on the simulator the fnRandom() call returns a random number.  However when I run it on the target MCF52233CAF, I get the same number over and over again: 32767.
I even tried calling fnInitialiseRND() right before it each time...same number.

Any ideas?


µTasker general / Re: Visual Studio help
« on: April 24, 2009, 09:22:31 PM »
Thanks!  I kept looking in the debug area...


µTasker general / Visual Studio help
« on: April 24, 2009, 07:44:39 PM »
I know this isn't uTasker directly, but I am working on a uTasker project.   ;)

I use F5 to start debugging, and since I'm lazy, I let that do the build also.  But I accidentally clicked the check box to "don't warn me anymore" when there are errors in the build.  Now I can't figure out how to turn that warning back on.
Any ideas?


µTasker general / Re: How to change MAC address?
« on: April 24, 2009, 07:40:43 PM »
Thanks Mark, i wasn't aware of that MAC limitation.


µTasker general / Re: How to change MAC address?
« on: April 16, 2009, 05:21:43 PM »
Awesome!  That worked.  Mine was called FLASH_M5223X.ini for the Freescale part.


Pages: 1 ... 3 4 [5] 6 7