 
        
        
    | 各位同仁:      大家好,最近在接触stm32的开发,遇到些问题,希望能给予帮助,将十分感谢!      我用MDK4.21编译的STM32程序,生成HEX文件。BOOT0置1,BOOT1置0,通过FLASH LOADER DEMOSTRATOR 串口下载时,勾上:JUMP TO PROGRAM 不能运行。 下载完成后,BOOT0置0,BOOT1置1,重启单片机仍不能运行. 到底怎么回事?  用了一个最简单的测试程序,如下代码:   #include "stm32f10x.h" GPIO_InitTypeDef GPIO_InitStructure;  ErrorStatus HSEStartUpStatus; void RCC_Configuration(void) { /* RCC system reset(for debug purpose) */ RCC_DeInit(); /* Enable HSE */ RCC_HSEConfig(RCC_HSE_ON);   /* Wait till HSE is ready */ HSEStartUpStatus = RCC_WaitForHSEStartUp(); if(HSEStartUpStatus == SUCCESS) { /* Enable Prefetch Buffer */ FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);     /* Flash 2 wait state */ FLASH_SetLatency(FLASH_Latency_2); /* HCLK = SYSCLK */ RCC_HCLKConfig(RCC_SYSCLK_Div1); /* PCLK2 = HCLK */ RCC_PCLK2Config(RCC_HCLK_Div1);     /* PCLK1 = HCLK/2 */ RCC_PCLK1Config(RCC_HCLK_Div2);     /* PLLCLK = 8MHz * 9 = 72 MHz */ RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_6);     /* Enable PLL */  RCC_PLLCmd(ENABLE);     /* Wait till PLL is ready */ while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET) { }     /* Select PLL as system clock source */ RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);     /* Wait till PLL is used as system clock source */ while(RCC_GetSYSCLKSource() != 0x08) { } } RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE); /* Enable GPIO_LED clock */ RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); } void LED_Init(void)  { RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable, ENABLE); // 改变指定管脚的映射 GPIO_Remap_SWJ_Disable SWJ 完全禁用(JTAG+SW-DP) GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable , ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz; GPIO_Init(GPIOB, &GPIO_InitStructure); } void NVIC_Configuration(void) { #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, 0x0); #endif } void Delay(vu32 nCount) { for(; nCount != 0; nCount--); } int main(void)  { #ifdef DEBUG debug(); #endif SystemInit(); RCC_Configuration(); NVIC_Configuration(); LED_Init(); for( ; ;) { GPIO_SetBits(GPIOB, GPIO_Pin_9); Delay(0x8ffff); GPIO_SetBits(GPIOB, GPIO_Pin_10); Delay(0x8ffff); } } #ifdef DEBUG /******************************************************************************* * Function Name : assert_failed * Description : Reports the name of the source file and the source line number * where the assert_param error has occurred. * Input : - file: pointer to the source file name * - line: assert_param error line source number * Output : None * Return : None *******************************************************************************/ void assert_failed(u8* file, u32 line) { /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */   /* Infinite loop */ while (1) { } } #endif    是不是在MDK4.01设置不对! 谁遇到过这样的问题?请高手帮忙分析一下! PS:  复位电路没有问题,如附件reset.bmp     MCU电路图如下面附件MCU+Schematic.pdf 希望大家帮着检查一下吧,谢谢 | 
 
 
MCU Schematic.pdf
下载34.23 KB, 下载次数: 24, 下载积分: ST金币 -1
STM32F105 USB HID RCC設定
STM32F103VCT6单片机的复位引脚和地引脚短路
【官方例程】STM32F107以太网官方例程
【MCU实战经验】基于STM32F103C8T6的hart总线调试器设计
求教STM32F103进入STOP模式后用外部中断唤醒的问题
基于STM32F103RCT6的无源蜂鸣器音乐播放(生日快乐歌)
STM32F103c8t6有没有DAC 功能?
新手求教,为何在我电脑上找不到STM32F1Xx.h文件
金龙107例程汇总(STM32F107)
万利STM32F107VC 原理图
 微信公众号
                微信公众号
             手机版
                手机版
             
		
	
	
	
RE:STM32F100C8 用STMISP下载程序后不运行
回复:STM32F100C8 用STMISP下载程序后不运行
我用例程也下载试过,也不运行;包括把所有的原编译文件都删除掉再重新编译,只对几个gpio口进行操作的程序编译下载等都不见效。
我没有留jtag口,仿真还有点困难。
可否能给给点建议,软件出问题一般会在什么地方出现这种问题?
RE:STM32F100C8 用STMISP下载程序后不运行
回复:STM32F100C8 用STMISP下载程序后不运行
RE:STM32F100C8 用STMISP下载程序后不运行
回复:STM32F100C8 用STMISP下载程序后不运行