-
Enable USB
03/12/2021 at 13:04 • 0 commentsThe USB port is connected on PB15 and PB14 (OTG HS).
To enable the Serial on this port, you have to configure the compiler options in the Arduino IDE :
In "Tools" choose :
- U(S)ART support : Disabled
- USB support : CDC generic serial
- USB speed : High speed in full speed mode
Now the board should be reconized as an USB device
- U(S)ART support : Disabled
-
CAN1 & CAN2
03/12/2021 at 09:31 • 0 commentsNow I want to check if the 2 CAN buses work.
I am going to use the stm32f407.ino example from this repository : https://github.com/nopnop2002/Arduino-STM32-CAN
1/In the stm32f407.ino I add these lines (in the
"bool CANInit(BITRATE bitrate, int remap)" function) in order to match to the hardware :
if (remap == 4) { // CAN1 RCC->AHB1ENR |= 0x2; // Enable GPIOB clock CANSetGpio(GPIOB, 8); // Set PB8 CANSetGpio(GPIOB, 9); // Set PB9 // CAN2 RCC->AHB1ENR |= 0x2; // Enable GPIOB clock CANSetGpio(GPIOB, 5); // Set PB5 CANSetGpio(GPIOB, 6); // Set PB6 }
2/In the setup add :
bool ret = CANInit(CAN_1000KBPS, 4);
If you want to send to CAN2:
//uint8_t send_ch = 1; //send to CAN1 uint8_t send_ch = 2; ////send to CAN2
Both CAN work : we have the bases !
-
1st program upload
03/11/2021 at 17:38 • 0 commentsAfter many tries I have succeded to flash the STM32. Details in "Build Instructions".
First issue : impossible to connect the STM32 and the STLINK. Solution : Put the NRST pin to the GND, click on connect in the cube programmer, then after 1s disconnect NRST.
Second issue : The program doesn't start due to a wrong board selection in the ARDUINO IDE. Solution : In the list select the Blue F407VE mini. Should correspond to this board (??) : https://stm32-base.org/boards/STM32F407VET6-VCC-GND-Small
Next step : CAN test
-
Pinout
03/11/2021 at 16:34 • 0 comments