EmbeddedRelated.com
Forums

eeprom in LPC2129 ?

Started by tomi January 29, 2010
I want to use flash memory as eeprom in LPC2129, I have code "LPC2000 onchip
Flash as EEPROM demo" from NXP.

In demo code I have defined first sector for eeprom array in LPC2k_ee.H:

#define EE_SEC_L 0 //Flash sector where EEPROM begins (see UM
for details)
#define EE_SEC_H 1 //Flash sector where EEPROM ends (see UM
for details)
#define EE_ADDR_L 0x00000000 //Must match the EE_SEC_L Flash
sector start address
#define EE_ADDR_H 0x00001FFF //Must match the EE_SEC_H Flash
sector end address

and linker section at the required position in the memory map

Program crashes on LPC2129, but the same code works correctly on LPC2148 - I
can save and read eeprom.

Is there difference between LPC2148 and LPC2129 ?

An Engineer's Guide to the LPC2100 Series

There is a difference in case of Flash and SRAM sizes.U need to change
the stack sizes and memory sizes changes in the linker script file.It is
better to keep working files on LPC2148 in files area so that others can be
modified corresponding to LPC2129.It is for others to say where will be the
changes?

On Sat, Jan 30, 2010 at 2:23 AM, tomi wrote:

>
> I want to use flash memory as eeprom in LPC2129, I have code "LPC2000
> onchip Flash as EEPROM demo" from NXP.
>
> In demo code I have defined first sector for eeprom array in LPC2k_ee.H:
>
> #define EE_SEC_L 0 //Flash sector where EEPROM begins (see UM
> for details)
> #define EE_SEC_H 1 //Flash sector where EEPROM ends (see UM
> for details)
> #define EE_ADDR_L 0x00000000 //Must match the EE_SEC_L Flash
> sector start address
> #define EE_ADDR_H 0x00001FFF //Must match the EE_SEC_H Flash
> sector end address
>
> and linker section at the required position in the memory map
>
> Program crashes on LPC2129, but the same code works correctly on LPC2148 -
> I can save and read eeprom.
>
> Is there difference between LPC2148 and LPC2129 ?
>
>

--
Raju Nalla
Application Engineer
Unistring Tech solution pvt Ltd
I generate code for LPC2129 with linker script for LPC2129, the same .hex
code on LPC2129 crashes, on LPC2148 works correctly.

2010/1/30 Raju N

> There is a difference in case of Flash and SRAM sizes.U need to change
> the stack sizes and memory sizes changes in the linker script file.It is
> better to keep working files on LPC2148 in files area so that others can be
> modified corresponding to LPC2129.It is for others to say where will be the
> changes?
>
> On Sat, Jan 30, 2010 at 2:23 AM, tomi wrote:
>
>> I want to use flash memory as eeprom in LPC2129, I have code "LPC2000
>> onchip Flash as EEPROM demo" from NXP.
>>
>> In demo code I have defined first sector for eeprom array in LPC2k_ee.H:
>>
>> #define EE_SEC_L 0 //Flash sector where EEPROM begins (see
>> UM for details)
>> #define EE_SEC_H 1 //Flash sector where EEPROM ends (see
>> UM for details)
>> #define EE_ADDR_L 0x00000000 //Must match the EE_SEC_L Flash
>> sector start address
>> #define EE_ADDR_H 0x00001FFF //Must match the EE_SEC_H Flash
>> sector end address
>>
>> and linker section at the required position in the memory map
>>
>> Program crashes on LPC2129, but the same code works correctly on LPC2148 -
>> I can save and read eeprom.
>>
>> Is there difference between LPC2148 and LPC2129 ?
>>
What compiler and programmer u r using ?
On Sat, Jan 30, 2010 at 12:54 PM, tomi wrote:

