#define APPLICATION_ADDRESS (uint32_t)0x08003000
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
#if (defined ( __CC_ARM ))
__IO uint32_t VectorTable[48] __attribute__((at(0x20000000)));
#elif (defined (__ICCARM__))
#pragma location = 0x20000000
__no_init __IO uint32_t VectorTable[48];
#elif defined ( __GNUC__ )
__IO uint32_t VectorTable[48] __attribute__((section(".RAMVectorTable")));
#elif defined ( __TASKING__ )
__IO uint32_t VectorTable[48] __at(0x20000000);
#endif
void IAP_Set()
{
uint32_t i = 0;
for(i = 0; i < 48; i++)
{
VectorTable[i] = *(__IO uint32_t*)(APPLICATION_ADDRESS + (i<<2));
}
/* Enable the SYSCFG peripheral clock*/
//RCC_APB2PeriphResetCmd(RCC_APB2Periph_SYSCFG, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
/* Remap SRAM at 0x00000000 */
SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_SRAM);
}
void Delay(__IO uint32_t nTime)
{
TimingDelay = nTime;
while(TimingDelay != 0);
}
void TimingDelay_Decrement(void)
{
if (TimingDelay != 0x00)
{
TimingDelay--;
}
}
int main(void)
{
// LED_Init();
// USART_Configuration();
// //ÉèÖÃÖжÏÏòÁ¿±íµÄλÖÃÔÚ 0x3000
// SystemInit();
IAP_Set();
SystemInit();
LED_Init();
USART_Configuration();
if (SysTick_Config(SystemCoreClock / 1000))
{
/* Capture error */
while (1);
}
while(1)
{
LED_Open();//´ò¿ªledµÆ
Delay(500);
UART_send_byte(0x31);
LED_Close();//¹ØµôledµÆ
Delay(500);
UART_send_byte(0x33);
}
}
设置也是按照官网配的,不过用的变压器是keil5.14
生产bin文件配置E:\Keil_v5\ARM\ARMCC\bin\fromelf.exe --bin --output ./gg.bin ./led.axf
|