EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

LPC2138 Flashing Help needed

Started by priyankvmaiya2 February 15, 2010
Hi,
I newly started working on this board.
I am trying to flash a hex file onto my lpc2138 board. But even though I flash different hex files, I get the same output on the board. i.e. I see that the 2 LEDs glow on and off alternately.
I am now confused whether my board has a problem or I am flashing incorrectly. I also suspect the Erase of the blocks is not happening properly. I am using Flash Magic for flashing.
It would be great of anyone could share light on this. Also if anyone who owns this board could flash the hex file I have got and we can compare the outputs seen in the boards, so I can conclude whether there is a problem with my board or something else.

Thanks & Regards,
Priyank

An Engineer's Guide to the LPC2100 Series

Hi Priyank,

Typically it is quite straightforward to flash using FlashMagic. Are you
sure you haven't write-protected any memory block? Or the entire Flash of
the LPC2138?
Try checking the appropriate checkbox for "Erase all Flash+Code Rd Prot",
and in the Options, enable "Verify after programming".

Lastly (and here I have run into the same problem as you several times!),
make sure that the entire path to your hex file is correct. You could click
on the File->Information file menu and see that the file you are trying to
burn is indeed the one you have selected.

What is the message FlashMagic displays after flashing? A success message,
or a failure message?

Good luck!

Ahmad
On Mon, Feb 15, 2010 at 10:58 PM, priyankvmaiya2 wrote:

> Hi,
> I newly started working on this board.
> I am trying to flash a hex file onto my lpc2138 board. But even though I
> flash different hex files, I get the same output on the board. i.e. I see
> that the 2 LEDs glow on and off alternately.
> I am now confused whether my board has a problem or I am flashing
> incorrectly. I also suspect the Erase of the blocks is not happening
> properly. I am using Flash Magic for flashing.
> It would be great of anyone could share light on this. Also if anyone who
> owns this board could flash the hex file I have got and we can compare the
> outputs seen in the boards, so I can conclude whether there is a problem
> with my board or something else.
>
> Thanks & Regards,
> Priyank
>
>
>
Hi Ahmad,
Thanks for the reply.
Before I had not enabled the Verify after programming checkbox, due to which
it just showed a finished flashing message.
When I enabled the Verify after programming checkbox, the error message that
displayed was
"Error verifying. There is a difference in the Hex file value and the stored
value at address 0x00000139"

How do I check whether the memory block is write protected or not ?
I also tried checking "Erase all Flash+Code Rd Prot" and "Erase block used
by the hex file" individually but nothing changed. I guess the problem is
that the erasing is not happening.
I am sure of the hex file I am using since the flash magic also shows the
time stamp the file in use.

Thanks & Regards,
Priyank

On Mon, Feb 15, 2010 at 11:55 PM, Ahmad wrote:

> Hi Priyank,
>
> Typically it is quite straightforward to flash using FlashMagic. Are you
> sure you haven't write-protected any memory block? Or the entire Flash of
> the LPC2138?
> Try checking the appropriate checkbox for "Erase all Flash+Code Rd Prot",
> and in the Options, enable "Verify after programming".
>
> Lastly (and here I have run into the same problem as you several times!),
> make sure that the entire path to your hex file is correct. You could click
> on the File->Information file menu and see that the file you are trying to
> burn is indeed the one you have selected.
>
> What is the message FlashMagic displays after flashing? A success message,
> or a failure message?
>
> Good luck!
>
> Ahmad
> On Mon, Feb 15, 2010 at 10:58 PM, priyankvmaiya2 wrote:
>
>> Hi,
>> I newly started working on this board.
>> I am trying to flash a hex file onto my lpc2138 board. But even though I
>> flash different hex files, I get the same output on the board. i.e. I see
>> that the 2 LEDs glow on and off alternately.
>> I am now confused whether my board has a problem or I am flashing
>> incorrectly. I also suspect the Erase of the blocks is not happening
>> properly. I am using Flash Magic for flashing.
>> It would be great of anyone could share light on this. Also if anyone who
>> owns this board could flash the hex file I have got and we can compare the
>> outputs seen in the boards, so I can conclude whether there is a problem
>> with my board or something else.
>>
>> Thanks & Regards,
>> Priyank
>
>
Hi Priyank,

