Skip to content

Monitor hangs forever on the stm32 uC after #37

@bdmihai

Description

@bdmihai

On the Arduiono Uno Q the monitor hangs forever after 8 messages.

#include <Arduino_RouterBridge.h>
#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>

static const struct gpio_dt_spec led3 = GPIO_DT_SPEC_GET(DT_NODELABEL(led3_blue), gpios);
static const struct gpio_dt_spec led4 = GPIO_DT_SPEC_GET(DT_NODELABEL(led4_green), gpios);

void setup() {
  gpio_is_ready_dt(&led3);
  gpio_is_ready_dt(&led4);
  gpio_pin_configure_dt(&led3, GPIO_OUTPUT_ACTIVE);
  gpio_pin_configure_dt(&led4, GPIO_OUTPUT_INACTIVE);

  Serial.begin(115200);

  Bridge.begin();
  Bridge.provide("remote_event", remote_event);
}

void loop() {
  gpio_pin_toggle_dt(&led3);
  gpio_pin_toggle_dt(&led4);
  delay(1000);  // wait for a second
  Serial.println("Led ON");
  Monitor.println("on");
  gpio_pin_toggle_dt(&led3);
  gpio_pin_toggle_dt(&led4);
  delay(1000);  // wait for a second
  Serial.println("Led OFF");
  Monitor.println("off");
}

void remote_event(String data) {
  Serial.print("Remote event: ");
  Serial.println(data.c_str());
}
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions