IAR编译 STM32The stack pointer for stack 'CSTACK' (currently 0x20000E20) is outside the stack range
为了更灵活的使用IAR我还是把这些问题写下来了,关于 IAR编译 STM32The stack pointer for stack 'CSTACK' (currently 0x20000E20) is outside the stack range 的问题,记录我是怎么解决的。
出现此问题一般是stack不足出现了问题,而我用的是STM32F107VC的芯片,只编写了几个功能,怎么会把stack写满了呢,后来我在
NVIC内增加 下面几句话
NVIC_InitTypeDef NVIC_InitStructure;
#ifdef VECT_TAB_RAM
/* Set the Vector Table base location at 0x20000000 */
NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0);
#else /* VECT_TAB_FLASH */
/* Set the Vector Table base location at 0x08000000 */
NVIC_SetVectorTable(NVIC_VectTab_FLASH , 0);
#endif
/* Configure one bit for preemption priority */
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
并将IAR的debugger 如下图设置
就可以了