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 - hervé

Pages: 1 ... 5 6 [7]
91
NXPTM LPC2XXX and LPC17XX / Re: Parameters Save Command
« on: October 22, 2009, 05:28:31 PM »
Thanks for your help.

Quote
The swap block is presumably at 0x38000.
It helps me finf my problem.

Unfortunately, I would have another question !
On fnWriteBytesFlash a test is made to detect the end of inside flash with :

Code: [Select]
    if (ucDestination >= ((unsigned char *)(FLASH_START_ADDRESS + SIZE_OF_FLASH))) // we are working from _extern_al SPI FLASH memory

with
    #elif defined (LPC2387FBD100)
        #define SIZE_OF_FLASH (512*1024)                                 // 512k FLASH

but on the LPC2387 datasheet it is noted the last sector numbers is the 27th:
(0x1B)  0x0007 D000 - 0X0007 DFFF
and the amount of flash available for user code and data is 504 K bytes in "512K"
devices.


I think I would have to define SIZE_OF_FLASH (504*1024)  to avoid this boot block gap.

Is it right ?





92
NXPTM LPC2XXX and LPC17XX / Re: Parameters Save Command
« on: October 22, 2009, 02:19:32 PM »
Hi Mark,

Getting more detail on my problem I found that I had a PARAMETER_BLOCK_SIZE of 4*1024K, with PARAMETER_BLOCK_START = 0x30000.
In those addresses the LPC2387 has a block size of 32K.....
That means that both Parameter Blocks are on the same µP sector, which may cause the problem. :-\

Code: [Select]
1 / With fnSaveNewPars not modified :

After erasing all flash and uploading program :
PARAMETER_BLOCK_1
00030000:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030010:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

PARAMETER_BLOCK_2
00031000:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00031010:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

After first Save Command :
PARAMETER_BLOCK_1
00030000:55 55 55 55 ff ff ff ff ff ff ff ff ff ff ff ff    UUUU............
00030010:55 55 55 55 ff ff ff ff ff ff ff ff ff ff ff ff    UUUU............

PARAMETER_BLOCK_2
00031000:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00031010:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

After second Save Command :
PARAMETER_BLOCK_1
00030000:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030010:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

PARAMETER_BLOCK_2
00031000:55 55 55 55 ff ff ff ff ff ff ff ff ff ff ff ff    UUUU............
00031010:55 55 55 55 ff ff ff ff ff ff ff ff ff ff ff ff    UUUU............

and so on... the swap is working but with no data.


2 / With fnSaveNewPars modified :

After erasing all flash and uploading program :
PARAMETER_BLOCK_1
00030000:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030010:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

PARAMETER_BLOCK_2
00031000:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00031010:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................


After first Save Command :
PARAMETER_BLOCK_1
00030000:55 55 55 55 ff ff ff ff ff ff ff ff ff ff ff ff    UUUU............
00030010:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
...with some data
00030060:18 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030070:00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

PARAMETER_BLOCK_2
00031000:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00031010:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
 

93
NXPTM LPC2XXX and LPC17XX / Parameters Save Command
« on: October 22, 2009, 10:50:19 AM »
Hello,

I notice that the
Save command is not working...
When I did it, the memory dump of parameters was :

00030000:55 55 55 55 ff ff ff ff ff ff ff ff ff ff ff ff    UUUU............
00030010:55 55 55 55 ff ff ff ff ff ff ff ff ff ff ff ff    UUUU............
00030020:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030030:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030040:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030050:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030060:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030070:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030080:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030090:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
000300a0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
000300b0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
000300c0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
000300d0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
000300e0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
000300f0:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

I change the code to suppress the line
Code: [Select]
      fnDelPar(SWAP_PARAMETER_BLOCK);                                   // delete old block and validate new one.
then the dump gave me:
00030000:55 55 55 55 ff ff ff ff ff ff ff ff ff ff ff ff    UUUU............
00030010:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030020:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030030:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030040:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030050:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030060:18 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030070:00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030080:0c ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
00030090:1d ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
000300a0:12 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
000300b0:e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
000300c0:1f ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
000300d0:23 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    #...............
000300e0:c0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
000300f0:a8 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

It looks the valid parameter block is deleted ...
Do you have some idea where it comes from ?

Code: [Select]
extern int fnSaveNewPars(int iTemp)
{
#ifdef USE_PARAMETER_BLOCK
   // Network variables
   if (iTemp == SAVE_NEW_PARAMETERS_CHECK_CRITICAL) {                    // we check to see whether network parameters have been changed
       if (((temp_pars->temp_parameters.ucServers & ACTIVE_DHCP) != (parameters->ucServers & ACTIVE_DHCP)) || (uMemcmp((unsigned char *)&temp_pars->temp_network, (unsigned char *)&network_flash, sizeof(NETWORK_PARAMETERS)))) {
           return 1;                                                     // since a network parameter has been change, we warn the user that he/she will have to validate afterwards
       }
   }
    #ifndef USE_PAR_SWAP_BLOCK
   fnDelPar(INVALIDATE_PARAMETER_BLOCK);                                 // delete parameter block before continuing
   iTemp = SAVE_NEW_PARAMETERS;
    #endif
   fnSetPar((unsigned short)(PAR_NETWORK | TEMPORARY_PARAM_SET), (unsigned char *)&temp_pars->temp_network, sizeof(NETWORK_PARAMETERS)); // network parameters

   // device parameters
   fnSetPar((PAR_DEVICE | TEMPORARY_PARAM_SET), (unsigned char *)&temp_pars->temp_parameters, sizeof(PARS));  // copy the new set to the swap buffer (temp)

   if (iTemp != SAVE_NEW_PARAMETERS_VALIDATE) {
   #ifdef ACTIVE_FILE_SYSTEM
//       fnDelPar(SWAP_PARAMETER_BLOCK);                                   // delete old block and validate new one.
   #endif
//     uMemcpy(&network, &temp_pars->temp_network, sizeof(NETWORK_PARAMETERS)); // update working parameter set - we never do this since we always reset after a network change (otherise we can have DHCP difficulties, since DHCP values will be overwritten)
       uMemcpy(parameters, &temp_pars->temp_parameters, sizeof(PARS));
   }
#endif
   return 0;
}

