Hello.
I don’t really understand how this pin mapping works. For example this PA4 pin is indeed CS pin on my chip but how does this code know that? When hovering over the definition it says that it maps to physical pin 39 (PX_DAC1). I think the correct physical pin would be 20
In PeripheralPins.c I can find this PA_4 in few places, PinMap_ADC, PinMap_DAC and PinMap_SPI_SSEL (I assume this last is what makes it work)
#ifdef HAL_SPI_MODULE_ENABLED
WEAK const PinMap PinMap_SPI_SSEL[] = {
{PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
{PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)},
{NC, NP, 0}
};
#endif
In variant_SAVI.cpp there is one place with PA_4, // PX_DAC1
Then lastly in variant_SAVI.h there are few places where PA4 is mentioned
// Mapping of STM32 GPIO pin to digital pin number
#define PA4 39 /* PX_DAC1 */
// Mapping of net name to digital pin number
#define PX_SPI1_CS PA4 /* 29 */
#define PX_DAC1 PA4 /* 39 */
// SPI Definitions
#ifndef PIN_SPI_SS
#define PIN_SPI_SS PA4
#endif
But I can find nowhere mapping of PA4 to my chips pin 20 as per schematic. I must be missing something again