# System hangs if I work without debugging tool

**URL:** <https://forums.freertos.org/t/system-hangs-if-i-work-without-debugging-tool/2270>\
**Category:** Kernel\
**Created:** [May 22, 2008, 2:02pm UTC](https://forums.freertos.org/t/system-hangs-if-i-work-without-debugging-tool/2270 "2008-05-22T14:02:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 22, 2008, 2:02pm UTC](https://forums.freertos.org/t/system-hangs-if-i-work-without-debugging-tool/2270/1 "2008-05-22T14:02:13Z")

</div>

**[pdeflandre](https://sourceforge.net/u/pdeflandre/)** wrote on [Thursday, May 22, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/69c6ded1/#8b11):

Hello,

I works for quite a while now with FreeRTOS, and I have made a design with an Atmel AT91SAM7X256. I had used for a starting point the lwIP\_Demo\_Rowley\_ARM7 port, as I work with gcc on a Linux desktop.

I use several interrupts which interact with the OS by using the XX\_from\_ISR functions.  
I use the following at91sam7x device : aic, emac, pwm, spi, timer, serial, dbgu, twi.

All was very friendly until I tried to use my new design without any developping device. I found then with some fears that if I disconnect my JTAG Olimex Arm-usb-ocd from my developping board, the system become very unstable. Sometimes it works for few seconds, sometimes it crash immediately.

Firstly, I check my task’s stack size, but it doesn’t seem to be undersized.

Secondly, I thought about some noise problem, or interrupt problems. I found there could be spurious interrupts and add a new interrupt handler to manage them. As I put a counter in it and as it has not solve my problem, I know now it must be something else.

As it is very difficult to analyse a problem which arise only when you haven’t debugging tools on the board, I am a little bit confuse.

Does anybody have some ideas on what I can check in my application. Any remarks or suggestions will be very useful for me.

Patrick

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 22, 2008, 2:44pm UTC](https://forums.freertos.org/t/system-hangs-if-i-work-without-debugging-tool/2270/2 "2008-05-22T14:44:35Z")

</div>

**[davedoors](https://sourceforge.net/u/davedoors/)** wrote on [Thursday, May 22, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/69c6ded1/#8b11/8fc6):

See - [http://ccgi.rowley.co.uk/support/faq.php?do=article&articleid=52](http://ccgi.rowley.co.uk/support/faq.php?do=article&articleid=52)

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 23, 2008, 9:39am UTC](https://forums.freertos.org/t/system-hangs-if-i-work-without-debugging-tool/2270/3 "2008-05-23T09:39:49Z")

</div>

**[pdeflandre](https://sourceforge.net/u/pdeflandre/)** wrote on [Friday, May 23, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/69c6ded1/#8b11/8fc6/8c34):

Hello davedoors,

I thank you for the link.

I try to attach to the target without reset it. It is a little bit different as Rowley tells to do it because I use Eclipse CDT IDE with Zylin CDT plugin.

My problem shouldn’t be a problem of target startup reset, as the target works sometime for a while before crashes. And the bank start is select by a non volatil bit which select a boot from flash. I manage to attach the openocd server to the target, and I check that this bit is correctly set when the “crash” appears.

In the same way, I haven’t any boot loader on my design, so it can’t be the problem’s reason.

When I use a telnet session for debugging with openocd, I can check that my target is block on a data abort or a fetch abort.

But I don’t manage to attach the target from a gdb session with Eclipse. There is no problem if I reset the target on connection, but if I only attach to the target, I can’t stop, step, resume the target. I think my Eclipse configuration isn’t as good as it should… So it is difficult to know from where my application crash.

I will try some new tests on Monday, as I could’nt work on it this afternoon.

Thanks for your help.

Patrick.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 26, 2008, 12:16pm UTC](https://forums.freertos.org/t/system-hangs-if-i-work-without-debugging-tool/2270/4 "2008-05-26T12:16:41Z")

</div>

**[pdeflandre](https://sourceforge.net/u/pdeflandre/)** wrote on [Monday, May 26, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/69c6ded1/#8b11/6c0f):

So, I find my mistake.

I had inadvertently remove the AT91C\_BASE\_MC-\>MC\_FMR register initialisation.

When I used my flash script loader, his value was set with an openocd command, and all seem’s to go well.

But if I make an hard reboot or a power on, the MC\_FMR was cleared by default to 0x0000 0000, so the micro controller tried to run without any wait state on a 48 MHz master clock, which lead rapidly to a program or data abort.

Shame on me !
