MKL27Z256VLH4 can not switch from Run to Vlpr


MKL27Z256VLH4 can not switch from Run to Vlpr

1,112 次查看
Contributor I

I use MKL27Z256VLH4 to implement bootloader(range 0-32K) + application(range 32K-256K)  scenario.

For bootloader, I modify it base on example AN4764SW_Freescale_HID_Bootloader_r10

it's functions include: connect to PC as usb HID device, and update application via HIDBootloader PC tool.

For application, I modify it base on example of KSDK_1.3.0\examples\frdmkl27z\demo_apps\power_manager_hal_demo.

it's functions include: do power mode switching.

Current, I have strange appearance as below:

First, I set BOOTSRC_SEL of FTFA_FOPT  as 11(set flash 0x40c-0x40f  as 0xfffffffe)

it boot from ROM, bootloader can work as usb hid device and update application successfully,  POR reset.

bootloader load application and application run at Run mode.

two actions as:

1. I switch from Run to Vlpr directly, mcu halt, as debug, I found:

at SMC_HAL_SetPowerModeVlpr, after set PMCTRL_RUNM as 10, it will check  PMSTAT  to confirm it success, but it stucked as below code always unless POR reset:

while (kStatVlpr != SMC_HAL_GetStat(base)) { }.

But switch from Run mode to the other modes(except Vlpr) successfully.

2. I switch from Run to Vlls0, then wakeup it, it will cause reset again(by LLWU  not POR).

    then every power mode can switch freely.

Second, I set BOOTSRC_SEL of FTFA_FOPT  as 00(set flash 0x40c-0x40f  as 0xffff3ffe).

it boot from flash, base this setting, bootloader can not get any USB interrupt anyway, it seems usb hid features invalid.

But application can switch every power mode freely.



when I boot from rom(maybe some code for usb hid solidified), it interfere with power mode switching to Vlpr from every the other power mode.

Could anyone give me answer? plenty thanks!

0 项奖励
1 回复

1,014 次查看
Contributor I

Resolved, DFU(default empty flash boot from ROM) to upgrade bootloader(set boot mode from flash), reset, start from flash to load bootloader always, bootloader can jump to app or upgrade app flash area.

0 项奖励