arduino / arduino/ArduinoCore-samd

board_driver_i2c.c not visible at runtime

Open
#477 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
502
Forks
740
PR merge metrics
No merged PRs in 30d

Description

Hi!

I am trying to set-up a bootloader for my custom board, starting from the arduino zero bootloader.

I want to communicate with an external EEPROM with I2C on pins PA22 and PA23 (SERCOM3).
I was able to do this succesfully, setting up a "library" starting from the ASF example for I2C master polled.

But the same code doesn't work on SAM-BA, because ASF is not included. Tried including it but I couldn't manage to make it work.

I found the included functions (_board_driver_i2c.c_ and _board_driver_i2c.h_) and I included a few that use them in order to read and write to the EEPROM.

I can compile on Atmel Studio without errors, but I get warnings for "undefined reference" to all of the I2C functions.

I checked and the C files are included in the Makefile, so I am at lost as to why the final program can't find them.

If I run a step by step debugging session, and I try to step into these functions, it just skips them.

[I leave a link to the repo for the code](https://gitlab.com/yaeltex/ytx-controller/tree/kwhat-features/bootloader/sam-ba-copia2)

I added to _main.c_ lines 212 - 230, which call the functions to read and write to the EEPROM.
These are the ones that use the included I2C functions, defined in _extEEPROM.c_

![2019-12-09 19_21_35-samd21_sam_ba - AtmelStudio](https://user-images.githubusercontent.com/4588575/70478170-2e859600-1ab9-11ea-8d9f-49f9ae961370.png)

Any help will be appreciated.

Thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Makefile and the linker output, then inspect board_driver_i2c.c, board_driver_i2c.h, extEEPROM.c, and main.c lines 212-230. Determine why the I2C function references are not available to the final program, and verify that the EEPROM read and write calls work in the bootloader.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.