No LPC 1224/101 in LPCXpresso,using /201 as target?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

No LPC 1224/101 in LPCXpresso,using /201 as target?

1,750 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by diegotrex on Mon Jan 14 08:30:17 MST 2013
Hello
i'm using LPC1224/FBD64//101,but i discovered that LPCXpresso v4.1.5_219 does not list this device(i'm i right?)

So i set for LPC1224/201,having the same memory size,can I do this?[COLOR=Blue]compiling for [B]/201[/B] and debugging and running the code on a [B]/101[/B]?[/COLOR]
Sometimes i have a strange behaviour leading to Hard Fault Handler as showed in Debug Mode.

One of this cases is relative to size and optimization

* text   data    bss    dec    hexfilename
* 6584     96     36   6716   1a3cMy_Board1224.axf     [COLOR=SeaGreen]ok[/COLOR]
* 6588     96     36   6720   1a40My_Board1224.axf  [COLOR=Red]hard fault[/COLOR]


If i optimize,or if i stay below 6584 bytes i have have no longer this fault.
Why?The code size is smaller than the 32K limts.
I have the doubt that i'm running the code from RAM

I used a section of Flash but this is allocated at 0x7000,and code is located at low locations.



Please can i have any help about it?
0 Kudos
Reply
9 Replies

1,708 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by diegotrex on Mon Jan 28 10:25:22 MST 2013

Quote: CodeRedSupport
Apparently, NXP made a part name change here with LPC1224/221 becoming LPC1224/121, and LPC1224/201 becoming LPC1224/101. Thus you can safely use the /201 part for your project for now. And we'll update LPCXpresso IDE in a future release to provide the new part names too.

With regards to your hard fault problem, it sounds like you are using IAP calls? If so I presume that you have reserved RAM for these routines?

http://support.code-red-tech.com/CodeRedWiki/ReserveIAPRam

Alternatively you might be overwritting the flash containing your code/data. Double check the map file generated by the linker against the memory that you are using for your flash storage.

http://support.code-red-tech.com/CodeRedWiki/FlashRamSize

And you could also try debugging the cause of the hard fault:

http://support.code-red-tech.com/CodeRedWiki/DebugHardFault

Dear Code-Red Support
I'm still having the hard fault issue in Debug mode and due by lack of experience i can't get out of it:

Furthermore i have  errors
DescriptionResourcePathLocationType
make: *** [src/main.o] Error 1 C/C++ Problem
make: *** [src/Interrupt.o] Error 1 C/C++ Problem
make: [clean] Error 1 (ignored) C/C++ Problem
make: *** [Telecomando_Board1224.axf] Error 1 C/C++ Problem
but i did'nt found hints about it

I can't see the VECTPC in the registers view,even if i set a  breakpoint before main(attached there is a jpg showing registers window):

In .map file i have no idea on how to check there is not overlap of areas,But at least the memory looks coherent with linker scripts.
In previous test i verfied that even calling IAP routines the flash is modified at correct locations
The code is just 6 KB ,by now ,and data is just hundred bytes

the IAP routines are never been called before Hard Fault time


Please,help me because i don't know how to get out on that
Many thanks

0 Kudos
Reply

1,708 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by diegotrex on Tue Apr 23 09:29:50 MST 2013
Trivial solution,the VCO in PLL was too close to upper limit,i made it  run at 320 MHz,it's only my fault,no reason to choose such an high  value.
When i changed divisors and made it work at 240 Mhz never
had anymore hard fault..
Sorry i f i close the thread many months after i solved.it
That was due to a memory fault(in my brain)
0 Kudos
Reply

1,708 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by diegotrex on Tue Apr 23 09:29:13 MST 2013

Quote: diegotrex
Hello
i'm using LPC1224/FBD64//101,but i discovered that LPCXpresso v4.1.5_219 does not list this device(i'm i right?)

So i set for LPC1224/201,having the same memory size,can I do this?[COLOR=Blue]compiling for [B]/201[/B] and debugging and running the code on a [B]/101[/B]?[/COLOR]
Sometimes i have a strange behaviour leading to Hard Fault Handler as showed in Debug Mode.