To know whether the memory is protected or not, try ISP->Erase Flash (with
"Erase all Flash+Code Rd Prot" checked), and then ISP->Blank Check... Also
make sure that Select Device on the main screen is still showing LPC2138 or
whatever is appropriate!

Regards,
Ahmad

On Tue, Feb 16, 2010 at 11:44 AM, Priyank Maiya wrote:

> Hi Ahmad,
> Thanks for the reply.
> Before I had not enabled the Verify after programming checkbox, due to
> which it just showed a finished flashing message.
> When I enabled the Verify after programming checkbox, the error message
> that displayed was
> "Error verifying. There is a difference in the Hex file value and the
> stored value at address 0x00000139"
>
> How do I check whether the memory block is write protected or not ?
> I also tried checking "Erase all Flash+Code Rd Prot" and "Erase block used
> by the hex file" individually but nothing changed. I guess the problem is
> that the erasing is not happening.
> I am sure of the hex file I am using since the flash magic also shows the
> time stamp the file in use.
>
> Thanks & Regards,
> Priyank
> On Mon, Feb 15, 2010 at 11:55 PM, Ahmad wrote:
>
>> Hi Priyank,
>>
>> Typically it is quite straightforward to flash using FlashMagic. Are you
>> sure you haven't write-protected any memory block? Or the entire Flash of
>> the LPC2138?
>> Try checking the appropriate checkbox for "Erase all Flash+Code Rd Prot",
>> and in the Options, enable "Verify after programming".
>>
>> Lastly (and here I have run into the same problem as you several times!),
>> make sure that the entire path to your hex file is correct. You could click
>> on the File->Information file menu and see that the file you are trying to
>> burn is indeed the one you have selected.
>>
>> What is the message FlashMagic displays after flashing? A success
>> message, or a failure message?
>>
>> Good luck!
>>
>> Ahmad
>> On Mon, Feb 15, 2010 at 10:58 PM, priyankvmaiya2 >> > wrote:
>>
>>>
>>>
>>> Hi,
>>> I newly started working on this board.
>>> I am trying to flash a hex file onto my lpc2138 board. But even though I
>>> flash different hex files, I get the same output on the board. i.e. I see
>>> that the 2 LEDs glow on and off alternately.
>>> I am now confused whether my board has a problem or I am flashing
>>> incorrectly. I also suspect the Erase of the blocks is not happening
>>> properly. I am using Flash Magic for flashing.
>>> It would be great of anyone could share light on this. Also if anyone who
>>> owns this board could flash the hex file I have got and we can compare the
>>> outputs seen in the boards, so I can conclude whether there is a problem
>>> with my board or something else.
>>>
>>> Thanks & Regards,
>>> Priyank
>>>
>>
>
Hi Ahmad,
I carried out what you told. I did the "Erase all Flash+Code Rd Prot" >
Erase. But when I did the Blank check, it showed that the Block 0 is still
Not Blank. This I guess means that the memory is protected. Any idea how do
we remove this protection. I saw an option ProtectISP in Flash Magic which
was checked. Has this got to do anything with memory protection? But this
option is not highlighted for me to uncheck it.

I was also going through the Flash Magic manual. Can we use Command Line
Interface for erasing the memory block ?

Thanks,
Priyank

On Tue, Feb 16, 2010 at 12:28 AM, Ahmad wrote:

