debug will pause even no breakpoint

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

debug will pause even no breakpoint

378 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by murnesty on Sun Mar 31 19:13:35 MST 2013
Hi,

  I'm porting a FreeRTOS firmware. It works well on task and it is able to do 2 led blinking tasks. Now I would like to port the uip LAN code. After I port the code, it starts to auto break a specific line. I have search :
http://stackoverflow.com/questions/3441153/eclipse-pausing-without-a-breakpoint

  They say most probably is an exception but I can't check the exception message. I tried both delete the .metadata folder and create a new project but still the same. So I sure is code problem because this happened after I added the uip code.

I'm using :
1) Red suite 4
2) FreeRTOS v7.4.0
3) LPC2368
4) CR-JR ARM7 development kit
http://www.etteam.com/product/ARM/CH_JR_ARM7_LPC2368.htm


I have attached my src code and makefile those. It breaks at portISR.c line 130 : portSAVE_CONTEXT();


Here is the console screen I have:
1) C-Build
**** Build of configuration Debug for project RTOS Sample4 ****

make all
make: Nothing to be done for `all'.


2) MCU Debug Log
(crt_emu_a7_nxp) terminating on communication loss: Pipe has been closed by GDB.
Code Red Technologies Debug Driver v4.0 (Jul 22 2011 23:38:09)
Looked for chip XML file in C:/code_red/RedSuiteNXP_4.0.6_249/redsuite/bin/LPC2368.xml
Looked for vendor directory XML file in C:/code_red/RedSuiteNXP_4.0.6_249/redsuite/bin/nxp_directory.xml
Found generic directory XML file in C:/code_red/RedSuiteNXP_4.0.6_249/redsuite/bin/crt_directory.xml
Emu(0): Conn&Reset. DpID: 4F1F0F0F. Info: T1S6RGRIA
JTAG Frequency: 250 KHz. RTCK: False. Vector catch: False.
Packet delay: 0  Poll delay: 0.
NXP: LPC2368  Part ID: 0x1600F925
Connected: was_reset=false. was_stopped=true
v Full license with download limit of 512K
Writing 65808 bytes to 0000 in Flash (assumed clock: 48.0MHz)
Verified-same page 0-7 with 32768 bytes in 2410msec
Verified-same page   8 with 32768 bytes in 2426msec
Verified-same page   9 with 272 bytes in 66msec
Flash write Done
Stopped
Stopped: Breakpoint #1
Stopped: Step


3) Debug arm-none-eobi-gdb
set remotetimeout 60000
info program
Debugging a target over a serial line.
Program stopped at 0xffffffec.
Type "info stack" or "info registers" for more information.
set mem inaccessible-by-default off
mon ondisconnect cont
Note: automatically using hardware breakpoints for read-only addresses.


4) Debug *.axf
[no msg]
0 Kudos
5 Replies

345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by murnesty on Sun Apr 07 21:02:14 MST 2013
I think I found the reason. It break at my SWI handler in debug mode.

I read the arm7 technical manual : http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0234b/CHDGHJJB.html
From that, seems like able to use SWI as breakpoint but how do I disable SWI breakpoint?

I failed to allocate the address mask register. I can't understand the clear software breakpoint sequence too.

I'm trying this to see whether the problem still exists.

Here is my startup code:
_undf:  .word __undf                    // undefined
_swi:   .word vPortYieldProcessor       /* SWI */
_pabt:  .word __pabt// program abort
_dabt:  .word __dabt// data abort
_irq:   .word __irq// CRT_IRQ_Handler
_fiq:   .word __fiq// FIQ

This is the SWI declaration
/* ISR to handle manual context switches (from a call to taskYIELD()). */
void vPortYieldProcessor( void ) __attribute__((interrupt("SWI"), naked));
0 Kudos

345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Fri Apr 05 00:15:16 MST 2013
There are many reasons for a fault, not just stack size. However, changing the stack size as you have done is not sufficient when running an RTOS. Each task has its own stack. So, increase the stack size for each of your tasks. Hint - the IP task will probably require a LOT bigger stack size.

If that doesn't help,  then it  requires you to do some debugging. First of all, take a look at the FAQ
http://support.code-red-tech.com/CodeRedWiki/DebugHardFault
This will tell you the PC of the instruction that caused the fault and will also help you decode the fault reason.
0 Kudos

345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by murnesty on Thu Apr 04 22:22:55 MST 2013
I have change the stack size but still the same.

                0x40005830                . = ALIGN (0x4)
                0x40005830                _ebss = .
                0x40005830                PROVIDE (end, .)
                0x40005830                PROVIDE (_pvHeapStart, .)
                0x40008000                PROVIDE (_vStackTop, (__top_Ram32 - 0x0))

I have checked the power register and is ok. The application is working well in run mode. My freertos is able to switch tasks and uip connection. The only problem is during debug mode will pause.

There is one symptom. In run mode, my program will restart after 1/2 seconds. I think is after it enter uip task.

Anyone face this problem before?
0 Kudos

345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by murnesty on Wed Apr 03 23:11:40 MST 2013
From the *.map file, my RAM is in range of 0x40000000 to 0x40008000.

                0x40007830                _ebss = .
                0x40007830                PROVIDE (end, .)
                0x40007830                PROVIDE (_pvHeapStart, .)
                0x40008000                PROVIDE (_vStackTop, (__top_Ram32 - 0x0))

Is that mean my stack heap too small and probably is stack overflow error?
0 Kudos

345 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Mon Apr 01 01:00:54 MST 2013
You have hit a fault, somewhere in your code. See

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