arduino on fysetc s6 board-STM32F446VE

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
s6 noob
Posts: 15
Joined: Mon Apr 05, 2021 1:45 pm

Re: arduino on fysetc s6 board-STM32F446VE

Post by s6 noob »

Hi all

I am back- sorry :oops:

got the board set up as previously mentioned, but now there are no ports shown in the arduino ide (low video, unselectable)
looked for drivers, CH340 - but that turned out to be a kind of excercise in futility, non working links, (down) load errors etc

checked the board documentation - it shows no CH 340 being used, while at the F6 board it is..
tried with 2 S6 boards, MAC/PC

https://wiki.fysetc.com/FYSETC_S6/


thx in advance


best

Noob
Last edited by s6 noob on Tue Oct 05, 2021 12:24 pm, edited 1 time in total.
ag123
Posts: 1656
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: arduino on fysetc s6 board-STM32F446VE

Post by ag123 »

If you are trying to compile Marlin firmware, you may need PlatformIO instead.
https://marlinfw.org/docs/basics/instal ... ormio.html
Things like Marlin + STM32Duino are a bit 'more than Arduino'.
Marlin uses some Platform IO settings that are pre-set for compiling, those may not work in the 'conventional' Arduino-IDE.

If you look at the schematic for the recent V2.0 board. USB is directly connected to the chip.
https://github.com/FYSETC/FYSETC-S6/blo ... SCH%20.pdf
So your serial is USB (CDC) Serial, if you use this particular version of the board.

Another way if you would play with Makefiles, I've tried this
viewtopic.php?f=10&t=1213
https://www.instructables.com/Compiling ... tm32dui-2/

Either way, Marlin & such, is *not for Novices*.

To make your sketch compile in STM32Duino core, in Arduino IDE first find a variant that has the appropriate clock speeds that matches the crystal on board.
Check in the variants and in the schematics. A first task is to blink a led on the board.
If you can't do this, there is a lot more mileage to cover / to learn.
and these are the places to start
viewtopic.php?f=2&t=3
viewtopic.php?f=2&t=301
Last edited by ag123 on Tue Oct 05, 2021 12:36 pm, edited 1 time in total.
s6 noob
Posts: 15
Joined: Mon Apr 05, 2021 1:45 pm

Re: arduino on fysetc s6 board-STM32F446VE

Post by s6 noob »

Hi ag

thx for chiming in

no its not Marlin, its actually nothing to do with 3D printing, but controlling a Cartesian device
Took a look at Platform IO, but somehow I can't even load "blink", while the board is recognized.....

Looked at the instructables link, but very Marlin

I was hoping that with the STMduino library this would be solved- isn't more of an issue in comms board/duino or bootloader- did not touch that


thx

Noob

further thinking about this: my Noobishness, but normal 2560 boards, like the F6 are "easy" to live with, then why is this such a can of worms?
Last edited by s6 noob on Tue Oct 05, 2021 12:39 pm, edited 1 time in total.
ag123
Posts: 1656
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: arduino on fysetc s6 board-STM32F446VE

Post by ag123 »

I'd assume that your board is the V2 board?
as given in this schematic?
https://github.com/FYSETC/FYSETC-S6/blo ... SCH%20.pdf

If you are not familiar with other tools. You'd need
STM32Cube programmer
https://github.com/stm32duino/wiki/wiki ... programmer

The procedure to programe using DFU (i.e. usb direct) is:

set BOOT0 jumper, press reset.
then run STM32Cube programmer to upload your firmware
(i think this is integrated in the menu, check in the Menus)
Otherwise, you can from the Arduino IDE, do a Sketch > Export compiled binary (something of that sort).
You need that *.bin file.

Then you can use STM32Cube programmer to program it manually.

--
For your sketch, the important thing is to choose the correct MCU variant.
Preferably with exact matching MCU.
Then you need to review the variant include files in your locally installed folders.
the important thing is the external crystal speed that is specified in the variant file. i.e. the HSE crystral frequency
https://github.com/stm32duino/Arduino_C ... 6.cpp#L160

Code: Select all

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;
look inside the ref manual for your chip e.g.
https://www.st.com/resource/en/referenc ... ronics.pdf
look in the 'reset and clock control' section, look at the clock tree.
e.g. system clock = HSE freq * N / M / P
so say the HSE clock is 12 mhz, 12 * 180 / 6 / 2 = 180 Mhz
note the PLLQ divisor won't work for USB - it needs to be 48 Mhz
HSE * N / M / Q = 12 * 180 / 6 / 7 = 51.43 Mhz - usb won't run on this

need to match that on your board
https://github.com/FYSETC/FYSETC-S6/blo ... SCH%20.pdf

so on your board that HSE crystal needs to be 12 mhz