> Hi Priyank,
>
> To know whether the memory is protected or not, try ISP->Erase Flash (with
> "Erase all Flash+Code Rd Prot" checked), and then ISP->Blank Check... Also
> make sure that Select Device on the main screen is still showing LPC2138 or
> whatever is appropriate!
>
> Regards,
> Ahmad
> On Tue, Feb 16, 2010 at 11:44 AM, Priyank Maiya wrote:
>
>> Hi Ahmad,
>> Thanks for the reply.
>> Before I had not enabled the Verify after programming checkbox, due to
>> which it just showed a finished flashing message.
>> When I enabled the Verify after programming checkbox, the error message
>> that displayed was
>> "Error verifying. There is a difference in the Hex file value and the
>> stored value at address 0x00000139"
>>
>> How do I check whether the memory block is write protected or not ?
>> I also tried checking "Erase all Flash+Code Rd Prot" and "Erase block used
>> by the hex file" individually but nothing changed. I guess the problem is
>> that the erasing is not happening.
>> I am sure of the hex file I am using since the flash magic also shows the
>> time stamp the file in use.
>>
>> Thanks & Regards,
>> Priyank
>> On Mon, Feb 15, 2010 at 11:55 PM, Ahmad wrote:
>>
>>>
>>>
>>> Hi Priyank,
>>>
>>> Typically it is quite straightforward to flash using FlashMagic. Are you
>>> sure you haven't write-protected any memory block? Or the entire Flash of
>>> the LPC2138?
>>> Try checking the appropriate checkbox for "Erase all Flash+Code Rd Prot",
>>> and in the Options, enable "Verify after programming".
>>>
>>> Lastly (and here I have run into the same problem as you several times!),
>>> make sure that the entire path to your hex file is correct. You could click
>>> on the File->Information file menu and see that the file you are trying to
>>> burn is indeed the one you have selected.
>>>
>>> What is the message FlashMagic displays after flashing? A success
>>> message, or a failure message?
>>>
>>> Good luck!
>>>
>>> Ahmad
>>>
>>>
>>> On Mon, Feb 15, 2010 at 10:58 PM, priyankvmaiya2 <
>>> p...@gmail.com> wrote:
>>>
>>>>
>>>>
>>>> Hi,
>>>> I newly started working on this board.
>>>> I am trying to flash a hex file onto my lpc2138 board. But even though I
>>>> flash different hex files, I get the same output on the board. i.e. I see
>>>> that the 2 LEDs glow on and off alternately.
>>>> I am now confused whether my board has a problem or I am flashing
>>>> incorrectly. I also suspect the Erase of the blocks is not happening
>>>> properly. I am using Flash Magic for flashing.
>>>> It would be great of anyone could share light on this. Also if anyone
>>>> who owns this board could flash the hex file I have got and we can compare
>>>> the outputs seen in the boards, so I can conclude whether there is a problem
>>>> with my board or something else.
>>>>
>>>> Thanks & Regards,
>>>> Priyank
>>>>
>>>>
>>
>
Hi Ahmad,
Problem solved.
I got this memory block erased. The problem was with the Oscillator Crystal
Frequency. I had kept it blank. Now I put a 16 MHz frequency. Its now
erasing the blocks completely and flashing the new hex file and the new
changes are observed.
Thanks again for your help.

Regards,
Priyank

On Tue, Feb 16, 2010 at 12:39 PM, Priyank Maiya wrote:

