# \`Too many arguments to function hw\_timer\_t

**URL:** <https://forum.arduino.cc/t/too-many-arguments-to-function-hw-timer-t/1389998>\
**Category:** Programming\
**Created:** [June 19, 2025, 11:16pm UTC](https://forum.arduino.cc/t/too-many-arguments-to-function-hw-timer-t/1389998 "2025-06-19T23:16:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wxman23](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wxman23/32/1223280_2.png) [@wxman23](https://forum.arduino.cc/u/wxman23)\
**Post date:** [June 19, 2025, 11:16pm UTC](https://forum.arduino.cc/t/too-many-arguments-to-function-hw-timer-t/1389998/1 "2025-06-19T23:16:55Z")

</div>

Hi, new to this, but running and a MH ET Live ESP32 Mini Kit Board and got this error in compiling. It is pretty self-explanatory, the function will not take my variables, but does anyone know why it is being thrown and more importantly, how to fix  
it?  
libraries\RadioHead\_v1.121\RH\_ASK.cpp:528:23: error: too many arguments to function 'hw\_timer\_t\* timerBegin(uint32\_t)' 528 | timer = timerBegin(0, 80, true); // Alarm value will be in in us  
| ~~^~~~~  
  
The entire log is here:  
c:\Users\mccaya\Documents\Arduino\libraries\RadioHead\_v1.121\RH\_ASK.cpp: In member function 'void RH\_ASK::timerSetup()':  
c:\Users\mccaya\Documents\Arduino\libraries\RadioHead\_v1.121\RH\_ASK.cpp:528:23: error: too many arguments to function 'hw\_timer\_t\* timerBegin(uint32\_t)'  
528 | timer = timerBegin(0, 80, true); // Alarm value will be in in us  
| ~~^~~~~  
In file included from C:\Users\mccaya\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\cores\esp32/esp32-hal.h:98,  
from C:\Users\mccaya\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\cores\esp32/Arduino.h:45,  
from c:\Users\mccaya\Documents\Arduino\libraries\RadioHead\_v1.121/RadioHead.h:1544,  
from c:\Users\mccaya\Documents\Arduino\libraries\RadioHead\_v1.121/RHGenericDriver.h:9,  
from c:\Users\mccaya\Documents\Arduino\libraries\RadioHead\_v1.121/RH\_ASK.h:9,  
from c:\Users\mccaya\Documents\Arduino\libraries\RadioHead\_v1.121\RH\_ASK.cpp:6:  
C:\Users\mccaya\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\cores\esp32/esp32-hal-timer.h:35:13: note: declared here  
35 | hw\_timer\_t _timerBegin(uint32\_t frequency);  
| ^ ~~~~~~~~~  
c:\Users\mccaya\Documents\Arduino\libraries\RadioHead\_v1.121\RH\_ASK.cpp:529:25: error: too many arguments to function 'void timerAttachInterrupt(hw\_timer\_t_, void (\*)())'  
529 | timerAttachInterrupt(timer, &esp32\_timer\_interrupt\_handler, true);  
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~  
C:\Users\mccaya\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\cores\esp32/esp32-hal-timer.h:50:6: note: declared here  
50 | void timerAttachInterrupt(hw\_timer\_t \*timer, void (\*userFunc)(void));  
| ^ ~~~~~~~~~~~~~~~~~~~  
c:\Users\mccaya\Documents\Arduino\libraries\RadioHead\_v1.121\RH\_ASK.cpp:530:5: error: 'timerAlarmWrite' was not declared in this scope; did you mean 'timerWrite'?  
530 | timerAlarmWrite(timer, 1000000 / \_speed / 8, true);  
| ^ ~~~~~~~~~~~~~~  
| timerWrite  
c:\Users\mccaya\Documents\Arduino\libraries\RadioHead\_v1.121\RH\_ASK.cpp:531:5: error: 'timerAlarmEnable' was not declared in this scope; did you mean 'timerAlarm'?  
531 | timerAlarmEnable(timer);  
| ^ ~~~~~~~~~~~~~~~  
| timerAlarm  
exit status 1

Compilation error: exit status 1

---

<div class="post-metadata">

**Author:** ![qubits-us](https://avatars.discourse-cdn.com/v4/letter/q/5daacb/32.png) [@qubits-us](https://forum.arduino.cc/u/qubits-us)\
**Post date:** [June 20, 2025, 12:01am UTC](https://forum.arduino.cc/t/too-many-arguments-to-function-hw-timer-t/1389998/2 "2025-06-20T00:01:49Z")

</div>

Hi @wxman23 ,

Welcome to the forum..  
check the documentation for the lib [RadioHead..](https://www.airspayce.com/mikem/arduino/RadioHead/)

looks like it only support up to 3.0.2 of the esp32 core you are using 3.2.0

try downgrading your esp32 core..

good luck.. ~q

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [June 20, 2025, 12:04am UTC](https://forum.arduino.cc/t/too-many-arguments-to-function-hw-timer-t/1389998/3 "2025-06-20T00:04:30Z")

</div>

Check out the pinned post re 'How to get the most from the forum'. After you do that, have a look at the RH\_ASK.h file to see what the arguments should be.  
Meanwhile, edit your post and add code tags.

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [June 20, 2025, 5:41am UTC](https://forum.arduino.cc/t/too-many-arguments-to-function-hw-timer-t/1389998/4 "2025-06-20T05:41:13Z")

</div>

> [@wxman23](#):
>
> too many arguments to function 'hw\_timer\_t\* timerBegin(uint32\_t)'  
> 528 | timer = timerBegin(0, 80, true); // Alarm value will be in in us

it looks like you are attempting to build code using ESP32 core 3.x which was implemented for ESP32 core 2.x

have a look at the ESP32 core V3.x [Arduino-ESP32 Timer API](https://docs.espressif.com/projects/arduino-esp32/en/latest/api/timer.html)

also worth looking at is [Migration from ESP32 core 2.x to 3.x](https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html)

---

<div class="post-metadata">

**Author:** ![wxman23](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wxman23/32/1223280_2.png) [@wxman23](https://forum.arduino.cc/u/wxman23)\
**Post date:** [June 20, 2025, 10:18pm UTC](https://forum.arduino.cc/t/too-many-arguments-to-function-hw-timer-t/1389998/5 "2025-06-20T22:18:50Z")

</div>

Thanks all. I had to walk back to 2.0.17 but it compiles now.

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [June 21, 2025, 5:17am UTC](https://forum.arduino.cc/t/too-many-arguments-to-function-hw-timer-t/1389998/6 "2025-06-21T05:17:22Z")

</div>

> [@wxman23](#):
>
> . I had to walk back to 2.0.17 but it compiles now

the alternative is to update the code to use ESP32 core V3.x  
e.g. generating a 1Hz square wave

```cpp
// ESP32 timer inteerrupts - 1Hz square wave print period counter

// updated to use ESP32 core V3.0 - changes indicated by <<<

#define pin 19

hw_timer_t *timer = NULL;

// timer ISR invert pin level
volatile int counter = 0;
void ARDUINO_ISR_ATTR onTimer() {
  static uint32_t level = 0;
  counter++;
  // digitalWrite(pin, !digitalRead(pin));
  gpio_set_level((gpio_num_t)pin, level); //!gpio_get_level((gpio_num_t)pin));
  level = !level;
}

void setup() {
  Serial.begin(115200);
  pinMode(pin, OUTPUT);
  timer = timerBegin(100000); // <<< Set timer frequency Mhz
  timerAttachInterrupt(timer, &onTimer); // <<< Attach onTimer function to our timer.
  // Set alarm to call onTimer function(value in microseconds).
  // Repeat the alarm (third parameter) with unlimited count = 0 (fourth parameter).
  timerAlarm(timer, 50000, true, 0); // <<<
}

void loop() {
  // display counter every second
  static long timer1 = millis();
  if (millis() - timer1 > 1000) {
    timer1 = millis();
    Serial.println(counter);
    counter = 0;
  }
}

```

if the problem is solved click the Solution button at the bottom of the reply that answered the question - this helps others with a similar question

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [December 18, 2025, 5:17am UTC](https://forum.arduino.cc/t/too-many-arguments-to-function-hw-timer-t/1389998/7 "2025-12-18T05:17:43Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
