Page 1 of 1

STM32F103VET6 availabilty

Posted: Wed Feb 26, 2020 9:25 am
by sankarAMP2
Hello,
At present Im working STM32f103vet6 on roger's core https://github.com/rogerclarkmelbourne/Arduino_STM32
now I want to use https://github.com/stm32duino/Arduino_Core_STM32 this core.
In this core I can not find VET6 controller. Is that controller core is developing :roll:

Re: STM32F103VET6 availabilty

Posted: Thu Feb 27, 2020 9:48 pm
by .rpv
Hi, the ST core supports a lot of the ST MCU's but the individual variants may not be available, you can add one yourself using this guide.

I made a variant for this STM32F103VET6 MCU (I just updated the installation info that also I just noticed that I forgot to add :lol: )

So this variant should work for other boards based on the STM32F103VET6 MCU with an 8mhz external crystal.

Re: STM32F103VET6 availabilty

Posted: Fri Feb 28, 2020 4:16 am
by fredbox
Thanks for posting the link to the VET6. I have a board with a STM32F103VCT6 that I never got around to creating a variant.
It looks like the main difference is that the VCT6 has 256K flash instead of 512, and 48K ram instead of 64. All the pin names seem to be the same at first glance. Hopefully all that is needed is to specify the correct flash and ram sizes in the linker script.

Re: STM32F103VET6 availabilty

Posted: Fri Feb 28, 2020 5:35 am
by sankarAMP2
Thank you @.rpv

Re: STM32F103VET6 availabilty

Posted: Fri Feb 28, 2020 9:32 pm
by .rpv
fredbox wrote: Fri Feb 28, 2020 4:16 am Thanks for posting the link to the VET6. I have a board with a STM32F103VCT6 that I never got around to creating a variant.
It looks like the main difference is that the VCT6 has 256K flash instead of 512, and 48K ram instead of 64. All the pin names seem to be the same at first glance. Hopefully all that is needed is to specify the correct flash and ram sizes in the linker script.
Yes, I think you're right, even they share the same pinmaping file, you just have to change the boards.txt with the correct ram/flash sizes.

@sankarAMP2 you're welcome.


So this variant was made for boards using a 8mhz crystal, but if your boards have different crystal you just need to change the content of the SystemClock_Config() function on the variant.cpp file, you can generate the code using the stm32cubemx or the stm32cubeide software, on the how to add new variant guide says how to.

Re: STM32F103VET6 availabilty

Posted: Fri Feb 28, 2020 11:11 pm
by fredbox
Multiple LEDs are blinking and USB serial is saying 'hello world.'
It took about 15 minutes to get it working. Half of that was figuring out where to connect the wires from the ST-Link.

Flash and ram are reporting the correct values on upload.

Re: STM32F103VET6 availabilty

Posted: Mon Mar 02, 2020 1:47 pm
by sankarAMP2
hello @.rpv
blink ok, Serial ok but SPI not working.
i am trying to run graphics test code from adafruit its compiling but not able to get anything on display.
I kept like this.

Code: Select all

#define TFT_MISO PB14
#define TFT_MOSI PB15
#define TFT_CLK PB13
#define TFT_CS   PB12
#define TFT_DC    PD9
#define TFT_RST   PD8
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
as I am new to this core Want to know how to set SPI.
could you please explain me how to select SPI? multiple SPI slaves on single SPI :idea:

Re: STM32F103VET6 availabilty

Posted: Mon Mar 02, 2020 3:12 pm
by stas2z
sankarAMP2 wrote: Mon Mar 02, 2020 1:47 pm hello @.rpv
blink ok, Serial ok but SPI not working.
i am trying to run graphics test code from adafruit its compiling but not able to get anything on display.
I kept like this.

Code: Select all

#define TFT_MISO PB14
#define TFT_MOSI PB15
#define TFT_CLK PB13
#define TFT_CS   PB12
#define TFT_DC    PD9
#define TFT_RST   PD8
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
as I am new to this core Want to know how to set SPI.
could you please explain me how to select SPI? multiple SPI slaves on single SPI :idea:
according to adafruit's code, your constructor call will force library to use SOFTWARE spi implementation
and if this kind of init doesn't work, you need to check your connections, pin defines erc, cuz it cant be issued by hardware spi defines
to use this library with HW SPI you need to call contructor with SPIClass instance (and define your own instance with proper pins set like SPIClass MySPI(MOSI, MISO, SCLK);) or use it with only cs/cd pins and prepare preconfigured SPI instance (with SPI.setMOSI(...)/setMISO(...) etc)

to select slave you need to set pin, connected to slave CS you need to communicate, LOW and others have to be HIGH
but most spi libraries will set LOW configured CS pin automatically, so you usually just need to set all CS pins HIGH at setup()

Re: STM32F103VET6 availabilty

Posted: Tue Mar 03, 2020 5:06 am
by sankarAMP2
yeah its came by keeping
SPI.setMISO(PB14);
SPI.setMOSI(PB15);
SPI.setSCLK(PB13);
SPI.setSSEL(PB12);
in setup()
but printing is very slow when compare with my old core.
see graphics test code run resultswith this core

Code: Select all

Screen fill              
10:33:02 [RX] - 4987978<CR><LF>
Text                     
10:33:04 [RX] - 271673<CR><LF>

10:33:07 [RX] - Lines                    
10:33:21 [RX] - 2495543<CR><LF>
Horiz/Vert Lines         
10:33:23 [RX] - 413266<CR><LF>
Rectangles (outline)     
10:33:25 [RX] - 262321<CR><LF>
Rectangles (filled)      
10:33:37 [RX] - 10353227<CR><LF>
Circles (filled)         
10:33:40 [RX] - 1209731<CR><LF>
Circles (outline)        
10:33:41 [RX] - 1098647<CR><LF>
Triangles (outline)      
10:33:43 [RX] - 568266<CR><LF>
Triangles (filled)       
10:33:48 [RX] - 3386369<CR><LF>
Rounded rects (outline)  
10:33:50 [RX] - 510888<CR><LF>
Rounded rects (filled)   
10:34:02 [RX] - 10303390<CR><LF>
Done!<CR><LF>

Re: STM32F103VET6 availabilty

Posted: Tue Mar 03, 2020 8:57 am
by stas2z
if you are still calling construcor for software spi, it's ok that it's slow
if not, use SPI.setClockDivider(2..256) to set faster bus clock (by default it close to 4MHz, but depends on your hardware), or, better, use SPISettings to configure your slaves with proper params for each