Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp32[c3]: Add XTWDT support #12450

Merged
merged 1 commit into from
Jun 4, 2024
Merged

Conversation

eren-terzioglu
Copy link
Contributor

Summary

esp32[c3]: Add XTWDT support

Impact

Only ESP32-C3

Testing

esp32c3-generic:watchdog config used with following options enabled:

CONFIG_ESPRESSIF_XTWDT=y
CONFIG_ESPRESSIF_RTCIO_IRQ=y
CONFIG_ESPRESSIF_RTC=y
CONFIG_ESPRESSIF_RTC_CLK_EXT_OSC=y
CONFIG_ESPRESSIF_XTWDT=y

To simulate 32768hz clock output, another esp device used with adjusted timer example. Clock connected to external oscillator pin (GPIO0) and these lines added to watchdog example to check output:

//apps/examples/watchdog/watchdog_main.c:215
static int wdt_handler(int irq, FAR void *context, FAR void *arg)
{
  printf("IRQ: %d\n", irq);
  return OK;
}

//apps/examples/watchdog/watchdog_main.c:258
struct watchdog_capture_s handlers_xtwdt;
handlers_xtwdt.oldhandler = NULL;
handlers_xtwdt.newhandler = wdt_handler; 

ioctl(fd, WDIOC_CAPTURE, (unsigned long)((uintptr_t) (&handlers_xtwdt)));
if (ret < 0)
{
    ret = errno;
    wderr("Error: %d\n", ret);
    goto errout_with_dev;
}

wdog -i /dev/watchdog3 command applied and during runtime clock connection removed. Expected output needs to be like this:

wdog_ioctl: cmd: 515 arg: 1070123900
wdog_main: flags=00000005 timeout=2000 timeleft=0
  NO ping elapsed=15000
IRQ: 84

@acassis
Copy link
Contributor

acassis commented Jun 4, 2024

@eren-terzioglu I think there is also a table in the Documentation with supported peripherals, please update that information there

@eren-terzioglu
Copy link
Contributor Author

@eren-terzioglu I think there is also a table in the Documentation with supported peripherals, please update that information there

It was already set as true

@acassis
Copy link
Contributor

acassis commented Jun 4, 2024

Maybe in NOTES you can include XTWDT

@eren-terzioglu
Copy link
Contributor Author

Maybe in NOTES you can include XTWDT

Added, thanks

@acassis acassis merged commit 24af23e into apache:master Jun 4, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants