先交代一下芯片和环境软件信息:
芯片:STM32F103C8T6
J-FLASH:V4.90
keil:4.12
烧写方法:keil编译后通过J-Flash下载到单片机
问题是这样的,程序修改编译后烧写都正常,但修改后第一次烧写程序不能完成预期功能,但是只要用keil debug过之后不管有没有重新烧写都一切正常。请大神帮忙分析一下到底是什么问题?
想过要用串口打印,什么信息都不输出,但是debug过后就能正常输出了。
下面是J-FLASH和keil Debug的设置:

J-Flash General标签

J-Flash Target Interface 标签

J-Flash CPU标签

J-Flash Flash标签

J-Flash Production标签

keil debug设置

keil debug JLink settings
J-Flash烧写日志
Application log started
- J-Flash V4.90 (J-Flash compiled Jul 28 2014 10:35:37)
- JLinkARM.dll V4.90 (DLL compiled Jul 28 2014 10:35:20)
Reading flash device list [C:\Program Files (x86)\SEGGER\JLink_V490\ETC\JFlash\Flash.csv] ...
- List of flash devices read successfully (2774 Devices)
Reading MCU device list [C:\Program Files (x86)\SEGGER\JLink_V490\ETC\JFlash\MCU.csv] ...
- List of MCU devices read successfully (4232 Devices)
Opening project file [C:\Users\Administrator\Desktop\2016新程序\设备编译\STM32F103C8T6 QFP48.jflash] ...
- Project opened successfully
Opening data file [E:\hongwai去除CC1101.lib测试1\OBJ\hongwai.hex] ...
- Data file opened successfully (27652 bytes, 1 range, CRC = 0xAFF2C4AF)
Auto programming target (27652 bytes, 1 range) ...
- Connecting ...
- Connected successfully
- Unsecure chip ...
- Chip unsecured successfully
- Erasing affected sectors ...
- Erasing bank 0, sector 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27
- Erase operation completed successfully
- Programming target (27652 bytes, 1 range) ...
- Target programmed successfully
- Verifying CRC of affected sectors ...
- CRC of affected sectors verified successfully (CRC = 0x911B5839)
- De-initializing CPU core (Exit sequence) ...
- De-initialized successfully
- Target erased, programmed and verified successfully - Completed after 11.158 sec
- Starting application ...
- Target application started
keil调试日志
Load "..\\OBJ\\hongwai.AXF"
Set JLink Project File to "E:\hongwai去除CC1101.lib测试1\USER\JLinkSettings.ini"
JLink info:
------------
DLL: V4.15n, compiled Jun 18 2010 19:55:09
Firmware: J-Link ARM V8 compiled Jan 31 2018 18:34:52
Hardware: V8.00
S/N : 20080643
Feature(s) : RDI,FlashDL,FlashBP,JFlash,GDBFull
* JLink Info: Found SWD-DP with ID 0x1BA01477
* JLink Info: TPIU fitted.
* JLink Info: FPUnit: 6 code (BP) slots and 2 literal slots
ROMTableAddr = 0xE00FF003
Target info:
------------
Device: STM32F103C8
VTarget = 3.293V
State of Pins:
TCK: 0, TDI: 0, TDO: 0, TMS: 0, TRES: 1, TRST: 1
* JLink Info: Found SWD-DP with ID 0x1BA01477
* JLink Info: TPIU fitted.
* JLink Info: FPUnit: 6 code (BP) slots and 2 literal slots
Hardware-Breakpoints: 6
Software-Breakpoints: 2048
Watchpoints: 4
JTAG speed: 4000 kHz
Erase Done.
Programming Done.
Verify OK.
* JLink Info: Found SWD-DP with ID 0x1BA01477
* JLink Info: TPIU fitted.
* JLink Info: FPUnit: 6 code (BP) slots and 2 literal slots
Application running ...