Application-Specific Configurations

Hi,

I want to override some pin assignments that are set in the default configuration of my board. I tried to follow Application-Specific Configurations, although my board is different from the one being documented in this section. However, the procedure looks pretty general, but is it ?

I did :

  • create $(APPDIR)/board.h and $(APPDIR)/periph_conf.h
  • let Makefile start with INCLUDES += -I$(APPDIR)
  • add #include_next "board.h" and #include_next "periph_conf.h at the end of the above mentioned files, respectively

Now, I get a bunch of undefined errors.

Should I create an external board instead ?

Well, I was close. That was a beginner’s mistake :face_with_open_eyes_and_hand_over_mouth:. Anyway, here what was missing.

In $(APPDIR)/board.h and in $(APPDIR)/periph_conf.h, do not leave the include guard as is, but change it to be unique. In other words, replace BOARD_H with BOARD_MYAPP_H and PERIPH_CONF_H with PERIPH_CONF_MYAPP_H.

2 Likes

I’m trying to change the default pinout of I2C0_SCL and I2C0_SDA in $(APPDIR)/periph_conf.h, which is actually included.

However, the I2C-related macros (e.g. I2C_NUMOF, I2C0_SPEED, etc.) are not defined anymore. It seems like the #include_next "periph_conf.h" has no effect. Any idea?

My board:

BOARD = esp32s3-devkit
BOARD_VERSION = esp32s3-devkitc-1-n8r2

Here is the only way I managed to change the I2C0 pins.

Makefile:

INCLUDES += -I$(RIOTBOARD)

$(APPDIR)/periph_conf:

/* #include_next "periph_conf.h" */
#include "esp32s3-devkit/include/periph_conf.h"

I’m modifiying the RIOT/tests/periph/i2c/ project. Is there something I missed ?