>
> I generate code for LPC2129 with linker script for LPC2129, the same .hex
> code on LPC2129 crashes, on LPC2148 works correctly.
>
> 2010/1/30 Raju N
>>
>> There is a difference in case of Flash and SRAM sizes.U need to change
>> the stack sizes and memory sizes changes in the linker script file.It is
>> better to keep working files on LPC2148 in files area so that others can be
>> modified corresponding to LPC2129.It is for others to say where will be the
>> changes?
>>
>> On Sat, Jan 30, 2010 at 2:23 AM, tomi wrote:
>>
>>>
>>>
>>> I want to use flash memory as eeprom in LPC2129, I have code "LPC2000
>>> onchip Flash as EEPROM demo" from NXP.
>>>
>>> In demo code I have defined first sector for eeprom array in LPC2k_ee.H:
>>>
>>> #define EE_SEC_L 0 //Flash sector where EEPROM begins (see
>>> UM for details)
>>> #define EE_SEC_H 1 //Flash sector where EEPROM ends (see
>>> UM for details)
>>> #define EE_ADDR_L 0x00000000 //Must match the EE_SEC_L Flash
>>> sector start address
>>> #define EE_ADDR_H 0x00001FFF //Must match the EE_SEC_H Flash
>>> sector end address
>>>
>>> and linker section at the required position in the memory map
>>>
>>> Program crashes on LPC2129, but the same code works correctly on LPC2148
>>> - I can save and read eeprom.
>>>
>>> Is there difference between LPC2148 and LPC2129 ?
>>>
>

--
Raju Nalla
Application Engineer
Unistring Tech solution pvt Ltd
Crashes means u r successfully dumping the code to lpc2129 and not working
as u expected is it right?
On Sat, Jan 30, 2010 at 1:56 PM, Raju N wrote:

>
> What compiler and programmer u r using ?
>
> On Sat, Jan 30, 2010 at 12:54 PM, tomi wrote:
>
>>
>> I generate code for LPC2129 with linker script for LPC2129, the same .hex
>> code on LPC2129 crashes, on LPC2148 works correctly.
>>
>> 2010/1/30 Raju N
>>>
>>> There is a difference in case of Flash and SRAM sizes.U need to change
>>> the stack sizes and memory sizes changes in the linker script file.It is
>>> better to keep working files on LPC2148 in files area so that others can be
>>> modified corresponding to LPC2129.It is for others to say where will be the
>>> changes?
>>>
>>> On Sat, Jan 30, 2010 at 2:23 AM, tomi wrote:
>>>
>>>>
>>>>
>>>> I want to use flash memory as eeprom in LPC2129, I have code "LPC2000
>>>> onchip Flash as EEPROM demo" from NXP.
>>>>
>>>> In demo code I have defined first sector for eeprom array in LPC2k_ee.H:
>>>>
>>>> #define EE_SEC_L 0 //Flash sector where EEPROM begins (see
>>>> UM for details)
>>>> #define EE_SEC_H 1 //Flash sector where EEPROM ends (see
>>>> UM for details)
>>>> #define EE_ADDR_L 0x00000000 //Must match the EE_SEC_L Flash
>>>> sector start address
>>>> #define EE_ADDR_H 0x00001FFF //Must match the EE_SEC_H Flash
>>>> sector end address
>>>>
>>>> and linker section at the required position in the memory map
>>>>
>>>> Program crashes on LPC2129, but the same code works correctly on LPC2148
>>>> - I can save and read eeprom.
>>>>
>>>> Is there difference between LPC2148 and LPC2129 ?
>>>>
>>>
>>>
>> --
> Raju Nalla
> Application Engineer
> Unistring Tech solution pvt Ltd
>

--
Raju Nalla
Application Engineer
Unistring Tech solution pvt Ltd
Yes

Crossstudio 1.7 + Jlink

I have run step by step debugging on LPC2129, function ee_erase return
status 00 = ok, but with ee_write() or ee_read() I have different values in
status and program crashes: stop or jump to random location.

2010/1/30 Raju N