> Hi Ahmad,
> I carried out what you told. I did the "Erase all Flash+Code Rd Prot" >
> Erase. But when I did the Blank check, it showed that the Block 0 is still
> Not Blank. This I guess means that the memory is protected. Any idea how do
> we remove this protection. I saw an option ProtectISP in Flash Magic which
> was checked. Has this got to do anything with memory protection? But this
> option is not highlighted for me to uncheck it.
>
> I was also going through the Flash Magic manual. Can we use Command Line
> Interface for erasing the memory block ?
>
> Thanks,
> Priyank
> On Tue, Feb 16, 2010 at 12:28 AM, Ahmad wrote:
>
>> Hi Priyank,
>>
>> To know whether the memory is protected or not, try ISP->Erase Flash (with
>> "Erase all Flash+Code Rd Prot" checked), and then ISP->Blank Check... Also
>> make sure that Select Device on the main screen is still showing LPC2138 or
>> whatever is appropriate!
>>
>> Regards,
>> Ahmad
>> On Tue, Feb 16, 2010 at 11:44 AM, Priyank Maiya wrote:
>>
>>>
>>>
>>> Hi Ahmad,
>>> Thanks for the reply.
>>> Before I had not enabled the Verify after programming checkbox, due to
>>> which it just showed a finished flashing message.
>>> When I enabled the Verify after programming checkbox, the error message
>>> that displayed was
>>> "Error verifying. There is a difference in the Hex file value and the
>>> stored value at address 0x00000139"
>>>
>>> How do I check whether the memory block is write protected or not ?
>>> I also tried checking "Erase all Flash+Code Rd Prot" and "Erase block
>>> used by the hex file" individually but nothing changed. I guess the problem
>>> is that the erasing is not happening.
>>> I am sure of the hex file I am using since the flash magic also shows the
>>> time stamp the file in use.
>>>
>>> Thanks & Regards,
>>> Priyank
>>>
>>>
>>> On Mon, Feb 15, 2010 at 11:55 PM, Ahmad wrote:
>>>
>>>>
>>>>
>>>> Hi Priyank,
>>>>
>>>> Typically it is quite straightforward to flash using FlashMagic. Are
>>>> you sure you haven't write-protected any memory block? Or the entire Flash
>>>> of the LPC2138?
>>>> Try checking the appropriate checkbox for "Erase all Flash+Code Rd
>>>> Prot", and in the Options, enable "Verify after programming".
>>>>
>>>> Lastly (and here I have run into the same problem as you several
>>>> times!), make sure that the entire path to your hex file is correct. You
>>>> could click on the File->Information file menu and see that the file you are
>>>> trying to burn is indeed the one you have selected.
>>>>
>>>> What is the message FlashMagic displays after flashing? A success
>>>> message, or a failure message?
>>>>
>>>> Good luck!
>>>>
>>>> Ahmad
>>>>
>>>>
>>>> On Mon, Feb 15, 2010 at 10:58 PM, priyankvmaiya2 <
>>>> p...@gmail.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> Hi,
>>>>> I newly started working on this board.
>>>>> I am trying to flash a hex file onto my lpc2138 board. But even though
>>>>> I flash different hex files, I get the same output on the board. i.e. I see
>>>>> that the 2 LEDs glow on and off alternately.
>>>>> I am now confused whether my board has a problem or I am flashing
>>>>> incorrectly. I also suspect the Erase of the blocks is not happening
>>>>> properly. I am using Flash Magic for flashing.
>>>>> It would be great of anyone could share light on this. Also if anyone
>>>>> who owns this board could flash the hex file I have got and we can compare
>>>>> the outputs seen in the boards, so I can conclude whether there is a problem
>>>>> with my board or something else.
>>>>>
>>>>> Thanks & Regards,
>>>>> Priyank
>>>>>
>>>>>
>>>>
>>>
>>
>>
Ah! Great that you've solved the problem!

Good luck with whatever you're doing with the chip.

:-)

Ahmad

On Wed, Feb 17, 2010 at 12:46 AM, Priyank Maiya wrote:

> Hi Ahmad,
> Problem solved.
> I got this memory block erased. The problem was with the Oscillator Crystal
> Frequency. I had kept it blank. Now I put a 16 MHz frequency. Its now
> erasing the blocks completely and flashing the new hex file and the new
> changes are observed.
> Thanks again for your help.
>
> Regards,
> Priyank
> On Tue, Feb 16, 2010 at 12:39 PM, Priyank Maiya wrote:
>
>> Hi Ahmad,
>> I carried out what you told. I did the "Erase all Flash+Code Rd Prot" >
>> Erase. But when I did the Blank check, it showed that the Block 0 is still
>> Not Blank. This I guess means that the memory is protected. Any idea how do
>> we remove this protection. I saw an option ProtectISP in Flash Magic which
>> was checked. Has this got to do anything with memory protection? But this
>> option is not highlighted for me to uncheck it.
>>
>> I was also going through the Flash Magic manual. Can we use Command Line
>> Interface for erasing the memory block ?
>>
>> Thanks,
>> Priyank
>> On Tue, Feb 16, 2010 at 12:28 AM, Ahmad wrote:
>>
>>>
>>>
>>> Hi Priyank,
>>>
>>> To know whether the memory is protected or not, try ISP->Erase Flash
>>> (with "Erase all Flash+Code Rd Prot" checked), and then ISP->Blank Check...
>>> Also make sure that Select Device on the main screen is still showing
>>> LPC2138 or whatever is appropriate!
>>>
>>> Regards,
>>> Ahmad
>>>
>>>
>>> On Tue, Feb 16, 2010 at 11:44 AM, Priyank Maiya >>> > wrote:
>>>
>>>>
>>>>
>>>> Hi Ahmad,
>>>> Thanks for the reply.
>>>> Before I had not enabled the Verify after programming checkbox, due to
>>>> which it just showed a finished flashing message.
>>>> When I enabled the Verify after programming checkbox, the error message
>>>> that displayed was
>>>> "Error verifying. There is a difference in the Hex file value and the
>>>> stored value at address 0x00000139"
>>>>
>>>> How do I check whether the memory block is write protected or not ?
>>>> I also tried checking "Erase all Flash+Code Rd Prot" and "Erase block
>>>> used by the hex file" individually but nothing changed. I guess the problem
>>>> is that the erasing is not happening.
>>>> I am sure of the hex file I am using since the flash magic also shows
>>>> the time stamp the file in use.
>>>>
>>>> Thanks & Regards,
>>>> Priyank
>>>>
>>>>
>>>> On Mon, Feb 15, 2010 at 11:55 PM, Ahmad wrote:
>>>>
>>>>>
>>>>>
>>>>> Hi Priyank,
>>>>>
>>>>> Typically it is quite straightforward to flash using FlashMagic. Are
>>>>> you sure you haven't write-protected any memory block? Or the entire Flash
>>>>> of the LPC2138?
>>>>> Try checking the appropriate checkbox for "Erase all Flash+Code Rd
>>>>> Prot", and in the Options, enable "Verify after programming".
>>>>>
>>>>> Lastly (and here I have run into the same problem as you several
>>>>> times!), make sure that the entire path to your hex file is correct. You
>>>>> could click on the File->Information file menu and see that the file you are
>>>>> trying to burn is indeed the one you have selected.
>>>>>
>>>>> What is the message FlashMagic displays after flashing? A success
>>>>> message, or a failure message?
>>>>>
>>>>> Good luck!
>>>>>
>>>>> Ahmad
>>>>>
>>>>>
>>>>> On Mon, Feb 15, 2010 at 10:58 PM, priyankvmaiya2 <
>>>>> p...@gmail.com> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> Hi,
>>>>>> I newly started working on this board.
>>>>>> I am trying to flash a hex file onto my lpc2138 board. But even though
>>>>>> I flash different hex files, I get the same output on the board. i.e. I see
>>>>>> that the 2 LEDs glow on and off alternately.
>>>>>> I am now confused whether my board has a problem or I am flashing
>>>>>> incorrectly. I also suspect the Erase of the blocks is not happening
>>>>>> properly. I am using Flash Magic for flashing.
>>>>>> It would be great of anyone could share light on this. Also if anyone
>>>>>> who owns this board could flash the hex file I have got and we can compare
>>>>>> the outputs seen in the boards, so I can conclude whether there is a problem
>>>>>> with my board or something else.
>>>>>>
>>>>>> Thanks & Regards,
>>>>>> Priyank
>>>>>>
>>>>>>
>>>>>
>>>>
>>
>

The 2024 Embedded Online Conference