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

Pages: 1 [2]
16
Hey Mark,

we had some problem with our network activity led and the KSZ8081 PHY. The LINK_UP was detected just fine but LINK_DOWN was never received.
In the function fnCheckEthLinkState(void) in kinetis.c you mask the register value with PHY_LINK_STATE_CHANGE which is defined as:
Code: [Select]
#define PHY_LINK_STATE_CHANGE  (PHY_LINK_UP_INT | PHY_LINK_DOWN_INT)when using the KSZ8081.
This breaks the following else case:
Code: [Select]
else if (PHY_LINK_DOWN_INT & usInterrupt) {        // {27} add else so that the LINK UP event is not overwritten to UNKNOWNIf the define is changed to
Code: [Select]
#define PHY_LINK_STATE_CHANGE PHY_LINK_UP_INTthe LINK_DOWN event is detected.
   
Regards

Paul

17
utFAT / Re: utFAT Versions
« on: October 07, 2014, 08:15:02 AM »
Thank You Mark! :)

18
utFAT / Re: utFAT Versions
« on: October 06, 2014, 01:46:49 PM »
Hey Mark,

just wanted to inform you that there is a  "{" missing in line 2719 in mass_storage.c.


Kind regards

Paul



19
Thanks mark for your explanation!
I read the UART documentation but as stated on page 15
"Code 9 shows a method of controlling the RTS signal together with processors which do not have a HW setting to automatically control it"
So I thought it wasn't necessary for the K60.
I removed my changes in kinetis.c and tried the fnDriver function and it really does the same!

I'm really sorry for questioning your code but somehow I must have overread the right configuration commands ;)

Paul

P.S. The ECHO_RX_CHARS was only set for testing purposes it is gone now and everything works fine!
      Thank You!

20
Ok looks like I found the problem:

For the initialisation of the UART the function fnConfigSCI() in kinetis.c gets called.
In the function there is only an if-statement which checks the RTS_CTS configuration:
Code: [Select]
if (pars->Config & RTS_CTS) {                                        // HW flow control defined so configure RTS/CTS pins
        fnControlLine(Channel, (CONFIG_RTS_PIN | CONFIG_CTS_PIN), 0);
    }

As you stated here http://www.utasker.com/forum/index.php?topic=692.msg3048#msg3048 "".. the serial interface must not be configured for RTS/CTS flow control operation" when the RTS is to control RS485."

I added a second if-statement to kinetis.c:
Code: [Select]
if (pars->Config & SET_RS485_MODE) {                                        // RS485-Mode defined so configure RTS Control
        fnControlLine(Channel, (SET_RS485_MODE | CONFIG_RTS_PIN), 0);
    }

Now the automatic switching works and I can communicate.

I hope this helps others with similiar problems.

The way I understand the code is that it could have never worked without the second if-statement because the RS458 settings are completely ignored.
Am I right or did I get something wrong? :)

21
Hey all,

I currently have to program a test for the rs-485 interface on our hardware but can't get it to work properly.
After reading the Kinetis Demo document it looks like my hardware should support automatic switching between RX and TX but I can't get it to work...
In my current configuration I can only receive characters but it will never send.


The initialisation code is as follows:
Code: [Select]
extern QUEUE_HANDLE fnSetNewSerialMode485(unsigned char ucDriverMode) {
TTYTABLE tInterfaceParameters; // table for passing information to driver
tInterfaceParameters.Channel = 2; // set UART channel for serial use
tInterfaceParameters.ucSpeed = temp_pars->temp_parameters.ucSerialSpeed; // baud rate
tInterfaceParameters.Rx_tx_sizes.RxQueueSize = RX_BUFFER_SIZE; // input buffer size
tInterfaceParameters.Rx_tx_sizes.TxQueueSize = TX_BUFFER_SIZE; // output buffer size
tInterfaceParameters.Task_to_wake = OWN_TASK; // wake self when messages have been received
tInterfaceParameters.Config = (CHAR_MODE | CHAR_8 | ECHO_RX_CHARS | SET_RS485_MODE | SET_RS485_NEG | NO_PARITY | ONE_STOP | NO_HANDSHAKE );

if ((SerialPort485ID = fnOpen(TYPE_TTY, FOR_I_O, &tInterfaceParameters))
!= 0) { // open or change the channel with defined configurations (initially inactive)
fnDriver(SerialPort485ID, (TX_ON | RX_ON ), 0); // enable rx and tx

}
return SerialPort485ID;
}

On receive my Tasks wakes up prints the received characters and should send a "Hello" with following function:
Code: [Select]
QUEUE_TRANSFER fnSend485Msg(unsigned char * cToSend) {
return (fnPrint((unsigned char *) cToSend, SerialPort485ID)); // send to UART2
}

I never receive the "Hello" on the pc-side. With another configuration (which i lost after playing around too much...) I received the "Hello" on the pc-side but couldn't receive on the K60. For me it looks like the control-lines aren't switching like they should but I even tried the example with manual switching of the lines and it doesn't work either.
Maybe someone has an idea what I'm doing wrong?

22
Hey,