One of this cases is relative to size and optimization

* text       data        bss        dec        hex    filename
* 6584         96         36       6716       1a3c    My_Board1224.axf     [COLOR=SeaGreen]ok[/COLOR]
* 6588         96         36       6720       1a40    My_Board1224.axf  [COLOR=Red]hard fault[/COLOR]


If i optimize,or if i stay below 6584 bytes i have have no longer this fault.
Why?The code size is smaller than the 32K limts.
I have the doubt that i'm running the code from RAM

I used a section of Flash but this is allocated at 0x7000,and code is located at low locations.

Please can i have any help about it?

.
Trivial solution,the VCO in PLL was too close to upper limit,i made it run at 320 MHz,it's only my fault,no reason to choose such an high value.
When i changed divisors and made it work at 240 Mhz never
had anymore hard fault..
Sorry i f i close the thread many months after i solved.it
That was due to a memory fault(in my brain)
0 Kudos
Reply

1,708 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Tue Jan 29 02:02:02 MST 2013
Suggest you add the HardFault_Handler code mentioned in the FAQ and then use that to find out what the exact cause of the fault is, and where it is occuring.
0 Kudos
Reply

1,708 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Jan 21 03:12:51 MST 2013
IIRC, you need to use a stack offset of 32 bytes, not 4 - but double check the memory usage required for your part's IAP routines in NXP documentation.

As a slight aside, you might want to check the FAQ's. If the only reason you are using your own linker script rather than the managed linker script mechanism is to reduce the size of the flash, then you can do this using the memory configuration editor instead.

http://support.code-red-tech.com/CodeRedWiki/MemoryConfigEditing

Regards,
CodeRedSupport
0 Kudos
Reply

1,708 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by diegotrex on Fri Jan 18 02:06:57 MST 2013
Thanks for quick help,forgive me if i didn't reply so quickly;

[I]With regards to your hard fault problem, it sounds like you are using IAP calls? If so I presume that you have reserved RAM for these routines?[/I]

No,i forgot to do it.
I wrote code using IAP calls,but any of them was called before hard fault happened.
Heving reserved last 0x1000 bytes to a Flash Section,i did my own .ld files(attached).
In this way i can't flag the [COLOR=DarkRed]Manage linker script[/COLOR] checkbox in
[COLOR=Blue]Project Properties ->  C/C++ Build -> Settings -> MCU Linker -> Target[/COLOR]
I guess i have to act on the .ld files,changing its last row :
PROVIDE(_vStackTop = __top_RamLoc8 - [B]0[/B]);     becomes
PROVIDE(_vStackTop = __top_RamLoc8 - [B]4[/B]);    Is it correct??

Thanks again for your support.
Diego
0 Kudos
Reply

1,708 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Jan 15 01:45:03 MST 2013
Apparently, NXP made a part name change here with LPC1224/221 becoming LPC1224/121, and LPC1224/201 becoming LPC1224/101. Thus you can safely use the /201 part for your project for now. And we'll update LPCXpresso IDE in a future release to provide the new part names too.

With regards to your hard fault problem, it sounds like you are using IAP calls? If so I presume that you have reserved RAM for these routines?

http://support.code-red-tech.com/CodeRedWiki/ReserveIAPRam

Alternatively you might be overwritting the flash containing your code/data. Double check the map file generated by the linker against the memory that you are using for your flash storage.

http://support.code-red-tech.com/CodeRedWiki/FlashRamSize

And you could also try debugging the cause of the hard fault:

http://support.code-red-tech.com/CodeRedWiki/DebugHardFault

Regards,
CodeRedSupport
0 Kudos
Reply

1,708 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by diegotrex on Mon Jan 14 09:01:24 MST 2013
Thanks,following your hint i'm just downloading it.
0 Kudos
Reply

1,708 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Mon Jan 14 08:48:05 MST 2013
You are running a VERY old version of LPCXpresso. The latest version if v5.0.14, but there is also v4.3.0 which updates your version.
0 Kudos
Reply