platformio / platformio/platform-raspberrypi

undefined reference to `alarm_pool_get_default'

Open
#51 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
94
Forks
141
PR merge metrics
No merged PRs in 30d

Description

I can't use the timer irq with the rp2040 and the arduino framework. Some help or recommendations?

#define PICO_TIME_DEFAULT_ALARM_POOL_DISABLED 0

#include <string.h>
#include "unity.h"

#include <stdio.h>
#include "pico/stdlib.h"
extern "C" {
#include <hardware/timer.h>
#include <hardware/watchdog.h>
#include "pico/multicore.h"
};
#include "pio_tx_controller.h"

#include "gpio.h"
#include "pico/time.h"

#include "test_utils.h"
// Implements
#include "tests.h"

void setUp(){};

void tearDown(){};

bool led_state{false};

bool led_callback(repeating_timer_t* rt) {
    Pio_tx_controller::get()->write("Hey Jude!\r\n");
    gpio_put(PICO_DEFAULT_LED_PIN, led_state);
    led_state = !led_state;
    return true;
}

void test_timer_irq() {
    _gpio_init(PICO_DEFAULT_LED_PIN);
    gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);

    struct repeating_timer timer;
    bool ok = add_repeating_timer_ms(1000, led_callback, NULL, &timer);

    while (true)
        tight_loop_contents();
};

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the RP2040 Arduino-framework build with the shown timer example and inspect the linker output for alarm_pool_get_default. The issue names no repository files or tests, so trace how the timer and alarm-pool components are linked. Done means the example links and the timer IRQ runs without the undefined-reference error.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, cpp
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.