Coder Social home page Coder Social logo

platformio / platform-ststm32 Goto Github PK

View Code? Open in Web Editor NEW
387.0 23.0 305.0 9.74 MB

ST STM32: development platform for PlatformIO

Home Page: https://registry.platformio.org/platforms/platformio/ststm32

License: Apache License 2.0

Python 99.02% C++ 0.98%
platformio stm32 iot firmware continuous-integration continuous-deployment build arduino platformio-platform

platform-ststm32's Introduction

ST STM32: development platform for PlatformIO

Build Status

The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development.

  • Home (home page in the PlatformIO Registry)
  • Documentation (advanced usage, packages, boards, frameworks, etc.)

Usage

  1. Install PlatformIO
  2. Create PlatformIO project and configure a platform option in platformio.ini file:

Stable version

[env:stable]
platform = ststm32
board = ...
...

Development version

[env:development]
platform = https://github.com/platformio/platform-ststm32.git
board = ...
...

Configuration

Please navigate to documentation.

platform-ststm32's People

Contributors

benwaffle avatar caiosignor avatar coderkalyan avatar daniel-starke avatar erdnaxe avatar esden avatar gudnimg avatar ivankravets avatar jcw avatar kilroy42 avatar long-pham avatar masa6372 avatar maxgerhardt avatar niki-timofe avatar owennewo avatar pmantoine avatar podiumnoche avatar rhapsodyv avatar sczekajewski avatar tedor avatar truschke avatar ubis avatar unn4m3d avatar valeros avatar victorpv avatar vipqualitypost avatar walle256 avatar xc0000005 avatar zapta avatar zgoda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

platform-ststm32's Issues

mbed-filesystem compile error


Configuration

Operating system:Ubuntu 17.04 x64

PlatformIO Version (platformio --version): PlatformIO, version 3.4.1a5

Description of problem

Failed to compile mbed-filesystem

Steps to Reproduce

  1. Create any mbed project from example
  2. Add #include "FATFileSystem.h" at main.cpp
  3. Try to compile

Actual Results

[Mon Jul 10 12:47:23 2017] Processing nucleo_f411re (upload_protocol: stlink; platform: ststm32; board: nucl
eo_f411re; framework: mbed)

Verbose mode can be enabled via -v, --verbose option
Collected 8 compatible libraries
Looking for dependencies...

Library Dependency Graph
|--
|--
Compiling .pioenvs/nucleo_f411re/src/main.o
Compiling .pioenvs/nucleo_f411re/lib/filesystem/Dir.o
Compiling .pioenvs/nucleo_f411re/lib/filesystem/File.o
In file included from /home/maximus/.platformio/packages/framework-mbed/features/filesystem/Dir.cpp:17:0:
/home/maximus/.platformio/packages/framework-mbed/features/filesystem/Dir.h:20:35: fatal error: filesystem/F
ileSystem.h: No such file or directory
#include "filesystem/FileSystem.h"
^
compilation terminated.
Linter
Severity Provider Description Line
Git
GitHub (preview)
PIO Buildsrc/main.cpp0208:1(1, 26)
LFUTF-8C++0 files

Expected Results

If problems with PlatformIO Build System:

The content of platformio.ini:

Insert here...

Source file to reproduce issue:

Insert here...

Additional info

Support for maple mini

Hi, I'm wondering if it's viable to add mapple mini to the supported devices list. Using the arduino ide and arduino stm32 it's possible but I don't know how hard would be to do the same with platformio.

Thank you

mbed RTOS not building on board disco_f051r8

Tinkering with the examples for mbed platform found in here, I get the following error when trying to compiled the mbed-rtos example:

[Tue Aug  9 10:43:04 2016] Processing disco_f051r8 (platform: ststm32, board: disco_f051r8, framework: mbed)
--------------------------------------------------------------------------------
arm-none-eabi-g++ -o .pioenvs/disco_f051r8/firmware.elf -Wl,--gc-sections -Wl,--wrap,main -mcpu=cortex-m0 -mthumb --specs=nano.specs -Wl,-T"/home/carvalhais/.platformio/packages/framework-mbed/variant/DISCO_F051R8/mbed/TARGET_DISCO_F051R8/TOOLCHAIN_GCC_ARM/STM32F0xx.ld" .pioenvs/disco_f051r8/src/main.o -L/home/carvalhais/.platformio/packages/ldscripts -L/home/carvalhais/.platformio/packages/framework-mbed/variant/DISCO_F051R8/mbed/TARGET_DISCO_F051R8/TOOLCHAIN_GCC_ARM -L/home/carvalhais/.platformio/packages/framework-mbed/libs/rtos/TARGET_DISCO_F051R8/TOOLCHAIN_GCC_ARM -L/home/carvalhais/.platformio/packages/frameworkmbed/libs/rtos/TARGET_DISCO_F051R8/TOOLCHAIN_GCC_ARM -L.pioenvs/disco_f051r8 -Wl,--start-group -Wl,-whole-archive .pioenvs/disco_f051r8/libFrameworkMbed.a -Wl,-no-whole-archive -lsupc++ -lmbed -lc -lgcc -lc -lgcc -lm -lstdc++ -lnosys -lrtos -lrtx -Wl,--end-group
/home/carvalhais/.platformio/packages/framework-mbed/libs/rtos/TARGET_DISCO_F051R8/TOOLCHAIN_GCC_ARM/librtx.a(HAL_CM0.o): In function `SysTick_Handler':
HAL_CM0.S:(.text+0x12c): multiple definition of `SysTick_Handler'
.pioenvs/disco_f051r8/libFrameworkMbed.a(system_stm32f0xx.o):system_stm32f0xx.c:(.text.SysTick_Handler+0x0): first defined here
collect2: error: ld returned 1 exit status
scons: *** [.pioenvs/disco_f051r8/firmware.elf] Error 1
========================= [ ERROR ] Took 0.48 seconds =========================

However, if I try the mbed-blink example, the code compiles without any issue, which suggests the error might be in the "rtos.h" file.

It seems this is a linker issue confirmed by other users, as it can be seen in this community thread here.

I'm opening this ticket on behalf of valeros, as he asked in the link above.

Request: SPL support for stm32f103-series

I have recently acquired a few STM32F103C8T6 (Cortex-M3) & STM32F030F4P6 (Cortex-M0) mini boards, would you mind adding CMSIS / SPL support for those to this platform?

I see the STM32L1, STM32F3, STMF4 series have, so I hope it isn't too much work.

Thanks!

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/41887663-request-spl-support-for-stm32f103-series?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github).

stm32 nucleo f207zg: Sample code fails to compile, but compiles in ARM mbed online compiler

$ pio --version
PlatformIO, version 3.3.0a17

$ pio update

Platform Manager
================
Platform Atmel AVR
--------
Updating atmelavr                        @ 1.4.5          [Up-to-date]
Updating toolchain-atmelavr              @ 1.40902.0      [Up-to-date]
Updating tool-avrdude                    @ 1.60300.0      [Up-to-date]

Platform Espressif 8266
--------
Updating espressif8266                   @ 1.3.0          [Up-to-date]
Updating tool-mkspiffs                   @ 1.102.0        [Up-to-date]
Updating tool-esptool                    @ 1.409.0        [Up-to-date]
Updating tool-espotapy                   @ 1.0.0          [Up-to-date]
Updating framework-arduinoespressif8266  @ 1.20300.1      [Up-to-date]
Updating toolchain-xtensa                @ 1.40802.0      [Up-to-date]

Platform Native
--------
Updating native                          @ 1.1.0          [Up-to-date]

Platform ST STM32
--------
Updating ststm32                         @ 1.8.1          [Up-to-date]
Updating tool-stm32duino                 @ 1.0.0          [Up-to-date]
Updating framework-mbed                  @ 3.137.0        [Up-to-date]
Updating toolchain-gccarmnoneeabi        @ 1.40804.0      [Up-to-date]
Updating tool-stlink                     @ 1.10200.0      [Up-to-date]


Library Manager
===============

Taking this sample code snippet from ARM mbed sources

#if !FEATURE_LWIP
    #error [NOT_SUPPORTED] LWIP not supported for this target
#endif

#include "mbed.h"
#include "EthernetInterface.h"
#include "TCPServer.h"
#include "TCPSocket.h"

#define HTTP_STATUS_LINE "HTTP/1.0 200 OK"
#define HTTP_HEADER_FIELDS "Content-Type: text/html; charset=utf-8"
#define HTTP_MESSAGE_BODY ""                                     \
"<html>" "\r\n"                                                  \
"  <body style=\"display:flex;text-align:center\">" "\r\n"       \
"    <div style=\"margin:auto\">" "\r\n"                         \
"      <h1>Hello World</h1>" "\r\n"                              \
"      <p>It works !</p>" "\r\n"                                 \
"    </div>" "\r\n"                                              \
"  </body>" "\r\n"                                               \
"</html>"

#define HTTP_RESPONSE HTTP_STATUS_LINE "\r\n"   \
                      HTTP_HEADER_FIELDS "\r\n" \
                      "\r\n"                    \
                      HTTP_MESSAGE_BODY "\r\n"

int main()
{
    printf("Basic HTTP server example\n");

    EthernetInterface eth;
    eth.connect();

    printf("The target IP address is '%s'\n", eth.get_ip_address());

    TCPServer srv;
    TCPSocket clt_sock;
    SocketAddress clt_addr;

    /* Open the server on ethernet stack */
    srv.open(&eth);

    /* Bind the HTTP port (TCP 80) to the server */
    srv.bind(eth.get_ip_address(), 80);

    /* Can handle 5 simultaneous connections */
    srv.listen(5);

    while (true) {
        srv.accept(&clt_sock, &clt_addr);
        printf("accept %s:%d\n", clt_addr.get_ip_address(), clt_addr.get_port());
        clt_sock.send(HTTP_RESPONSE, strlen(HTTP_RESPONSE));
    }
}

works with the online compiler on developer.mbed.org, but fails in pio:

$ pio run 
(...)
Compiling .pioenvs/nucleo_f207zg/lib/rtos/RtosTimer.o
Compiling .pioenvs/nucleo_f207zg/lib/rtos/Semaphore.o
In file included from src/main.cpp:6:0:
/Users/cassini/.platformio/packages/framework-mbed/features/unsupported/net/eth/EthernetInterface/EthernetInterface.h:24:2: error: #error The Ethernet Interface library is not supported on this target
#error The Ethernet Interface library is not supported on this target
^
In file included from /Users/cassini/.platformio/packages/framework-mbed/platform/platform.h:28:0,
from /Users/cassini/.platformio/packages/framework-mbed/mbed.h:55,
from /Users/cassini/.platformio/packages/framework-mbed/rtos/RtosTimer.cpp:26:
/Users/cassini/.platformio/packages/framework-mbed/platform/toolchain.h:23:2: warning: #warning toolchain.h has been replaced by mbed_toolchain.h, please update to mbed_toolchain.h [since mbed-os-5.3] [-Wcpp]
#warning toolchain.h has been replaced by mbed_toolchain.h, please update to mbed_toolchain.h [since mbed-os-5.3]
^
src/main.cpp:7:23: fatal error: TCPServer.h: No such file or directory

$ cd ~/.platformio
$ find . -name "EthernetInterface.h"
./packages/framework-mbed/features/FEATURE_LWIP/lwip-interface/EthernetInterface.h
./packages/framework-mbed/features/unsupported/net/eth/EthernetInterface/EthernetInterface.h

The error message The Ethernet Interface library is not supported on this target is due to a check for presence of a define !defined(TARGET_STM32F4), suggesting that an STM32F2xx boards is not compatible. But when compiling and flashing this using the online compiler, the sample works.

framework: arduino - using ST-Link probe will not reset the board after upload -

Hello,

I am using an ST-Link probe for uploading on STM32F103 and F407 boards.
The problem is that the boards will not be reset after upload.

The root cause seems to be the used flash utility "st-flash.exe" from ".platformio\packages\tool-stlink" folder.

The Arduino IDE uses "ST-LINK_CLI.exe" from the .platformio\packages\tool-stm32duino\stlink folder, and it can successfully reset the boards after uploading.

Is it possible to use the same utility for ST-Link_CLI for uploading as Arduino does? Or at least make an option to select an appropriate upload tool (with parameters) via board definition file?

Thank you in advance.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Program linking working in previous version not working in 3.1

I have a program that uses arduino's SD library. It used to compile and work (using 3.0 development version and std32duino) but it gives a linker error with the latest version. I reduced the code to it minimum:
`#define SD_CS 25

include <Arduino.h>

include <SPI.h>

include <SD.h>

void setup() {
SPI.setModule(2);
pinMode(SD_CS, OUTPUT);
SD.begin(SD_CS);
}

void loop() {
}`

