# Crash when tone() called during GTimer interrupt

**URL:** https://forum.amebaiot.com/t/crash-when-tone-called-during-gtimer-interrupt/3150
**Category:** Peripherals
**Tags:** rtl8735b
**Created:** [July 19, 2024, 5:19pm UTC](https://forum.amebaiot.com/t/crash-when-tone-called-during-gtimer-interrupt/3150 "2024-07-19T17:19:12Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nsmith1024](https://avatars.discourse-cdn.com/v4/letter/n/bc79bd/32.png) [@nsmith1024](https://forum.amebaiot.com/u/nsmith1024)
#### Post date: [July 19, 2024, 5:19pm UTC](https://forum.amebaiot.com/t/crash-when-tone-called-during-gtimer-interrupt/3150/1 "2024-07-19T17:19:12Z")

</div>

Hello,

The whole system crashes if a create a timer

```
    GTimer.begin(0, (1 * 1000 * 200), tick, false, 0);

```

When the timer times out it calls tick(…) as shown above

If i call tone(pin, freq) inside that tick() function to generate a tone on a pin, it crashes the whole computer and gives this error:

line 3066 file: E:/SDK\_Gerrit/amebapro2/SDK\_9.6/9.x/component/os/freertos/freertos\_v202012.00/Source/tasks.c

But if i call tone(pin, freq) outside of tick() then doesnt crash but works fine.

Is this a bug?

Thanks

---

<div class="post-metadata">

### Author: ![Kelvin\_Huang](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/kelvin_huang/32/2130_2.png) [@Kelvin\_Huang](https://forum.amebaiot.com/u/Kelvin_Huang)
#### Post date: [July 22, 2024, 2:03am UTC](https://forum.amebaiot.com/t/crash-when-tone-called-during-gtimer-interrupt/3150/2 "2024-07-22T02:03:01Z")

</div>

Hi @nsmith1024,

Can you share your code to replicate the issue?

Thank you.
