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

Pages: [1]
1
µTasker general / Re: Bug in TCP client?
« on: August 24, 2009, 08:13:44 AM »
Hi Mark,

Yes, it's make a sense... By the way, I solved similar problem two days later...

Code: [Select]
if ((value == 0x01) || (value == 0x02) || (value == 0x03)) - on some special location this condition was always false... But few lines later this condition works fine (or works if I changed code before or after)... I think that this bug is also depending on code around problematic lines, so in this moment I downgrade CW.

Thanks for your help...

Martin

2
µTasker general / Bug in TCP client?
« on: August 23, 2009, 03:43:35 PM »
Hi mark,

I compile new uTasker 1.4 for freescale, and I find out some strange behaviour (I dont know if this bevaviour is also in 1.3): When I enable TIME_SERVER, the result in wireshark is quiet strange... Creation of connection is ok, data comes OK, but next server send request with FIN bit enabled, but uTasker reply only with ACK (TCP requires FIN+ACK), so the connection is still opened, and no notification cames to application... Can you please check if it's really a bug?

Code: [Select]
192.168.64.209 | 192.168.64.2   | TCP | 61264 > time [SYN] Seq=0 Win=1460 Len=0 MSS=1460
192.168.64.2   | 192.168.64.209 | TCP | time > 61264 [SYN, ACK] Seq=0 Ack=1 Win=1460 Len=0 MSS=1460
192.168.64.209 | 192.168.64.2   | TCP | 61264 > time [ACK] Seq=1 Ack=1 Win=1460 Len=0
192.168.64.2   | 192.168.64.209 | TIME | TIME response
192.168.64.2   | 192.168.64.209 | TCP | time > 61264 [FIN, ACK] Seq=5 Ack=1 Win=5840 Len=0
192.168.64.209 | 192.168.64.2   | TCP | 61264 > time [ACK] Seq=1 Ack=5 Win=1460 Len=0
192.168.64.2   | 192.168.64.209 | TCP | time > 61264 [FIN, ACK] Seq=5 Ack=1 Win=5840 Len=0
192.168.64.2   | 192.168.64.209 | TCP | time > 61264 [FIN, ACK] Seq=5 Ack=1 Win=5840 Len=0
192.168.64.2   | 192.168.64.209 | TCP | time > 61264 [FIN, ACK] Seq=5 Ack=1 Win=5840 Len=0
192.168.64.2   | 192.168.64.209 | TCP | time > 61264 [FIN, ACK] Seq=5 Ack=1 Win=5840 Len=0
192.168.64.2   | 192.168.64.209 | TCP | time > 61264 [FIN, ACK] Seq=5 Ack=1 Win=5840 Len=0
192.168.64.2   | 192.168.64.209 | TCP | time > 61264 [FIN, ACK] Seq=5 Ack=1 Win=5840 Len=0
192.168.64.2   | 192.168.64.209 | TCP | time > 61264 [FIN, ACK] Seq=5 Ack=1 Win=5840 Len=0
192.168.64.2   | 192.168.64.209 | TCP | time > 61264 [FIN, ACK] Seq=5 Ack=1 Win=5840 Len=0
Problematic is sixth line.

Thanks,
Martin

3
NXPTM M522XX, KINETIS and i.MX RT / Dependency problem
« on: February 25, 2009, 07:46:35 AM »
Hi Mark,

I'm trying to use only PARAMETER_BLOCK without FLASH_FILE_SYSTEM:
Code: [Select]
#define USE_PARAMETER_BLOCK
#define USE_PAR_SWAP_BLOCK
//#define SPI_FILE_SYSTEM
//#define FLASH_FILE_SYSTEM
//#define NVRAM
//#define INTERNAL_USER_FILES

But the result is compilation problem (missing some defines like FILE_SYSTEM_SIZE) is this behaviour correct? Why parameter block is depending on file system?

---
Martin

4
Hi,

has anybody macros va_strart, va_end, etc... , which are working with REG_ABI enabled? I try to find something but without sucess...

--
Martin

5
There is pointer to "Exception Stack" in A0. So witch a little macros I can easily find out which exception was happend, I don't need to start debugger, but i see all needed informations on my debug uart...

--
Martin

6
Hi,

thanks for advice... It seems that this code works: ( if somebody interested :) )

Code: [Select]
asm_exception_handler:
_asm_exception_handler:
    lea     -64(SP),SP                                 // move SP forward 64 bytes (16*4)
    movem.l D0-D7/A0-A7,(SP) // save registers
    lea     64(SP),A0                                  // get value of SP 64 bytes backwarded and store it in A0
    jsr     real_exception_handler                  // call function
    movem.l (SP),D0-D7/A0-A7 // restore registers
    lea     64(SP),SP                                  // move SP back...
    rte

