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

Pages: [1] 2
1
NXPTM M522XX, KINETIS and i.MX RT / Re: SW upload file length wrong
« on: March 09, 2009, 04:07:57 PM »
Hi Mark.
I put breakpoint into fnPostFrame(..) fuction and see into ucIp_Data the next data: Host: 192.168.10.13..Content-Length:231133.
Before this part
#ifdef SUPPORT_POST_BINARY
                        if (!(uMemcmp((unsigned char *)cContentType1, ucIp_Data, (sizeof(cContentType1) - 1)))) {
                            ucIp_Data += (sizeof(cContentType1) - 1);
                            usPortLen -= (sizeof(cContentType1) - 1);
                            http_session->FileLength -= ((sizeof(cContentType1) - 1) + 2);
                            http_session->FileLength -= http_session->ucBoundaryLength;
                            http_session->ucState = HTTP_STATE_POSTING_DATA;
                            break;
                        }
#endif
http_session->FileLength = 231077 and after this part http_session->FileLength = 231001.
In windows I check file length by mouse right button click and it is: 230,884 bytes. Into uFileCloseMime(..) file length = 231001.
When Bootloader startup in fnCheckNewCode(..) 
MAX_FILE_LENGTH file_length = uGetFileLength(UPLOAD_FILE_LOCATION); receive written before file lingth (231001) and
fnGetPars(UPLOAD_FILE_LOCATION + FILE_HEADER, (unsigned char*)file_header, SIZE_OF_UPLOAD_HEADER); receive true length of file (written into file header).
My project after short time shall be finished but this bug don't give possibility do this.

I need your help!

Thanks. Have a good day.
Evgeni.

2
NXPTM M522XX, KINETIS and i.MX RT / SW upload file length wrong
« on: February 22, 2009, 06:37:23 AM »
Hi Mark.

At this time I work with boot loader.

I can upload new HS.bin file but (I view this by checking file length) its length is wrong: its length is 230884 bytes and uTasker write it as 310000 bytes. I want check all path of upload: from press 'Upload software' button, calculation file length, up to writing it to SPI flash. All files length used by uTasker, HTMLs calculated right. What is the best way to do this?

I work with Freescale 52235 micro, AT26DF081A SPI flash, uTasker v1.6 and use these definitions for this flash:
#ifdef SPI_EEPROM_1024K
    #define EEPROM_PAGE_SIZE       (256)                                 
    #define SPI_FLASH_PAGE_LENGTH_256K  (256)                                 
    #define SPI_FLASH_BLOCK_LENGTH (4096)                             // block size 4k( 4096 bytes) - a block can be deleted
    #define SPI_FLASH_PAGES        (4 * 1024)                            // 4096 pages of 256 byte each page
    #define SPI_DATA_FLASH_SIZE (SPI_FLASH_PAGES * SPI_FLASH_PAGE_LENGTH_256K)
    #define SPI_FLASH_START        (FLASH_START_ADDRESS + SIZE_OF_FLASH)
    #define FILE_GRANULARITY        (4096)                                // File made up of 4k byte FLASH blocks
    #define SINGLE_FILE_SIZE        (FILE_GRANULARITY)              // each file a multiple of 4k
    #define FILE_SYSTEM_SIZE        (64 * SINGLE_FILE_SIZE + PAR_BLOCK_SIZE)
    #define NEW_UTASKER_APP_ADDRESS 0x0AF000
    #define TEST_FLASH_ADDRESS      (SYS_PARAMETERS + SINGLE_FILE_SIZE)
#endif

For receive NEW_UTASKER_APP_ADDRESS (that outside of uTasker spaces) I use with macro in uFile.c->static MAX_FILE_SYSTEM_OFFSET fnGetFilePointer(CHAR *ucIp_Data) :
#if defined SPI_SW_UPLOAD                                                
    if (SW_UPLOAD_FILE()) {
        return (MAX_FILE_SYSTEM_OFFSET)(NEW_UTASKER_APP_ADDRESS - PAR_BLOCK_SIZE);
    }
#endif

in app_hw_m5223x.h
#define SW_UPLOAD_FILE()       (*ucIp_Data == 'H') && (*(ucIp_Data+1) == 'S') && (*(ucIp_Data+2) == '.')

Thanks.
Evgeni


3
Hi Mark.

1) I have any dilemma: when I want send email I need MAC defined to my Network but I cann't run Web server (can't view HTML files), but when MAC is disabled (cucNullMACIP) Web server work perfect but I cann't send email. On what to pay attention, in what there can be a problem?
2) I use I2C definition in fnConfigIIC_Interface() and call to RTC updating from external RTC in fnApplication() after
#elif defined TEST_DS1307
    if ((iRTC_state & (STATE_INIT_RTC | STATE_GET_RTC)) && (fnMsgs(IICPortID) >= 7))
{
...
}
sometimes a program start RTC updating  and sometimes is not present. Function to not anything returns. How to receive the answer from I2C confidently?

