Value Line Discovery Board

Phisatho
Fri Oct 28, 2016 2:22 pm
Where can I get the support files for STM32VLDISCOVERY board?
http://www.st.com/en/evaluation-tools/s … overy.html
This board has a STM32F100 chip running at 24MHz with a built-in ST-Link (The ST-Link itself is a STM32F103).

I could not find any pointers from the net.


RogerClark
Fri Oct 28, 2016 7:58 pm
What do you mean by “Support files”

Do you mean use the Arduino IDE with this board, if so then we do not have any existing code that would work with this board.

It uses a processor which is similar to the F103 but I suspect it has less timers etc, and it also runs at a much lower clock speed.

You would either need to make your own “variant” files using the libmaple repo, or use the STM32CubeMx to generate your own “variant” for the official STM Aruino core


Phisatho
Sat Oct 29, 2016 5:47 am
Both routes are beyond my capabilities.
Looks like I will have to put the back in its place in the box.
In any case, the board’s form factor makes it unsuitable for any project. My plan was to use it for testing code.

I was a bit elated when I saw this document:
http://air.imag.fr/mediawiki/images/7/7 … GU-GUO.pdf
which shows a discovery board listed in Arduino. Now I realise that it is F0 Discovery.


Pito
Sat Oct 29, 2016 8:16 am
FYI- my VL disco boards ran overclocked at 48MHz stable (one even 56MHz). At that speed they over-perform the F103 at 72MHz (as the VL have 0 flash waitstates, F103 has got 3 ws) :)

stevestrong
Sat Oct 29, 2016 9:56 am
Pito wrote: the VL have 0 flash waitstates, F103 has got 3 ws :)

RogerClark
Sat Oct 29, 2016 10:02 am
Phisatho wrote:Both routes are beyond my capabilities.
Looks like I will have to put the back in its place in the box.
In any case, the board’s form factor makes it unsuitable for any project. My plan was to use it for testing code.

I was a bit elated when I saw this document:
http://air.imag.fr/mediawiki/images/7/7 … GU-GUO.pdf
which shows a discovery board listed in Arduino. Now I realise that it is F0 Discovery.


zmemw16
Sat Oct 29, 2016 11:48 am
the vldiscovery f100 is breadboard friendly’ish, you may well need long side-long side joined breadboards and to span double supply rails, also spi(pa4-pa7) has to dangle off the end(its pins are orientated across the board :x ).
bar that, seems fine
stephen

RogerClark
Sat Oct 29, 2016 9:12 pm
I dont think it would be that hard to create a new variant what may work

MCUs in the F1 series are fairly similar and I managed to run code on a STLink dongle which is a STM32F101

BTW.
I read that PDF and all I could find was a link to a hacked version of the old leaflabs repo.
It had a discovery board files added, but there may have been other changes throughout the repo

Making a new variant, based on an existing board, is really not that hard.

@Phisatho if you are still interested in trying to use your Valueline board, It wouldnt take me long to duplicate the a folder and add a boards.txt entry, but someone else will probably need to help you with the PLL config stuff, as I just don’t have time at the moment


Phisatho
Sun Oct 30, 2016 5:32 am
Hi Roger,
I am giving a try.
What I am trying is –
1) Replicate one of the folders under ‘Variant’ folder and name it something like ‘VLDiscovery’.
2) Edit ‘board.h’ in the newly created folder to match the board – including the PLL multiplier.
3) Edit ‘Boards.txt’ and add an entry for the new board.
(I am at workplace at the moment and not near the PC where Arduino is installed. Some of the file / folder names could be wrong)

What else will I need to do?

Shibu Thomas


RogerClark
Sun Oct 30, 2016 7:47 am
Phisatho wrote:Hi Roger,
I am giving a try.
What I am trying is –
1) Replicate one of the folders under ‘Variant’ folder and name it something like ‘VLDiscovery’.
2) Edit ‘board.h’ in the newly created folder to match the board – including the PLL multiplier.
3) Edit ‘Boards.txt’ and add an entry for the new board.
(I am at workplace at the moment and not near the PC where Arduino is installed. Some of the file / folder names could be wrong)

What else will I need to do?

Shibu Thomas


