well your board schematics etc is here
https://github.com/bigtreetech/BIGTREETECH-OCTOPUS-V1.0
https://github.com/bigtreetech/BIGTREET ... ctopus.pdf
apparently it uses a 12 Mhz crystal for the HSE.
If you want to use that you need to learn how to make a variant
https://github.com/stm32duino/Arduino_C ... 28board%29
and you need to adapt and define a
that uses the crystal for HSE.
Otherwise, you can try using the generic variant as you have indicated, that one runs on HSI (the internal RC oscillator).
You can normally select the generic variant from the Arduino menu under boards.
To make a real variant, you can take a look as some real variant files
https://github.com/stm32duino/Arduino_C ... 446V(C-E)T
e.g. how they define that
https://github.com/stm32duino/Arduino_C ... 6.cpp#L139
perhaps copy that rename it and put it in the appropriate variant folder for your board/variant.
take particular care for this part:
Code: Select all
/* Enable HSE Oscillator and activate PLL with HSE as source */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 6;
RCC_OscInitStruct.PLL.PLLN = 180;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 7;
RCC_OscInitStruct.PLL.PLLR = 2;
HAL_RCC_OscConfig(&RCC_OscInitStruct);
those M, N, P, Q, R multipliers need to be configured for your 12 Mhz crystal
the above is from variant_FYSETC_S6, it is for STM32F446VE series, actually it seemed you could select that variant and try it out for your board, that seemed to use a 12 Mhz crystal as well. And later copy and adapt that for your variant.
I've made a little python script that generate a lot of values for the M, N, P, Q multipliers, only a few specific ones is appropriate for your board.
viewtopic.php?t=78
choose the lowest possible multipliers if you are using the script, or sometimes it may not even run.
note that normally, you should only run up to the rated clock speeds for your microcontroller, e.g. 180 Mhz? for STM32F446ZE
https://www.st.com/en/microcontrollers- ... 446ze.html
The usual files to update a variant is normally boards.txt found inside the core folder (where your core is installed).
You need to create your variant_myvariant.cpp, variant_myvariant.h, and other files as well and perhaps copy the entry from a sample which you used and update boards.txt to point to those files.
as like indicated in the wiki
https://github.com/stm32duino/Arduino_C ... 28board%29
and when you are building your sketch, you need to select USB (CDC ACM) Serial from the Arduino Menu so that your Serial.print() will go to your terminal in a virtual com port.