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

Pages: [1]
1
Hi m_mikula

If the offer is still up, and not to much trouble, I would like you to upload the schematics with pinoutfor the BDM interface you mention.

Thank You

Kim

2
µTasker general / Re: "Stack up" messages to tasks
« on: March 26, 2008, 11:05:52 PM »
Hi again

Quote
I think that the following may work:

    len = fnRead( PortIDInternalQueue, ucRxMessage, ucRxMessage[MSG_CONTENT_LENGTH]);           
    fnWrite(SerialID, ucRxMessage, len);

In your method:
    fnRead( PortIDInternalQueue, ucRxMessage, SMALL_MESSAGE);
will read all messages in the input queue into ucRxMessage.
    len = uStrlen(ucRxMessage); will then probably give the length of the first string in the queue (although there are proabably several strings waiting there)

That did the trick

Thank you

ZeroOne

3
µTasker general / Re: "Stack up" messages to tasks
« on: March 26, 2008, 03:27:00 PM »
Hi Mark

Tried "Dummy task idea" above and it seems to work partially. I am only able to write out one message (the first one). The rest of the messages don't seem to be stored. The fnRead() in the while-loop is not reading anything (returns 0) when it's supposed to read the sekund message.
I have the following code to read the content of the queue:

Code: [Select]

//include
#include "config.h"

//Global variables
static QUEUE_HANDLE PortIDInternalQueue;                                          // queue ID for task input

//Prototypes
void fnDummyQueueTask(TTASKTABLE *ptrTaskTable);

//functions
void fnRxMessage(TTASKTABLE *ptrTaskTable)                                        // scheduled once every 2s
{
unsigned char ucRxMessage[SMALL_MESSAGE] = {0};
static QUEUE_HANDLE SerialID;
int len = 0;

    while ( fnRead( PortIDInternalQueue, ucRxMessage, HEADER_LENGTH + 1 ))  // read the queued inputs every 2s.
{
SerialID = ucRxMessage[MSG_CONTENT_COMMAND];

switch(ucRxMessage[MSG_SOURCE_TASK]) // Source of message
{
case TASK_TX_MESSAGE:
{
fnRead( PortIDInternalQueue, ucRxMessage, SMALL_MESSAGE);
len = uStrlen(ucRxMessage);

fnWrite(SerialID, ucRxMessage, len);
}
}
    }
}

void fnDummyQueueTask(TTASKTABLE *ptrTaskTable)
{
    PortIDInternalQueue = ptrTaskTable->TaskID;                                    // remember the input handle but don't read the queue
}

The following code is used to build and send the message to the fnDummyQueueTask() and to set up the UART. :

Code: [Select]
//Includes
#include "config.h"

//defines


//Global varables

//Prototypes
void fnSendToDummy(unsigned char ucCommand, unsigned char *ucData, unsigned char ucLength);
QUEUE_HANDLE fnConfigureUART(unsigned char mode);

//functions
void fnTxMessage(TTASKTABLE *ptrTaskTable)
{
static unsigned int uiState;
unsigned char ucRxUART[SMALL_MESSAGE] = {0};

static QUEUE_HANDLE SerialID;

if(uiState == 0)
{
SerialID = fnConfigureUART(FOR_I_O);
uTaskerStateChange(TASK_TX_MESSAGE, UTASKER_STOP);
uiState = 1;
}


if(fnRead(SerialID, (unsigned char *)ucRxUART, SMALL_MESSAGE) != 0)
fnSendToDummy(SerialID, (unsigned char *)ucRxUART, uStrlen(ucRxUART));
else
fnSendToDummy(SerialID, (unsigned char *)"empty\r", uStrlen("empty\r"));
}

void fnSendToDummy(unsigned char ucCommand, unsigned char *ucData, unsigned char ucLength)
{
unsigned char ucTxMessage[ HEADER_LENGTH + SMALL_MESSAGE + 1];

ucTxMessage[ MSG_DESTINATION_NODE ]  = INTERNAL_ROUTE;
ucTxMessage[ MSG_SOURCE_NODE ]       = INTERNAL_ROUTE;
ucTxMessage[ MSG_DESTINATION_TASK ]  = TASK_DUMMY;
ucTxMessage[ MSG_SOURCE_TASK ]       = TASK_TX_MESSAGE;            
ucTxMessage[ MSG_CONTENT_LENGTH ]    = ucLength;
ucTxMessage[ MSG_CONTENT_COMMAND ]   = ucCommand;

if (fnWrite(INTERNAL_ROUTE, ucTxMessage, 0))
fnWrite(INTERNAL_ROUTE, ucData, ucLength);

}

QUEUE_HANDLE fnConfigureUART(unsigned char mode)
{
TTYTABLE tInterfaceParameters;       //table for passing information to driver
QUEUE_HANDLE SerialPortID;

tInterfaceParameters.Channel = 0;  // serial 0, 1, 2, 3, 4, etc.
  tInterfaceParameters.ucSpeed =  SERIAL_BAUD_19200; // baud rate
  tInterfaceParameters.Rx_tx_sizes.RxQueueSize = RX_BUFFER_SIZE;       // input buffer size
tInterfaceParameters.Rx_tx_sizes.TxQueueSize = TX_BUFFER_SIZE;
    tInterfaceParameters.Task_to_wake = TASK_TX_MESSAGE;
tInterfaceParameters.usConfig = (CHAR_8| NO_PARITY | ONE_STOP | NO_HANDSHAKE | MSG_MODE);    
tInterfaceParameters.ucMessageTerminator = '\r';

if (SerialPortID = fnOpen( TYPE_TTY, mode, &tInterfaceParameters ))  // open or change the channel with defined configurations (initially inactive)
        fnDriver( SerialPortID, (RX_ON | TX_ON ), 0 );        // enable RX

return SerialPortID;
 
}

In TaskConfig.h I have the following configuration:

Code: [Select]
{ "1_Tx", fnTxMessage, NO_QUE, 0, 0, UTASKER_GO},
  { "2_Rx", fnRxMessage, NO_QUE, 0, (DELAY_LIMIT)(10 * SEC), UTASKER_STOP},
  { "3_Dummy", fnDummyQueueTask, (2 * 1024), 0, 0, UTASKER_STOP},

I am fully able to send and recieve from the UART using message mode. During the 10 sec I can send messages from the UART and everytime the fnTxMessage() is called so the messages can be build, sent and stored. When the 10 sec are done only the first message sent is recieved the rest is gone.

Can't figure out what is wrong

ZeroOne

4
µTasker general / "Stack up" messages to tasks
« on: March 24, 2008, 10:23:07 AM »
Hi

Is it possible to "stack up" messages to a task, for them to be read later on?

For instance:

funktion1 is set run every 10 sek. funktion2 is running all the time (UTASKER_GO) sending internal messages to funktion1.

Is it possible to read all the messages send by funktion2 every 10 sek? or will funktion1 respond everytime a message arrives?

ZeroOne

5
µTasker general / Re: UART / Serial and the simulator problem
« on: March 15, 2008, 01:27:37 PM »
Hi

Just a note. I figured out what the problem was:
Turns out hyperterminal didn't close down properly. It was running in the background keeping com1 open.  :( . (Had to close it under proceses using ctrl+alt+del)

Sorry for the inconvience.

ZeroOne

6
µTasker general / Re: UART / Serial and the simulator problem
« on: March 15, 2008, 01:16:49 PM »
Hi again

It seems to work and I have no idea why! I haven't changed anything, so my best bet is that windows didn't do what is was supposed to do.

Anyway thank you

ZeroOne


7
µTasker general / UART / Serial and the simulator problem
« on: March 15, 2008, 10:01:44 AM »
Hi

I have a problem with the UART/serial interface and the simulator.

I have the forlowing code in a file called MyUart.c:
Code: [Select]
//includes
#include "config.h"

//Prototypes
void setUart(unsigned char mode);

// Global variables
static QUEUE_HANDLE SerialPortID; // quehandler for serialport 0

//call functions
void fnSerialTest(TTASKTABLE *ptrTaskTable)         // my task task in polling mode (at the moment)
{
static int iState = 0;

        if (iState== 0)
{   
setUart(FOR_I_O); //Rx & Tx
iState = 1;
        }
fnWrite(SerialPortID, (unsigned char *)"Hello world", uStrlen("Hello world"));
}

