Forum: Mikrocontroller und Digitale Elektronik STM32 Read-Out Protection geht nicht?


von Plan (Gast)


Lesenswert?

Hallo,

Ich bin gerade dabei die Read-Out Protection benutzen zu wollen, doch 
der belässt den Code ohne diese Protection.
1
void __boot FW_UU_Reset(void)
2
{
3
    FW_Flash_Busy();
4
    FLASH->OPTKEYR = FLASH_KEY1;
5
    FLASH->OPTKEYR = FLASH_KEY2;
6
    FLASH->CR |= 0x20;  // CR_OPTER_Set
7
    FLASH->CR |= 0x40;  // CR_STRT_Set
8
    FW_Flash_Busy();
9
    FLASH->CR &= 0x1FDF;// CR_OPTER_Reset
10
    FLASH->CR |= 0x10;  // CR_OPTPG_Set
11
    OB->RDP = 0x00;  // Read-Out-Protection
12
    FW_Flash_Busy();
13
    FLASH->CR &= 0x1FEF;
14
    *(u32*)0xE000ED0C = 0x05FA0001; // Application Interrupt and Reset Control Register vom Cortex-M3
15
    while(1);
16
}

Das Ziel sollte sein die Read-Out Protection zu setzen und dann einen 
Reset zu machen. Reset macht er, aber das OB->RDP wird nicht auf 0x00 
gesetzt. Es bleibt auf 0xA5.

Der Code aus der FW-Lib "FLASH_ReadOutProtection(ENABLE);" geht auch 
nicht.
STM32F103RC / GCC.

Hatte schon mal jemand das Problem? Bzw. gelöst?
Vielen Dank im Voraus für eure Unterstützung.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.