久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3554|回復: 2
打印 上一主題 下一主題
收起左側

STM32F4xx官方IAP源碼

[復制鏈接]
跳轉到指定樓層
樓主
ID:622511 發表于 2019-10-11 20:07 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
STM32F4xx官方IAP源碼

單片機源程序如下:
  1. /* Includes ------------------------------------------------------------------*/
  2. #include "menu.h"
  3. #include "stm324xg_eval.h"

  4. /* Private typedef -----------------------------------------------------------*/
  5. /* Private define ------------------------------------------------------------*/
  6. /* Private macro -------------------------------------------------------------*/
  7. /* Private variables ---------------------------------------------------------*/
  8. extern pFunction Jump_To_Application;
  9. extern uint32_t JumpAddress;

  10. /* Private function prototypes -----------------------------------------------*/
  11. static void IAP_Init(void);

  12. /* Private functions ---------------------------------------------------------*/

  13. /**
  14.   * @brief  Main program.
  15.   * @param  None
  16.   * @retval None
  17.   */
  18. int main(void)
  19. {
  20.   /* Unlock the Flash Program Erase controller */
  21.   FLASH_If_Init();

  22.   /* Initialize Key Button mounted on STM324xG-EVAL board */
  23.   STM_EVAL_PBInit(BUTTON_KEY, BUTTON_MODE_GPIO);

  24.   /* Test if Key push-button on STM324xG-EVAL Board is pressed */
  25.   if (STM_EVAL_PBGetState(BUTTON_KEY) == 0x00)
  26.   {
  27.     /* Execute the IAP driver in order to reprogram the Flash */
  28.     IAP_Init();
  29.     /* Display main menu */
  30.     Main_Menu ();
  31.   }
  32.   /* Keep the user application running */
  33.   else
  34.   {
  35.     /* Test if user code is programmed starting from address "APPLICATION_ADDRESS" */
  36.     if (((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
  37.     {
  38.       /* Jump to user application */
  39.       JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);
  40.       Jump_To_Application = (pFunction) JumpAddress;
  41.       /* Initialize user application's Stack Pointer */
  42.       __set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);
  43.       Jump_To_Application();
  44.     }
  45.   }

  46.   while (1)
  47.   {}
  48. }

  49. /**
  50.   * @brief  Initialize the IAP: Configure USART.
  51.   * @param  None
  52.   * @retval None
  53.   */
  54. void IAP_Init(void)
  55. {
  56. USART_InitTypeDef USART_InitStructure;

  57.   /* USART resources configuration (Clock, GPIO pins and USART registers) ----*/
  58.   /* USART configured as follow:
  59.         - BaudRate = 115200 baud  
  60.         - Word Length = 8 Bits
  61.         - One Stop Bit
  62.         - No parity
  63.         - Hardware flow control disabled (RTS and CTS signals)
  64.         - Receive and transmit enabled
  65.   */
  66.   USART_InitStructure.USART_BaudRate = 115200;
  67.   USART_InitStructure.USART_WordLength = USART_WordLength_8b;
  68.   USART_InitStructure.USART_StopBits = USART_StopBits_1;
  69.   USART_InitStructure.USART_Parity = USART_Parity_No;
  70.   USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
  71.   USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;

  72.   STM_EVAL_COMInit(COM1, &USART_InitStructure);
  73. }

  74. #ifdef USE_FULL_ASSERT
  75. /**
  76.   * @brief  Reports the name of the source file and the source line number
  77.   *         where the assert_param error has occurred.
  78.   * @param  file: pointer to the source file name
  79.   * @param  line: assert_param error line source number
  80.   * @retval None
  81.   */
  82. void assert_failed(uint8_t* file, uint32_t line)
  83. {
  84.   /* User can add his own implementation to report the file name and line number,
  85.      ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  86.   /* Infinite loop */
  87.   while (1)
  88.   {
  89.   }
  90. }
  91. #endif

  92. /**
  93.   * @}
  94.   */

  95. /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
復制代碼

所有資料51hei提供下載:
STM32F4xx_AN3965_V1.0.0.7z (1.07 MB, 下載次數: 60)


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏2 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:565307 發表于 2020-7-2 15:17 | 只看該作者
這個實例是在官方哪兒下載的
回復

使用道具 舉報

板凳
ID:606388 發表于 2020-9-11 15:00 | 只看該作者
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 亚洲一区二区精品视频 | 99久久精品免费看国产小宝寻花 | 日韩精品一区二区三区视频播放 | 久久久久久网站 | 91精品国产91久久久久久吃药 | 国产精品我不卡 | 日本电影免费完整观看 | 免费在线观看一区二区三区 | 97视频免费 | 国产网站在线免费观看 | 国产精品一区二区精品 | 一区二区三区四区在线视频 | 欧美激情精品久久久久久变态 | 91一区二区三区在线观看 | 欧美三级视频 | 午夜在线视频 | 国产97碰免费视频 | 操操网站 | 国产精品一区二区免费 | 在线免费观看日本视频 | 日日夜夜精品 | 久久亚洲一区二区三 | 亚洲精品免费观看 | 国内自拍偷拍 | 日日操视频| 久久精品一区二区三区四区 | 日韩美女一区二区三区在线观看 | 在线观看国产wwwa级羞羞视频 | 精品国产伦一区二区三区观看体验 | 狠狠干狠狠操 | 亚洲成人网在线播放 | 91精品国产色综合久久不卡98 | 一区二区三区四区国产 | 黄色大片在线视频 | 日韩免费毛片视频 | 中文字幕一区在线观看视频 | 中文字幕四虎 | 亚洲看片| 日韩一区二区三区视频 | 欧美日日日日bbbbb视频 | 国产精品成人一区二区三区夜夜夜 |