void setUart(unsigned char mode)
{
TTYTABLE tInterfaceParameters;       //table for passing information to driver

tInterfaceParameters.Channel = 0;  // serial 0, 1, 2, 3, 4, etc.
  tInterfaceParameters.ucSpeed =  SERIAL_BAUD_19200; // baud rate
  tInterfaceParameters.Rx_tx_sizes.RxQueueSize = RX_BUFFER_SIZE;       // input buffer size
tInterfaceParameters.Rx_tx_sizes.TxQueueSize = TX_BUFFER_SIZE; // outpu buffer size
    tInterfaceParameters.Task_to_wake = TASK_MYUART;
tInterfaceParameters.usConfig = (CHAR_8 | NO_PARITY | ONE_STOP | NO_HANDSHAKE | CHAR_MODE);    

if ( (SerialPortID = fnOpen(TYPE_TTY, mode, &tInterfaceParameters)) != 0 )  // open or change the channel with defined configurations (initially inactive)
fnDriver( SerialPortID, (RX_ON | TX_ON), 0 );        // enable RX & TX

}

In TaskConfig.h I have the forlowing entrys:
Code: [Select]
#define TASK_MYUART 'u'
...
extern void fnSerialTest(TTASKTABLE *ptrTaskTable);
...
TASK_MYUART,   //ctNodes
...
{ "uart", fnSerialTest,    NO_QUE,      0, 0, UTASKER_GO}, //ctTaskTable

and in app_hw_m5223x.h:
Code: [Select]
#define SERIAL_PORT_0   '1'
This is correct since I use channel zero and com1 for communication.

The problem is that nothing is written to com1 using the simulator.

When i debug in MyUart.c at:
Code: [Select]
if ( (SerialPortID = fnOpen(TYPE_TTY, mode, &tInterfaceParameters)) != 0 )
fnOpen() doesn't return to this line. Instad it returns to
Code: [Select]
if ((SerialPortID = fnOpen( TYPE_TTY, ucDriverMode, &tInterfaceParameters )) != 0)
in application.c.

I am using uTasker sp6.

ZeroOne

8
Hi

I am using a crossed LAN cable between the M52233DEMO (running uTasker) and my PC and there seems to be no connection what so ever between the two. The netmask on the PC is the same as the one one the demoboard. The funny thing is when the M52233DEMO is connected to a router I have no problem connecting to M52233DEMO using ftp or http. I can upload webpages, view them and use them.

I tried disabling the DHCP i config.h, but the result is the same.

ZeroOne

Ps. I did check the cable and it is ok.

9
Hi

Problem solved  ;D
Updating to SP6 did the job. (It properly also would haved worked if I only would have updated to SP1)

Thanks for the great support  ;D

ZeroOne

10
Hello again.

I am sorry it's nearly been a little over a month since my last reply. There has been som urgent issues that I had to attend to instead of dealing with uTasker.

First I uninstalled VS 2008 and replaced it by Visual C++ 2005 express edition in the hope that this might solve the problem. I followed the instructions given by the FAQ concerning Visual C++ 2005 express edition and no problem there. I can compile and build, but the simulator still don't want to save to flash.

Then I followed the advise and debugged with a breakpoint at the beginning of the funktion fnSaveFlashToFile() in FileToDisk.c.

At the code line:

Code: [Select]
_sopen_s(&iFileIni, FLASH_FILE, (_O_BINARY |  _O_TRUNC  | _O_CREAT | _O_RDWR), 0, _S_IREAD | _S_IWRITE);
the debugger stops and a dialog box apears with the message: There is no source code available for the current location.

When I set a breakpoint below the above given code line, the breakpoint is never reached so the code is never executed.

I don't know what the problem might be. Any suggestions

ZeroOne

11
Hej again  :)

I'm using VS 2008 and running XP SP2.

My system is a laptop:
Dell inspriron 6400/E1505
1 GB ram
ATI x1400
80 GB Harddrive

ZeroOne

12
Hej.

I'm working through the coldfire tutorial and at the point where uTasker is suppose to create the file FLASH_M5223x.ini to store the webpages it simply doesn't. When I close down uTasker and start it up again I have to upload alle the webpages again.
Does anyone know what the problem might be?

ZeroOne

ps. I close doen uTasker by using File|Exit

Pages: [1]