>
> Crashes means u r successfully dumping the code to lpc2129 and not working
> as u expected is it right?
>
> On Sat, Jan 30, 2010 at 1:56 PM, Raju N wrote:
>
>>
>> What compiler and programmer u r using ?
>>
>> On Sat, Jan 30, 2010 at 12:54 PM, tomi wrote:
>>
>>>
>>>
>>> I generate code for LPC2129 with linker script for LPC2129, the same .hex
>>> code on LPC2129 crashes, on LPC2148 works correctly.
>>>
>>>
>>>
>>> 2010/1/30 Raju N
>>>
>>>
>>>>
>>>> There is a difference in case of Flash and SRAM sizes.U need to
>>>> change the stack sizes and memory sizes changes in the linker script file.It
>>>> is better to keep working files on LPC2148 in files area so that others can
>>>> be modified corresponding to LPC2129.It is for others to say where will be
>>>> the changes?
>>>>
>>>> On Sat, Jan 30, 2010 at 2:23 AM, tomi wrote:
>>>>
>>>>>
>>>>>
>>>>> I want to use flash memory as eeprom in LPC2129, I have code "LPC2000
>>>>> onchip Flash as EEPROM demo" from NXP.
>>>>>
>>>>> In demo code I have defined first sector for eeprom array in
>>>>> LPC2k_ee.H:
>>>>>
>>>>> #define EE_SEC_L 0 //Flash sector where EEPROM begins
>>>>> (see UM for details)
>>>>> #define EE_SEC_H 1 //Flash sector where EEPROM ends
>>>>> (see UM for details)
>>>>> #define EE_ADDR_L 0x00000000 //Must match the EE_SEC_L Flash
>>>>> sector start address
>>>>> #define EE_ADDR_H 0x00001FFF //Must match the EE_SEC_H Flash
>>>>> sector end address
>>>>>
>>>>> and linker section at the required position in the memory map
>>>>>
>>>>> Program crashes on LPC2129, but the same code works correctly on
>>>>> LPC2148 - I can save and read eeprom.
>>>>>
>>>>> Is there difference between LPC2148 and LPC2129 ?
>>>>>
>>>>
>>>>
>>>
>>>
>> --
>> Raju Nalla
>> Application Engineer
>> Unistring Tech solution pvt Ltd
>> --
> Raju Nalla
> Application Engineer
> Unistring Tech solution pvt Ltd
>
>
Let me modify the working code of LPC2148 to LPC2129.keep the working
content of lpc2148 in files section.
On Sat, Jan 30, 2010 at 10:36 PM, tomi wrote:

> Yes
>
> Crossstudio 1.7 + Jlink
>
> I have run step by step debugging on LPC2129, function ee_erase return
> status 00 = ok, but with ee_write() or ee_read() I have different values in
> status and program crashes: stop or jump to random location.
> 2010/1/30 Raju N >
>> Crashes means u r successfully dumping the code to lpc2129 and not working
>> as u expected is it right?
>>
>> On Sat, Jan 30, 2010 at 1:56 PM, Raju N wrote:
>>
>>>
>>> What compiler and programmer u r using ?
>>>
>>> On Sat, Jan 30, 2010 at 12:54 PM, tomi wrote:
>>>
>>>>
>>>>
>>>> I generate code for LPC2129 with linker script for LPC2129, the same
>>>> .hex code on LPC2129 crashes, on LPC2148 works correctly.
>>>>
>>>>
>>>>
>>>> 2010/1/30 Raju N
>>>>
>>>>
>>>>>
>>>>> There is a difference in case of Flash and SRAM sizes.U need to
>>>>> change the stack sizes and memory sizes changes in the linker script file.It
>>>>> is better to keep working files on LPC2148 in files area so that others can
>>>>> be modified corresponding to LPC2129.It is for others to say where will be
>>>>> the changes?
>>>>>
>>>>> On Sat, Jan 30, 2010 at 2:23 AM, tomi wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> I want to use flash memory as eeprom in LPC2129, I have code "LPC2000
>>>>>> onchip Flash as EEPROM demo" from NXP.
>>>>>>
>>>>>> In demo code I have defined first sector for eeprom array in
>>>>>> LPC2k_ee.H:
>>>>>>
>>>>>> #define EE_SEC_L 0 //Flash sector where EEPROM begins
>>>>>> (see UM for details)
>>>>>> #define EE_SEC_H 1 //Flash sector where EEPROM ends
>>>>>> (see UM for details)
>>>>>> #define EE_ADDR_L 0x00000000 //Must match the EE_SEC_L Flash
>>>>>> sector start address
>>>>>> #define EE_ADDR_H 0x00001FFF //Must match the EE_SEC_H Flash
>>>>>> sector end address
>>>>>>
>>>>>> and linker section at the required position in the memory map
>>>>>>
>>>>>> Program crashes on LPC2129, but the same code works correctly on
>>>>>> LPC2148 - I can save and read eeprom.
>>>>>>
>>>>>> Is there difference between LPC2148 and LPC2129 ?
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Raju Nalla
>>> Application Engineer
>>> Unistring Tech solution pvt Ltd
>>> --
>> Raju Nalla
>> Application Engineer
>> Unistring Tech solution pvt Ltd
>>
>

