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

 找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 3534|回復(fù): 2
打印 上一主題 下一主題
收起左側(cè)

STM32F4xx官方IAP源碼

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:622511 發(fā)表于 2019-10-11 20:07 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
STM32F4xx官方IAP源碼

單片機(jī)源程序如下:
  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****/
復(fù)制代碼

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


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

使用道具 舉報(bào)

沙發(fā)
ID:565307 發(fā)表于 2020-7-2 15:17 | 只看該作者
這個(gè)實(shí)例是在官方哪兒下載的
回復(fù)

使用道具 舉報(bào)

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

使用道具 舉報(bào)

本版積分規(guī)則

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

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: 国产不卡一区在线观看 | 特黄小视频 | 在线观看免费观看在线91 | 亚洲第1页 | 欧美在线观看免费观看视频 | 精品粉嫩aⅴ一区二区三区四区 | 精品久久久久久红码专区 | 久久精品 | 色综合国产 | 日韩欧美国产不卡 | 国产91视频播放 | av免费电影在线 | 黄色a视频 | www.国产精品 | 国产精品a久久久久 | 91免费在线看 | 亚洲第一视频网站 | 国产精品亚洲一区二区三区在线观看 | 九九热精品视频 | 性欧美hd | 综合精品 | 日韩av一区二区在线 | 午夜视频在线观看网站 | 国产片淫级awww | 欧美日韩国产三级 | 欧美综合一区二区三区 | 五月激情婷婷六月 | 成人精品一区二区三区中文字幕 | 久久久国产一区二区 | 中文字幕在线观看 | 日韩一区二区不卡 | 国产精品99一区二区 | 欧美一区二区三区在线 | 麻豆国产一区二区三区四区 | 孕妇一级毛片 | 国产一级视频免费播放 | 91av小视频 | 亚洲精品在线视频 | 国产不卡视频 | 波多野结衣一区二区三区 | 久久久久久久久久久久久9999 |