94
µTasker general / Re: uFileWrite
« on: October 07, 2009, 04:27:56 PM »
Hello Mark,
I planned using some database code source with SPI eeprom using µfileSystem.
It look quite good with the simulator, but I got problems with writing to file.
The code reads from a file using fseek (in a tempory buffer) then performs some write with fseek too....
Here  is some debug value : at the end the dump shows the data were written but sequentially...

Seek<>length:value
         from here reading with seek
@0000<=0200:
@0200<=0200:
@0400<=0200:
@0600<=0200:
@0800<=0200:
@0a00<=0200:
@0c00<=0200:
@0e00<=0200:
         from here writing with seek
@0028=>0008:€
@0000=>0008:JL
@0028=>0008:€
@0008=>0002:€€
@000a=>001e:€™address[name:S,country:S]‚ˆ
@0030=>0008:€
@0000=>0008:JL
         Commit 1
@0085=>0008:€
@0000=>0008:JL
@0085=>0008:€
@0038=>0018:John Williams
@0050=>0001:®
@0051=>0009:UK
@005a=>0001:c
@005b=>000c:€‚˜¸Ð€‰ÑÚ€
@0067=>001e:€™address[name:S,country:S]ŒÛ
@008d=>0008:€
@0000=>0008:JL
         Commit 2

#dump
 DUMP myfile.dat
00000000:80 00 00 00 00 00 00 28 4a 4c 1a ff ff ff ff ff    €
00000010:80 00 00 00 00 00 00 28 80 80 80 99 61 64 64 72    €
00000020:65 73 73 5b 6e 61 6d 65 3a 53 2c 63 6f 75 6e 74    ess[name:S,count
00000030:72 79 3a 53 5d 81 82 88 80 00 00 1e 00 00 00 0a    ry:S]‚ˆ€
00000040:4a 4c 1a 00 00 00 00 38 80 00 00 00 00 00 00 85    JL
00000050:4a 4c 1a 00 00 00 00 95 80 00 00 00 00 00 00 85    JL
00000060:4a 6f 68 6e 20 57 69 6c 6c 69 61 6d 73 00 50 61    John Williams
00000070:63 6f 20 50 65 6e 61 00 ae 55 4b 00 53 70 61 69    co Pena
00000080:6e 00 63 80 82 98 b8 81 d0 80 89 d1 81 da 80 80    n
00000090:99 61 64 64 72 65 73 73 5b 6e 61 6d 65 3a 53 2c    ™address[name:S,
000000a0:63 6f 75 6e 74 72 79 3a 53 5d 81 8c db 80 00 00    country:S]ŒÛ€
000000b0:1e 00 00 00 67 4a 4c 1a 00 00 00 00 95

#

95
µTasker general / uFileWrite
« on: October 07, 2009, 10:16:34 AM »
Does there is any way to have a fseek function on uFileWrite ?
like SubFile with SUB_FILE_SIZE = 1 ....

96
µTasker general / Re: close socket question
« on: August 06, 2009, 10:24:07 AM »
Sorry,
Simply using fnReleaseTCP_Socket()
Everything is OK now...

97
µTasker general / Re: close socket question
« on: August 06, 2009, 10:19:18 AM »
Hi,
In fact I made a mistake and the return value is 2 : TCP_STATE_CLOSED
But fnGetTCP_Socket test for TCP_STATE_FREE to affect a new socket.
How can I free a socket ?

98
µTasker general / Close socket question
« on: August 06, 2009, 09:57:34 AM »
Hello mark,
I open TCP connection then get TCP_ABORT event as nobody is connected...
I try 3 different servers then I wnat to close the socket and try again.
I use the folowing code, on which I put a tGIP_TCP_socket variable for test purpose.
In fact my problem is that this code dont free the TCP I wanted to closed and in fact open a new connection as eack attempt.
The fnTCP_close function return the value 07, which I don't understand.. Can you help ?

case GIP_OPEN_REQUESTED:
   tGIP_TCP_socket = fnTCP_close(GIP_TCP_socket);
   if ((GIP_TCP_socket = fnGetTCP_Socket(TOS_MINIMISE_DELAY, TCP_NO_TIMEOUT, fnGIPListener)) >= 0) {
      ucGIP_state = GIP_STATE_OPENED;
      fnDebugMsg("GIPxchg MOUNT:");
      fnDebugHex(GIP_TCP_socket ,1);
      fnDebugMsg("\r\n");
   } // if
   else
      fnDebugMsg("GIPxchg NO_MOUNT\r\n");
   uTaskerStateChange(OWN_TASK, UTASKER_ACTIVATE);
   break;

Pages: 1 ... 5 6 [7]