aleelove 发表于 2014-7-17 20:08:23

STVP 如何将Option Byte 里的ROP改为disable

 菜鸟求助,先谢过各位高手。
现象是这样的,我做的是蜂鸣器的功能,程序里有改写Option Byte,我的芯片烧写几次之后就不能烧写了。错误如下面提示。看到有帖子说在Option Byte里面的ROP改为disable,再enable就可以解决问题。但是我打开Option Byte发现ROP只有"READ OUT PROTECTION ON"和"READ OUT PROTECTION OFF”选择。我试了这两项都不行。请高手指教一下,我的程序功能是实现了的。再次谢谢各位。
错误提示:
Programming  PROGRAM MEMORY area...
Error : Error on Option Bytes (complementary bytes). Reprogram Option Bytes of device
Error : < PROGRAM MEMORY programming failed.
Error : < Operation aborted.
我的程序:
 
 

aleelove 发表于 2014-7-17 20:09:20

RE:STVP 如何将Option Byte 里的ROP改为disable

#include "stm8s.h"
#include "stm8s105C6.h"
#include "stm8s_beep.h"
#include "stm8s_flash.h"
#include "stm8s_clk.h"
#include "stm8s_gpio.h"
void delay(unsigned int x)
{
        unsigned int m,n;
        for(m=x;m>0;m--)
                for(n=200;n>0;n--);
}
void BEEPer_Init(void)
{
   int i;
    FLASH_DUKR = 0xae;
                  ;
    FLASH_DUKR = 0x56;
                        ;
                i=10;
                while(i--);
          while(!(FLASH_IAPSR & 0x08));
           FLASH_CR2 = 0x80;
      i=10;
                while(i--);
    FLASH_NCR2 = 0x7f;
                i=10;
                while(i--);
    *((unsigned char *)0x4803) = 0x80;
      i=10;
                while(i--);
    *((unsigned char *)0x4804) = 0x7f;
}
main()
{
        BEEPer_Init();
       while(1)
        {
                BEEP_CSR = 0x2e;
                delay(1500);
                BEEP_CSR = 0x20;
                delay(1500);
        }
       
}

zykzyk-93033 发表于 2014-7-17 21:07:23

RE:STVP 如何将Option Byte 里的ROP改为disable

应该是可以的啊:D

aleelove 发表于 2014-7-17 21:26:17

回复:STVP 如何将Option Byte 里的ROP改为disable

回复第 3 楼 于2014-07-17 21:07:23发表:
应该是可以的啊:D我的STVP版本是4.3.2,里面没有这个选项啊,求指点,谢谢 

aleelove 发表于 2014-7-18 08:01:42

RE:STVP 如何将Option Byte 里的ROP改为disable

版主能解答一下吗,谢谢

aleelove 发表于 2014-7-18 08:48:31

RE:STVP 如何将Option Byte 里的ROP改为disable

解决了 谢谢各位的关注将选项字节清零即可
页: [1]
查看完整版本: STVP 如何将Option Byte 里的ROP改为disable