Thanks.
Evgeni.

4
NXPTM M522XX, KINETIS and i.MX RT / Re: AT26F004
« on: September 14, 2008, 07:27:44 AM »
Hi chronosdino.

I am work with  AT26DF081A (this is the same family of Data Flash Memory).
You shall send to SPI flash before every call Write enable command and modify your fnSendSPIMessage() function in M5223X.c file that you call address and data with the same ChipSelect:
1) Chip select
2) Write enable command
3) fnSendSPIMessage() - modified by you
4) Chip select disable

in this order I work with my SPI flash.

Regards.
Evgeni.

5
NXPTM M522XX, KINETIS and i.MX RT / Re: HTML submit action generation
« on: September 10, 2008, 04:41:45 PM »
Thank for quik response.

After small correction this begun work but in this state I have additional question: How to disable (do not reflect) in Internet Explorer address line record that received by application (in red color):

 "http://XXX.XXX.XXX.XXX/name=r?T=3&C=1&r=E+n+t+e+r"

Thanks.

6
NXPTM M522XX, KINETIS and i.MX RT / HTML submit action generation
« on: September 10, 2008, 12:53:11 PM »
Hi Mark.

Now I work with Web Interface. This is small part of HTML code of file "0.htm":

<form action=1.htm name=r>
<table border = "2" align=center cellspacing=5 bordercolor=gray width = 240>
<TR><th colspan=2 bgcolor = #AABBFF>
<TR>
<TD align = left> Login as : </TD>
<TD align = center ><SELECT NAME=T id="loginas">
<OPTION VALUE="0"><b>-- User type --</b>
<OPTION VALUE="1">Regular User
<OPTION VALUE="2">Administrator
</SELECT></TD></TR>
<TR><TD align = left>Password: </TD>
<TD align = center><input name=C size =12 maxlength =6></TD></TR>
</TR></table><br>
<table border = "2" align=center cellspacing=5 bordercolor=gray>
<tr><td><input type=submit value="E n t e r" name=r></td></tr>
</table></form>


When I press button on the form in "0.htm" file, application receive and check all my data but I don't know how generate (open) "1.htm" file if application check is successfully.
In HTML code I write:

<form action=1.htm name=r> ...
<input name=C size =12 maxlength =6>
<input type=submit value="E n t e r" name=r></form>


but before this action I need do application check and if check is successfully then open "1.htm".

Thanks.
Evgeni.

7
NXPTM M522XX, KINETIS and i.MX RT / Working state of Web Server
« on: July 13, 2008, 12:31:04 PM »
Hi Mark.

During work above the project I checked work of a server sending command 'ping' with the address of my server. But now, checking work of a server and trying for the first time to load pages html ,  FTP server does not give connection and ping for the first time always answers, but then answers "Reply..." randomally or all time "Request timed out".
I configured FTP by you example in 'uTasker-FTP' section of tutorial for Coldfire. Have any idea?

Thanks.
Evgeni.

8
NXPTM M522XX, KINETIS and i.MX RT / Write to/ read from file
« on: July 13, 2008, 07:19:00 AM »
Hi Mark.
At last at me began work SPI memory. But now I have collided with a following problem: at record in a file the first 5 bytes of the kept information are ignored and at file reading I receive '-1' in "uGetFileLength" function and no received bytes. If I to the initial address add 'FILE_HEADER' the information is read out, but with wrong long (more short, than have been requested).

This is my small code example:
    MEMORY_RANGE_POINTER ucFile;
    MAX_FILE_LENGTH byte_retrieved = 0;
    MAX_FILE_LENGTH file_offset = 0;
    MAX_FILE_SYSTEM_OFFSET FileLength = 0;
    u32 lAddress = 0;
    unsigned char ucBlockErase[] = {M95XXX_BLOCK_ERASE_4K,0,0,0};
    static const unsigned char ucWriteEnable[] = {M95XXX_WRITE_ENABLE};
    // test_buffer - array to be copied to test_buffer2
    for(i = 0; i < PageLen; i++)
    {
        if(i >= FILE_HEADER - 1)
        {
            test_buffer = i - FILE_HEADER;
        }
    }
    uMemset(test_buffer2, 0x0, PageLen);

     ucFile = uOpenFile("0File.txt");                          // open the file to be displayed
    lAddress = (u32)ucFile;

    ucBlockErase[3] = (unsigned char)(lAddress);
    ucBlockErase[2] = (unsigned char)((lAddress) >> 8);
    ucBlockErase[1] = (unsigned char)((lAddress) >> 16);
 
    fnSendSPIMessage((unsigned char *)ucWriteEnable, sizeof(ucWriteEnable)); // prepare write
    fnSendSPIMessage((unsigned char *)ucBlockErase, PageLen);                // prepare write
    // !!! for write file to EEPROM to file first 5 bytes are ignored for HEADER information
   uFileWrite((unsigned char*)ucFile, test_buffer, PageLen);                // save the received data to file. Existing files will automatically be deleted   
    if(uFileCloseMime((unsigned char*)ucFile,(unsigned char*)ucMimeType) != PageLen)
    {
        // error
        return;
     }
    ucFile = uOpenFile("0File.txt");                          // open the file to be displayed
    FileLength = uGetFileLength(ucFile);                  // Get opened file length
    do
    {
        byte_retrieved = uGetFileData(ucFile + FILE_HEADER, file_offset, test_buffer2, FileLength );
        if(byte_retrieved == 0)
        {
            return; // error
        }
        file_offset += byte_retrieved;
    }while(byte_retrieved < PageLen);

