打印
[demo程序]

NV32F100x bootloader_demo

[复制链接]
720|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
enginezhong|  楼主 | 2017-10-30 16:30 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式


#include "common.h"
#include "ics.h"
#include "rtc.h"
#include "uart.h"
#include "gpio.h"
#include "sysinit.h"
#include "start.h"
#include "boot.h"
#include "flash.h"

int main (void);
void RTC_Task(void);


/********************************************************************/
int main (void)
{
    /*系统初始化*/
    sysinit();
          Flash_Init();
    uint8_t sectornum;
          uint32_t i;
          uint32_t *boot32;
          uint32_t adr;
          adr =0x400000;          
          for(i=0;i<10;i++)
        {       
          Flash_EraseSector(adr+512*i);
        }
         boot32=(uint32_t *)boot;
        for (i=0;i<boot_size/4;i++)
        {
                Flash_Program1LongWord(adr,*boot32);
                boot32++;
                adr+=4;
        }
       
       
    printf("\nRunning the GPIO_demo project.\n");
    GPIO_Init(GPIOB, GPIO_PTE7_MASK, GPIO_PinOutput);


    while (1);
}

/*****************************************************************************//*!
*
* [url=home.php?mod=space&uid=247401]@brief[/url] RTC回调函数
*        
* @param  none
*
* [url=home.php?mod=space&uid=266161]@return[/url] none
*
*****************************************************************************/


相关帖子

沙发
enginezhong|  楼主 | 2017-10-30 16:30 | 只看该作者
/******************************************************************************
*
* @brief define interrupt service routines referenced by the vector table.
*
* Note: Only "vectors.c" should include this header file.
*
*******************************************************************************
******************************************************************************/

#ifndef __ISR_H
#define __ISR_H


/* Example */
/*
#undef  VECTOR_036
#define VECTOR_036 RTC_Isr

// ISR(s) are defined in your project directory.
extern void RTC_Isr(void);
*/

/*!
* @brief define interrupt service routine for different vectors.
*
*/
#undef  VECTOR_036
#define VECTOR_036      RTC_Isr          /*!< Vector 36 points to RTC interrupt service routine */

extern void RTC_Isr(void);

#endif  //__ISR_H

/* End of "isr.h" */

使用特权

评论回复
板凳
enginezhong|  楼主 | 2017-10-30 16:31 | 只看该作者
bootloader_demo.rar (1008 Bytes)

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

29

主题

218

帖子

0

粉丝