Question: The `STM32F2 micro-controller` has build in capabilities to prevent readout of application code using a debug interface. It works fine and is accomplished pretty easily by configuring the read protection(RDP) level to `'1' (!0xAA || !0xCC) or '2' (0xCC which is irreversible)`. Except trying to turn it off is where i run in to issues.

The expected behavior when the RDP level is lowered back to 0:

* The chip will perform a mass flash erase.
* Followed by clearing the protection flag.
* System reset

Except after a power cycle the flash has been successfully erased but the protection flag remains on level '1' (0x55) keeping the debug interface disabled. And thus preventing me from writing any new application code. It is possible to fiddle around with the debugger and force the flag to level 0 (0xAA) manually though..

Is there anyone who have had the same or similar issues with the `STM32F2xx` series that can help me out? I'm using the `STM32` standard peripheral drivers for programming the flash.

**Enable**

```
// Enable read out protection
FLASH_OB_Unlock();
FLASH_OB_RDPConfig(OB_RDP_Level_1);
FLASH_OB_Launch();
FLASH_OB_Lock();

// Restart platform
NVIC_SystemReset();

```

**Disable**

```
// Disable read out protection
FLASH_OB_Unlock();
FLASH_OB_RDPConfig(OB_RDP_Level_0);
FLASH_OB_Launch();
FLASH_OB_Lock();

// Restart platform
NVIC_SystemReset();

```

Answer: 
Use a parameterized query

```
cmd = New OleDbCommand("Insert into table_petugas (name,status) Values (?,?)", conn)
cmd.Parameters.AddWithValue("@p1", txtname.Text)
cmd.Parameters.AddWithValue("@p2", s) 
cmd.ExecuteNonQuery()

```

This approach pass the work to correctly define the values required by your database fields to the framework code that create a boolean parameter and update your field. 

Of course this will avoid also any possible Sql Injection scenario
Maybe it is your "status" variable which is not present on the code?

```
dim s as boolean
if radiobutton1.checked = true then
s = true
elseif radiobutton2.checked = true then
s = false
end if

cmd = New OleDbCommand("Insert into table_petugas (name,status) Values ('" & txtname.Text & "','" & s & "' )", conn)
cmd.ExecuteNonQuery()
MsgBox("Data Saved!", MsgBoxStyle.Information, "PERHATIAN!")

```