Martin

7
Hi,

RSTI is very important, we spend more time while we findout a problem... Now our full BDM interface have 10pins and everithing works great... If you want, I can upload some images and schemes(with complete pinouts for BDM cable)...

8
Hi mark,

How can I call C functions from assemler when REG_ABI is enabled? I want to write my own exception processing function but I dont know how to write this small assembler code:

in m5223X:
Code: [Select]
for (n = 0; n < 256; n++) {
//__VECTOR_RAM[n] = (unsigned long)undef_int;                      // set undefined interrupt for all interrupts at start
__VECTOR_RAM[n] = (unsigned long)asm_exception_handler;
}

added file m5223X_ext:
Code: [Select]
#define GET_FORMAT(ESF)  ((*((unsigned short *)(ESF)) >> 12) & 0x00FF)
#define GET_VECTOR(ESF)   ((*((unsigned short *)(ESF)) >>  2) & 0x00FF)
#define GET_FS(ESF) ( ((*((unsigned short *)(ESF)) & 0x0C00) >> 8) | (*((unsigned short *)(ESF)) & 0x0003) )
#define GET_PC(ESF) *((unsigned long *)(ESF)+1)

void real_exception_handler (unsigned long *esf)
{
unsigned char fmt = GET_FORMAT(esf);
unsigned char vector = GET_VECTOR(esf);
unsigned char fs = GET_FS(esf);
unsigned char epc = GET_PC(esf);

// log this
fnErrorMsg("Exception - FMT: "); fnErrorDec(fmt);
fnErrorMsg(", VECTOR: "); fnErrorDec(vector);
fnErrorMsg(", FS: "); fnErrorDec(fs);
fnErrorMsg(", EPC: "); fnErrorDec(epc);
fnErrorMsg("\n\r");

// test if is critical...
if (isCritical(fmt, vector, fs))
while(1) {}

// else continue with program execution so return from handler...
}

and i dont know write asm_exception_handler in Startup.s
Code: [Select]
asm_exception_handler:
_asm_exception_handler:
// save registers
// load values from SP
    jsr     real_exception_handler // call real handler
// restore registers
    rte // return from handler

please can you help me with missing code?

9
NXPTM M522XX, KINETIS and i.MX RT / MSL library
« on: March 21, 2008, 05:59:30 PM »
Hi, Is any option how to use standard MSL library into uTasker??? I need some functions and floating point aritmetics...
I insert this libs:
fp_coldfire.a
C_4i_CF_RegABI_Runtime.a
C_4i_CF_RegABI_SZ_MSL.a

Result:
floating works, but some functions like: sprintf doesn't

Code: [Select]
char aa[20];
sprintf(&aa, "char: \n\r");
fnDebugMsg(aa);

What I'm doing wrong?

10
NXPTM M522XX, KINETIS and i.MX RT / Problem with auto-negotiation ?
« on: February 14, 2008, 11:41:12 PM »
I have problems with auto-negotiation in some cases ( some switches, cross cable, etc... ) I found this problem in Errata document, and copy code from cold-fire lite stack... When I connect device and then power it up, everithing seems OK, but when I connect device to 100M/s switch port power up device and then connect it to 10M/s switch port the re-detection fails and I must power down and power up the device.

Have anybody some ideas how to solve this problem?

11
µTasker general / Re: Problem with GlobalMonoTimers ?
« on: January 21, 2008, 11:22:45 PM »
Thanks!!!

It's seems that you are right. Now when I looks to your patch, I can't beleve that i dont see it... However this looks like my problem, now I must add this patch to base source and do some additional tests for timers... Is anywhere list of hnown bugs? Maybe It could help in some cases to know about known bugs between service packs... Before I send this topic I read the SP5 patch list for MCF5223X at:
http://www.utasker.com/forum/index.php?topic=40.0
but there  is nothing about this problem, so if such page doesn't exists do you consider about something like that?

12
µTasker general / Problem with GlobalMonoTimers ?
« on: January 21, 2008, 08:06:58 PM »
Hi,

I have problem with GlobalMonoTimers, maybe i't my mistake... We use some complicated timers usage, so we need about 30 timers at same time and there is some strange...

I write some example:
Code: [Select]
#define E_RDR2_PING_TIMEOUT 21
#define E_RDR2_DO_PING 23
#define E_RDR_3SEC 24