I get the error: undefined reference to `_sbrk' when linking. I have tried to set lib_ldf_mode to both 1 and 2. I have also tried installing the SD library from within platformio IDE as well as add it to the libs folder of the project.
Any ideas why this is not working with this version?

header not found with genericSTM32F103C8 board

I'm testing if platformio could be used for developing in arduino framework with genericSTM32F103C8 board.

I run into an issue: I don't know if this is the right repository to issue this but here it is now.

it seems it can't find header :

MapleFreeRTOS821.h

.platformio\packages\framework-arduinoststm32\STM32F1\libraries\FreeRTOS821\MapleFreeRTOS821.h

The file is in the file system correctly

.platformio\packages\framework-arduinoststm32\STM32F1\libraries\FreeRTOS821\MapleFreeRTOS821.h

Thanks, for help.

Some other info:

C:\Temp\e34_lcd\BPCB>platformio platform show ststm32
ststm32 ~ ST STM32
==================
The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development.



Version: 1.3.0

Home: http://platformio.org/platforms/ststm32

License: Apache-2.0

Frameworks: cmsis, spl, libopencm3, mbed, arduino



Package tool-stm32duino

-----------------------
Type: uploader

Requirements: ~1.0.0

Installed: No (optional)


Package framework-libopencm3

----------------------------
Type: framework

Requirements: ~1.1.0

Installed: No (optional)


Package framework-arduinoststm32

--------------------------------
Type: framework

Requirements: ~2.0.0

Installed: Yes
Description: Arduino Wiring-based Framework (ST STM32 Core)

Url: https://github.com/rogerclarkmelbourne/Arduino_STM32

Version: 2.0.0



Package toolchain-gccarmnoneeabi

--------------------------------
Type: toolchain

Requirements: >=1.40803.0,<1.40805.0

Installed: Yes
Description: gcc-arm-embedded

Url: https://launchpad.net/gcc-arm-embedded

Version: 1.40804.0



Package tool-stlink

-------------------
Type: uploader

Requirements: ~1.10200.0

Installed: No (optional)


Package framework-spl

---------------------
Type: framework

Requirements: ~1.10201.0

Installed: No (optional)


Package framework-cmsis

-----------------------
Type: framework

Requirements: ~1.40300.0

Installed: No (optional)


Package framework-mbed

----------------------
Type: framework

Requirements: ~3.126.0

Installed: No (optional)



C:\Temp\e34_lcd\BPCB>platformio platform list
ststm32 ~ ST STM32
==================
The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to
 MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal
 processing, and low-power, low-voltage operation, while maintaining full integration and ease of development.

Home: http://platformio.org/platforms/ststm32
Packages: framework-arduinoststm32, toolchain-gccarmnoneeabi
Version: 1.3.0

platformio.ini

[env:genericSTM32F103C8]
platform=ststm32
board=genericSTM32F103C8
framework=arduino

[platformio]
src_dir=BPCB

C:\Temp\e34_lcd\BPCB>platformio run
[11/03/16 12:56:35] Processing genericSTM32F103C8 (platform: ststm32, board: genericSTM32F103C8, framework: arduino)
-----------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
Converting BPCB.ino
Collected 24 compatible libraries
Looking for dependencies...
Project does not have dependencies
Compiling .pioenvs\genericSTM32F103C8\src\BPCB.ino.o
Compiling .pioenvs\genericSTM32F103C8\src\mcp_can.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\adc.o
C:/Temp/e34_lcd/BPCB/BPCB/BPCB.ino:3:30: fatal error: MapleFreeRTOS821.h: No such file or directory
#include <MapleFreeRTOS821.h>
^
compilation terminated.
In file included from BPCB\mcp_can.h:27:0,
from BPCB\mcp_can.cpp:24:
BPCB\mcp_can_dfs.h:28:17: fatal error: SPI.h: No such file or directory
#include <SPI.h>
^
compilation terminated.
Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\adc_f1.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\bkp_f1.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\dac.o
Compiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\dma.o
*** [.pioenvs\genericSTM32F103C8\src\BPCB.ino.o] Error 1
C*ompiling .pioenvs\genericSTM32F103C8\FrameworkArduino\libmaple\dma_f1.o** [.pioenvs\genericSTM32F103C8\src\mcp_can.o]
Error 1

============================================== [ERROR] Took 1.83 seconds ==============================================

C:\Temp\e34_lcd\BPCB>



Upload with ST-Link 2.1 fail after firmware upgrade of ST-Link

The upload with ST-Link 2.1 to STM32 Nucleo boards fails after firmware upgrade of the ST-Link.
ST-Link 2.1 works with Version V2J25M14, but fails with firmware V2J27M15 and later.
I have this problem with Nucleo- STM32F303K8 and STM32F432KC. I have also another Nucleo STM32F303 with ST-Link firmware V2J25M14 and it works without any problem. The latest firmware of ST-Link is V2J28M18

upload via STM32duino bootloader

Hi,
I tried all kinds of hints from other issues, but cannot get upload via STM32duino bootloader working in platformio. Inside Arduino it works flawless!

I got installed:

ststm32 @ 3.0.0
framework-arduinoststm32 @ 2.0.0
tool-stlink @ 1.10301.0
tool-stm32duino @ 1.0.0
toolchain-gccarmnoneeabi @ 1.40804.0

platformio.ini:

[env:STM]
platform = ststm32
framework = arduino
board = bluepill_f103c8

result:
s2t-flash 1.3.1017-07-03T13:39:09 WARN src\usb.c: Couldn't find any ST-Link/V2 devices
Well, makes some sense although I would expect that it uses the STM32duino bootloader...

So if I change then upload_protocol = serial the result is:

Auto-detected: COM13
Uploading .pioenvs\STM\firmware.bin
stm32flash 0.4Failed to init device.


http://stm32flash.googlecode.com/

Using Parser : Raw BINARY
Interface serial_w32: 230400 8E1

This doesn't seam right to me since the upload process from Arduino is different and uses a java -jar maple_loader.jar %1 %2 %3 %4 %5 %6 %7 %8 %9 uploader:

C:\arduino-1.6.11\hardware\Arduino_STM32/tools/win/maple_upload.bat COM13 2 1EAF:0003 C:\Users\sl\AppData\Local\Temp\build0fed3136074a62d7fa3761becf2703b1.tmp/StressSerialUSB.ino.bin 
maple_loader v0.1
Resetting to bootloader via DTR pulse
Searching for DFU device [1EAF:0003]...
Found it!

Opening USB Device 0x1eaf:0x0003...
Found Runtime: [0x1eaf:0x0003] devnum=1, cfg=0, intf=0, alt=2, name="STM32duino bootloader v1.0  Upload to Flash 0x8002000"
Setting Configuration 1...
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x0400
bytes_per_hash=417
Starting download: [##################################################] finished!
error resetting after download: usb_reset: could not reset device, win error: The system cannot find the file specified.
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present

Done!

Resetting USB to switch back to runtime mode

Any idea how to do it?

Thanks!

Support SPL framework for STM32F0

(issue moved from platformio/platformio-core#683)

The assembly file framework-spl/stm32/cmsis/variants/stm32f0/startup_stm32f0xx.s is named with a lower-case .s, causing build problems. Renaming to the upper-case .S helps, but it should better be renamed in the SPL F0 package. Or the build scripts should be modified to handle both, .s and .S.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39592457-support-spl-framework-for-stm32f0?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github).

bluepill_f103c8 cannot buil mbed-rtos without specific build_flags

if not set any build flag RTOS fail with error:
~/.platformio/packages/framework-mbed/rtos/rtx/TARGET_CORTEX_M/RTX_CM_lib.h:609:2: error: #error "no target defined"

by looking what is inside that file i found closest TARGET_STM32F103RB - so need to add build_flags = -D TARGET_STM32F103RB in platformio.ini to be to be able build.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38255605-bluepill_f103c8-cannot-buil-mbed-rtos-without-specific-build_flags?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github).

Support for SPL framework on STM32L1

Moved from platformio/platformio-core#348

/cc @laurentS


I'm testing code on ST Nucleo L152RE, which is based on STM32L152 mcu. I found code examples that use SPL framework for this MCU, but cannot get them to compile with platformio.
When I try to add SPL to frameworks (along with mbed), I get a "SPL not supported for this platform" error.
Why is this? I understand that SPL is linked to the MCU, not the board. So I'm expecting I should be able to use it for that MCU. Any suggestions?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39568071-support-for-spl-framework-on-stm32l1?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github).

Build Error for nucleo_f429zi

This version of ststm32 gives build error for nucleo_f429zi.
1.7.0 version works ok, but when I upgrade it to 1.8.1, it started to give this error;

Linking .pioenvs/nucleo_f429zi/firmware.elf
/Users/eeyurdakul/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld:
.pioenvs/nucleo_f429zi/STM32F429xI.ld.link_script.ld:90: syntax error
collect2: error: ld returned 1 exit status
*** [.pioenvs/nucleo_f429zi/firmware.elf] Error 1

I tested blink example for all other boards, it works well with them, the problem occurs only for nucleo_f429zi.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Wrong linker script used for generic_stm32f103c ( with fix proposal )

Problem was that platformio builded and uploaded (dfu) the flash file OK but it did not boot.

Reason seems to be platformio links files with linker script 'jtag.ld'

Arduino IDE build uses 'bootloader_20.ld' script

-T"bootloader_20.ld"

So I added the bolded rows into arduino.py and it works again.

I don't know if this is the right way but obviously the row board.get("upload.boot_version", 0) == 2: did not work for generic_stm32f103c and DFU upload option.

if "stm32f103r" in board.get("build.mcu", ""):
        env.Replace(LDSCRIPT_PATH="bootloader.ld")
    **elif "stm32f103c" in board.get("build.mcu", ""):
        env.Replace(LDSCRIPT_PATH="bootloader_20.ld")**
    elif board.get("upload.boot_version", 0) == 2:
        env.Replace(LDSCRIPT_PATH="bootloader_20.ld")

This issue has been a blocker for me in using platformio for many months but now I finally am able to use it again !

Missing "tool-stm32duino" for ARMv7 Host

Trying to upload the code via "platformio run -t upload" but unfortunately it bails out with...

PackageManager: Installing tool-stm32duino @ ~1.0.0
Error: Could not find a version that satisfies the requirement '~1.0.0' for your system 'linux_armv7l'

Worth noting that stm32flash does exist for ARMv7 but I'm not 100% sure what tool-stm32duino entirely consists of.

In the meantime, I've used "stm32flash -b 1000000 -i -23,23 /dev/ttyAMA0 -w .pioenvs/stm32/firmware.bin" but that seems to end at "Wrote address 0x08020000 (47.46%) Done" (rather than 100%) but I'm not sure if that's actually an issue or not, uploading things other than the platformio generated firmware.bin does reach 100%.

Flashing problem Arduino_STM32 DFU devices

I have a new chinese board with a STM32F103CBT6; 1 reset button, 1 user button.

I like to program it over its inbuilt USB with the Arduino_STM32 framework.
I'm working on OSX 10.11 with dfu-utils installed over homebrew.

my init file:
[env:genericSTM32F103CB]
platform = ststm32
board = genericSTM32F103CB
framework = arduino
upload_protocol = dfu

A simple Blink Sketch compiles but i get an error: "no upload_port".
In concole: "dfu-util -l" i can see 2 DFU devices for the board (FLASH and RAM).
The bootloader on the board is blinking the LED fast, holding both buttons sets the LED low.

I tried several reset timings with the reset button and/or user button. No success as the DFU wont get recognized by platformio...

Maybe another bootloader is necessary?

On a side note: I tried with it's little brother board STM32F103C8T6, with only 1 reset button and BOOT0/BOOT1 options.
Here i could successfully flash the bootloader 2.0 with a USB-TTL converter. Flashing over USB does not succeed with same error as above (similar init file). "dfu-util -l" does not show me any devices though. Thorough resetting tactics did not succeed.

After a few days of trials I might just give up and program the boards with my USB-TTL adapter.

Maybe someone could present me the proper workflow (flashing bootloaders, installations for platformio/dfu-utils/STM32frameworks, init files,..) as I might have done something wrong there...

Thanks!

mbed, SPL, arduino support for STM32F411E-DISCO

I have a couple STM32F411E-DISCO boards, which are based on the STM32F411VET6. This board doesn't seem to be in the database!

I'd be happy to help out with a pull request if someone can point to guidelines and give me an idea where to start.

REQUEST: Update of framework-arduinoststm32

Recently there has been a lot of pull requests brought into master on the base framework for stm32duino: https://github.com/rogerclarkmelbourne/Arduino_STM32

These have added significant functionality and additional compatibility with the arduino API.

It looks like the last pull from this for package framework-arduinoststm32 2.0.0 was in Oct 2016.

Would it be possible to get a revised package version pulled from master on the above repo?

Upgrade bundled stlink utility from 1.1 to 1.3

Hello,

A couple of users (including myself) have faced issues with the bundled stlink utility unable to flash or debug the compiled binaries. I have tried to flash with the 1.3 version binary downloaded from the texane/github page and the binary works as expected.

Can I trouble the platformio team to spend some time upgrading the bundled stlink to 1.3??
It will reduce a couple of issues related to flashing and debugging.

Add support for STM32 Nucleo board - L432KC (and ST Nucleo L011K4)

It would be great to have platformio support for the Nucleo board (L432KC).
At least a schematic of how to add new boards of the same family would be really helpful.

The other boards of the same Nucleo family that are supported are listed below:

  1. ST Nucleo F303K8
  2. ST Nucleo F031K6
  3. ST Nucleo F042K6
  4. ST Nucleo L031K6

Also another missing one from the same family- ST Nucleo L011K4

Thanks

Chandra

Extending libopenCM3 support for other processors

Hello,
I would like to thank the team for the wonderful work and prompt response shown to me and many others like me on the forum.

I have yet another request that I believe will make platformio much more potent and feature rich.
The present package for libopenCM3 even in platformio contains the processors and families that is mostly uptodate.

However, the platformio IDE itself has limited support for the number of processors and boards.
Right now, I am having to deviate away from platformio and use the makefiles method to work with libopencm3. I would like to do it within platformio IDE itself (The peripheral support and features make it too hard to move away from platformio :-D ).

I would like to request the team to see if they can make the build script a little more generic so as to include the processors and families that are supported by libopenCM3.
I think many more users will be eager to see the extended support for the processors.

@valeros @ivankravets
Thank you and have a nice day!! :-)


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

`.text' will not fit in region `FLASH'

platformio.ini:

[env:xdot_l151cc]
platform = ststm32
board = xdot_l151cc
framework = mbed
build_flags = -Wl,--gc-sections -L./lib -lxDot-GCC_ARM
extra_script = extra_script.py

extra_script.py:

Import('env')

env.Append(
  LINKFLAGS=[
      "-Wl,--gc-sections,--relax",
      "-Os"
  ]
)

env.Append(
  CCFLAGS=[
      "-g",
      "-fdata-sections",
      "-ffunction-sections",
      "-Os"
  ]
)

I am trying to link in the libxDot-GCC_ARM.a from the mBed compiler. My project obviously builds fine there.

When I attempt to build using platformio 2.0beta I get something like this:

Archiving .pioenvs/xdot_l151cc/lib/libMTS-Utils.a
Archiving .pioenvs/xdot_l151cc/lib/libxDot-mbed5.a
Indexing .pioenvs/xdot_l151cc/lib/libMTS-Utils.a
Indexing .pioenvs/xdot_l151cc/lib/libxDot-mbed5.a
Archiving .pioenvs/xdot_l151cc/lib/librtos.a
Indexing .pioenvs/xdot_l151cc/lib/librtos.a
Linking .pioenvs/xdot_l151cc/firmware.elf
/Users/rrodriguez/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/
bin/ld: .pioenvs/xdot_l151cc/firmware.elf section `.text' will not fit in region `FLASH'
/Users/rrodriguez/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/
bin/ld: region `FLASH' overflowed by 38020 bytes
collect2: error: ld returned 1 exit status
*** [.pioenvs/xdot_l151cc/firmware.elf] Error 1

I have tried both GCC 4.8.4 and 4.9.3. It seems to not want to strip the imported lib. The files its linking are tiny, so I'm assuming its that:

Roberts-iMac:appa-mbed-fw rrodriguez$ ls -alh .pioenvs/xdot_l151cc/lib/
total 224
drwxr-xr-x   8 rrodriguez  staff   272B Mar 10 08:18 .
drwxr-xr-x  13 rrodriguez  staff   442B Mar 10 08:18 ..
drwxr-xr-x   4 rrodriguez  staff   136B Mar 10 08:18 ISL29011
-rw-r--r--   1 rrodriguez  staff   5.0K Mar 10 08:18 libISL29011.a
-rw-r--r--   1 rrodriguez  staff     8B Mar 10 08:18 libMTS-Utils.a
-rw-r--r--   1 rrodriguez  staff    96K Mar 10 08:18 librtos.a
-rw-r--r--   1 rrodriguez  staff     8B Mar 10 08:18 libxDot-mbed5.a
drwxr-xr-x  13 rrodriguez  staff   442B Mar 10 08:18 rtos

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Programming MultiTech mDot using PlatformIO instead of ARM mbed online compiler

Hello PlatformIO !

I am using the MultiTech mDot in my projects. Actually, I use mbed online compiler and MultiTech MDK to program the board.

I would like to do all of it using Platformio and a cable USB -> Serial (FTDI chip).

As the first step, I use a basic code :

#include "mbed.h"

int main() {
// pin PA_1 is connected to my LED
DigitalOut led(PA_1);

while (true) {
        led = !led;
        wait_ms(3000);
    }
}

It works fine when compiled with mbed online compiler and then uploaded firmware.bin with MultiTech MDK. But when I compile it with Platformio and upload the firmware.bin with Multitech MDK, it doesn't blink my LED.

Here is my .ini content :

[env:mts_mdot_f411re]
platform = ststm32
board = mts_mdot_f411re
framework = mbed

My setup :

  • Windows 10
  • PlatformIO IDE 1.6.0 | CLI 3.1.0
  • Does someone have any clue ?

If you need any more information, please ask me !

Thank you in advance.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38335856-programming-multitech-mdot-using-platformio-instead-of-arm-mbed-online-compiler?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github).

Support CMSIS for STM32F0

It seems like framework-cmsis has variants for F1, F2, F3, F4, L0 and L1, but not for F0. I probably could copy CMSIS sources into my project source tree and go without any frameworks, but in this case all *.S boot files would be built instead of just one. So as a better solution I suggest to add ST's CMSIS implementation for F0 as well into PlatformIO framework package.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39595742-support-cmsis-for-stm32f0?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github).

st-flash: error while loading shared libraries: libstlink-shared.so.1:

I am receiving the following error when uploading.

st-flash: error while loading shared libraries: libstlink-shared.so.1: cannot open shared object file: No such 
file or directory
*** [upload] Error 127

This is on Atom version running on Ubuntu 17.04 . I have found this link to the same error in the stlink repository.

I found where platformio stores these tools and ran them. In a system terminal they reported the same error but in the platformio spawned terminal they worked. The suggestions offered there did not work for obvious reasons. Leads me to believe the pio environment needs to cloned into that build process.

Two board configs with same mcu

Alright, I noticed that there is two board configs with same mcu. However, they have some different options, and one is using mbed framework and another one is arduino.

As I can see, there are a few options:

  • keep configs as it is now - there might be possible board config duplicates in the near future...
  • keep one config for one framework, if another framework is used, make these config changes inside builder script - I think it should be a better way to do this...
  • use one config only, change one framework directory structure so it would be similar to another one - due this, it should be maintained when there is any changes on original framework's repo.
  • ???

This is only for one board yet, but if I recall correctly, stm32duino has some of stm nucleo boards, and there is already config's for these nucleo boards. So option one won't work here, and option two - builder script will be messy.

Bellow are the configs of boards.

bluepill_f103c8.json
genericSTM32F103C8.json

Simple upload test with maple board not working

I have just switched to 3.1.0 and I can upload a simple sketch using the maple bootloader.
Looking at the command, and comparing it to a working version of the same I see a couple of differences.
Standard platformio install upload command for maple:
/maple_upload /dev/ttyACM0 2 0x1EAF:0x0003 /firmware.bin
working command:
/maple_upload ttyACM0 1 0x1EAF:0x0003 /firmware.bin
I can change 2 to 1 in main.py (usbid = '1 %s:%s' % (usbids[0][0], usbids[0][1])) but that seems hard coded and I don't know what effects that could have.
Also, I can set upload_port = ttyACM0 in platformio.ini, but that seems like a work around as it would change depending of what has been plugged in the system.
Is there a better way to do it without breaking future updates?

STM32F103 (Blue Pill) customize upload options

Programming in Atom and using Arduino framework. While I press upload, I see that program compiles fine and started to upload, but it chooses wrong configuration (thus failing to upload)

in dfu mode it need "Alternate Setting 2" to be set
in stlink mode it need to set address to 0x08000000
May be there are options to include to platformio.ini?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

SDBlockDevice and FATFileSystem not working

Hi
I am trying to do a simple SPI read/write to an SD card using the following libraries

SDBlockDevice.h
FATFileSystem.h

I am having trouble with the -D PIO_FRAMEWORK_MBED_FILESYSTEM_PRESENT flag.

The exact output message is attached in screenshot.
screenshot from 2017-07-25 12-00-18

However, if I go to the mbed-os github repository for v5.50, I am able to see the FATFileSystem library.

Could you help me with this ? Thanks

Chandra


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Firmware written in Flash but program is not working?

Hello, i'm trying to upload my code to mts_dragonfly_f411re . Even after successful upload, the code does not work. I have used the simple code of led blink:

#include "mbed.h"
DigitalOut myled(D3);
int main()
{
while(1)
{
myled = 1;
wait(0.2);
myled = 0;
wait(0.2);
}
}

This works perfectly with bin file made from mbed-cli and mbed online compiler. How can I fix this problem?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/41459804-firmware-written-in-flash-but-program-is-not-working?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github).

STM32F103 executable size optimization

I've been working with a Nucleo-F103 development board and am trying to move over to PlatformIO for development and testing.

However, I've noticed that PlatformIO generates an executable about twice the size of my typical development environment which is gcc4mbed (https://github.com/adamgreen/gcc4mbed). PlatformIO produces an executable that is 92KB and gcc4mbed produces an exectable that is 51KB.

Both are using arm-none-eabi-g++ so I'm guessing it's a problem with compiler flags or libraries that are being included? Digging into the flags a bit, I haven't found any obvious causes for the size increase. PlatformIO uses the -Os flag, and gcc4mbed uses -O2 but they should produce similar code sizes.

I've attached a log file from compiling in both environments if that helps at all.

piolog.txt
makelog.txt


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Upload to target eventually fails after multiple uploads due to "no space left on device"

Moved from platformio/platformio-core#669

/cc @gilandose @valeros


Configuration

Operating system: Linux

PlatformIO Version (platformio --version):PlatformIO, version 2.9.1

Description of problem

[Tue May 24 16:13:58 2016] Processing nucleo_f401re (platform: ststm32, upload_port: /media/rgilmore/NODE_F401RE, board: nucleo_f401re, framework: mbed, bui
ld_flags: -lstdc++ -lsupc++)
--------------------------------------------------------------------------------
MethodWrapper(["upload"], [".pioenvs/nucleo_f401re/firmware.bin"])
scons: *** [upload] No space left on device
========================= [ ERROR ] Took 1.13 seconds =========================

Steps to Reproduce

1.Upload a design to device multiple times.
2.After a certain number of times error appears
3.unplug and replug in device to fix

Actual Results

Seems to keep incrementing write area until no space left

Expected Results

Should erase flash and upload new program.

If problems with PlatformIO Build System:

The content of platformio.ini:


[env:nucleo_f401re]
platform = ststm32
framework = mbed
board = nucleo_f401re
build_flags = -lstdc++ -lsupc++
upload_port=/media/rgilmore/NODE_F401RE
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39567416-upload-to-target-eventually-fails-after-multiple-uploads-due-to-no-space-left-on-device?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github).

arduino-blink example is not working

[18:59:44]sj:arduino-blink[develop]#: pwd
/Users/sj/dev/src/thirdparty/platform-ststm32/examples/arduino-blink
[18:59:45]sj:arduino-blink[develop]#: pio run
[Tue Sep 20 18:59:50 2016] Processing maple (platform: ststm32, board: maple, framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
AttributeError: 'PlatformBoardConfig' object has no attribute 'id':
File "/usr/local/Cellar/platformio/3.0.1/libexec/lib/python2.7/site-packages/platformio/builder/main.py", line 134:
env.SConscript("$BUILD_SCRIPT")
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 551:
return _SConscript(self.fs, *files, **subst_kw)
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 260:
exec _file_ in call_stack[-1].globals
File "/Users/sj/.platformio/platforms/ststm32/builder/main.py", line 177:
target_elf = env.BuildProgram()
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "/usr/local/Cellar/platformio/3.0.1/libexec/lib/python2.7/site-packages/platformio/builder/tools/platformio.py", line 56:
f.lower().strip() for f in env['PIOFRAMEWORK'].split(",")
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "/usr/local/Cellar/platformio/3.0.1/libexec/lib/python2.7/site-packages/platformio/builder/tools/platformio.py", line 251:
SConscript(env.GetFrameworkScript(f))
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 614:
return method(*args, **kw)
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 551:
return _SConscript(self.fs, *files, **subst_kw)
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 260:
exec _file_ in call_stack[-1].globals
File "/Users/sj/.platformio/platforms/ststm32/builder/frameworks/arduino.py", line 33:
if board.id == "bluepill_f103c8":
======================================================================================== [ERROR] Took 0.37 seconds ========================================================================================

[Tue Sep 20 18:59:51 2016] Processing genericSTM32F103RB (platform: ststm32, board: genericSTM32F103RB, framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
AttributeError: 'PlatformBoardConfig' object has no attribute 'id':
File "/usr/local/Cellar/platformio/3.0.1/libexec/lib/python2.7/site-packages/platformio/builder/main.py", line 134:
env.SConscript("$BUILD_SCRIPT")
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 551:
return _SConscript(self.fs, *files, **subst_kw)
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 260:
exec _file_ in call_stack[-1].globals
File "/Users/sj/.platformio/platforms/ststm32/builder/main.py", line 177:
target_elf = env.BuildProgram()
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "/usr/local/Cellar/platformio/3.0.1/libexec/lib/python2.7/site-packages/platformio/builder/tools/platformio.py", line 56:
f.lower().strip() for f in env['PIOFRAMEWORK'].split(",")
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "/usr/local/Cellar/platformio/3.0.1/libexec/lib/python2.7/site-packages/platformio/builder/tools/platformio.py", line 251:
SConscript(env.GetFrameworkScript(f))
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 614:
return method(*args, **kw)
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 551:
return _SConscript(self.fs, *files, **subst_kw)
File "/Users/sj/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 260:
exec _file_ in call_stack[-1].globals
File "/Users/sj/.platformio/platforms/ststm32/builder/frameworks/arduino.py", line 33:
if board.id == "bluepill_f103c8":

any ideas what is wrong?

HAL support for STM32 MCUs

HAL is an "official" way to develop software for STM32 MCUs. It's supported by STM32CubeMX tool which is also an "official" tool from STMicroelectronics.

It would be really nice to have HAL support integrated with PlatformIO.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

FreeBSD install of toolchain-gccarmnoneeabi fails

The error I get running platformio run is:

Error: Could not find a version that satisfies the requirement '>=1.40803.0,<1.40805.0' for your system 'freebsd_amd64'

Am I doing something wrong? Is FreeBSD even supported?

Problem to burn bluepill_f103c8 via UART (arduino)

Looking for upload disk...
Auto-detected: /dev/cu.SLAB_USBtoUART
Uploading .pioenvs/stm32f103c8t6/firmware.bin
sh: ~/.platformio/packages/framework-arduinoststm32/tools/macosx/: is a directory
*** [upload] Error 126

But then i do same with CLI:

~/.platformio/packages/framework-arduinoststm32/tools/macosx/stm32flash:$ ./stm32flash -w ~/Projects/test_ST32/.pioenvs/stm32f103c8t6/firmware.bin -v -g 0x0 /dev/cu.SLAB_USBtoUART

and that burns normally

for mbed - for now no success at all..

The st-util tool causes error on STM32F091 Nucleo-64 board

What kind of issue is this?

  • PlatformIO Core. If you’ve found a bug, please provide an information below.

Configuration

Operating system: Linux

PlatformIO Version (platformio --version): 3.2.1

Description of problem

The st-util tool causes error on STM32F091 Nucleo-64 board. This issue is fixed at latest version of the tool.

Steps to Reproduce

  1. Using some elf file.
  2. Run "~/.platformio/packages/tool-stlink/st-util"
  3. Run "arm-none-eabi-gdb foo.elf"
  4. Type "tar ext localhost:4242" on gdb
  5. Type "load" on gdb

Actual Results

The gdb console shows:

Loading section startup, size 0xc0 lma 0x8000000
Loading section .text, size 0x62ac lma 0x80000c0
Loading section .data, size 0xb8 lma 0x8006370
Error finishing flash operation

The st-util console shows:

2017-01-15T20:20:47 INFO src/stlink-common.c: Loading device parameters....
2017-01-15T20:20:47 INFO src/stlink-common.c: Device connected is: F09X device, id 0x10006442
2017-01-15T20:20:47 INFO src/stlink-common.c: SRAM size: 0x8000 bytes (32 KiB), Flash: 0x40000 bytes (256 KiB) in pages of 2048 bytes
2017-01-15T20:20:47 INFO gdbserver/gdb-server.c: Chip ID is 00000442, Core ID is  0bb11477.
2017-01-15T20:20:47 INFO gdbserver/gdb-server.c: Target voltage is 3253 mV.
2017-01-15T20:20:47 INFO gdbserver/gdb-server.c: Listening at *:4242...
2017-01-15T20:22:18 INFO gdbserver/gdb-server.c: Found 4 hw breakpoint registers
2017-01-15T20:22:18 INFO gdbserver/gdb-server.c: GDB connected.
2017-01-15T20:22:57 INFO src/stlink-common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08000000 erased
2017-01-15T20:22:57 INFO src/stlink-common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:22:57 INFO src/stlink-common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:22:57 INFO src/stlink-common.c: Successfully loaded flash loader in sram
2017-01-15T20:23:01 ERROR src/stlink-common.c: flash loader run error
2017-01-15T20:23:01 ERROR src/stlink-common.c: run_flash_loader(0x8000000) failed! == -1

Expected Results

The gdb console should show:

Loading section startup, size 0xc0 lma 0x8000000
Loading section .text, size 0x62ac lma 0x80000c0
Loading section .data, size 0xb8 lma 0x8006370
Start address 0x80000c0, load size 25636
Transfer rate: 11 KB/sec, 6409 bytes/write.

The st-util console should show:

st-util 1.1.0-316-g0106c53
2017-01-15T20:25:01 INFO /home/kiwamu/src/stlink/src/common.c: Loading device parameters....
2017-01-15T20:25:01 INFO /home/kiwamu/src/stlink/src/common.c: Device connected is: F09X device, id 0x10006442
2017-01-15T20:25:01 INFO /home/kiwamu/src/stlink/src/common.c: SRAM size: 0x8000 bytes (32 KiB), Flash: 0x40000 bytes (256 KiB) in pages of 2048 bytes
2017-01-15T20:25:02 INFO /home/kiwamu/src/stlink/src/gdbserver/gdb-server.c: Chip ID is 00000442, Core ID is  0bb11477.
2017-01-15T20:25:02 INFO /home/kiwamu/src/stlink/src/gdbserver/gdb-server.c: Listening at *:4242...
2017-01-15T20:25:41 INFO /home/kiwamu/src/stlink/src/gdbserver/gdb-server.c: Found 4 hw breakpoint registers
2017-01-15T20:25:41 INFO /home/kiwamu/src/stlink/src/gdbserver/gdb-server.c: GDB connected.
2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08000000 erased
2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram

2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134219776 (0x8000800)
Flash page at addr: 0x08000800 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram

2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134221824 (0x8001000)
Flash page at addr: 0x08001000 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram

2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134223872 (0x8001800)
Flash page at addr: 0x08001800 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram

2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134225920 (0x8002000)
Flash page at addr: 0x08002000 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram

2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134227968 (0x8002800)
Flash page at addr: 0x08002800 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram

2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134230016 (0x8003000)
Flash page at addr: 0x08003000 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram

2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134232064 (0x8003800)
Flash page at addr: 0x08003800 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram

2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134234112 (0x8004000)
Flash page at addr: 0x08004000 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram

2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134236160 (0x8004800)
Flash page at addr: 0x08004800 erased
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram

2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134238208 (0x8005000)
Flash page at addr: 0x08005000 erased
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram

2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134240256 (0x8005800)
Flash page at addr: 0x08005800 erased
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram

2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134242304 (0x8006000)
Flash page at addr: 0x08006000 erased
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram

2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40992119-the-st-util-tool-causes-error-on-stm32f091-nucleo-64-board?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github).

EthernetInterface doesn't work with RTOS on mbed

Hi,
I'm using nucleo_f767zi board with mbed-framework. I'm having issues working with new mbed 5.x lwip stack and RTOS. Following is a sample code that fails;

#include "mbed.h"
#include "rtos.h"
#include "NTPClient.h"
#include "EthernetInterface.h"

// Network interface
EthernetInterface net;

// Socket demo
void sync_time() {
  // Bring up the ethernet interface
  int ret = net.connect();
  printf("Ethernet connect result: %d \r\n", ret);

  // Show the network address
  const char *ip = net.get_ip_address();
  printf("IP address is: %s  \r\n", ip ? ip : "No IP  \r\n");

  NTPClient ntp = NTPClient(&net);
  NTPClient::NTPResult res = ntp.setTime();
  if (res == NTPClient::NTP_OK) {
    time_t ctTime = time(NULL);
    printf("UTC Time read successfully ... [OK]  \r\n");
    printf("Current time (UTC): %s  \r\n", ctime(&ctTime));
    time_t seconds = time(NULL) + ZHARK_TIMEZONE_OFFSET;
    char buffer[32];
    strftime(buffer, 32, "%Y-%m-%d %H:%M:%S", localtime(&seconds));
    printf("Local time now is %s  \r\n", buffer);
  } else {
    printf("Error code: %d ... [FAIL]  \r\n", res);
  }

  // Bring down the ethernet interface
  net.disconnect();
  printf("Done  \r\n");
}

int main() {
  printf("Ethernet socket example - new \r\n");

  Thread *thread = new Thread(osPriorityNormal, 8192, NULL);
  thread->start(callback(&sync_time));

  // sync_time(); // <-- this works

  while (1) {
  }
}

My platformio.ini file;

[platformio]
env_default = nucleo_f767zi

[common]
build_flags = -Wall --exceptions -DMBED_HEAP_STATS_ENABLED=1 -DMBED_STACK_STATS_ENABLED=1 -DZHARK_TIMEZONE_OFFSET=19800 -DZHARK_MAINBOARD_USE_FAST_UART
netsocket_flags = -DFEATURE_LWIP=1 -DZHARK_MAINBOARD_USE_FEATURE_LWIP -DMBED_CONF_NSAPI_PRESENT=1 -DMBED_CONF_LWIP_IPV6_ENABLED=0 -DMBED_CONF_LWIP_SOCKET_MAX=4 -DMBED_CONF_LWIP_ADDR_TIMEOUT=5  -DMBED_CONF_LWIP_UDP_SOCKET_MAX=4 -DMBED_CONF_LWIP_TCP_SERVER_MAX=4 -DMBED_CONF_LWIP_IPV4_ENABLED -DMBED_CONF_LWIP_IP_VER_PREF=4 -DMBED_CONF_LWIP_TCP_SOCKET_MAX=4

[env:nucleo_f767zi]
platform = ststm32
framework = mbed
board = nucleo_f767zi
build_flags = ${common.build_flags} ${common.netsocket_flags}

It doesn't connect to Ethernet (error code: -3004) when net.connect() is called from a separate thread with RTOS. Any idea why?

Thanks.

STM32F303K8 CAN(controller area network) RECEIVE PROBLEM

Hello
i am working with CAN of STM32F303K8 i can transmit the data but i can't receive data i get the fonction receive returne HAL_TIMEOUT
i am working with 1M and 32 clock
my code

`/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f3xx_hal.h"
#include "stdio.h"
UART_HandleTypeDef huart2;
/* USER CODE BEGIN Includes */
#ifdef __GNUC__
/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf
set to 'Yes') calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif /* __GNUC__ */
/* USER CODE END PFP */
/* USER CODE BEGIN 4 */
/**
* @brief Retargets the C library printf function to the USART.
* @param None
* @retval None
*/
PUTCHAR_PROTOTYPE
{
/* Place your implementation of fputc here */
/* e.g. write a character to the EVAL_COM1 and Loop until the end of transmission */
// HAL_UART_Transmit(&UartHandle, (uint8_t *)&ch, 1, 0xFFFF);
HAL_UART_Transmit(&huart2, (uint8_t *)&ch, 1, 0xFFFF);


return ch;
}
/* USER CODE END Includes */
/* Private variables ---------------------------------------------------------*/
CAN_HandleTypeDef hcan;
 
/* USER CODE BEGIN PV */
/* Private variables ---------------------------------------------------------*/
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
void Error_Handler(void);
static void MX_GPIO_Init(void);
static void MX_CAN_Init(void);
static void MX_USART2_UART_Init(void);
/* USER CODE BEGIN PFP */
/* Private function prototypes -----------------------------------------------*/
/* USER CODE END PFP */
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration----------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_CAN_Init();
MX_USART2_UART_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 1.0);
HAL_Delay( 1000); 
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3,0);
HAL_Delay( 1000); 

HAL_StatusTypeDef status; 
status = HAL_CAN_Receive(&hcan, CAN_FIFO0, 1000);
if (status != HAL_OK)
{
while(1)
{
}
}
printf("CAN Receive id : %x \n ",hcan.pRxMsg->StdId);
}
/* USER CODE END 3 */
}
/** System Clock Configuration
*/
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;
/**Initializes the CPU, AHB and APB busses clocks 
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = 16;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL16;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
/**Initializes the CPU, AHB and APB busses clocks 
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
{
Error_Handler();
}
/**Configure the Systick interrupt time 
*/
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);
/**Configure the Systick 
*/
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
/* SysTick_IRQn interrupt configuration */
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
}
/* CAN init function */
static void MX_CAN_Init(void)
{

static CanTxMsgTypeDef TxMessage;
static CanRxMsgTypeDef RxMessage;
hcan.pTxMsg = &TxMessage;
hcan.pRxMsg = &RxMessage;
hcan.Instance = CAN;
hcan.Init.Prescaler = 4;
hcan.Init.Mode = CAN_MODE_NORMAL;
hcan.Init.SJW = CAN_SJW_1TQ;
hcan.Init.BS1 = CAN_BS1_5TQ;
hcan.Init.BS2 = CAN_BS2_2TQ;
hcan.Init.TTCM = DISABLE;
hcan.Init.ABOM = DISABLE;
hcan.Init.AWUM = DISABLE;
hcan.Init.NART = DISABLE;
hcan.Init.RFLM = DISABLE;
hcan.Init.TXFP = DISABLE;
if (HAL_CAN_Init(&hcan) != HAL_OK)
{
Error_Handler();
}

}
/* USART2 init function */
static void MX_USART2_UART_Init(void)
{
huart2.Instance = USART2;
huart2.Init.BaudRate = 9600;
huart2.Init.WordLength = UART_WORDLENGTH_8B;
huart2.Init.StopBits = UART_STOPBITS_1;
huart2.Init.Parity = UART_PARITY_NONE;
huart2.Init.Mode = UART_MODE_TX_RX;
huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart2.Init.OverSampling = UART_OVERSAMPLING_16;
huart2.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
huart2.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
if (HAL_UART_Init(&huart2) != HAL_OK)
{
Error_Handler();
}
}
/** Configure pins as 
* Analog 
* Input 
* Output
* EVENT_OUT
* EXTI
*/
static void MX_GPIO_Init(void)
{
GPIO_InitTypeDef GPIO_InitStruct;
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET);
/*Configure GPIO pin : PB3 */
GPIO_InitStruct.Pin = GPIO_PIN_3;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
}
/* USER CODE BEGIN 4 */
/* USER CODE END 4 */
/**
* @brief This function is executed in case of error occurrence.
* @param None
* @retval None
*/
void Error_Handler(void)
{
/* USER CODE BEGIN Error_Handler */
/* User can add his own implementation to report the HAL error return state */
while(1) 
{
}
/* USER CODE END Error_Handler */ 
}
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file, uint32_t line)
{
/* USER CODE BEGIN 6 */
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
/* USER CODE END 6 */
}
#endif
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/`

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Support for mbed 3.127

When will mbed 3.127 be added?

BTW, is there a way to install (locally) a yet unsupported version of mbed somehow in platformio?

Thanks,

David

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.