[AT32F421] 雅特力读保护函数是那个呀?

[复制链接]
 楼主| nokiagx 发表于 2023-6-29 21:48 | 显示全部楼层 |阅读模式
各位好,雅特力读保护函数是那个呀?
以下是STM32的读保护函数,请各位大佬帮改改
  1. uint32_t Flash_EnableReadProtection(void) //读保护
  2. {
  3.   /* Returns the FLASH Read Protection level. */
  4.   if( FLASH_OB_GetRDP() == RESET )
  5.   {
  6.     /* Unlock the Option Bytes */
  7.     FLASH_OB_Unlock();
  8.    
  9.     /* Sets the read protection level. */
  10.     FLASH_OB_RDPConfig(OB_RDP_Level_1);
  11.    
  12.     /* Start the Option Bytes programming process. */  
  13.     if (FLASH_OB_Launch() != FLASH_COMPLETE)
  14.     {
  15.       /* Disable the Flash option control register access (recommended to protect
  16.          the option Bytes against possible unwanted operations) */
  17.       FLASH_OB_Lock();
  18.       
  19.       /* Error: Flash read unprotection failed */
  20.       return (2);
  21.     }
  22.   
  23.     /* Disable the Flash option control register access (recommended to protect
  24.        the option Bytes against possible unwanted operations) */
  25.     FLASH_OB_Lock();

  26.     /* Read Protection successfully enable */
  27.     return (1);
  28.   }
  29.         return(0);
  30. }
muyichuan2012 发表于 2023-6-30 09:00 | 显示全部楼层
421 bsp里有现成案例
AT32F421_Firmware_Library/ project / at_start_f421 / examples / flash / fap_enable
 楼主| nokiagx 发表于 2023-6-30 09:00 | 显示全部楼层
雅特力的函数和STM32的对不上,相差太远了
 楼主| nokiagx 发表于 2023-6-30 09:01 | 显示全部楼层
muyichuan2012 发表于 2023-6-30 09:00
421 bsp里有现成案例
AT32F421_Firmware_Library/ project / at_start_f421 / examples / flash / fap_enab ...

我都知道有现成案例,就是找不到这个读保护函数

点评

[url=home.php?mod=space&uid=1886524]@muyichuan2012[/url] :原来是这个呀,函数说明和STM不一样,谢谢!谢谢!  发表于 2023-6-30 11:21
AT32的定义是flash_fap_enable fap(访问保护),即ST的RDP 读保护  发表于 2023-6-30 11:04
您需要登录后才可以回帖 登录 | 注册

本版积分规则

10

主题

38

帖子

0

粉丝
快速回复 返回顶部 返回列表