MC56F83789 : The code is working while debug but not working the same code after falshing

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC56F83789 : The code is working while debug but not working the same code after falshing

Jump to solution
298 Views
Aman786
Contributor II

Hi,

 

When the code Debug with MC56F83789 the logic is completely working but flashing the code the logic is not working as expected.

Please look into this issue.

@xiangjun_rong 

0 Kudos
Reply
1 Solution
288 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that the MC56F83789 enters bootloader mode, so the application code is not executed.

Because there is ROM bootloader for MC56F83xxx, so a question arise, how does the
MC56F83xxx enter bootloader mode or execute code in flash directly.
There are two structures in
Flash_config.c to configure flash and ROM.
(a). You can change below values to configure Flash, such as secure or not, backdoo
r key,
boot from ROM or not, etc.
static
const uint8_t _flash_config_field [] =
/* NV_BACKKEY3: KEY=0xFF
0xFFU,
/* NV_BACKKEY2: KEY=0xFF
0xFFU,
/* NV_BACKKEY1: KEY=0xFF
0xFFU,
/* NV_BACKKEY0: KEY=0xFF
0xFFU,
/* NV_BACKKEY7: KEY=0xFF
0xFFU,
/* NV_BACKKEY6: KEY=0xFF
0xFFU,
/* NV_BACKKEY5: KEY=0xFF
0xFFU,
/* NV_BACKKEY4: KEY=0xFF
0xFFU,
/* NV_FPROT3: PROT=0xFF
0xFFU,
/* NV_FPROT2: PROT=0xFF
0xFFU,
/* NV_FPROT1: PROT=0xFF
0xFFU,
/* NV_FPROT0: PROT=0xFF
0xFFU,
/* NV_FSEC: KEYEN=1,MEEN=3,FSLACC=3,SEC=2 (Note: set SEC to
00b for secure) */
0x7EU,
/* NV_FOPT: FOPT[7:6] = 11b means boot from ROM, other value
means boot from Flash */
0x3FU,
/* Reserved
0xFFU,
/* Rese rved */
0xFFU

};
For the above red 0x3F data, it’s bit7 and bit6 are zero, it means the MC56F83xxx starts
from Flash. If the data is changed to 0xFF, it means the MC56F83xxx starts from
bootloader after Reset.

Hope it can help you

BR

XiangJun Rong

View solution in original post

1 Reply
289 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that the MC56F83789 enters bootloader mode, so the application code is not executed.

Because there is ROM bootloader for MC56F83xxx, so a question arise, how does the
MC56F83xxx enter bootloader mode or execute code in flash directly.
There are two structures in
Flash_config.c to configure flash and ROM.
(a). You can change below values to configure Flash, such as secure or not, backdoo
r key,
boot from ROM or not, etc.
static
const uint8_t _flash_config_field [] =
/* NV_BACKKEY3: KEY=0xFF
0xFFU,
/* NV_BACKKEY2: KEY=0xFF
0xFFU,
/* NV_BACKKEY1: KEY=0xFF
0xFFU,
/* NV_BACKKEY0: KEY=0xFF
0xFFU,
/* NV_BACKKEY7: KEY=0xFF
0xFFU,
/* NV_BACKKEY6: KEY=0xFF
0xFFU,
/* NV_BACKKEY5: KEY=0xFF
0xFFU,
/* NV_BACKKEY4: KEY=0xFF
0xFFU,
/* NV_FPROT3: PROT=0xFF
0xFFU,
/* NV_FPROT2: PROT=0xFF
0xFFU,
/* NV_FPROT1: PROT=0xFF
0xFFU,
/* NV_FPROT0: PROT=0xFF
0xFFU,
/* NV_FSEC: KEYEN=1,MEEN=3,FSLACC=3,SEC=2 (Note: set SEC to
00b for secure) */
0x7EU,
/* NV_FOPT: FOPT[7:6] = 11b means boot from ROM, other value
means boot from Flash */
0x3FU,
/* Reserved
0xFFU,
/* Rese rved */
0xFFU

};
For the above red 0x3F data, it’s bit7 and bit6 are zero, it means the MC56F83xxx starts
from Flash. If the data is changed to 0xFF, it means the MC56F83xxx starts from
bootloader after Reset.

Hope it can help you

BR

XiangJun Rong