Does JLink SDK support WFi WFE commands?

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Hi Hila,

    What exactly are you looking for?
    The WFI and WFE are core instructions. They have nothing to do with the J-Link API...
    If your target application makes use of these instructions, it depends on the device you are using, if you are able to debug the device when using them
    because it depends on what clocks are turned off while a WFI / WFE is active.
    On the STM32F0 / F1 / F2 / F4 / L series devices, I know it is supported because the relevant clocks for debugging are not turned off.


    Best regards
    Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello Alex,


    Sorry for the delay, we were on Holiday for several days.


    I'm afraid I was not clear enough.


    Our task is to validate a product which is based on an IP of ARM M4, M0 or A9 (dual core).
    We use the Segger Jlink DLL to configure and read registers or memory and to operate various HW modules thru USB while executing FW on the product.
    So far we never ran into an operation we wanted to perform thru the DLL but was missing from the SDK.

    As part of the validation we measure power consumption. For that purpose we need the WFI/WFE
    One option is to run a dedicated FW which "listens" to a pipe in memory and performs WFI/WFE from the core side. However it means that we cannot run the test using our production FW.

    Does the SDK include any wrapping for these commands?

    Many Thanks,

    Hila
  • Hi Hila,

    I still do not understand what you are looking for....

    We use the Segger Jlink DLL to configure and read registers or memory and to operate various HW modules thru USB while executing FW on the product.

    Does this mean, you use J-Link, to download a certain firmware on the target, then set the PC (program counter)
    to the start of the firmware and execute it. This firmware will then perform some tests.
    ???

    As part of the validation we measure power consumption. For that purpose we need the WFI/WFE
    One option is to run a dedicated FW which "listens" to a pipe in memory and performs WFI/WFE from the core side. However it means that we cannot run the test using our production FW.

    To execute an WFI/WFE, the CPU needs to perform a WFI/WFE.
    So you will need an application that enters WFI/WFE state, in any case.
    It is not possible to force a WFI/WFE by setting some magic registers via JTAG etc. if this is what you are looking for...

    What you can do:
    Generate a small application (basically it is just 2 instructions...) that just performs:
    __asm("WFI");
    do {} while (1);

    Download this into RAM, set the PC to the start of this application and let the CPU run.
    It will then enter the low power mode.
    But not sure what else expect the WFI/WFE you need to perform, since I do not have any information about your test setup

    Hope it helps anyhow...


    - Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Alex,

    Thanks.. I'm afraid the solution of writing a FW to do the WFI is not quite what we wanted because we were interested in testing power consumption while our commercial FW is running..

    I guess it's just not supported.

    Better luck for us next time.
    ^^


    Many Thanks!

    Hila