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

Pages: [1]
1
µTasker general / Re: send UDP subnet broadcast
« on: March 01, 2016, 08:39:11 AM »
Hi Mark
Thanks, my project is to old, I will have to update.
Christo

2
µTasker general / send UDP subnet broadcast
« on: February 29, 2016, 04:10:15 PM »
Hi
I am tying to send a udp broadcast to 192.168.0.255, but I don't see it with wireshark. If I use 255.255.255.0 for the IP it does send.
It looks like uTasker is looking for a apr entry for 192.168.0.255.
What must I do to be able to send to this broadcast address

uTasker 1.4
MCF52259

Regards
Christo

3
µTasker general / Re: USB fnWrite not writing all data
« on: October 30, 2013, 08:31:52 AM »
Hi Mark
I have to check what fnWrite(USBPortID_mcu, 0, 1024) returns.
It is just a simple request response protocol, I slowed it down to once a second made no difference.
No other code is writing to the USB yet, I still have to write that code.
If I write the remaining bytes immediately after the first write it works every time. I can even write the complete message again then it works.

To me it look like a problem at the point where the circular buffer wraps.

To get it working a changed my buffer size to 512 and padded all the messages up to 512 bytes, fnWrite(USBPortID_mcu,ucOutputMessage,BIG_MESSAGE), it works now with all the delays removed.

Christo


4
µTasker general / USB fnWrite not writing all data
« on: October 28, 2013, 02:29:38 PM »
Hi
Why would fnWrite not copy all the bytes to the USB endpoint.
Code: [Select]
if (fnWrite(USBPortID_mcu, 0, 1024) != 0) {     // check that there is space for a block of data

     if(fnMsgs(USBPortID_mcu) != 0) {
         fnDebugMsg("Usb Data ");
         Length = fnRead(USBPortID_mcu, ucInputMessage, BIG_MESSAGE); // read the content
         fnDebugDec(Length,0);
         fnDebugMsg(" bytes in ");
         Length = fnProcessMCUMessage("USB",0,ucInputMessage,Length,ucOutputMessage);
         fnDebugDec(Length,0);
         fnDebugMsg(" bytes to send ");
         if(Length > 0)
             Length = fnWrite(USBPortID_mcu,ucOutputMessage,Length);
         fnDebugDec(Length,0);
         fnDebugMsg(" bytes sent\r\n");
     }
    }
The function fnProcessMCUMessage dont return more than 512 bytes.

Quote
Usb Data 18 bytes in 34 bytes to send 34 bytes sent
Usb Data 18 bytes in 34 bytes to send 34 bytes sent
Usb Data 18 bytes in 34 bytes to send 34 bytes sent
Usb Data 34 bytes in 498 bytes to send 20 bytes sent
Usb Data 34 bytes in 66 bytes to send 66 bytes sent
Usb Data 34 bytes in 498 bytes to send 480 bytes sent
Usb Data 34 bytes in 66 bytes to send 66 bytes sent
Usb Data 34 bytes in 66 bytes to send 66 bytes sent
Usb Data 34 bytes in 498 bytes to send 498 bytes sent
Usb Data 34 bytes in 498 bytes to send 376 bytes sent

The buffer is supposed to have space 1024 bytes but sometimes the 498 bytes dont get sent.

The debug output is from the telnet session.

MCF52259 GNU compiler

Christo

5
utFAT / IRQ on card detect pin
« on: July 18, 2012, 11:54:48 AM »
Hi
On my board i have the card detect pin wired to a IRQ pin (IRQ1 on my 52259).
What should I do in the Interrupt so that the application know that the card is now removed and start the instillation sequence when the card is inserted again.
I know the code can check for removal periodically and retry until a card is detected, but I have the interrupt to work with.

Christo

6
NXPTM M522XX, KINETIS and i.MX RT / Re: Uart RX Dma with break 52259
« on: July 12, 2012, 08:23:47 AM »
Hi Mark
Tanks for clearing this up for me. I did not understand how it could be working, I missed the half buffer ping-pong part.
Christo

7
NXPTM M522XX, KINETIS and i.MX RT / Re: Uart RX Dma with break 52259
« on: June 27, 2012, 10:03:29 PM »
Hi Mark
In my application I am not worried about message overruns. The messages can be big but nicely spaced.
You're mention of ring buffer got me thinking what will happen if I get a bunch of small messages followed by a big one. Will the ring buffer wrap properly.
Example if my tty que is 40 bytes big and I get 3 5 byte messages read them, what will happen with if the next message is 30 bytes big. Will the dma only be started for 25 bytes or will the last 5 bytes end up outside the que.

Christo

8
NXPTM M522XX, KINETIS and i.MX RT / Re: Uart RX Dma with break 52259
« on: June 27, 2012, 11:03:24 AM »
Hi Mark
I found the problem when I moved my port to uart 1
If the dma is enabled on rx
fnRxOn() is never called and the RXD pin stays an normal input and not uart rx.

The dma is working on uart 2 it was only the pin function that was the problem

At the moment I added PUCPAR |= UC_RX2_FUNCTION; before fnOpen and it works.

Where should the pin function be set if the dma is used?

Christo

9
NXPTM M522XX, KINETIS and i.MX RT / Re: Uart RX Dma with break 52259
« on: June 26, 2012, 03:29:05 PM »
Hi Mark

Uart 2 is unfortunately hard wired on the pcb. I don't want to start cutting tracks on the pcb, not yet anyway.
I will have a look at the registers

this is my setup code
Code: [Select]
if (ucUseDMA & UART_RX_DMA) {
            DMAREQC |= (DMA_UART_2_RX << DMAC_2_SHIFT);                  // select DMA matrix for Rx on DMA channel 1
            PACR_UART2  |= (SUP_USER_FULL_ACCESS << UART2_ACCESS_SHIFT); // enable DMA access to UART1
        #ifdef _M520X
            IC_ICR_0_9 = (DMA2_INTERRUPT_PRIORITY & LEVEL_MASK);         // define interrupt level
        #else
            IC_ICR_0_11 = DMA2_INTERRUPT_PRIORITY;                       // define interrupts level and priority
        #endif
            fnSetIntHandler(DMA2_VECTOR, (unsigned char *)_DMA2_Rx_handler);// enter the handler routine
            IC_IMRL_0 &= ~(DMA2_PIF_INT_L | MASK_ALL_INT);               // unmask interrupt source
        }

Thanks
Christo

10
NXPTM M522XX, KINETIS and i.MX RT / Uart RX Dma with break 52259
« on: June 26, 2012, 02:33:40 PM »
Hi
I have a problem with the rx dma on a uart. This is my setup.
Code: [Select]
tInterfaceParameters.Channel = 2; // set UART channel for serial use
    tInterfaceParameters.ucSpeed = SERIAL_BAUD_230400; // baud rate
    //tInterfaceParameters.ucSpeed = SERIAL_BAUD_9600; // baud rate
    tInterfaceParameters.Rx_tx_sizes.RxQueueSize = 40; // input buffer size
    tInterfaceParameters.Rx_tx_sizes.TxQueueSize = TX_BUFFER_SIZE; // output buffer size
    tInterfaceParameters.Task_to_wake = TASK_BACNET; // wake self when messages have been received
    tInterfaceParameters.Config = CHAR_8 | NO_PARITY | ONE_STOP | /*RTS_CTS*/NO_HANDSHAKE |MSG_MODE | MSG_MODE_RX_CNT | MSG_BREAK_MODE;
    tInterfaceParameters.ucDMAConfig = UART_RX_DMA |UART_RX_DMA_HALF_BUFFER |UART_RX_DMA_BREAK /*| UART_TX_DMA*/; // activate DMA on transmission

    if((MstpPortID = fnOpen(TYPE_TTY, FOR_I_O, &tInterfaceParameters)) != 0)
    { // open or change the channel with defined configurations (initially inactive)
        fnDriver(MstpPortID, (RX_ON|TX_ON), 0); // enable rx
        fnDebugMsg("fnInitialise dl port\r\n");
        //fnWrite(MstpPortID,(void*)&tInterfaceParameters,5);
    }

if  tInterfaceParameters.ucDMAConfig is 0 then I can receive my messages.

I added this
Code: [Select]
static __interrupt__ void _DMA2_Rx_handler(void)                         // rx buffer reception completed on SCI1
{
    DMA_SR_BCR2 = DSR_DONE;
        #ifdef _WINDOWS
    DMA_SR_BCR2 &= ~DSR_DONE;                                            // {100}
        #endif
    iInterruptLevel = 1;                                                 // ensure interrupts remain blocked during subroutine
    fnSciRxByte(0, 2);                                                   // tty block ready for read
    iInterruptLevel = 0;
}
to M5223X.c and changed fnConfigSCI to set up dma 2

Did I miss some thing.

Christo

11
utFAT / Re: utFat and uFile
« on: February 07, 2012, 01:40:31 PM »
Hi Mark

I will use a global variable to ensure that ptr_utDirectory in ftp.c is not valid when I want to use the internal flash.
The global variable can be switched on an off via the web pages.
This will be sufficient for now. I will revisit the virtual dir when I have time later in the development.

Thanks
Christo

12
utFAT / Re: utFat and uFile
« on: February 06, 2012, 08:49:41 AM »
Hi Mark

I think the best solution would be 3, and give the virtual directory a obscure name that user is not likely to create on the card.
My short term solution will be a bit simpler. The config data is crated and uploaded with pc application. The pc can stop the sd card and then do the ftp to internal flash.

How do I stop the sd card? It can be started with a system reset.

Christo

13
utFAT / Re: utFat and uFile
« on: February 03, 2012, 10:58:28 AM »
Hi Mark

Ok I see, what will it take to have both accessible from ftp and http.
The config data is created on the pc and send to uTasker with ftp. The sd card log function is an optional and if the sd card is removed or inserted the config file will change with the sd-card. I want the config file to stay on the internal flash even if the sd-card is available.

Christo

14
utFAT / utFat and uFile
« on: February 03, 2012, 07:55:49 AM »
Hi

Can the sd card and internal flash be accessible from ftp and http at the same time.
I want to store config data on internal flash and write logs to the sd card.

Christo

Pages: [1]