Author Topic: LPC23XX For Olimex Problem  (Read 16619 times)

Offline dsidlauskas

  • Newbie
  • *
  • Posts: 1
    • View Profile
LPC23XX For Olimex Problem
« on: January 25, 2008, 01:06:13 AM »
When I try to FTP CI_O_Olimex.htm using DOS FTP the simulator hangs at a trap in LPC23XXSIM.c:
==========================================

                if (iOldLineBlank == 0) {                                // check that we only write 1 to non-blank lines
                    iLineLength = 0;
                    while (iLineLength < FLASH_LINE_SIZE) {
                        if (ucNewLine[iLineLength++] != 0xff) {
                            *(unsigned char *)0 = 0;                     // writing non- '1' to a non-blank line - signal so that this   can be corrected
                        }
                    }
                }
========================================
in LPC23XXSIM.c.  At that point ucNewLine is:

ucNewLine   0x02b6f4a0 "><meta http-equiÌÌÌÌÌÌÌÌ><meta http-equiÌÌÌÌÌÌÌÌ"   

Any ideas.

Thanks,

Dave Sidlauskas

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3243
    • View Profile
    • uTasker
Re: LPC23XX For Olimex Problem
« Reply #1 on: January 25, 2008, 10:54:22 AM »
Hi Dave

This is in fact 'normal' when working with the simulator - it is warning that FLASH is being written, but not respecting the rules of the LPCxxxx FLASH. For details about the internal FLASH operation and its restrictions see:
http://www.utasker.com/forum/index.php?topic=136.0

The LPC23XX has 32k FLASH granularity which makes is a bit more difficult to work with. If one FLASH sector was used for each file there would be a lot of wasted space - therefore this type uses "sub-file" operation, which means that several files can share a sector. Working with sub-files requires some knowledge of the file system since it allows writing files without first deleting the block to which it is written to. This allows writing the files the first time but to overwrite a file in a block, the complete block needs to be first deleted. More details are given about this in the file
\Applications\uTaskerV1.3\WebPages\WebPagesLPC23xx\FileSystem\FileSystemLPC23xx.doc

The correct method of updating this file is
A.
- Delete C.HTM (this will clear its sector - also deleting the files 6.HTM, 8.HTM and A.JPG (this is seen after a refresh (F5))
- then reload these 4 files, where their contents can be new as in the case of CI_O_Olimex.htm

B.
- Delete all files
- Reload all files again, where their contents can be new as in the case of CI_O_Olimex.htm

B is the simplest method for less experienced users.

As detailed in the description of the sub-file system operation, it is possible to copy some files directly (it depends on their naming convention) and these will then automatically delete space for themselves.
There are presently 2 devices in the uTasker project requiring sub-file system due to the fact that the FLASH granularity is too large to implement efficient systems where each file occupies at least one FLASH section - the LPC23XX and the STR91X. All other types (NE64, M5223X, LM3SXXXX) have much smaller (better...) FLASH granularity. Although not so practical to use, the sub-file system solution does achieve efficient FLASH usage.

Regards

Mark
« Last Edit: January 25, 2008, 11:08:31 AM by mark »