Hi,
I have another problem with secure of my S12G128 device. If I change configuration field at address 0xFF0F. My new value is 0xFC. After reset FSEC is still 0xFE.
I tried send message after reset with value at address 0xFF0F and second message with FSEC and receive data in my terminal are 0xFC, 0xFE. I tried many resets but result is the same.
Here is my code:
if flasher module:
===============================
.
.
const unsigned char flash_array[] @0xFF08 = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC};
/*
0xFF08-0xFF0B - reserved
0xFF0C - P-Flash Protection byte = 0xFF (default state, protection is disabled)
0xFF0D - D-Flash Protection byte = 0xFF (default state, protection is disabled)
0xFF0E - Flash Nonvolatile byte = 0xFF (default state, watchdog is disabled)
0xFF0F - Flash Security byte = 0xBC (secured)
*/
.
.
in main module:
================================
.
.
#pragma OPTION ADD _CONST_FAR "-CpPPage"
//================== IMPLEMENTACE VEŘEJNÝCH FUNKCÍ ===========
//=============================================================
// Spusteni hlavni funkce loaderu
// Vstupy: bez vstupu
// Vystupy: bez vystupu
// Pozn.:
void main(void)
{
AppExecute_t *pt_AppRestVector;
LONG u32_ResetApplAddr = ((LONG)APPL_END_ADDR) - 1;
volatile BYTE *__far pau8_Cfg = (BYTE *__far)0x3FF0F;
pt_AppRestVector = (AppExecute_t*)((WORD)u32_ResetApplAddr);
PE_low_level_init();
V_Sci0_InitPort();
V_Sci0_PutChar(*pau8_Cfg);
V_Sci0_PutChar(FSEC);
if(u8_Main_WaitForFlashMo
.
.
I do not understand why FSEC is 0xFE if this register is loaded during reset from address 0xFF0F and here is 0xFC.
CW: 5.9.0
Programmer: P&E Multilink
Device: S9S12G128F0CLH
Thanks a lot for any idea.
Mirek