打印
[AT32F421]

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

[复制链接]
453|5
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
nokiagx|  楼主 | 2023-6-29 21:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
各位好,雅特力读保护函数是那个呀?
以下是STM32的读保护函数,请各位大佬帮改改
uint32_t Flash_EnableReadProtection(void) //读保护
{
  /* Returns the FLASH Read Protection level. */
  if( FLASH_OB_GetRDP() == RESET )
  {
    /* Unlock the Option Bytes */
    FLASH_OB_Unlock();
   
    /* Sets the read protection level. */
    FLASH_OB_RDPConfig(OB_RDP_Level_1);
   
    /* Start the Option Bytes programming process. */  
    if (FLASH_OB_Launch() != FLASH_COMPLETE)
    {
      /* Disable the Flash option control register access (recommended to protect
         the option Bytes against possible unwanted operations) */
      FLASH_OB_Lock();
      
      /* Error: Flash read unprotection failed */
      return (2);
    }
  
    /* Disable the Flash option control register access (recommended to protect
       the option Bytes against possible unwanted operations) */
    FLASH_OB_Lock();

    /* Read Protection successfully enable */
    return (1);
  }
        return(0);
}

使用特权

评论回复
沙发
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 ...

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

使用特权

评论回复
评论
nokiagx 2023-6-30 11:21 回复TA
@muyichuan2012 :原来是这个呀,函数说明和STM不一样,谢谢!谢谢! 
muyichuan2012 2023-6-30 11:04 回复TA
AT32的定义是flash_fap_enable fap(访问保护),即ST的RDP 读保护 
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

10

主题

38

帖子

0

粉丝