无法进行调试,但是能够识别

2019-07-20 20:24发布

我用的芯片是STM32F429
STLINK进行调试
调试的时候不停的报这个警告。
Thu Sep 01, 2016 11:11:09: The stack pointer for stack 'CSTACK' (currently 0x1FFEE8A8) is outside the stack range (0x20000128 to 0x20002128)
Thu Sep 01, 2016 11:11:10: The stack pointer for stack 'CSTACK' (currently 0x1FFEE8A0) is outside the stack range (0x20000128 to 0x20002128)
Thu Sep 01, 2016 11:11:11: The stack pointer for stack 'CSTACK' (currently 0x1FFEE890) is outside the stack range (0x20000128 to 0x20002128)
Thu Sep 01, 2016 11:11:13: The stack pointer for stack 'CSTACK' (currently 0x1FFEE890) is outside the stack range (0x20000128 to 0x20002128)
Thu Sep 01, 2016 11:11:17: The stack pointer for stack 'CSTACK' (currently 0x1FFEE890) is outside the stack range (0x20000128 to 0x20002128)
Thu Sep 01, 2016 11:11:17: The stack pointer for stack 'CSTACK' (currently 0x1FFEE890) is outside the stack range (0x20000128 to 0x20002128)
Thu Sep 01, 2016 11:11:18: The stack pointer for stack 'CSTACK' (currently 0x1FFEE890) is outside the stack range (0x20000128 to 0x20002128)
Thu Sep 01, 2016 11:11:53: The stack pointer for stack 'CSTACK' (currently 0x1FFEE890) is outside the stack range (0x20000128 to 0x20002128)
Thu Sep 01, 2016 11:11:54: The stack pointer for stack 'CSTACK' (currently 0x1FFEE890) is outside the stack range (0x20000128 to 0x20002128)
Thu Sep 01, 2016 11:11:55: The stack pointer for stack 'CSTACK' (currently 0x1FFEE890) is outside the stack range (0x20000128 to 0x20002128)
Thu Sep 01, 2016 11:11:55: The stack pointer for stack 'CSTACK' (currently 0x1FFEE890) is outside the stack range (0x20000128 to 0x20002128)
Thu Sep 01, 2016 11:11:56: The stack pointer for stack 'CSTACK' (currently 0x1FFEE890) is outside the stack range (0x20000128 to 0x20002128)


我的程序首先运行的是这个函数。当运行到标红的那句时,调试箭头消失,无法继续进行调试。于是乎,我就退出了调试。当我再次点击调试时,系统提示:无法连接到设备了。
于是,我用STM32 ST-LINK Utility选择 select "Connect Under Reset" mode from Target->Settings menu 。进行连接,然后擦除芯片,才可以进行下一次调试。


GPIO_InitTypeDef GPIO_InitStructure;

        RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
        RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
        RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
        RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);

        //***************************************************************************
        /* PA输出 */
        GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4;
        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;       
        GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;       
        GPIO_InitStructure.GPIO_OType=GPIO_OType_PP;      
        GPIO_InitStructure.GPIO_PuPd= GPIO_PuPd_NOPULL;
        GPIO_Init(GPIOA, &GPIO_InitStructure);



我怀疑应该是我程序的问题:
我的 stm32f4xx_adc.c里面有这个


/* ADC CCR register Mask */
#define CR_CLEAR_MASK             ((uint32_t)0xFFFC30E0)  

我的stm32f4xx_dac.c里面也有这个
/* CR register Mask */
#define CR_CLEAR_MASK              ((uint32_t)0x00000FFE)


是不是这个东西引起的问题?是不是我的这两个文件有问题?





友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。