56f83xxx bootloader question

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

56f83xxx bootloader question

Jump to solution
1,435 Views
Ben
Senior Contributor I

Hello

I saw in the documentations that it is possible to run the bootloader from the user application firmware. Anyone know how to do it?

Ben

0 Kudos
1 Solution
1,397 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

As you know that the FOPT register is loaded from the flash configuration field at address 0x40D in flash memory after Reset, so it is impossible that you write the FOPT directly in order to run from flash directly after next Reset. Instead, you have to write the FOPT location in flash configuration field.

For detailed inf, pls refer to section 6.3.2 Start-up Process in the MC56F83xxxRM.pdf.

In the SDK example, we provide flash_config.c and Flash_config.h, as the following screenshot, pls change the macro

#define FCF_FLASH_OPTION_BYTE 0xFFU

to

#define FCF_FLASH_OPTION_BYTE 0x7EU

The flash configuration field corresponding FOPT location will be changed.

the DSC will start running from flash directly.

 

xiangjun_rong_0-1676256388978.png

 

 

 

6.3.2 Start-up Process
Any of the following conditions will force the hardware to start the Bootloader:
• FOPT [7:6] is set to 2'b11. This forces the ROM to run out of reset.
• A user applications running on flash or RAM calls into the Bootloader entry point
address in ROM, 0x780E7 for this device, to start Bootloader execution.
The FOPT register determines the boot source. The FOPT register is loaded from the
flash configuration field at address 0x40D in flash memory. The value of
FOPT[7:6]&(~SIM_BOOT_MODE_OVERRIDE[BOOT_OVERRIDE]) determines the
boot option: value 11b means booting from ROM, while any other value means booting
from flash. Flash memory defaults to all 1s when erased, and
SIM_BOOT_MODE_OVERRIDE[BOOT_OVERRIDE] is 00b after power on reset, so a
blank chip will automatically boot to ROM. See the "FTFE_FOPT Register" section in
the "Chip Configuration" chapter for more details.
When the ROM is executed out of reset, vector fetches from the CPU are redirected to
the ROM's vector table in ROM memory at offset 0x07_8000. This ensures that any
exceptions will be handled by the ROM.
After the Bootloader has started, the following procedure starts bootloader operations

 

Hope it can help you

BR

XiangJun Rong

View solution in original post

5 Replies
1,423 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Ben,

On PC side, you can use blhost.exe to communicate with the bootloader on MC56F83xxx through uart.

You can download blhost from the website:

https://www.nxp.com/webapp/sps/download/license.jsp?colCode=blhost_2.6.7&appType=file1&DOWNLOAD_ID=n...

Hope it can help you

BR

XiangJun Rong

0 Kudos
1,391 Views
Ben
Senior Contributor I

in the chip RM it is written: "Multiple options for executing the bootloader either at system start-up or under
application control at runtime". How do activate the bootloader "under application control at runtime"?

0 Kudos
1,411 Views
Ben
Senior Contributor I

Thanks Rong, but I mean, is it possible to access the FOPT register from my application while it is running to set the register that next reset will run the bootloader, or the only way to change the reg. value is through the sdk programming / debugging?

0 Kudos
1,398 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

As you know that the FOPT register is loaded from the flash configuration field at address 0x40D in flash memory after Reset, so it is impossible that you write the FOPT directly in order to run from flash directly after next Reset. Instead, you have to write the FOPT location in flash configuration field.

For detailed inf, pls refer to section 6.3.2 Start-up Process in the MC56F83xxxRM.pdf.

In the SDK example, we provide flash_config.c and Flash_config.h, as the following screenshot, pls change the macro

#define FCF_FLASH_OPTION_BYTE 0xFFU

to

#define FCF_FLASH_OPTION_BYTE 0x7EU

The flash configuration field corresponding FOPT location will be changed.

the DSC will start running from flash directly.

 

xiangjun_rong_0-1676256388978.png

 

 

 

6.3.2 Start-up Process
Any of the following conditions will force the hardware to start the Bootloader:
• FOPT [7:6] is set to 2'b11. This forces the ROM to run out of reset.
• A user applications running on flash or RAM calls into the Bootloader entry point
address in ROM, 0x780E7 for this device, to start Bootloader execution.
The FOPT register determines the boot source. The FOPT register is loaded from the
flash configuration field at address 0x40D in flash memory. The value of
FOPT[7:6]&(~SIM_BOOT_MODE_OVERRIDE[BOOT_OVERRIDE]) determines the
boot option: value 11b means booting from ROM, while any other value means booting
from flash. Flash memory defaults to all 1s when erased, and
SIM_BOOT_MODE_OVERRIDE[BOOT_OVERRIDE] is 00b after power on reset, so a
blank chip will automatically boot to ROM. See the "FTFE_FOPT Register" section in
the "Chip Configuration" chapter for more details.
When the ROM is executed out of reset, vector fetches from the CPU are redirected to
the ROM's vector table in ROM memory at offset 0x07_8000. This ensures that any
exceptions will be handled by the ROM.
After the Bootloader has started, the following procedure starts bootloader operations

 

Hope it can help you

BR

XiangJun Rong

1,390 Views
Ben
Senior Contributor I

sorry, I did not see your last answer below. thank you for the support and for the detailed answer.

Ben

0 Kudos