void fnApplication(TTASKTABLE *ptrTaskTable)
{
....
if (!iAppState) {
uTaskerGlobalMonoTimer( OWN_TASK, (DELAY_LIMIT)(5*SEC), E_RDR2_DO_PING);
uTaskerGlobalMonoTimer( OWN_TASK, (DELAY_LIMIT)(1*SEC), E_RDR2_PING_TIMEOUT);
uTaskerGlobalMonoTimer( OWN_TASK, (DELAY_LIMIT)(0.5*SEC), E_RDR_3SEC);
iAppState = 1;
    } // END OF INIT

// check input queue
while ( fnRead( PortIDInternal, ucInputMessage, HEADER_LENGTH )) {
    // switch depending on message source
        switch ( ucInputMessage[ MSG_SOURCE_TASK ] ) {
        case TIMER_EVENT:
        if (E_RDR2_DO_PING == ucInputMessage[ MSG_TIMER_EVENT ]) {
        fnDebugMsg("RDR2 do ping\r\n");
        uTaskerGlobalMonoTimer( OWN_TASK, (DELAY_LIMIT)(5*SEC), E_RDR2_DO_PING);
        uTaskerGlobalMonoTimer( OWN_TASK, (DELAY_LIMIT)(1*SEC), E_RDR2_PING_TIMEOUT);
        uTaskerGlobalMonoTimer( OWN_TASK, (DELAY_LIMIT)(0.5*SEC), E_RDR_3SEC);
        }
        else if (E_RDR2_PING_TIMEOUT == ucInputMessage[ MSG_TIMER_EVENT ]) {
        fnDebugMsg("Ping timeout\r\n");
        LED_2_OFF();
        }
        else if (E_RDR_3SEC == ucInputMessage[ MSG_TIMER_EVENT ]) {
        fnDebugMsg("3SEC timeout\r\n");
      uTaskerGlobalMonoTimer( OWN_TASK, (DELAY_LIMIT)(5*SEC), E_RDR2_DO_PING);
        uTaskerGlobalStopTimer( OWN_TASK, E_RDR2_PING_TIMEOUT );
        }
    break;   
        default:
        // flush any unexpected messages (assuming they arrived from another task)
            fnRead( PortIDInternal, ucInputMessage, ucInputMessage[MSG_CONTENT_LENGTH]);
            break;
        }
    }
}
Right behaviour:
After uTasker boot set up three timers: E_RDR2_DO_PING, E_RDR2_PING_TIMEOUT, E_RDR_3SEC. After 0.5 sec, the first timer E_RDR_3SEC may elapse. So timer E_RDR2_DO_PING shoud be relaunch to 5 sec interval, and timer E_RDR2_PING_TIMEOUT should be stopped.
Real behaviour:
After 0.5 sec, the first timer E_RDR_3SEC elapsed. After approx next 0.5 timer E_RDR2_DO_PING elapsed. I can't find reason why!?

When I replace code:
Code: [Select]
uTaskerGlobalMonoTimer( OWN_TASK, (DELAY_LIMIT)(5*SEC), E_RDR2_DO_PING);
uTaskerGlobalStopTimer( OWN_TASK, E_RDR2_PING_TIMEOUT );
with
Code: [Select]
uTaskerGlobalStopTimer( OWN_TASK, E_RDR2_DO_PING);
uTaskerGlobalStopTimer( OWN_TASK, E_RDR2_PING_TIMEOUT );
uTaskerGlobalMonoTimer( OWN_TASK, (DELAY_LIMIT)(5*SEC), E_RDR2_DO_PING);
everithing works fine....

As I mentioned before we use many timers at same time and this undefined/undocumented behaviour is very bad for us... Please help...

Thanks...
Best Regards...

13
NXPTM M522XX, KINETIS and i.MX RT / Thanks!!!
« on: November 21, 2007, 10:16:02 PM »
Thanks, your answer help me very much...

You have been right with DMA problem... I added some additional functions to boot loader, so I need three blocks for BL. So I want to ask if value "#0x161" will work with this configuration. Now it seems that everithing work fine, but I want to be sure...

So thanks, now I'm back in the game :)

14
NXPTM M522XX, KINETIS and i.MX RT / DMA problem
« on: November 21, 2007, 08:38:31 PM »
Hi,

I have enabled macros:
DMA_MEMCPY_SET and also SERIAL_SUPPORT_DMA

I use UART0 and UART1 but without DMA - params.ucDMAConfig = 0;

Now the system can't boot, and when I debugging it I identificate that system stops in function uMemcpy in line:

while (!(DMA_SR_BCR3 & DSR_DONE)) { SIM_DMA_3 };                 // wait until the transfer has terminated

Any ideas why?

Question2:
When static __interrupt__ void undef_int(void) function is called, how can I identificate from which interrupt is this function called? I use PEMICRO debbugger on my own hardware...

Pages: [1]