How to use SPI1 in conjunction with maple ports PB3, PB4, PB5? I did a remap but it doesn’t work. If I am not using the maple, it works correctly through the assignment of SPI.setMOSI(PB5); SPI.setMISO(PB4);
SPI.setSCLK(PB3);
Here is my code:
#include <Arduino.h>
#include <SPI.h>
void setup() {
afio_cfg_debug_ports (AFIO_DEBUG_SW_ONLY);
afio_remap (AFIO_REMAP_SPI1);
gpio_set_mode (GPIOB, 3, GPIO_AF_OUTPUT_PP);
gpio_set_mode (GPIOB, 4, GPIO_INPUT_FLOATING);
gpio_set_mode (GPIOB, 5, GPIO_AF_OUTPUT_PP);
pinMode(PA8, OUTPUT);
SPI.begin(); //Initialize the SPI_1 port.
digitalWrite(PA8, LOW);
SPI.transfer(0b11111111);
digitalWrite(PA8, HIGH);
}
void loop(){
}
platformio.ini
[env:test]
platform = GitHub - platformio/platform-ststm32: ST STM32: development platform for PlatformIO
board_build.mcu = stm32f103cbt6
board_build.f_cpu = 72000000L
board = genericSTM32F103CB
framework = arduino
board_build.core = maple ; Use Maple core
upload_flags = -c set CPUTAPID 0x2ba01477 ;AIR32F103CB
debug_tool = stlink
upload_protocol = stlink