Pito
Sun Oct 30, 2016 1:08 pm
stevestrong wrote:Pito wrote: the VL have 0 flash waitstates, F103 has got 3 ws :)

Rick Kimball
Sun Oct 30, 2016 1:13 pm
Phisatho wrote:I could not find any pointers from the net.

Phisatho
Sun Oct 30, 2016 1:29 pm
Hi Rick,
You are right, my statement was about programming this board with Arduino.

Shibu Thomas


stevestrong
Mon Oct 31, 2016 12:51 pm
Pito wrote:
F100: 0 wait states hard wired at 24MHz, you cannot change it via config file
F103: 0 wait state from 0 to 24 MHz, 1 wait state from 24 to 48 MHz and 2 wait states above.. you may change it in the config file..

Pito
Mon Oct 31, 2016 8:02 pm
@Pito, could you please indicate where and what to change for F103?
Here you are:
/**
* @file libmaple/flash.c
* @brief Flash management functions
*/

#include <libmaple/libmaple_types.h>
#include <libmaple/flash.h>

/**
* @brief Set flash wait states
*
* Note that not all wait states are available on every MCU. See the
* Flash programming manual for your MCU for restrictions on the
* allowed value of wait_states for a given system clock (SYSCLK)
* frequency.
*
* @param wait_states number of wait states (one of
* FLASH_WAIT_STATE_0, FLASH_WAIT_STATE_1,
* ..., FLASH_WAIT_STATE_7).
*/
void flash_set_latency(uint32 wait_states) {
uint32 val = FLASH_BASE->ACR;

val &= ~FLASH_ACR_LATENCY;
val |= wait_states;

FLASH_BASE->ACR = val;
}


stevestrong
Mon Oct 31, 2016 9:35 pm
Thanks, i’ll try it.

Phisatho
Fri Nov 04, 2016 7:26 pm
No luck so far with VLDiscovery. Initially I was able to compile, but could not get LED to blink.
But then I updated STM32duino. Now I am not able to compile.
Error message:
“C:\arduino-1.6.12\hardware\Arduino_STM32\STM32F1\cores\maple/boards.h:39:25: fatal error: board/board.h: No such file or directory”
I am stumped.

RogerClark
Fri Nov 04, 2016 8:05 pm
Which files did you change and add?

Looks like your new variant is still accessing the Maple folder, so there is a mistake possibly in your changes to board.txt


Phisatho
Sat Nov 05, 2016 5:02 pm
I deleted the boards.txt section I created and started from scratch. Copied genericSTM32F103R section and modified as below:
###################### STM32VLDISCOVERY ########################################

STM32VLDISCOVERY.name=STM32VLDISCOVERY
STM32VLDISCOVERY.vid.0=0x1EAF
STM32VLDISCOVERY.pid.0=0x0004
STM32VLDISCOVERY.build.variant=STM32VLDISCOVERY
STM32VLDISCOVERY.build.vect=VECT_TAB_ADDR=0x8000000
STM32VLDISCOVERY.build.core=maple
STM32VLDISCOVERY.build.f_cpu=24000000L
STM32VLDISCOVERY.build.board=STM32_VLDISCOVERY
STM32VLDISCOVERY.upload.use_1200bps_touch=false
STM32VLDISCOVERY.upload.file_type=bin
STM32VLDISCOVERY.upload.auto_reset=true
STM32VLDISCOVERY.upload.tool=stlink_upload

## STM32_VLDISCOVERY -------------------------
STM32VLDISCOVERY.menu.device_variant.STM32VLDISCOVERY=STM32F100RB (20k RAM. 128k Flash)
STM32VLDISCOVERY.menu.device_variant.STM32VLDISCOVERY.build.cpu_flags=-DMCU_STM32F103CB
STM32VLDISCOVERY.menu.device_variant.STM32VLDISCOVERY.build.ldscript=ld/jtag.ld
STM32VLDISCOVERY.menu.device_variant.STM32VLDISCOVERY.upload.maximum_size=131072
STM32VLDISCOVERY.menu.device_variant.STM32VLDISCOVERY.upload.ram.maximum_size=20480
STM32VLDISCOVERY.menu.device_variant.STM32VLDISCOVERY.upload.flash.maximum_size=131072

