[demo程序] NV32F100x bootloader_demo

[复制链接]
 楼主| enginezhong 发表于 2017-10-30 16:30 | 显示全部楼层 |阅读模式


  1. #include "common.h"
  2. #include "ics.h"
  3. #include "rtc.h"
  4. #include "uart.h"
  5. #include "gpio.h"
  6. #include "sysinit.h"
  7. #include "start.h"
  8. #include "boot.h"
  9. #include "flash.h"

  10. int main (void);
  11. void RTC_Task(void);


  12. /********************************************************************/
  13. int main (void)
  14. {
  15.     /*系统初始化*/
  16.     sysinit();
  17.           Flash_Init();
  18.     uint8_t sectornum;
  19.           uint32_t i;
  20.           uint32_t *boot32;
  21.           uint32_t adr;
  22.           adr =0x400000;          
  23.           for(i=0;i<10;i++)
  24.         {       
  25.           Flash_EraseSector(adr+512*i);
  26.         }
  27.          boot32=(uint32_t *)boot;
  28.         for (i=0;i<boot_size/4;i++)
  29.         {
  30.                 Flash_Program1LongWord(adr,*boot32);
  31.                 boot32++;
  32.                 adr+=4;
  33.         }
  34.        
  35.        
  36.     printf("\nRunning the GPIO_demo project.\n");
  37.     GPIO_Init(GPIOB, GPIO_PTE7_MASK, GPIO_PinOutput);


  38.     while (1);
  39. }

  40. /*****************************************************************************//*!
  41. *
  42. * [url=home.php?mod=space&uid=247401]@brief[/url] RTC回调函数
  43. *        
  44. * @param  none
  45. *
  46. * [url=home.php?mod=space&uid=266161]@return[/url] none
  47. *
  48. *****************************************************************************/
复制代码


 楼主| enginezhong 发表于 2017-10-30 16:30 | 显示全部楼层
  1. /******************************************************************************
  2. *
  3. * @brief define interrupt service routines referenced by the vector table.
  4. *
  5. * Note: Only "vectors.c" should include this header file.
  6. *
  7. *******************************************************************************
  8. ******************************************************************************/

  9. #ifndef __ISR_H
  10. #define __ISR_H


  11. /* Example */
  12. /*
  13. #undef  VECTOR_036
  14. #define VECTOR_036 RTC_Isr

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

  18. /*!
  19. * @brief define interrupt service routine for different vectors.
  20. *
  21. */
  22. #undef  VECTOR_036
  23. #define VECTOR_036      RTC_Isr          /*!< Vector 36 points to RTC interrupt service routine */

  24. extern void RTC_Isr(void);

  25. #endif  //__ISR_H

  26. /* End of "isr.h" */
复制代码
 楼主| enginezhong 发表于 2017-10-30 16:31 | 显示全部楼层
bootloader_demo.rar (1008 Bytes, 下载次数: 14)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

29

主题

218

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部