LPC11C24 FreeRTOS Redlib(semihost)

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

LPC11C24 FreeRTOS Redlib(semihost)

1,058 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andre.marschalek on Thu Aug 08 05:19:25 MST 2013
hi

downloaded FreeRTOSV7.5.2 and use the CORTEX_M0_LPC1114_LPCXpresso Project
it works as expectd but i need to debug print something
based on some error messages during compile i changed the used C library from Redlib(none) to Redlib(semihost) and afterwards compiled the project without any problems

but if i start/debug the project it stops at HardFault_Handler

please could you help me to solve this issue?

the freertos project where debug print works and also use Redlib(semihost) from the nxp examples is unfortunately a very old one v5.3.0

thank you
Andre
Labels (1)
0 Kudos
13 Replies

911 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Sat Aug 10 16:43:00 MST 2013
The top hit from doing a forum search for something like "reserve CAN memory" will be the following rather useful previous thread...

http://www.lpcware.com/content/forum/how-to-reserve-lpc11cxx-ram

[ although the import from the old LPCXpresso isn't perfect, so you might want to read the original...
http://knowledgebase.nxp.com/showthread.php?p=21853 ]

PS - be a good idea to post a new and completely unrelated question into a new thread if you want maximum chance of getting a response!

HTH!  :)
0 Kudos

911 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andre.marschalek on Thu Aug 08 09:37:43 MST 2013
last question not related to that topic

whats the best practice to reserve space for rom can driver

at the moment i have one source file which handles can and added

#include "cr_section_macros.h"
__BSS(RESERVED) char CAN_driver_memory[256] ; // reserve 256 bytes for CAN driver

on top

but i am not sure if its ok to do that, first steps with c and lpcxpresso
0 Kudos

911 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andre.marschalek on Thu Aug 08 09:19:57 MST 2013
looks like the "best" way is to not use debug_print but debug output redirect to uart instead?
0 Kudos

911 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Aug 08 09:14:37 MST 2013
In the first place, see this previous post...

http://www.lpcware.com/content/forum/lpc-1114-hard-fault#comment-1130672

However I suspect that this will just lead to you encountering further problems. The Redlib printf has stack and heap requirements which are likely to cause problems if invoked from within a task with only small resources (and the function is also not reentrant).

Regards,
LPCXpresso Support
0 Kudos

911 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andre.marschalek on Thu Aug 08 08:43:41 MST 2013
attached the project
0 Kudos

911 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Aug 08 07:51:36 MST 2013
Please post your build log, map file, linker scripts (*.ld files) and the actual AXF you are debugging.

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

Regards,
LPCXpresso Support
0 Kudos

911 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andre.marschalek on Thu Aug 08 07:34:11 MST 2013
ah ok thank you, didn't saw a message or information, looked to me like a forum bug
0 Kudos

911 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andre.marschalek on Thu Aug 08 07:34:08 MST 2013
ah ok thank you, didn't saw a message or information, looked to me like a forum bug
0 Kudos

911 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Aug 08 07:24:24 MST 2013
Your message was blocked as spam. I have now cleared it. I have also deleted the multiple posts with the same content.
0 Kudos

911 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andre.marschalek on Thu Aug 08 07:19:59 MST 2013
cant post the register content :-( your forum doesn't accept that?
0 Kudos

911 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andre.marschalek on Thu Aug 08 07:17:55 MST 2013
whats that for a strange forum, i cant see my post with the register content
0 Kudos

911 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andre.marschalek on Thu Aug 08 07:15:59 MST 2013
looks like the call to __main() from redlib  within startup raise the fault

that's the content from vectpc register

Fault PC   = 0x00000000
           = g_pfnVectors in section .text
           = No line number information available.

Fault status registers:
IPSR       = 0x61000003: 3  (HardFault)
CFSR       = 00000000 (Configurable Fault Status Register)
HFSR       = 00000000 (Hard Fault Status Register)
DFSR       = 00000000 (Debug Fault Status Register)
MMAR       = 00000000 [INVALID] (MemManage Fault Address Register)
BFAR       = 00000000 [INVALID] (Bus Fault Address Register)
AFSR       = 00000000 (Auxiliary Fault Status Register)

Stacked registers:
R0         = 10001e78
R1         = 00000000
R2         = 00000000
R3         = 00000000
R12        = 10001e78
LR         = 00004045
PC         = 00000000
PSR        = 60000000
0 Kudos

911 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Aug 08 06:31:09 MST 2013
In the first place, see:

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

Regards,
LPCXpresso Support
0 Kudos