Control PWM in MCUboot

To output PWM signal as early as possible after powering on the NRF5340DK, I added the same code in mcuboot/boot/zephy/main.c and mcuboot.overlay as in the app core. This allows the bootloader to generate the PWM signal during its execution. However, when the net core initializes, the PWM signal is interrupted and does not resume until the app core is ready. How can I avoid this problem? 

Thank u for reading.

  • Hello,

    The temporary disruption might be due to the reconfiguration of shared resources when the net core initializes. Could you try delaying the net core initialization until the app core has fully booted and taken control of the PWM?

    You can do this by using the NETWORK.FORCEOFF register. Please refer to pages 67 and 71 of the datasheet for more details. Keep this thread as a reference, as it discusses the NETWORK.FORCEOFF configuration.

    Start the PWM in the app core as soon as possible after boot and perform any other necessary initializations required by the app core, ensuring no interference. Once the app core has initialized the PWM and is ready for the net core to start, it can clear the NETWORK.FORCEOFF register to release the net core.

    I’m not completely certain if this is the right method, but please give it a try and let me know the outcome.

    Kind regards,
    Abhijith

Related