I tried your code Mark and it looks like it works!
I was also able to fix my problem from here http://www.utasker.com/forum/index.php?topic=1735.0 with the same method.
So if anybody has the problem that css won't load or html just gets displayed as plain text this should help.

I just added your code and edited it for html :

Code: [Select]
  }else if (http_session->ucMimeType == MIME_CSS) {                   // ¿ check whether this type should be declared as css content
        uMemcpy((pucTCP_Message + (SIMPLE_HTTP_HEADER_LENGTH - 2)), cucHTTP_css, CSS_PLAIN_HTTP_HEADER_LENGTH);
        usHTTP_HeaderLength += (CSS_PLAIN_HTTP_HEADER_LENGTH - 2);
    }
    else if (http_session->ucMimeType == MIME_HTML) {                   // ¿ check whether this type should be declared as html content
        uMemcpy((pucTCP_Message + (SIMPLE_HTTP_HEADER_LENGTH - 2)), cucHTTP_html, HTML_PLAIN_HTTP_HEADER_LENGTH);
        usHTTP_HeaderLength += (HTML_PLAIN_HTTP_HEADER_LENGTH - 2);
    }

where

Code: [Select]
static const CHAR cucHTTP_html[] = "Content-Type: text/html\r\n\r\n";
    #define HTML_PLAIN_HTTP_HEADER_LENGTH    (sizeof(cucHTTP_html) - 1)
   
    static const CHAR cucHTTP_css[] = "Content-Type: text/css\r\n\r\n";
    #define CSS_PLAIN_HTTP_HEADER_LENGTH    (sizeof(cucHTTP_css) - 1)

There was a "PLAIN" missing in your example but I guess this wasn't hard to spot for anyone :)

Thank you so much and sorry for taking over this thread...


Paul

 

23
µTasker general / Re: Time Server
« on: July 31, 2012, 09:01:52 AM »
Hi Mark,
 
I was near desperation because I just couldn't get it to work but now I found the problem in my firewall configuration...


Thanks again!

Paul


EDIT: Time works as it should but the date doesn't get synced. I tried writing a function myself but couldn't find the raw 32bit value transmitted in the time protocol. Any hints? :)

24
µTasker general / Time Server
« on: July 06, 2012, 12:31:21 PM »
Hey all,

I recently tried using the time servers in my project but it looks like it never tries to get the time.
What are the necessary steps to fetch the time?
Is defining USE_TIME_SERVERS not enough?
I can't find documentation about this other than some forum posts so please help me.

Thank You

Paul

25
µTasker general / Re: uTasker Webserver
« on: June 15, 2012, 07:20:48 AM »
Hi Mark,

yes the content is seen like in a text editor. I tried IE and it works like it should so the problem is with FF and how it requests the page.
The meta tag should be right so I have to investigate whats the difference between the two browser methods.

Thanks

Paul

EDIT:

It looks like the content-type is not reported in the http header so FF and Safari just show plain text.
Safari even displays plain text when the htm file is called directly.
I saw in "http.c" that the HTTP header should always contain the content type but with FF-addon HTTP Live-Header I only get "OK" as a response and nothing about content.

Code: [Select]
#ifdef SUPPORT_CHROME                                                    // {34} Chrome requires that the web server always sends a HTTP header otherwise it refuses to operate
    static const CHAR cucHTTP_header[] = "HTTP/1.0 200 OK\r\n\r\n";
    #define SIMPLE_HTTP_HEADER_LENGTH    (sizeof(cucHTTP_header) - 1)
    static const CHAR cucHTTP_plain_text[] = "Content-Type: text/plain\r\n\r\n"; // {45}
    #define TEXT_PLAIN_HTTP_HEADER_LENGTH    (sizeof(cucHTTP_plain_text) - 1)

I tried changing the "text/plain" to "text/html" in the above code but no change as it seems this doesn't even get transfered.
I will try chrome and opera next but guess the results will be the same.


EDIT #2:
I edited the code as follows and now it works!

Code: [Select]
#ifdef SUPPORT_CHROME                                                    // {34} Chrome requires that the web server always sends a HTTP header otherwise it refuses to operate
    static const CHAR cucHTTP_header[] = "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"; //Original     static const CHAR cucHTTP_header[] = "HTTP/1.0 200 OK\r\n\r\n"; ¿
    #define SIMPLE_HTTP_HEADER_LENGTH    (sizeof(cucHTTP_header) - 1)
    static const CHAR cucHTTP_plain_text[] = "Content-Type: text/plain\r\n\r\n"; // {45}
    #define TEXT_PLAIN_HTTP_HEADER_LENGTH    (sizeof(cucHTTP_plain_text) - 1)

as this is really quick and dirty I hope there is another workaround for it.


26
µTasker general / uTasker Webserver
« on: June 14, 2012, 01:14:20 PM »
Hello,

I have a strange problem with the uTasker webserver. I'm using a Kinetis K60 and have put my website "index.htm" in "dir1" on the sd-card.
When I try to open the website by typing in the ip it serves the html source code.
When I explicitly call 192.168.2.7/index.htm it works and the website gets displayed.
Has anybody experienced this and maybe knows a fix?

Thanks

Paul

Pages: 1 [2]