This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2340R5: MCUBOOT with LFRCOSC

Part Number: CC2340R5
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

My customer is using a board without an external 32kHz crystal. The software project is based on MCUBOOT + basic_ble_dual_image_onchip_oad, both of them have a configuration to choose the LF clock source.

In basic_ble_dual_image_onchip_oad, I found a call of  PowerLPF3_selectLFOSC which seems to overwrite the clock source configuration in CCFG:

My question is if it is still necessary to set the LF clock source in MCUBOOT?

It looks the LF clock source is called no where inside MCUBOOT project except for the CCFG bit. I have a few questions needed to be clarified:

  1. Does CC2340 go to standby in MCUBOOT? I did not find any code to invoke the power policy in MCUBOOT.
  2. If no power policy is used, what is the default clock source in MCUBOOT? Does it use the 48MHz clock all the way?
  3. If I set LF clock source to LFXOSC in MCUBOOT and LFRCOSC in basic_ble_dual_image_onchip_oad, is CC2340 able to switch to LFRCOSC after jumping into basic_ble_dual_image_onchip_oad? Is there any risk?

Best regards,

Shuyang

  • Hi !

    When changing the LF clock source in SysConfig, you can see which files change on the right side of the GUI.
    For the basic_ble_onchip_oad example, two files change : ti_ble_config.h and ti_drivers_config.c

    The changes are the following : 

    This means that when switching clocks, only these two lines change in the source files generated by sysconfig.

    Unlike the oad example, for the mcuboot example, switching the clock changes nothing in the generated files. When looking at the Board_init function in the MCUBoot example, the power manager is never turned on, so the MCUBoot example never goes into standby. This makes sense because the only thing MCUBoot does is checking the images in the images slot in flash, check if the signature is correct, and boot into the image. It does not need to enter standby, as it is never waiting for an external input or for an interrupt.

    For your last question, the CC2340 is able to switch to LFRCOSC after jumping into basic_ble_dual_image_onchip_oad, because MCUBoot doesn't set the clock.

    Kind regards,
    Maxence