搜索
bottom↓
回复: 7

求助:程序位运行到main函数就进入了IntDefaultHandler(void)()的死循环

[复制链接]

出0入0汤圆

发表于 2010-10-20 00:01:17 | 显示全部楼层 |阅读模式
今天刚刚拿到一款周立功的micromouse615,有两三个年头的东西了,今天想烧个出厂程序进去,编译也通过了,可一点反应都没有。。。仿真发现程序在未进入main函数之前就进入了IntDefaultHandler(void)()里的死循环。。。怎么也跳不出来了。。网上查了一下,多半说是中断注_册有问题。。。但是这个是出厂程序啊。后来怀疑是编译器版本问题,这个程序时两年前的,现在我用的是IAR5。3。。。就是不知道怎么改,特向高手求助。。。

阿莫论坛20周年了!感谢大家的支持与爱护!!

一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。

出0入0汤圆

 楼主| 发表于 2010-10-20 00:01:56 | 显示全部楼层
startup.c的代码如下
//*****************************************************************************
//
// startup.c - Boot code for Stellaris.
//
// Copyright (c) 2005-2007 Luminary Micro, Inc.  All rights reserved.
//
// Software License Agreement
//
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's microcontroller products.
//
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws.  All rights are reserved.  You may not combine
// this software with "viral" open-source software in order to form a larger
// program.  Any use in violation of the foregoing restrictions may subject
// the user to criminal sanctions under applicable laws, as well as to civil
// liability for the breach of the terms and conditions of this license.
//
// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
//
// This is part of revision 1928 of the Stellaris Peripheral Driver Library.
//
//*****************************************************************************

//*****************************************************************************
//
// Enable the IAR extensions for this source file.
//
//*****************************************************************************
#pragma language=extended

//*****************************************************************************
//
// Forward declaration of the default fault handlers.
//
//*****************************************************************************
void ResetISR(void);
static void NmiSR(void);
static void FaultISR(void);
static void IntDefaultHandler(void);
extern void Timer0A_ISR(void);
extern void Timer1A_ISR(void);
extern void SysTick_ISR(void);

//*****************************************************************************
//
// The entry point for the application.
//
//*****************************************************************************
extern int main(void);

//*****************************************************************************
//
// Reserve space for the system stack.
//
//*****************************************************************************
#ifndef STACK_SIZE
#define STACK_SIZE                              64
#endif
static unsigned long pulStack[STACK_SIZE];

//*****************************************************************************
//
// A union that describes the entries of the vector table.  The union is needed
// since the first entry is the stack pointer and the remainder are function
// pointers.
//
//*****************************************************************************
typedef union
{
    void (*pfnHandler)(void);
    unsigned long ulPtr;
}
uVectorEntry;

//*****************************************************************************
//
// The minimal vector table for a Cortex M3.  Note that the proper constructs
// must be placed on this to ensure that it ends up at physical address
// 0x0000.0000.
//
//*****************************************************************************
__root const uVectorEntry g_pfnVectors[] @ "INTVEC" =
{
    { .ulPtr = (unsigned long)pulStack + sizeof(pulStack) },
                                            // The initial stack pointer
    ResetISR,                               // The reset handler
    NmiSR,                                  // The NMI handler
    FaultISR,                               // The hard fault handler
    IntDefaultHandler,                      // The MPU fault handler
    IntDefaultHandler,                      // The bus fault handler
    IntDefaultHandler,                      // The usage fault handler
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    IntDefaultHandler,                      // SVCall handler
    IntDefaultHandler,                      // Debug monitor handler
    0,                                      // Reserved
    IntDefaultHandler,                      // The PendSV handler
    SysTick_ISR,                            // The SysTick handler
    IntDefaultHandler,                      // GPIO Port A
    IntDefaultHandler,                      // GPIO Port B
    IntDefaultHandler,                      // GPIO Port C
    IntDefaultHandler,                      // GPIO Port D
    IntDefaultHandler,                      // GPIO Port E
    IntDefaultHandler,                      // UART0 Rx and Tx
    IntDefaultHandler,                      // UART1 Rx and Tx
    IntDefaultHandler,                      // SSI Rx and Tx
    IntDefaultHandler,

出0入0汤圆

发表于 2010-10-20 11:12:27 | 显示全部楼层
LS的呢就认了吧,我也买了这个,FLASH和容易坏,不稳定,关键东西已经设计了,痛心呀
换ST的吧,LM被收购后就是没娘的孩子,没人管了

出0入0汤圆

 楼主| 发表于 2010-10-20 19:40:46 | 显示全部楼层
不是吧,烧个现成的bin文件是可以运行的,肯定不是硬件问题

出0入0汤圆

发表于 2010-10-20 20:38:24 | 显示全部楼层
我用LM3S系列的芯片,也经常遇到。。。  我也不知道什么原因

出0入0汤圆

发表于 2012-2-13 21:38:49 | 显示全部楼层
凡是中断入口为IntDefaultHandler的中断,就会触发IntDefaultHandler进入无限循环。这些中断在向量表uVectorEntry g_pfnVectors中可以看到。如果软件程序没有问题,那么原因就是程序运行时触发了相应的中断。比如GPIO有信号,串口有数据等。

出0入0汤圆

发表于 2012-11-17 14:44:34 | 显示全部楼层
LS说的好像很对,但是不请吃。我用st的也是进入default handler这个死循环,郁闷

出0入0汤圆

发表于 2012-11-19 21:57:02 | 显示全部楼层
堆栈问题,看看咯!
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-5-20 23:53

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表