--
Raju Nalla
Application Engineer
Unistring Tech solution pvt Ltd
Thank you for helping. I have found problem

#define EE_BUFFER_SIZE 256 - for LPC2129 should be 512, and demo code is
working on LPC2129.
Regards
tomi

2010/2/1 Raju N

>
> Let me modify the working code of LPC2148 to LPC2129.keep the working
> content of lpc2148 in files section.
> On Sat, Jan 30, 2010 at 10:36 PM, tomi wrote:
>
>>
>> Yes
>>
>> Crossstudio 1.7 + Jlink
>>
>> I have run step by step debugging on LPC2129, function ee_erase return
>> status 00 = ok, but with ee_write() or ee_read() I have different values in
>> status and program crashes: stop or jump to random location.
>> 2010/1/30 Raju N
>>
>>>
>>>
>>> Crashes means u r successfully dumping the code to lpc2129 and not
>>> working as u expected is it right?
>>>
>>> On Sat, Jan 30, 2010 at 1:56 PM, Raju N wrote:
>>>
>>>>
>>>> What compiler and programmer u r using ?
>>>>
>>>> On Sat, Jan 30, 2010 at 12:54 PM, tomi wrote:
>>>>
>>>>>
>>>>>
>>>>> I generate code for LPC2129 with linker script for LPC2129, the same
>>>>> .hex code on LPC2129 crashes, on LPC2148 works correctly.
>>>>>
>>>>>
>>>>>
>>>>> 2010/1/30 Raju N
>>>>>
>>>>>
>>>>>>
>>>>>> There is a difference in case of Flash and SRAM sizes.U need to
>>>>>> change the stack sizes and memory sizes changes in the linker script file.It
>>>>>> is better to keep working files on LPC2148 in files area so that others can
>>>>>> be modified corresponding to LPC2129.It is for others to say where will be
>>>>>> the changes?
>>>>>>
>>>>>> On Sat, Jan 30, 2010 at 2:23 AM, tomi wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I want to use flash memory as eeprom in LPC2129, I have code "LPC2000
>>>>>>> onchip Flash as EEPROM demo" from NXP.
>>>>>>>
>>>>>>> In demo code I have defined first sector for eeprom array in
>>>>>>> LPC2k_ee.H:
>>>>>>>
>>>>>>> #define EE_SEC_L 0 //Flash sector where EEPROM begins
>>>>>>> (see UM for details)
>>>>>>> #define EE_SEC_H 1 //Flash sector where EEPROM ends
>>>>>>> (see UM for details)
>>>>>>> #define EE_ADDR_L 0x00000000 //Must match the EE_SEC_L
>>>>>>> Flash sector start address
>>>>>>> #define EE_ADDR_H 0x00001FFF //Must match the EE_SEC_H
>>>>>>> Flash sector end address
>>>>>>>
>>>>>>> and linker section at the required position in the memory map
>>>>>>>
>>>>>>> Program crashes on LPC2129, but the same code works correctly on
>>>>>>> LPC2148 - I can save and read eeprom.
>>>>>>>
>>>>>>> Is there difference between LPC2148 and LPC2129 ?
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Raju Nalla
>>>> Application Engineer
>>>> Unistring Tech solution pvt Ltd
>>>>
>>>
>>>
>>>
>>> --
>>> Raju Nalla
>>> Application Engineer
>>> Unistring Tech solution pvt Ltd
>>>
> --
> Raju Nalla
> Application Engineer
> Unistring Tech solution pvt Ltd
>
>