Mapping of peripherals by compiler
Posted: Sat Jan 16, 2021 3:41 am
I am looking for a convenient (lazy) way to determine how the Arduino IDE maps STM32 peripherals when it compiles a program. I am aware of the PeripheralPins.c file that is used to map generic functions (I2C communications e.g.) to specific pins for a selected board. And, working backwards through such files, I can find where to check for various physical interfaces. I'm hoping that there is a simpler way to accomplish this. Is there a way to create a compiler listing that gives that information?
For example, I bought an Adafruit si5351 shield, compiled the example file, uploaded to an Arduino Uno, connected the shield, and everything worked. I then created a new sketch using the same example file, and I selected the STM32F407G-DISC1 board. The sketch compiles, loads, and runs (at least I see the serial messages). The PeripheralPins.c file maps SDA to PB7, PB11, or PC9 and SCL to PA8 or PB8. I assume the compiler chooses the first pin that has not already been assigned to another alternate function. I can probe those pins to determine what the compiler chose. But, as I said, I looking for a lazy to accomplish that.
For example, I bought an Adafruit si5351 shield, compiled the example file, uploaded to an Arduino Uno, connected the shield, and everything worked. I then created a new sketch using the same example file, and I selected the STM32F407G-DISC1 board. The sketch compiles, loads, and runs (at least I see the serial messages). The PeripheralPins.c file maps SDA to PB7, PB11, or PC9 and SCL to PA8 or PB8. I assume the compiler chooses the first pin that has not already been assigned to another alternate function. I can probe those pins to determine what the compiler chose. But, as I said, I looking for a lazy to accomplish that.