platform-raspberrypi: undefined reference to `i2c_start' when trying to use mbed I2C

Hi!

I am having problems with using the event based implementation in wire.h, mainly I have problems getting the slave/peripheral on an Raspberry Pi Pico W (Arduino) replying to the ESP32 master/controllers request. All other directions work but that doesn’t. Also the interrupt-event-based implementation makes the timing difficult and a more generalized implementation messy.

So now I am trying to use the mbed I2C/I2Cslave implementation which seems quite nifty (no sure what Wire.h actually brings except from the interrupt-events and some minor abstractions) but something seem to be missing.

I am getting this error when building:

/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /.platformio/packages/framework-arduino-mbed/variants/RASPBERRY_PI_PICO/libs/libmbed.a(I2C.o): in function `mbed::I2C::start()':
I2C.cpp:(.text._ZN4mbed3I2C5startEv+0xc): undefined reference to `i2c_start'

Any ideas?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

Let me double check mbed, because I know there was https://github.com/platformio/platformio-core/issues/3980.

With the Arduino-Pico core, which is the entire point of this repo, it works without problems when you wait for Serial connection to be established

grafik

Just create test/test_embedded/test_example.cpp per

#include <Arduino.h>
#include <unity.h>

void setUp(void) {
    // set stuff up here
}

void tearDown(void) {
    // clean stuff up here
}

int function_under_test(int a, int b) {
    return a + b;
}

void test_calculator_addition(void) {
    TEST_ASSERT_EQUAL(32, function_under_test(25, 7));
}

void setup() {
    UNITY_BEGIN();
    // wait for serial monitor to be connected, however long it may take.
    while(!Serial) delay(10);
    RUN_TEST(test_calculator_addition);
    UNITY_END();
}

void loop() {
    pinMode(LED_BUILTIN, OUTPUT);
    digitalWrite(LED_BUILTIN, HIGH);
    delay(100);
    digitalWrite(LED_BUILTIN, LOW);
    delay(500);
}
[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = rpipico
framework = arduino
board_build.filesystem_size = 1m