#---------------------------- UPLOAD METHODS ---------------------------

STM32VLDISCOVERY.menu.upload_method.STLinkMethod=STLink
STM32VLDISCOVERY.menu.upload_method.STLinkMethod.upload.protocol=STLink
STM32VLDISCOVERYmenu.upload_method.STLinkMethod.upload.tool=stlink_upload
STM32VLDISCOVERY.menu.upload_method.STLinkMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1


RogerClark
Sat Nov 05, 2016 7:27 pm
F cpu is not the only place that value is setup.

its not possible to configure clock speed purely in the boards.txt , because the phase locked loop multiplier value depends on crystal osc freq and also even if you use an external crystal oscillator

its all setup in the various variant folder files.


Phisatho
Sat Nov 05, 2016 7:47 pm
Do you find any errors in the boards.txt section?

RogerClark
Sat Nov 05, 2016 8:00 pm
I would not be able to tell just by looking, I’d have to run your whole setup on my machine to have a chance it finding the problem

Pito
Sat Nov 05, 2016 9:01 pm
Also mind the VL possess only 8kB ram..

maxxir
Wed Nov 09, 2016 3:48 am
Hi friends!
STM32 VL Discovery working fork for old Maple IDE

RogerClark
Wed Nov 09, 2016 5:01 am
maxxir wrote:Hi friends!
STM32 VL Discovery working fork for old Maple IDE

Phisatho
Sat Nov 12, 2016 6:25 pm
Thanks to maxxir’s link, I think I have sorted out the variant except the ldscript for F100RB.
Any help on this is welcome.

Phisatho
Sat Nov 12, 2016 6:34 pm
Roger,
The link you provided is for the HAL version isn’t it?
How stable is the HAL version of STM32duino?

RogerClark
Sat Nov 12, 2016 7:17 pm
Phisatho wrote:Roger,
The link you provided is for the HAL version isn’t it?
How stable is the HAL version of STM32duino?

Phisatho
Mon Nov 14, 2016 6:46 pm
At last, I got the LEDs blinking.
I have not tested any other peripherals yet.
If anybody is interested, I can share the files.

RogerClark
Mon Nov 14, 2016 8:21 pm
Are you using the latest version from github ?

Phisatho
Tue Nov 15, 2016 7:01 am
If you meant Arduino_STM32, yes.

RogerClark
Tue Nov 15, 2016 7:44 am
I mean, from here

https://github.com/stm32duino


Phisatho
Tue Nov 15, 2016 8:18 am
No, I did not.
I took the files from Maxxir’s link, and stitched up an ldscript using files from two different sources.

RogerClark
Tue Nov 15, 2016 8:33 am
OK

Rick Kimball has the same board and did some initial tests using the new repo (modified version of STM’s own official code), and he reported that it worked OK

I’d recommend you give the official repo a try.

Instructions to install are here

viewtopic.php?f=16&t=1553


Phisatho
Thu Nov 17, 2016 9:36 pm
I faced a few problems with it.
1) The port-pin way of addressing is not available. Pins are addressed the Arduino way (1,2,3..).
2) Even with Pin# way, all pins are not included.
3) Some of the pins are marked as ARDUINO_PIN_EXT / GPIO_PIN_MORPHO_ONLY. I don’t know how to access these pins.
4) MAX_DIGITAL_IOS is defined as 22 which is incorrect. (actual count is 51).
5) LED_BUILTIN is defined as 13 which is incorrect. (this board has 2 LEDs – PC8 and PC9).
6) The board pins are marked in the PXYY format and it does not have the arduino way of pin labeling. Hence Port/pin way of addressing (PA1, PA2..) would make more sense.

RogerClark
Thu Nov 17, 2016 9:40 pm
1) The port-pin way of addressing is not available. Pins are addressed the Arduino way (1,2,3..).

When did you download the core ? The pin mapping was updated yesterday

2) Even with Pin# way, all pins are not included.
See answer to 4

3) Some of the pins are marked as ARDUINO_PIN_EXT / GPIO_PIN_MORPHO_ONLY. I don’t know how to access these pins.
See answer to 4

4) MAX_DIGITAL_IOS is defined as 22 which is incorrect. (actual count is 51).

