M8108 problems with low power mode

We are using the M8108 on a custom PCB with a NXP RW612 as the main processor. The system is running Zephyr 4.4. I started with your MM-iot-sdk 2.10.4 porting it forward main involved handling recent MBEDTLS Zephyr changes. To get the M8108 to enter low power mode I had to turn on a pull-down on the Busy line.

The application I am running will power up connect to the network, then a MQTT broker, and then publish JSON every 5 seconds. You can see the power and logic analyzer trace as it successfully completes 10 cycles. After which it fails to return to low power mode. The number of cycles it completes before failing varies. I have seen as many as 40. I can decode the SPI traffic if that would be helpful.

The failure presents as WAKE and IRQ staying high.

I am going to spend today working with your newer 2.13.1 release but I did not see anything in the release notes that seemed to describe what I am seeing.

I would be happy to share schematics and layout information but not so publicly.


I just finished moving to the 2.13.1 SDK the behavior is largely the same. The power consumption profile seems to show a slight improvement at the beginning of the test as the module joins the network. Once it gets connected the behavior appears the same. It completed 17 wakeup, publish, and go back to sleep before it failed with the WAKE and IRQ lines high.

Hey @Roy

Have you had a look at GitHub - MorseMicro/mm-iot-zephyr · GitHub, which is our Zephyr port of the MM IoT SDK. This might gove some insights into power consumption.

