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.

Parents
  • 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

  • Sorry for the late reply. This method doesn’t seem to work, as the netcore is initialized first and the PWM settings have already been reset. So app core set FORCEOFF is already too late. On the other hand, I have tried to set FORCEOFF in mcuboot. But it doesn't work, either.

  • Hi bf-wei,

    Could you please give more information on what happen when MCUboot jumps to the application core? What exactly happen when "PWM signal is interrupted?"

    What is the expectation before and after MCUboot pass processing to application?

    Hieu

  • Hello,

    My goal is to output a PWM signal during the MCUboot stage and have it continue uninterrupted until the app core is initialized. However, it seems that the net core resets the GPIO configuration in the process. Could I do something to avoid it?

Reply Children
  • Hi bf-wei,

    My apologies for the late follow-up. There was a holiday period, and it seems no one was able to look into this case while I was out of office.
    I have now returned and will resume helping you.

    Do I understand right that you just need a simple constant PWM signal, no change in duty cycle or period?

    I am not certain it is the netcore that causes the reset there. We might need to reinvestigate the cause.

    Do you mind sharing the modified MCUboot code for me to reproduce the issue? I assume the application can be as simple as Hello World with PWM drivers enabled.

Related