Where is my problem?
I have use with SP6.
Thanks. Evgeni.

9
NXPTM M522XX, KINETIS and i.MX RT / Interrupt generation
« on: June 19, 2008, 06:21:05 AM »
Hi Mark.

How I can generate Interrupt without external source? For exmple generate interrupt on Bit 7 of port GP?

Thanks.
Evgeni.

10
NXPTM M522XX, KINETIS and i.MX RT / Ports configuration
« on: June 05, 2008, 02:27:09 PM »
Hi Mark.

How I can define ports for In/Out? uTasker have any functions: fnConfigPort(..), fnConfigOutputPort(..), fnSetUserPortOut(..).  What is the function that i need for ports defenition. I wrote at the same function (for configuration port QS) as your but don't know correctly or no?

#define PORTQS_IN_OUT_DEFINITION         0x7D;               // X111.1101 where 1 = OUT, 0 = IN
                                                                                                              PORTQS1 = 1
                                                                                                              PORTQS2 = 0
                                                                                                              PORTQS3 = 1
                                                                                                              PORTQS4 = 1
                                                                                                              PORTQS5 = 1
                                                                                                              PORTQS6 = 1
                                                                                                              PORTQS7 = 1
extern int fnConfigureMyPort()
{
    CHAR cType;
    CHAR cPortBit = '0';
    u8 sPort = 0;
    unsigned char ucBit = 1;
    unsigned char ucUserOutputs = PORTQS_IN_OUT_DEFINITION;

    while (sPort < '8')
    {
        cType = 'o';
        if (!(ucUserOutputs & ucBit))
        {
            cType = 'i';
        }
            switch (cType)
            {
                case 'i':                                                    // port to be input
                    #ifdef _M5223X                                               
                        DDRQS &= ~(1<<cPortBit);                  // set port bit to input
                    #endif
                break;
                case 'o':                                                  // Port to be output
                    #ifdef _M5223X                                                                       
                        DDRQS |= (1<<cPortBit);                    // set port bit to output
                    #endif
                break;
               default:
                return -1;
            }
        sPort++;
        ucBit <<= 1;
        }
    return 0;
}

Thank.
Evgeni.

11
NXPTM M522XX, KINETIS and i.MX RT / Re: Work with email
« on: May 18, 2008, 07:18:04 AM »
Hi Mark.

I think, that the attached file is not sent directly and converted in binary format known to the email client program.
There can be an attached file it is necessary to write down in any coded kind? For example in MIME?
Can somebody will where find necessary information? I think by all such possibility of sending of files can be useful.

This is small part of body of email message that was attached file :
Content-type: multipart/mixed; boundary="----_=_NextPart_001_01C8B8A8.F0135738"
Thread-index: Aci4qO/ctwVHUjgSQheIQpENhabBSA==
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
------_=_NextPart_002_01C8B8A8.F0135738
Content-Type: text/plain;
   charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

------_=_NextPart_001_01C8B8A8.F0135738
Content-Type: application/octet-stream;
   name="Book1.csv"
Content-Transfer-Encoding: base64
Content-Description: Book1.csv
Content-Disposition: attachment;
   filename="Book1.csv"

MQ0 K Mg0 K Mw0 K NA0 K NQ0 K Ng0 K Nw0 K OA0 K OQ0 K MTANCjExDQo=

------_=_NextPart_001_01C8B8A8.F0135738--



MQ0 K Mg0 K Mw0 K NA0 K NQ0 K Ng0 K Nw0 K OA0 K OQ0 K MTANCjExDQo= is body of file converted to binary format
http://email.about.com/cs/standards/a/mime.htm
May be this give any idea how I can add this information to your part of email information.

Thanks.
Evgeni.

12
NXPTM M522XX, KINETIS and i.MX RT / Re: Work with email
« on: May 15, 2008, 09:38:09 AM »
Hi Mark.