OK. Looks like this is a mistake in both the BluePill and the Value Line, however we can’t simply change this number, because of the way Wi6Labs wrote the code it is very wasteful and puts loads of constant data into RAM, and changing that count from 22 to 51 would mean it consumes more RAM than is available in the F100

We already have an issue logged for this, but its not that easy to fix, as it requires a lot of changes to the code :-(

5) LED_BUILTIN is defined as 13 which is incorrect. (this board has 2 LEDs – PC8 and PC9).
Easy to fix. I’ll push a fix for this now.

6) The board pins are marked in the PXYY format and it does not have the arduino way of pin labeling. Hence Port/pin way of addressing (PA1, PA2..) would make more sense.
See answer to question 1 (fixed already)


Phisatho
Thu Nov 17, 2016 10:21 pm
I made the variant for the legacy(?) version of STMduino – not HAL. I am yet to get a grip on the HAL version.
I downloaded only an hour ago.
I am getting the error < ‘PC9’ was not declared in this scope >

RogerClark
Thu Nov 17, 2016 10:28 pm
Phisatho wrote:I made the variant for the legacy(?) version of STMduino – not HAL. I am yet to get a grip on the HAL version.
I downloaded only an hour ago.
I am getting the error < ‘PC9’ was not declared in this scope >

RogerClark
Thu Nov 17, 2016 10:57 pm
Update.

Fixed some but not all issues in the HAL version.

I can’t fix the issue with not all pins being available at the moment as its a serious underlying problem with the STM code


RogerClark
Fri Nov 18, 2016 2:26 am
Update. STM Core.

I was able to fix the MAX PINS issue because it didnt impact RAM usage as the number of analogue pins did not change, just the number of digital pins.

However it revealed that the are yet more problems with the way the analogue config is handed :-( as you will be limited to using only 7 specific pins as analogue, which is probably not correct.

The F103C spec is for 2 ADC’s with 10 analogue channels,
F103R and F103V have 16 analogue channels

I can’t see from the spec any limitation for which pins can be used as analog, but I will post a separate question about this


maxxir
Sat Nov 19, 2016 10:22 am
RogerClark wrote:maxxir wrote:Hi friends!
STM32 VL Discovery working fork for old Maple IDE

ProudPagan
Wed Feb 15, 2017 4:52 am
Hello Phisatho,

Could you provide the code that you used? I can compile and what seems like upload the
blinky sketch correctly — see below — but see no blinking LEDs.

STM32 ST-LINK CLI v2.1.0
STM32 ST-LINK Command Line Interface

ST-LINK SN : ST-Link/V1 on E:
ST-LINK Firmware version : V1J11S0 (Need Update)
Old ST-LINK firmware detected!
Please upgrade it from ST-LINK->'Firmware update' menu.
Connected via SWD.
Connection mode : Normal.
Device ID:0x420
Device flash Size : 128 Kbytes
Device family :STM32F100xx Low/Medium density Value Line

Loading file...
Flash Programming:
File : C:\Temp\arduino_build_100163\sketch_feb14a.ino.bin
Address : 0x08000000
Flash memory programming...
±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± 0%
0%ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ 44%ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ 89%ÛÛÛÛÛÛ 100%
Flash memory programmed in 1s and 435ms.
Programming Complete.

MCU Reset.

Application started.


nikosx
Sun May 07, 2017 5:08 pm
Have tested the Serial2 communication with PC and works OK !! Also analogRead from pin. However DAC -analogWrite- does not seem to work..(program freeze).

nikosx
Sun May 07, 2017 5:10 pm
Both board LEDs (green – blue) work OK & User Push switch (also with Interrupt)

dannyf
Sun Jun 04, 2017 10:58 am
Where can I get the support files for STM32VLDISCOVERY board?

i’m porting a generic flavor of arduino to ARM chips and this particular board is my stm32 workbench: viewtopic.php?f=42&t=2131

so far, all GPIO, timing, Interrupt, analogRead/Write, UART, hardware SPI/I2C functionalities have been ported over.


RogerClark
Sun Jun 04, 2017 10:32 pm
Link spam to your site has been replaced with a link to the discussion on this site.

Leave a Reply

Your email address will not be published. Required fields are marked *