BTT Octopus 1.1 for robotic project

Post here first, or if you can't find a relevant section!
Post Reply
Andy
Posts: 2
Joined: Mon Jun 19, 2023 5:03 pm

BTT Octopus 1.1 for robotic project

Post by Andy »

I would like to use the BTT Octopus board with STM32F446ZET6 to control a number of stepper motors with UART TMC2209.

I want to be able to use the Arduino IDE connected directly via serial and then to send commands via serial from a Windows program.

This variant is not listed in

https://github.com/stm32duino/Arduino_C ... 5f783b79b2

which gives https://github.com/stm32duino/BoardMana ... index.json

to be linked to in the "Additional Boards Managers URLs" field.

I've found

https://github.com/stm32duino/Arduino_C ... 9ec69efcee

but haven't been able to get this listed in the board manager.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: BTT Octopus 1.1 for robotic project

Post by ag123 »

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

Code: Select all

void SystemClock_Config(void)
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

Code: Select all

void SystemClock_Config(void)
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.
Andy
Posts: 2
Joined: Mon Jun 19, 2023 5:03 pm

Re: BTT Octopus 1.1 for robotic project

Post by Andy »

Many thanks for your help.

Got the Generic STM32F4 series loaded via https://github.com/stm32duino/BoardMana ... index.json.

Board part number Generic F466VETx.

We have options of:
STMCubeProgammer32 (SWD)
STMCubeProgammer32 (Serial)
STMCubeProgammer32 (DFU)
Black Magic Probe
HID Bootloader 2.2

Options for USB:
CDC (generic 'Serial' supersede U(S)ART
CDC (no generic 'Serial')
HID (keyboard and mouse)

Options for U(S)ART:
Enabled (generic serial)
Enabled (no generic serial)
Disabled (no Serial support)
Screenshot 2023-07-21 173158.png
Screenshot 2023-07-21 173158.png (23.37 KiB) Viewed 708 times
This is the error that shows
Screenshot 2023-07-21 173024.png
Screenshot 2023-07-21 173024.png (42.74 KiB) Viewed 708 times
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: BTT Octopus 1.1 for robotic project

Post by ag123 »

if you do not have an st-link try
STMCubeProgammer32 (DFU)
^ that DFU programmer

To use this, you need to set the boot0 pin and press reset on the board
https://github.com/bigtreetech/BIGTREET ... %20PIN.pdf
^ if this matches your board, check the board document and find where is that BOOT0 jumper, somewhere in the middle of the board near the microcontroller. you need to patch that BOOT0 jumper then press reset before you do the upload.
When you want to use your sketch, then take up the BOOT0 jumper.

in addition, instead of using the Generic variant / board you may want to try
FYSETC_S6 under STM32F446VE
to build your sketch, it has less features memory and pin compared to ZG a bigger chip, but there is a chance the HSE crystal may be a same frequency.
that would let you try more features on the board.
If FYSETC_S6 works for your board, and then eventually, if you want to fully use your board, you need to copy the variant files for FYSETC_S6 into your own variant files with the appropriate names and make a new variant using that as an example.
Post Reply

Return to “General discussion”