I have read SMTP documentation, configured uTasker to use SMPT (same as in uTasker SMTP document), have received from provider my username, password, SMTP address, defined my GateWay, have placed them in the stPARS struct.
I want to send some emails. At the first attempt to send the email I receive a socket but as there is any failure the subsequent behind it of the email do not pass that SMPT is busy (ERROR_SMTP_IN_USE). How I can check up a return code which returns SMTP server (in Debug mode)?  All emails don't reach its final destination.
When I send only one message - all works well and the message comes to the addressee.
Whether there is an opportunity to send attachment file with email? (I need to send .scv file).

Thanks.
Evgeni.

13
NXPTM M522XX, KINETIS and i.MX RT / Work with email
« on: April 29, 2008, 03:36:44 PM »
Hi Mark.
I have started to work with email. These are my definitions in the program:

config.h:
    #define OUR_USER_DOMAIN                                  "my_domain.com"
    #define DEFAULT_DESTINATION_EMAIL_ADDRESS     "evgenik@sysmop.com"
    #define SMTP_PROVIDER_IP_ADDRESS                    { 194,158,229,11 }
    #define SMTP_PROVIDER_ADDRESS                        "mail.provider.com"

application.c:
static const NETWORK_PARAMETERS network_default = {
    (AUTO_NEGOTIATE | FULL_DUPLEX | RX_FLOW_CONTROL),     // usNetworkOptions - see driver.h for other possibilities
    {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},                                // ucOurMAC - when no other value can be read from parameters this will be used
    { 192, 168, 10, 233 },                                                     // ucOurIP - our default IP address
    { 255, 255, 255, 0 },                                                      // ucNetMask - Our default network mask
    { 192, 168, 0, 1 },                                                         // ucDefGW - Our default gateway
    { 192, 168, 10, 1 },                                                       // ucDNS_server - Our default DNS server
};
...
#ifdef SMTP_PARAMETERS
    {'U', 's', 'e', 'r', ' ', 'n', 'a', 'm', 'e', 0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {'P', 'a', 's', 's', ' ', 'w', 'o', 'r', 'd', 0,0},
    {'M', 'y', 'A', 'd', 'd', 'r', 'e', 's', 's', '@', 'u', 'T', 'a', 's', 'k', 'e', 'r', '.', 'c', 'o', 'm', 0,0,0,0,0,0,0,0,0,0},
    {'m', 'a', 'i', 'l', '.', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '.', 'c', 'o', 'm', 0,0,0,0,0,0,0,0,0,0,0,0,0,0},

unsigned char ucSMTP_server[] = SMTP_PROVIDER_IP_ADDRESS;

app_hw_m5223x.h
    #define SENDERS_EMAIL_ADDRESS  "M52235EVB@uTasker.com"      // fictional Email address of the board being used
    #define EMAIL_SUBJECT                "M52235EVB Test"                  // Email subject
    #define EMAIL_CONTENT               "Hello!!\r\nThis is an email message from evgenik.\r\nI hope that you have received this test and have fun using the uTasker operating system with integrated TCP/IP stack.\r\r\nRegards evgenik!!";

#define SMTP_ACCOUNT_NAME           "smtp_user"
#define SMTP_PASSWORD                  "smtp_password"


I am not assured what data to me it is necessary to bring in these parameters. For example: SMTP_ACCOUNT_NAME and SMTP_PASSWORD must be at the same as in the PARs struct values (cUserName[8] and cUserPass[8]) or SMTP_PROVIDER_IP_ADDRESS value?
Help me to understand with it please.
Thanks.
Evgeni.

14
Hi Mark.

My mistake was that I did not send the 'Write and address' before a 'Read, address and data': therefore data were not received.
Example in fnGetRTCTime(void).

Thank you.
Evgeni.

15
Hi Mark.
I work with external RTC DS1338(very similar to your RTC) with Freescale M5223 micro and have problems with read(save data) and write:
In SP6 have functions: fnConfigureRTC - for save time to RTC registers;
       fnWrite(IICPortID, (unsigned char*)ucGetTime, sizeof(ucGetTime)); - use for save data (ucGetTime array)to external RTC or or fnSaveTime(); but after saving i don't receive from RTC right data.
       fnRead(IICPortID, (unsigned char *)&ucSlave, 7); - use for read data from external RTC to ucSlave array.
In oscilloscope i can view data in read mode, but i can't view it in array ucSlave. Where saved data is received from external RTC (in array or registers) ? In array ucSlave :const unsigned char ucSlave[] = {7, (ADDRTC_READ), OWN_TASK} (in your example) i haven't RTC data (here only these 3 parameters). When i want update time to external RTC fnWrite don't send data. May be have any order with read and write to IIC(RTC)?
Thanks.
Evgeni.

Pages: [1] 2