if it isn't, you would need to find new values for M, N, P, Q, those PLL dividers. You can try playing with this python script
viewtopic.php?f=41&t=78
Last edited by ag123 on Tue Oct 05, 2021 1:03 pm, edited 14 times in total.
s6 noob
Posts: 15
Joined: Mon Apr 05, 2021 1:45 pm

Re: arduino on fysetc s6 board-STM32F446VE

Post by s6 noob »

yes


just saw the second part of your post- we are editing away ;)

did get into the cubeprogrammer, but the screens worked different from the Fysetc wiki page, and got stuck in the menu, not being able to select the right drop down-grrr



Id be happy to supply/buy usuable board from you
s6 noob
Posts: 15
Joined: Mon Apr 05, 2021 1:45 pm

Re: arduino on fysetc s6 board-STM32F446VE

Post by s6 noob »

retried stm cube programmer


pressed boot button, then connected wiring then:

connection failed
ag123
Posts: 1656
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: arduino on fysetc s6 board-STM32F446VE

Post by ag123 »

boot0 is not a button, it is a jumper on your board, based on the schematics and in the guide

oh and you need to play with that suggested python script and get your M, N, P, Q PLL divisor values
sample run looks like this

Code: Select all

FHSE: 12 m: 1 n: 28 p: 2 (RCC_PLLP_DIV2) q: 7 fusb: 48.0 fcpu: 168.0
FHSE: 12 m: 2 n: 56 p: 2 (RCC_PLLP_DIV2) q: 7 fusb: 48.0 fcpu: 168.0
FHSE: 12 m: 3 n: 84 p: 2 (RCC_PLLP_DIV2) q: 7 fusb: 48.0 fcpu: 168.0
FHSE: 12 m: 4 n: 112 p: 2 (RCC_PLLP_DIV2) q: 7 fusb: 48.0 fcpu: 168.0
FHSE: 12 m: 5 n: 140 p: 2 (RCC_PLLP_DIV2) q: 7 fusb: 48.0 fcpu: 168.0
FHSE: 12 m: 6 n: 168 p: 2 (RCC_PLLP_DIV2) q: 7 fusb: 48.0 fcpu: 168.0
FHSE: 12 m: 7 n: 196 p: 2 (RCC_PLLP_DIV2) q: 7 fusb: 48.0 fcpu: 168.0
FHSE: 12 m: 8 n: 224 p: 2 (RCC_PLLP_DIV2) q: 7 fusb: 48.0 fcpu: 168.0
FHSE: 12 m: 9 n: 252 p: 2 (RCC_PLLP_DIV2) q: 7 fusb: 48.0 fcpu: 168.0
FHSE: 12 m: 10 n: 280 p: 2 (RCC_PLLP_DIV2) q: 7 fusb: 48.0 fcpu: 168.0
FHSE: 12 m: 11 n: 308 p: 2 (RCC_PLLP_DIV2) q: 7 fusb: 48.0 fcpu: 168.0
FHSE: 12 m: 12 n: 336 p: 2 (RCC_PLLP_DIV2) q: 7 fusb: 48.0 fcpu: 168.0
Last edited by ag123 on Tue Oct 05, 2021 1:10 pm, edited 2 times in total.
s6 noob
Posts: 15
Joined: Mon Apr 05, 2021 1:45 pm

Re: arduino on fysetc s6 board-STM32F446VE

Post by s6 noob »

thts the V2, I have the 1,2

the python... its snake oil to me....


screwing around with the cubeprogrammer, `i got a connection....

pushed the buttons according to Fystec site, still no port showing in in arduino ide
Last edited by s6 noob on Tue Oct 05, 2021 1:11 pm, edited 1 time in total.
ag123
Posts: 1656
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: arduino on fysetc s6 board-STM32F446VE

Post by ag123 »

If BOOT0 is a button, this is the finger dance.
- press both BOOT0 and RESET.
- hold BOOT0, release RESET.
- release BOOT0 2 secs later.

Then use stm32cubeprogrammer to program it.

Before you build your sketch:
find the variant file in your local copy, edit that variant.cpp (e.g. variant_FYSETC_S6.cpp line 160)
https://github.com/stm32duino/Arduino_C ... 6.cpp#L160
to use these values

Code: Select all

// FHSE: 12
M: 6 
N: 168   <<---- you need to update this value in your local copy
P: 2 (RCC_PLLP_DIV2)
Q: 7 
// fusb: 48.0 fcpu: 168.0
Note that with this, your board is running at 168 Mhz system clock, not 180 Mhz
s6 noob
Posts: 15
Joined: Mon Apr 05, 2021 1:45 pm

Re: arduino on fysetc s6 board-STM32F446VE

Post by s6 noob »

yep done it,

got the cubeprogrammer now actually connected

but now I cannot select the start address in cubeprogrammer screen- is Step 4

also- the firmware download from git is a hex file
the fystect wiki talks about a bin file......

also there are now 2 different versions of the start address- but does this relate to V1,2 vs V2, or boards manufactured after a certain date?
Post Reply

Return to “IDE's”