On our reference platform (EKH05 we see an idle consumption current of ~150uA with the power management variant, and do not see the issue you’ve described. I have some power profile captures lying around which I can attach.

Yes that is the code I started with. The first traces were done with version 2.10.4 and the second with 2.13.1. The MM8108 starts out entering and exiting low power mode as expected then fails. I have the SPI decoded if that would help. I have not found any documentation that explains the driver to MM8108 interactions.

Please send the SPI traces through.

HaLow.zip (6.7 MB)

I also shared the information in the zip with other MorseMicro employee Eric. Eric has the schematic also.

The SPI lines connecting the main module and the MM8108 are short and length matched. I included an image with the SPI bus traces highlighted file Badge_SPI_bus.png.

If you look at the attached file DeviceTreeMorseMicro.txt you will see how we have the module connected.

We are using PM2 Suspend for power savings. In the file DeviceTreePower.txt has the settings describing our low power setup. These recordings were made with low power enabled. However we wait until DHCP completes before we enable it.

else if (msg.type == MSG_EVT_DHCP_READY)  {
  release_connect_pm_lock();
  LOG_INF("Network ready (profile %u: %s)",current_profile,   g_wifi_profiles[current_profile].ssid);

//this was proven necessary. stops a constant stream of
//E 5114913 dr morse_yaps_hw_read_pkt[471] Invalid RX delim
if (g_wifi_profiles[current_profile].radio == RADIO_HALOW)
{
	enum mmwlan_status ps_rc = mmwlan_set_power_save_mode(MMWLAN_PS_ENABLED);

The files in SpiIrqEdge were generated with the default MorseMicro driver code which configures all the interrupts for edges.

The files specific to the Edge run are:

Edge_gpio_pin_interrupt.txt – code configuring the pin interrupts

Run20261021_0130_LogicAndPower_Trace.png – Picture of logic and power traces

Run20261021_0130_RTTDebug.txt – Debug output collected during the run

Run20261021_0130_SPI.txt – SPI traffic decoded by the logic analyzer

You can see the code changes in a git diff to switch to using a level interrupt for SPI_IRQ in SwitchToLevel.txt.

The files specific to the Level run are:

Level_gpio_pin_interrupt.txt – code configuring the pin interrupts

Run20261021_1030_LogicAndPower_Trace.png – Picture of logic and power traces

Run20261021_1030_RTTDebug.txt – Debug output collected during the run

Run20261021_1030_SPI.txt – SPI traffic decoded by the logic analyzer

In June I ported the mm-iot-zephyr which used mm-iot-sdk 2.10.4 to Zephyr 4.4. Due to the fact that the mm-iot-zephyr targeted Zephyr 3.7 I was forced to make several changes. They primarily dealt with Zephyr changes after 3.7 to mbedtls. The code was reliable as long as I did not turn on low power.

After spending a week trying to resolve the issues with low power I reached out for help. At that point I switched to your latest mm-iot-zephyr which uses mm-iot-sdk 2.13.1 and targets Zephyr 4.4.2. I did not have to make any changes to the MorseMicro code to get it to build and run. The latest code is not stable when low power is enabled. I have seen the code run for more than 100 transactions when low power is not in use.

Hi Ray,

actually I implemented low power mode on nRF54L15. I guess you issue is because trigger power saving will wait the mm8108 idle, if it’s not idle, will not go to sleep. Maybe you need to check your math whether it’s really released connection. Here is the low power mode I reached.

My problem is not getting into low power mode. The problem is exiting low power mode is not reliable. Sometimes it will work 5 time others 20 but pretty quickly it stops behaving properly.

I ordered a MM8108-EKH05 so I can compare the signals and run our code on it as a sanity check.

Given the wake line is held and the SPI IRQ + BUSY are not, that suggests the mm chip doesn’t have any outstanding work, and the host thinks it does (but is not doing it for some reason).

I think the best next steps for you is to investigate on the host side what is the wake source.

The Zephyr port builds against the precompiled morselib library which has mangled symbols. It looks like it does not have support for compiling against the morselib source code directly, which makes it challenging to debug.
If you’re up for it, you could have a go compiling the mm-iot-sdk morselib and supplicant code into a morselib.a lib file to link against, without stripping out the debug symbols. Have a look at how BUILD_MORSELIB_FROM_SOURCE is used to compile the code, but instead of compiling an application, just compile a .a library file. This isn’t a standard workflow today, so we don’t have existing tooling, but if you get it working you’ll be able to inspect state a lot easier.
If you do get it working,

Edit - libmorse is actually compiled from source in the zephyr port so the symbol is available.

Best spot to start is inspecting the state in driver_data.ps.

FYI @ajudge has found an NXP RW612 and will try replicate your observed behaviour when he finds some time :slight_smile: Let us know if you make any progress!

1 Like

I believe the problem has been identified. After making an adjustment to the semaphore handling involved with waiting for the MM8108 to be ready the system appears to be reliable. It has been running for over 12 hours now without error. I am going to let it run all weekend and provide more details Monday.

3 Likes

Hi @Roy

I believe I’ve reproduced the issue on an FRDM-RW612 with one of our MM8108 Arduino/Nucleo shields.

I suspect the IRQ GPIOs should be treated as wake up sources for the host, which they currently are not. There are some hints we can pass down from the Zephyr GPIO configuration to enable that.
I’ll do some further validation and share a patch :slight_smile:
Curious to know whatever it is you have found!


When tested on the STM32U585, where we use STOP2, the reference manual states one of the valid options for wake up source as

any EXTI line configured in interrupt mode

So this would be why it wasn’t picked up in our testing.

We will add the FRDM board to our test bed :slight_smile:

This is the patch which resolved the “lockup” for me over a 45 minute run

diff --git a/drivers/wifi/morsemicro/morsemicro_common.h b/drivers/wifi/morsemicro/morsemicro_common.h
index 543f11e..2e5477c 100644
--- a/drivers/wifi/morsemicro/morsemicro_common.h
+++ b/drivers/wifi/morsemicro/morsemicro_common.h
@@ -125,6 +125,18 @@ int morsemicro_init(const struct device *dev);
  *
  * @return 0 on success, negative errno otherwise.
  */
+#if defined(CONFIG_PM)
+#define MORSEMICRO_GPIO_INT_WAKE GPIO_INT_WAKEUP
+#else
+#define MORSEMICRO_GPIO_INT_WAKE 0
+#endif
+
 int morsemicro_pm_action(const struct device *dev, enum pm_device_action action);

 /**
diff --git a/drivers/wifi/morsemicro/morsemicro_spi.c b/drivers/wifi/morsemicro/morsemicro_spi.c
index 78abb1f..ec8fc7f 100644
--- a/drivers/wifi/morsemicro/morsemicro_spi.c
+++ b/drivers/wifi/morsemicro/morsemicro_spi.c
@@ -179,7 +179,8 @@ void mmhal_wlan_set_spi_irq_enabled(bool enabled)
                                spi_irq_handler();
                        }
                }
-               gpio_pin_interrupt_configure_dt(&bus_config.spi_irq, GPIO_INT_EDGE_TO_ACTIVE);
+               gpio_pin_interrupt_configure_dt(&bus_config.spi_irq,
+                                              GPIO_INT_EDGE_TO_ACTIVE | MORSEMICRO_GPIO_INT_WAKE);
        } else {
                gpio_pin_interrupt_configure_dt(&bus_config.spi_irq, GPIO_INT_DISABLE);
        }
diff --git a/drivers/wifi/morsemicro/shims/mmhal_wlan.c b/drivers/wifi/morsemicro/shims/mmhal_wlan.c
index 8ff03d9..2b5c5c9 100644
--- a/drivers/wifi/morsemicro/shims/mmhal_wlan.c
+++ b/drivers/wifi/morsemicro/shims/mmhal_wlan.c
@@ -151,7 +151,8 @@ void mmhal_wlan_set_busy_irq_enabled(bool enabled)
        const struct morsemicro_config *cfg = morsemicro_config0;

        if (enabled) {
-               gpio_pin_interrupt_configure_dt(&cfg->busy, GPIO_INT_EDGE_TO_ACTIVE);
+               gpio_pin_interrupt_configure_dt(&cfg->busy,
+                                              GPIO_INT_EDGE_TO_ACTIVE | MORSEMICRO_GPIO_INT_WAKE);
        } else {
                gpio_pin_interrupt_configure_dt(&cfg->busy, GPIO_INT_DISABLE);
        }

Though we may not implement like this in the official fix. Need to check how Zephyr handles the flag when PM is not enabled. If a NOP when CONFIG_PM=n, then this would allow the flag to live in devicetree on the gpio specification for the busy/spi-irq pins.