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.
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
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.
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.
bar that, seems fine
stephen
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
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
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
You are right, my statement was about programming this board with Arduino.
Shibu Thomas
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..
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;
}
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.
Looks like your new variant is still accessing the Maple folder, so there is a mistake possibly in your changes to board.txt
###################### 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
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.
STM32 VL Discovery working fork for old Maple IDE
Any help on this is welcome.
The link you provided is for the HAL version isn’t it?
How stable is the HAL version of STM32duino?
The link you provided is for the HAL version isn’t it?
How stable is the HAL version of STM32duino?
I have not tested any other peripherals yet.
If anybody is interested, I can share the files.
I took the files from Maxxir’s link, and stitched up an ldscript using files from two different sources.
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
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.
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)
I downloaded only an hour ago.
I am getting the error < ‘PC9’ was not declared in this scope >
I downloaded only an hour ago.
I am getting the error < ‘PC9’ was not declared in this scope >
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
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
STM32 VL Discovery working fork for old Maple IDE
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.
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.


