undefined reference to `alarm_pool_get_default'

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

Nobody has claimed this yet.

Assessment

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

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.

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();
};
Dominant language
Python
Stars
96
Forks
142
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from platformio/platform-raspberrypi

All issues in platformio/platform-raspberrypi

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.