Issues migrating from v2.5.0 to v2.9.1

Hey,

I am working with the Matter light bulb sample from the 2.9.1 SDK, which I have modified to support the occupancy cluster. (nRF-52840 and nRF-52840DK)

This worked fine on version 2.5.0, so I tried to follow the migration guides and implement my custom changes to the new SDK.

While the image builds successfully, there is no Bluetooth beacon, serial communication or any functionality at all. The debugger gets stuck in this IRQ-lock function:

FUNC_NORETURN __weak void arch_system_halt(unsigned int reason)
{
	ARG_UNUSED(reason);

	/* TODO: What's the best way to totally halt the system if SMP
	 * is enabled?
	 */

	(void)arch_irq_lock();
	for (;;) {
		/* Spin endlessly */
	}
}

The only interrupt related change I made is in SensorMeasureHandler() for the occupancy functionality:

void AppTask::SensorMeasureHandler()
{
  uint64_t now = k_uptime_get();
  uint64_t motion_time = pir.GetLastTdTime();

    // Waiting for the hold-up time to expire
	if (now - motion_time < kOccupancyOccupiedToUnoccupiedTransitionTimeMs)
    {
		// Set Occupancy true
		chip::app::Clusters::OccupancySensing::Attributes::Occupancy::Set(kOccupancyEndpointId, chip::app::Clusters::OccupancySensing::OccupancyBitmap::kOccupied);
	}
    // Checking the logic level after hold-up time expires (is it inactive?)
	else if (pir.GetTd() == false)
    {
		// Set Occupancy false
		chip::app::Clusters::OccupancySensing::Attributes::Occupancy::Set(kOccupancyEndpointId, 0x00);
    }
	else
	{
		// Reset the hold-up time
		uint32_t pins = BIT(td.pin); // Sensor TD pin number
		::td_activated(dev, &cb_data, pins);
	}
}

td_activated() mainly resets the timer:

void td_activated(const struct device *dev, struct gpio_callback *cb, uint32_t pins)
{
    uint64_t now = k_uptime_get();
    bool pd_pin = gpio_pin_get_dt(&pd);
    last_td_time = now;
    last_pd = pd_pin;
}

This worked fine with the old SDK, but I can't see what needs to be changed. I appreciate any help.

Parents
  • Hello,

    Can you share the necessary steps to reproduce this? Your shared code does not have all the needed definitions. So far I have added the occupancy cluster in ZAP tool, but since I am missing definitions for several objects and functions in AppTask.cpp, I'm not able to build the project.

    Just as a sanity check: does the unchanged light bulb sample boot properly?

    Best regards,

    Maria

Reply
  • Hello,

    Can you share the necessary steps to reproduce this? Your shared code does not have all the needed definitions. So far I have added the occupancy cluster in ZAP tool, but since I am missing definitions for several objects and functions in AppTask.cpp, I'm not able to build the project.

    Just as a sanity check: does the unchanged light bulb sample boot properly?

    Best regards,

    Maria

Children
No Data
Related