Giter Club home page Giter Club logo

arduino_core_stm32's People

Contributors

abostm avatar alextrical avatar bennehboy avatar beserge avatar chrissbarr avatar cparata avatar edogaldo avatar fpistm avatar frastm avatar gautierg-st avatar geosmall avatar ghent360 avatar hasenbanck avatar kbumsik avatar knielsen avatar ktand avatar lmestm avatar makarenya avatar massonal avatar mathieuchopstm avatar matthijskooijman avatar mcudude avatar ppescher avatar sabas1080 avatar sjasonsmith avatar tdhaoust avatar testato avatar valeros avatar vvestm avatar zfields 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  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

arduino_core_stm32's Issues

Uploader tool wrong path?

I think I missed some thing. Why change the path in platform.txt {runtime.tools.STM32Tools.path} in {runtime.hardware.path} ?

When I install the package from Arduino Manager board, tools/ is under STM32/ and not STM32/hardware/...

I rather to ask before to fix it. Just to be sure.

SPI clock acting weird

I was trying Adafruit ILI9341, but was not working.
I think the following code is a simplified version of the problem:

void setup() {
  int cs = 2;
  SPI.begin();
  pinMode(cs, OUTPUT);
  digitalWrite(cs, HIGH);

  while(1) {
      SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0));
      delay(100);
      digitalWrite(cs, LOW);
      SPI.transfer(0x01);
      digitalWrite(cs, HIGH);
      SPI.endTransaction();
      delay(100);
  }
}

With arduino UNO, I get the following:
image
With F746 discovery:
image
or ( with F407 always)
image
Logic analizer settings are the same.
Can you check if you get the same results?

serialEventRun() has typo calls serialEvent() for all ports

https://github.com/stm32duino/Arduino_Core_STM32/blob/master/variants/NUCLEO_F091RC/variant.cpp#L111-L112 is an example however it appears that is a problem in multiple variant.cpp files.

void serialEventRun(void)
{
  if (Serial.available()) serialEvent();
  if (Serial1.available()) serialEvent();
  if (Serial2.available()) serialEvent();
}

This should probably be

void serialEventRun(void)
{
  if (Serial.available()) serialEvent();
  if (Serial1.available()) serialEvent1();
  if (Serial2.available()) serialEvent2();
}

Support for Nucleo F302R8 and STM32F072B-DISCO

Are there plans to support the Nucleo F302R8 and Discovery STM32F072B-DISCO with the Arduino Core?
I have been experimenting with both boards, but have not been able to get them to work wit it :-( .

How add a variant from an external project

Question from stm32duino:

Roger Clark suggestion:

Someone on another forum recently told me about being able to add new boards to an existing core, but I have not had time to try it.
I will take a look at your files as if we can separate out the boards into different json files it will simply the number of variants in the core repo
We could also do things like bake json files for the blue pill and black pill etc etc

2017.6.2 SD libraries compilation issue

In any exemple which use SD (SD or TFT libraries) cannot find sd.conf.h.

C:\Users\rom\AppData\Local\Arduino15\packages\STM32\hardware\stm32\2017.6.2\libraries\SD\src/bsp_sd.h:47:21: fatal error: sd_conf.h: No such file or directory_

Thanks.

SERIAL_8E1: wrong data

//#define SERIAL SerialUSB //Zero
#define SERIAL Serial //STM32

void setup() {
  SERIAL.begin(115200);
  while(!SERIAL);
  Serial1.begin(19200,SERIAL_8E1);
  SERIAL.println("Setup ready");
}

void loop() {
  SERIAL.println("Send 0xFF");
  Serial1.write(0xFF);
  int temp = 0;
  delay(50);
  while(Serial1.available()>0){
      temp = Serial1.read();
      SERIAL.print("Data: ");
      SERIAL.println(temp,HEX);
  }
  delay(10000);
}

i tested this code on Arduino Zero and L476 and with a loop connection (RX shorted to TX)

Zero write 0xFF and read 0xFF
L476 write 0xFF and read 0x7F

Analog pins definition

Hi all,
I would like to open a discussion around the analog pins definition Ax
Currently, we mainly defined A0 to A5 but STM2 MCU provide more than 6 ADC.
And in PinMap_ADC we make available more than A0-A5.
So, constant NUM_ANALOG_INPUTS is not aligned.

Questions are:
Is it required to define more than A0 to A5 by default ?
If not then, only comment the other pins in PinMap_ADC.
If yes, extend the Ax to the same number of pins defined in PinMap_ADC. This will imply to duplicate some pin definitions in digital_arduino array or reordering it.

Furthermore, after discussion with Arduino developper, the AnalogRead(A0) == AnalogRead(0) should be the same while AnalogWrite(0) == AnalogWrite(D0).

For constant value, it should be changed to not use sizeof to avoid issue:

#define NUM_ANALOG_INPUTS       (AEND - A0)

Any feedback are welcome here on in the stm32duino forum dedicated topics

Note: I took as example the Nucleo F429ZI but it is valid far all variant.

Serial2 pins not correct

There is a mistake on the Serial2 pins definition for the Nucleo F401 and F303.
Both declare:
HardwareSerial Serial2(PA1, PA0);
while there is no U(S)ART on those pins

PWM freq not correct on all pins.

PWM frequencies is not the same on all pins.
Depending of the timer used, clock source is not the same (APB1/APB2) so the prescaler also.
timHandle.Init.Prescaler = (uint32_t)(SystemCoreClock / clock_freq) - 1

Unable to upload using massStorageCopy

I'm creating a new variant for the NUCLEO-F030R8. When using the massStoraryCopy build, platform.txt uses the {node} parameter of the board to decide where to copy the bin file at upload time. This fails for me when I follow the scheme used by all the other board.txt entries.

On my 64 bit linux 16.04, my NUCLEO-F030R8 board shows up with the name mass storage name of "NUCLEO" instead of "NODE_F030R8".

I tried running Win7 in a VM and it also shows up as "NUCLEO" there.

Is there an expected driver or udev entry I'm supposed to be using? Or should the my board entry look like this:

Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.node=NUCLEO

BTW: that works properly

AnalogInOutSerial max reading seems low

I'm using the Nucleo_F030R8 branch to test out the analog features. I used an unmodified version of the AnalogInOutSerial sketch. I connected pin A0 to the 3.3V pin using a 4.9k resistor. I would expect the sensor reading to be 1023. However I'm seeing 1005.

sensor = 1005	 output = 250
sensor = 1005	 output = 250
sensor = 1006	 output = 250
sensor = 1005	 output = 250

The voltage between GND and the 3.3v pins is 3.3158v

Is there a reason this isn't reading 1023?

http://tinyurl.com/y6v4u6sm

Merge Arduino_Core_STM32F1

Arduino_Core_STM32F1 have to be merged in this repo.

CMSIS ST and HALfrom STM32Cube_FW_F1 already included in this repo.

List of boards to merge:

  • NUCLEO-F103RB
  • DISCO-F100RB (STM32VLDISCOVERY)
  • BLUEPILL-F103C8
  • MAPLEMINI-F103CB

Not all STM32 Pin names (e.g. PC6,PC8...) are working

i tried to test PWM on 19 pins. with this code:
`int pins[] = {PC6,PC8,PC9,PB8,PB9,PA5,PA6,PA7,PB6,PC7,PA9,PA8,PB10,PB3,PA10,PB11,PB1,PB7,PB0};
//int pins[] = {34, 33, 32, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 3, 2, 39, 41, 22, 49 };

void setup() {

}

void loop() {
for(int i = 0; i<19;i++){
for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) {
analogWrite(pins[i], fadeValue);
delay(30);
}
}
for(int i = 0; i<19;i++){
for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5) {
analogWrite(pins[i], fadeValue);
delay(30);
}
}
}`
if i use STM32 style names, not all LEDs are working.
With Arduino names all LEDs are working.

For NUCLEO Morpho connectors it's easier to use STM32 style.

Tested on L476 with 2017.6.2 core.

ADC Libraries

From @palmerr23 on April 26, 2017 5:23

Frederic,

I've been testing the advanced ADC\DAC modes (beyond single conversion, polling) using the templates from STM32Cube_FW_F4_V1.15.0\Projects\STM324x9I_EVAL\Examples\ADC\ and \DAC\

When using these other analog routines, HAL_ADC_MspInit() etc need to be customised for each configuration.

Now I'm trying out the dual-interleaved mode, it has become clear that the code in analog.c is just an initial test.

As HAL_ADC_MspInit() needs to be customised for each configuration, I'm looking at hiding the MSP_Init functions in analog.c at the system level and moving the code up to a library. The Init functions can then be customised for each mode.

When I tried this, other functions break - like dac_stop() and pwm_stop(). I think I'll be able to leave them in analog.c

Give me a few days and I'll have something workable.

Single-Polling and Single-interrupt are working already, using pretty much standard code from the Cube libraries, next up is dual-interleaved

Richard

Copied from original issue: fpistm/Arduino_Core_STM32F4#11

micros() is going backwards

version 2017.5.12

Serial.println(micros());
Serial.println(micros());
Serial.println(micros());

result:

2001996
2001965
2001939

expected: numbers going up

Fix compiler warnings

Enabling compiler warning to "All" in Arduino IDE preferences show several warnings.

variant.h

i'm playing with Nucleo STM32F411RET6

but when I used Adafruit GX and Oled Library for SSD3306 via I2C i face a problem
with declaration of

#define SS BOARD_SPI_DEFAULT_SS
#define SS1 4
#define SS2 7
#define SS3 8
#define MOSI 11
#define MISO 12

#define SCLK 13

#define SCK SCLK

than i decide to rename those pins to
//On-board LED pin number
#define LED_BUILTIN D13
#define LED_GREEN LED_BUILTIN

//On-board user button
#define USER_BTN D23

//SPI definitions
//define 16 channels. As many channel as digital IOs
#define SPI_CHANNELS_NUM 16

//default chip salect pin
#define BOARD_SPI_DEFAULT_SS D10
#define SS1 D4
#define SS2 D7
#define SS3 D8
#define MOSI D11
#define MISO D12
define SCLK D13

//I2C Definitions
#define SDA D14
#define SCL D15

#define PIN_SERIAL_RX D0
#define PIN_SERIAL_TX D1
#define PIN_SERIAL1_RX D2
#define PIN_SERIAL1_TX D8
#define PIN_SERIAL2_RX D9
#define PIN_SERIAL2_TX D34

to avoid this kind of problems with libraries and no more problem with Adafruit SSD3306 libraries

DISCO_F100RB board using HSI should use HSE

The STM32VL Discovery board has an external 8MHz xtal. In spite of that, the SystemClock_Config() configures itself for the HSI which leads to a less accurate SYSCLK. Please consider using the HSE with this board.

linker _user_heap definition may conflict with Arduino IDE RAM calculation

From @rogerclarkmelbourne on November 20, 2016 21:52

See http://stm32duino.com/viewtopic.php?f=48&t=1564&p=20198#p20198

@RickKimball posted

The way the arduino IDE calculates RAM usage and the way the linker script attempts to warn you about the low memory usage are in conflict. There are really 1536 bytes of RAM that the linker "allocates" to the heap and the stack. However, the linker's approach doesn't really reflect how much heap or RAM is used. The arduino IDE knows how much RAM a board/chip has and will report low memory issues with a warning about stability. However, neither approach is accurate.

You could probably change the linker script part here from:

 ._user_heap_stack :
   {
     . = ALIGN(4);
     PROVIDE ( end = . );
     PROVIDE ( _end = . );
     . = . + _Min_Heap_Size;
     . = . + _Min_Stack_Size;
     . = ALIGN(4);
   } >RAM

to:

 ._user_heap_stack :
  {
  . = ALIGN(4);
 PROVIDE ( end = . );
 PROVIDE ( _end = . );
 } >RAM

This would stop the reporting of a bogus RAM memory usage and in our case, the arduino IDE will start complaining if you are getting too close to the edge.

Copied from original issue: fpistm/Arduino_Core_STM32L4#6

Firmata sketch compilation failed for all boards

Hi Frédéric,

I'm using intensively firmata sketch. I've upgraded with the latest package my arduino IDE.
But now, the compilation fails for all MCU/Nucleo boards.
Here is the log extracted from arduino's IDE (in french, sorry) targetting the STM32L053R8:

/home/vs1/Applications/arduino-1.8.2/arduino-builder -dump-prefs -logger=machine -hardware /home/vs1/Applications/arduino-1.8.2/hardware -hardware /home/vs1/.arduino15/packages -tools /home/vs1/Applications/arduino-1.8.2/tools-builder -tools /home/vs1/Applications/arduino-1.8.2/hardware/tools/avr -tools /home/vs1/.arduino15/packages -built-in-libraries /home/vs1/Applications/arduino-1.8.2/libraries -libraries /home/vs1/Arduino/libraries -fqbn=STM32:stm32:Nucleo_64:Nucleo_64_board=NUCLEO_L476RG,upload_method=MassStorageMethod -ide-version=10802 -build-path /tmp/arduino_build_25221 -warnings=none -build-cache /tmp/arduino_cache_431276 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.STM32Tools.path=/home/vs1/.arduino15/packages/STM32/tools/STM32Tools/2017.5.12 -prefs=runtime.tools.CMSIS.path=/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update -verbose /home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/examples/StandardFirmata/StandardFirmata.ino
/home/vs1/Applications/arduino-1.8.2/arduino-builder -compile -logger=machine -hardware /home/vs1/Applications/arduino-1.8.2/hardware -hardware /home/vs1/.arduino15/packages -tools /home/vs1/Applications/arduino-1.8.2/tools-builder -tools /home/vs1/Applications/arduino-1.8.2/hardware/tools/avr -tools /home/vs1/.arduino15/packages -built-in-libraries /home/vs1/Applications/arduino-1.8.2/libraries -libraries /home/vs1/Arduino/libraries -fqbn=STM32:stm32:Nucleo_64:Nucleo_64_board=NUCLEO_L476RG,upload_method=MassStorageMethod -ide-version=10802 -build-path /tmp/arduino_build_25221 -warnings=none -build-cache /tmp/arduino_cache_431276 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.STM32Tools.path=/home/vs1/.arduino15/packages/STM32/tools/STM32Tools/2017.5.12 -prefs=runtime.tools.CMSIS.path=/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update -verbose /home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/examples/StandardFirmata/StandardFirmata.ino
Using board 'Nucleo_64' from platform in folder: /home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2
Using core 'arduino' from platform in folder: /home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2
Detecting libraries used...
"/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Inc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Src/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32L4xx/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/usb" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m4 -DF_CPU=4000000L -DSTM32L4xx -DARDUINO=10802 -DARDUINO_NUCLEO_L476RG -DARDUINO_ARCH_STM32  -DSTM32L476xx -DUSBD_VID=0x0483 -DUSBD_PID=0x5711 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="NUCLEO-L476RG"' "-I/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG" "/tmp/arduino_build_25221/sketch/StandardFirmata.ino.cpp" -o "/dev/null"
"/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Inc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Src/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32L4xx/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/usb" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m4 -DF_CPU=4000000L -DSTM32L4xx -DARDUINO=10802 -DARDUINO_NUCLEO_L476RG -DARDUINO_ARCH_STM32  -DSTM32L476xx -DUSBD_VID=0x0483 -DUSBD_PID=0x5711 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="NUCLEO-L476RG"' "-I/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo" "/tmp/arduino_build_25221/sketch/StandardFirmata.ino.cpp" -o "/dev/null"
"/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Inc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Src/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32L4xx/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/usb" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m4 -DF_CPU=4000000L -DSTM32L4xx -DARDUINO=10802 -DARDUINO_NUCLEO_L476RG -DARDUINO_ARCH_STM32  -DSTM32L476xx -DUSBD_VID=0x0483 -DUSBD_PID=0x5711 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="NUCLEO-L476RG"' "-I/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Wire" "/tmp/arduino_build_25221/sketch/StandardFirmata.ino.cpp" -o "/dev/null"
"/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Inc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Src/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32L4xx/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/usb" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m4 -DF_CPU=4000000L -DSTM32L4xx -DARDUINO=10802 -DARDUINO_NUCLEO_L476RG -DARDUINO_ARCH_STM32  -DSTM32L476xx -DUSBD_VID=0x0483 -DUSBD_PID=0x5711 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="NUCLEO-L476RG"' "-I/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Wire" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata" "/tmp/arduino_build_25221/sketch/StandardFirmata.ino.cpp" -o "/dev/null"
"/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Inc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Src/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32L4xx/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/usb" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m4 -DF_CPU=4000000L -DSTM32L4xx -DARDUINO=10802 -DARDUINO_NUCLEO_L476RG -DARDUINO_ARCH_STM32  -DSTM32L476xx -DUSBD_VID=0x0483 -DUSBD_PID=0x5711 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="NUCLEO-L476RG"' "-I/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Wire" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata" "/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo/Servo.cpp" -o "/dev/null"
"/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Inc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Src/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32L4xx/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/usb" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m4 -DF_CPU=4000000L -DSTM32L4xx -DARDUINO=10802 -DARDUINO_NUCLEO_L476RG -DARDUINO_ARCH_STM32  -DSTM32L476xx -DUSBD_VID=0x0483 -DUSBD_PID=0x5711 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="NUCLEO-L476RG"' "-I/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Wire" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata" "/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Wire/Wire.cpp" -o "/dev/null"
"/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Inc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Src/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32L4xx/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/usb" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m4 -DF_CPU=4000000L -DSTM32L4xx -DARDUINO=10802 -DARDUINO_NUCLEO_L476RG -DARDUINO_ARCH_STM32  -DSTM32L476xx -DUSBD_VID=0x0483 -DUSBD_PID=0x5711 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="NUCLEO-L476RG"' "-I/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Wire" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/utility" "/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/Firmata.cpp" -o "/dev/null"
"/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Inc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Src/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32L4xx/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/usb" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m4 -DF_CPU=4000000L -DSTM32L4xx -DARDUINO=10802 -DARDUINO_NUCLEO_L476RG -DARDUINO_ARCH_STM32  -DSTM32L476xx -DUSBD_VID=0x0483 -DUSBD_PID=0x5711 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="NUCLEO-L476RG"' "-I/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Wire" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/utility" "/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/utility/EthernetClientStream.cpp" -o "/dev/null"
"/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Inc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Src/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32L4xx/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/usb" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m4 -DF_CPU=4000000L -DSTM32L4xx -DARDUINO=10802 -DARDUINO_NUCLEO_L476RG -DARDUINO_ARCH_STM32  -DSTM32L476xx -DUSBD_VID=0x0483 -DUSBD_PID=0x5711 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="NUCLEO-L476RG"' "-I/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Wire" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/utility" "/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/utility/SerialFirmata.cpp" -o "/dev/null"
"/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Inc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Src/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32L4xx/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/usb" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m4 -DF_CPU=4000000L -DSTM32L4xx -DARDUINO=10802 -DARDUINO_NUCLEO_L476RG -DARDUINO_ARCH_STM32  -DSTM32L476xx -DUSBD_VID=0x0483 -DUSBD_PID=0x5711 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="NUCLEO-L476RG"' "-I/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Wire" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/utility" "/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/utility/WiFi101Stream.cpp" -o "/dev/null"
"/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Inc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Src/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32L4xx/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/usb" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m4 -DF_CPU=4000000L -DSTM32L4xx -DARDUINO=10802 -DARDUINO_NUCLEO_L476RG -DARDUINO_ARCH_STM32  -DSTM32L476xx -DUSBD_VID=0x0483 -DUSBD_PID=0x5711 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="NUCLEO-L476RG"' "-I/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Wire" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/utility" "/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/utility/WiFiStream.cpp" -o "/dev/null"
Generating function prototypes...
"/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Inc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Src/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32L4xx/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/usb" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m4 -DF_CPU=4000000L -DSTM32L4xx -DARDUINO=10802 -DARDUINO_NUCLEO_L476RG -DARDUINO_ARCH_STM32  -DSTM32L476xx -DUSBD_VID=0x0483 -DUSBD_PID=0x5711 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="NUCLEO-L476RG"' "-I/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Wire" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata" "/tmp/arduino_build_25221/sketch/StandardFirmata.ino.cpp" -o "/tmp/arduino_build_25221/preproc/ctags_target_for_gcc_minus_e.cpp"
"/home/vs1/Applications/arduino-1.8.2/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/tmp/arduino_build_25221/preproc/ctags_target_for_gcc_minus_e.cpp"
Compilation du croquis...
"/home/vs1/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -MMD "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Inc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32L4xx_HAL_Driver/Src/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32L4xx/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/usb" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -mcpu=cortex-m4 -DF_CPU=4000000L -DSTM32L4xx -DARDUINO=10802 -DARDUINO_NUCLEO_L476RG -DARDUINO_ARCH_STM32  -DSTM32L476xx -DUSBD_VID=0x0483 -DUSBD_PID=0x5711 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="NUCLEO-L476RG"' "-I/home/vs1/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Wire" "-I/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata" "/tmp/arduino_build_25221/sketch/StandardFirmata.ino.cpp" -o "/tmp/arduino_build_25221/sketch/StandardFirmata.ino.cpp.o"
In file included from /home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/Arduino.h:75:0,
                 from /tmp/arduino_build_25221/sketch/StandardFirmata.ino.cpp:1:
/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/examples/StandardFirmata/StandardFirmata.ino: In function 'void reportAnalogCallback(byte, int)':
/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_L476RG/variant.h:72:51: error: invalid application of 'sizeof' to incomplete type 'const PinMap []'
 #define MAX_ANALOG_IOS          (sizeof(PinMap_ADC)/sizeof(PinMap))
                                                   ^
/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/Boards.h:670:33: note: in expansion of macro 'MAX_ANALOG_IOS'
 #define TOTAL_ANALOG_PINS       MAX_ANALOG_IOS  //7
                                 ^~~~~~~~~~~~~~
/home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata/examples/StandardFirmata/StandardFirmata.ino:408:19: note: in expansion of macro 'TOTAL_ANALOG_PINS'
   if (analogPin < TOTAL_ANALOG_PINS) {
                   ^~~~~~~~~~~~~~~~~
Plusieurs bibliothèque trouvées pour "Servo.h"
Utilisé : /home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo
Non utilisé : /home/vs1/Applications/arduino-1.8.2/libraries/Servo
Plusieurs bibliothèque trouvées pour "Firmata.h"
Utilisé : /home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata
Non utilisé : /home/vs1/Applications/arduino-1.8.2/libraries/Firmata
Utilisation de la bibliothèque Servo version 1.1.1 dans le dossier: /home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Servo 
Utilisation de la bibliothèque Wire version 1.0 dans le dossier: /home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Wire 
Utilisation de la bibliothèque Firmata version 2.5.2 dans le dossier: /home/vs1/.arduino15/packages/STM32/hardware/stm32/2017.6.2/libraries/Firmata 
exit status 1
Erreur de compilation pour la carte Nucleo-64

It seems that PeripheralPins.c is not evaluated before failing, even if you've declared
extern const PinMap PinMap_ADC[];
in PeripheralPins.h

Could you kindly correct and release a patch quickly ?
Thank you,
Jean-Marc

analogWrite() on low numbered digital pins not working

I have a Nucleo64 L476RG, and i noticed i cannot do PWM using the analogWrite() function when using D2, while i can with D8. D2 being wired to PA10 should have this capability.

I found this in variant.h which looks suspicious:
// Convert an analog pin number Axx to a PinName Pxy
#define analogToPinName(p) ((p < NUM_ANALOG_INPUTS) ? digitalToPinName(p+A0) : digitalToPinName(p))

This function is then used by analogWrite()

unknown chip id! 0x10076415

From @kuobakuoba on June 14, 2017 6:50

I connected my STM32L476RG to the arduinoIDE with according settings.
1191388541
And upload a Blink example from the IDE.

But I get these errors.
2017-06-14 2 39 14
2017-06-14 2 46 07

I am running mac with sierra.
2017-06-14 2 41 12
I have eclipse with Ac6 for STM32 and it works with no problem.
How can I get STM32duino to work?
Thanks.

Copied from original issue: stm32duino/wiki#1

boards.txt board order

When I did my quick hack to add the NUCLEO_F030R8 board to the boards.txt file I put it in the wrong order. Can we move the NUCLEO_F030R8 section to come before the R091RC so the list shows up sorted?

https://github.com/stm32duino/Arduino_Core_STM32/blob/master/boards.txt#L77

diff --git a/boards.txt b/boards.txt
index 230c139..2fa19f8 100644
--- a/boards.txt
+++ b/boards.txt
@@ -57,6 +57,21 @@ Nucleo_64.pid.0=0x5711
 Nucleo_64.build.core=arduino
 Nucleo_64.build.board=Nucleo_64
 
+# NUCLEO_F030R8 board
+
+Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8=Nucleo F030R8
+Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.node="NODE_F030R8,NUCLEO"
+Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.upload.maximum_size=65536
+Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.upload.maximum_data_size=8192
+Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.mcu=cortex-m0
+Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.f_cpu=48000000L
+Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.board=NUCLEO_F030R8
+Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.series=STM32F0xx
+Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.variant=NUCLEO_F030R8
+Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.cmsis_lib_gcc=arm_cortexM0l_math
+#To enable Serial1 (USART1 on PA10, PA9) add -DENABLE_SERIAL1
+Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.extra_flags=-DSTM32F030x8
+
 # NUCLEO_F091RC board
 
 Nucleo_64.menu.Nucleo_64_board.NUCLEO_F091RC=Nucleo F091RC
@@ -74,21 +89,6 @@ Nucleo_64.menu.Nucleo_64_board.NUCLEO_F091RC.build.cmsis_lib_gcc=arm_cortexM0l_m
 #To enable HID (keyboard and mouse support) add also '-DUSBD_USE_HID_COMPOSITE'
 Nucleo_64.menu.Nucleo_64_board.NUCLEO_F091RC.build.extra_flags=-DSTM32F091xC {build.usb_flags}
 
-# NUCLEO_F030R8 board
-
-Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8=Nucleo F030R8
-Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.node="NODE_F030R8,NUCLEO"
-Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.upload.maximum_size=65536
-Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.upload.maximum_data_size=8192
-Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.mcu=cortex-m0
-Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.f_cpu=48000000L
-Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.board=NUCLEO_F030R8
-Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.series=STM32F0xx
-Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.variant=NUCLEO_F030R8
-Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.cmsis_lib_gcc=arm_cortexM0l_math
-#To enable Serial1 (USART1 on PA10, PA9) add -DENABLE_SERIAL1
-Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.extra_flags=-DSTM32F030x8
-
 # NUCLEO_F303RE board
 
 Nucleo_64.menu.Nucleo_64_board.NUCLEO_F303RE=Nucleo F303RE

Move Arduino libraries dedicated for STM32 core into single repo

Purpose of this issue is to move Arduino libraries dedicated for STM32 core in separate repository.

I talk about libraries dedicated to hardware features: on board SD, Ethernet, LCD….
For purely software libraries, pull request should be done on dedicated github (ex: firmata,…) as far as possible else a repo could be created.

The core should only embed those for common hardware support (Wire/SPI/…).
As specified here:
https://github.com/arduino/Arduino/wiki/Library-Manager-FAQ#how-can-i-add-my-library-to-library-manager
So one library == a single repo.

  • SD required 2 repos:
  • FatFs: available through the Arduino Library manager
  • STM32SD: available through the Arduino Library manager
  • NativeEthernet required 2 repos:
  • LwIP: available through the Arduino Library manager
  • STM32Ethernet: available through the Arduino Library manager
  • Firmata: STM32 support added in Firmata 2.5.7
  • CapacitiveSensor-0.5.1 to do on related github --> PaulStoffregen/CapacitiveSensor#30
  • EEPROM; based on V2.0.0. Kept in the core as specific to the architecture "stm32". Only header modified.
  • GSM: Removed. See #331
  • LiquidCrystal; Use official one. See #77
  • Mouse & Keyboard: separated repo? --> kept as built-in library as USB dependent.
  • Servo: reworked thanks #102. PR done on official Library: arduino-libraries/Servo
  • TFT: pull request done and merged on related github --> arduino-libraries/TFT#11. Moreover, Ucglib_Arduino could be used and manage more displays than the ST7735.
  • WiFi: Use official one even if shield retired

ARDUINO_ARCH_STM32 must be used as differentiator.

This is a first approach any comments/suggestions are welcome. Mainly on repo name or way of working.

Winterrupts.c writes but never reads .configured

From @rogerclarkmelbourne on November 20, 2016 21:11

In various lines Winterrupts.c e.g.

https://github.com/stm32duino/Arduino_Core_STM32L4/blob/master/cores/arduino/WInterrupts.c#L43

.configured is written but never read.

These lines can be removed and

PinDescription g_intPinConfigured[MAX_DIGITAL_IOS];

can be changed to a array of pointers to PinDescription

(and the code changed accordingly)

Copied from original issue: fpistm/Arduino_Core_STM32L4#4

Error in boards.txt file for Nucleo-L432KC

Release: 2017.8.31

The values for the .upload.maximum_size and .upload.maximum_data_size are swapped in the boards.txt file for the NUCLEO_L432KC board on lines 229 and 230.

Current incorrect lines:
Nucleo_32.menu.board_part_num.NUCLEO_L432KC.upload.maximum_size=65536
Nucleo_32.menu.board_part_num.NUCLEO_L432KC.upload.maximum_data_size=262144

This should be:
Nucleo_32.menu.board_part_num.NUCLEO_L432KC.upload.maximum_size=262144
Nucleo_32.menu.board_part_num.NUCLEO_L432KC.upload.maximum_data_size=65536

Ic2 slave SEND issue.

I have the BLUEPILL board working - and took a look at the examples of I2c Slave..

The i2c Slave receive works - I can send several bytes to the slave (Bluepill) without issue.

Returning data however just isn't working. The code I've used to test this works a treat on a nano and is nothing more than your example (but with send and receive functions in the same program).

I have PC13 flashing in the background (timeout - not delay) so I know things are working. If I tell the Bluepill board to return 5 bytes and send a string using iWire.write("Hello "); I don't get that back - and after several attempts at getting that returned data - the board locks up (the light stays on).
I tried your slave_send example - merely changing the address to 4.

A scan showed as I would expect, device 4 to be there - but sending a read command - nothing returned just as in my own code. I even put in a Serial1.writeln in the function to see if it was actually triggering... as I have on the read function... which reads a string sent to the board no problem - but when I2c asks the board for data, the requestEvent function is not even being called.

Support for low power mode

Hello,

Is there a plan that supports low power mode for the L4 family
Sleep
Stop0 / Stop1 / STop2
Standby
shutdown

And in addition, the possibility of using different range MSI?

thanks

Problems with EEPROM.read() on L476RG

i've tried to use a eeprom_clear demo sketch, but if i upload it, LED stays off.

Then i tried to read a EEPROM:

#include <EEPROM.h>

void setup() {
  Serial.begin(115200);
  Serial.print("EEPROM Size: ");
  Serial.println(EEPROM.length()); //it works with only with delay(10);
  delay(10); 
  Serial.print("Data: ");
  Serial.println(EEPROM.read(0));
  Serial.println("I'm here"); //i've never seen this line :/
}
void loop() {}

Console output with delay(10);
EEPROM Size: 16384 Dat
without delay:
EEP

i use official core release 2017.06.2
Upload via Mass Storage.

analogWrite() doesn't use the full range

On a NUCLEO-F030R8, if I call analogWrite(9,255), I'm seeing a 3.9us low pulse each period. I expected pin 9 to just stay HIGH when using a value of 255 as that is the max value for the range (0-255). Shouldn't it do a digitalWrite(9,HIGH) if the value provided is the max of the analogResolution?

Using a value of 254 I'm seeing a low pulse of 7.8us where I expected to see a 3.9us one
Using a value of 1 I see a 3.9us high pulse this seems right so the problem isn't just an off by one problem.
Using a value of 0 produces a steady low value on the pin.

UART_OPTIMIZED flag seems to be not correctly used

Hi all,
in uart.c file, UART_OPTIMIZED is defined and set to 0 in order to not use the optimization.
But all tests are based on #ifdef UART_OPTIMIZED, and of course, the evaluation of the expression is true (even if UART_OPTIMIZED is set to 0, the UART_OPTIMIZED flag is defined).

When I replace
#define UART_OTPIMIZED 0
by
#undef UART_OPTIMIZED
the behavior is really strange. UART Rx callback fall in error 0x08 or 0x05 sometimes.
void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart) { uart_id_e uart_id = get_uart_id_from_handle(huart); if(NB_UART_MANAGED == uart_id) { return; } printf(">>UART Error callback uart id %i : ErrorCode=0x%x\n\r",uart_id,huart->ErrorCode); while(1); uart_deinit(uart_id); uart_init(uart_id, g_UartHandle[uart_id].Init.BaudRate); }
Do you have any idea why the code falls in error ?

Thank you,
Jean-Marc

analog.c can't deal with a chip that doesn't have a DAC

I'm trying to add a variant for the STM32F030R8, however it doesn't have a DAC. The analog.c file fails to compile because of all the DAC structures and defines used.

My solution was a complete hack, I just ifdefed out code that wouldn't compile.

It seems that to grow into a broader range of chips and boards this is going to have to be addressed.

SPI issue

Using another SPI instance created by constructor with arguments failed

Analog write

Am I doing something wrong? Bluepill board.....

analogWrite(PA1,x). If I fire out 255 the output comes on - if 0, I get 0 but I'm not getting anything on other values?

According to the sheet in front of me - PA1 should be a PWM output. I set it as as output....

Use recipe.hooks feature of the platform.txt file

Orignally posted in #38 by @RickKimball

I think you could take advantage of the recipe.hooks feature of the platform.txt file to conditionally override defines and gcc command line arguments on a per sketch basis. This seems to be a fairly new feature (since Arduino 1.6.something) something they added since I last looked to accomplish something like this.

You might approach it like this:

In the stm32 tools directory create a new tool called 'cpif' which copies a file called gcc_options.txt into the build directory if the file exists in the sketch directory or copies /dev/null if it doesn't

$ cat cpif 
#!/bin/bash
set -x
echo $0 $*

sketchdir=${1%.*}
dest=${2}/gcc_options.txt

options="$HOME/Arduino/$sketchdir/gcc_options.txt"

if [ -f $options ]
then
   cp $options $dest
else
   cp /dev/null $dest
fi

In platform.txt you add a recipe hook that is called before starting the build process.

 ## Compile c files
+recipe.hooks.prebuild.1.pattern=cpif {build.project_name} {build.path} b4all
 recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mcpu={build.mcu} -DF_CPU={build ...

modify the board.txt to use the @file feature of gcc or just add it to the platform.txt for all boards

Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.extra_flags=-DSTM32F030x8 @{build.path}/gcc_options.txt

When the user wants to override defines and gcc command line arguments they create a file called gcc_options.txt in the sketch directory. Here I imagine I want to override the F_CPU value

-U F_CPU
-D F_CPU=24000000UL

When I compile it uses the sketch specific defines and overrides.

/home/kimballr/github/Arduino/build/linux/work/arduino-builder -dump-prefs -logger=machine -hardware /home/kimballr/github/Arduino/build/linux/work/hardware -hardware /home/kimballr/.arduino15/packages -hardware /home/kimballr/Arduino/hardware -tools /home/kimballr/github/Arduino/build/linux/work/tools-builder -tools /home/kimballr/github/Arduino/build/linux/work/hardware/tools/avr -tools /home/kimballr/.arduino15/packages -built-in-libraries /home/kimballr/github/Arduino/build/linux/work/libraries -libraries /home/kimballr/Arduino/libraries -fqbn=STM32:stm32:Nucleo_64:Nucleo_64_board=NUCLEO_F030R8,upload_method=MassStorageMethod -ide-version=10803 -build-path /tmp/arduino_build_433355 -warnings=more -build-cache /tmp/arduino_cache_805852 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS.path=/home/kimballr/.arduino15/packages/arduino/tools/CMSIS/4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=/home/kimballr/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update -prefs=runtime.tools.STM32Tools.path=/home/kimballr/.arduino15/packages/STM32/tools/STM32Tools/2017.5.12 -verbose /home/kimballr/Arduino/BlinkWithoutDelay_HSE_Bypassx/BlinkWithoutDelay_HSE_Bypassx.ino
/home/kimballr/github/Arduino/build/linux/work/arduino-builder -compile -logger=machine -hardware /home/kimballr/github/Arduino/build/linux/work/hardware -hardware /home/kimballr/.arduino15/packages -hardware /home/kimballr/Arduino/hardware -tools /home/kimballr/github/Arduino/build/linux/work/tools-builder -tools /home/kimballr/github/Arduino/build/linux/work/hardware/tools/avr -tools /home/kimballr/.arduino15/packages -built-in-libraries /home/kimballr/github/Arduino/build/linux/work/libraries -libraries /home/kimballr/Arduino/libraries -fqbn=STM32:stm32:Nucleo_64:Nucleo_64_board=NUCLEO_F030R8,upload_method=MassStorageMethod -ide-version=10803 -build-path /tmp/arduino_build_433355 -warnings=more -build-cache /tmp/arduino_cache_805852 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS.path=/home/kimballr/.arduino15/packages/arduino/tools/CMSIS/4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=/home/kimballr/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update -prefs=runtime.tools.STM32Tools.path=/home/kimballr/.arduino15/packages/STM32/tools/STM32Tools/2017.5.12 -verbose /home/kimballr/Arduino/BlinkWithoutDelay_HSE_Bypassx/BlinkWithoutDelay_HSE_Bypassx.ino
Using board 'Nucleo_64' from platform in folder: /home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2
Using core 'arduino' from platform in folder: /home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2
cpif BlinkWithoutDelay_HSE_Bypassx.ino /tmp/arduino_build_433355 b4all+ echo /home/kimballr/opt64/bin/cpif BlinkWithoutDelay_HSE_Bypassx.ino /tmp/arduino_build_433355 b4all

+ sketchdir=BlinkWithoutDelay_HSE_Bypassx
/home/kimballr/opt64/bin/cpif BlinkWithoutDelay_HSE_Bypassx.ino /tmp/arduino_build_433355 b4all
+ dest=/tmp/arduino_build_433355/gcc_options.txt
+ options=/home/kimballr/Arduino/BlinkWithoutDelay_HSE_Bypassx/gcc_options.txtDetecting libraries used...

+ '[' -f /home/kimballr/Arduino/BlinkWithoutDelay_HSE_Bypassx/gcc_options.txt ']'
+ cp /home/kimballr/Arduino/BlinkWithoutDelay_HSE_Bypassx/gcc_options.txt /tmp/arduino_build_433355/gcc_options.txt
"/home/kimballr/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -O2 -g -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32F0xx_HAL_Driver/Inc/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32F0xx_HAL_Driver/Src/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32F0xx/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_F030R8/usb" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m0 -DF_CPU=48000000L -DSTM32F0xx -DARDUINO=10803 -DARDUINO_NUCLEO_F030R8 -DARDUINO_ARCH_STM32  -DSTM32F030x8 @/tmp/arduino_build_433355/gcc_options.txt "-I/home/kimballr/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32F0xx/Include/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_F030R8" "/tmp/arduino_build_433355/sketch/BlinkWithoutDelay_HSE_Bypassx.ino.cpp" -o "/dev/null"
Using cached library dependencies for file: /tmp/arduino_build_433355/sketch/customclock.c
Generating function prototypes...
"/home/kimballr/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -O2 -g -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf  "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32F0xx_HAL_Driver/Inc/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32F0xx_HAL_Driver/Src/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32F0xx/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_F030R8/usb" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -w -x c++ -E -CC -mcpu=cortex-m0 -DF_CPU=48000000L -DSTM32F0xx -DARDUINO=10803 -DARDUINO_NUCLEO_F030R8 -DARDUINO_ARCH_STM32  -DSTM32F030x8 @/tmp/arduino_build_433355/gcc_options.txt "-I/home/kimballr/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32F0xx/Include/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_F030R8" "/tmp/arduino_build_433355/sketch/BlinkWithoutDelay_HSE_Bypassx.ino.cpp" -o "/tmp/arduino_build_433355/preproc/ctags_target_for_gcc_minus_e.cpp"
"/home/kimballr/github/Arduino/build/linux/work/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/tmp/arduino_build_433355/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
Using previously compiled file: /tmp/arduino_build_433355/sketch/customclock.c.o
"/home/kimballr/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-g++" -mthumb -c -O2 -g -Wall -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -MMD "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/avr" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino/stm32" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32F0xx_HAL_Driver/Inc/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/STM32F0xx_HAL_Driver/Src/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/STM32F0xx/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_F030R8/usb" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -mcpu=cortex-m0 -DF_CPU=48000000L -DSTM32F0xx -DARDUINO=10803 -DARDUINO_NUCLEO_F030R8 -DARDUINO_ARCH_STM32  -DSTM32F030x8 @/tmp/arduino_build_433355/gcc_options.txt "-I/home/kimballr/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32F0xx/Include/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/system/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/cores/arduino" "-I/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_F030R8" "/tmp/arduino_build_433355/sketch/BlinkWithoutDelay_HSE_Bypassx.ino.cpp" -o "/tmp/arduino_build_433355/sketch/BlinkWithoutDelay_HSE_Bypassx.ino.cpp.o"
/home/kimballr/Arduino/BlinkWithoutDelay_HSE_Bypassx/BlinkWithoutDelay_HSE_Bypassx.ino:30:0: warning: "F_CPU" redefined
  #define F_CPU 48000000UL
 
<command-line>:0:0: note: this is the location of the previous definition
Compiling libraries...
Compiling core...
Using previously compiled file: /tmp/arduino_build_433355/core/PeripheralPins.c.o
Using previously compiled file: /tmp/arduino_build_433355/core/variant.cpp.o
Using precompiled core
Linking everything together...
"/home/kimballr/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-gcc" -mthumb -O2 -g -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -mcpu=cortex-m0 -DF_CPU=48000000L "-T/home/kimballr/.arduino15/packages/STM32/hardware/stm32/2017.6.2/variants/NUCLEO_F030R8/ldscript.ld" "-Wl,-Map,/tmp/arduino_build_433355/BlinkWithoutDelay_HSE_Bypassx.ino.map"   -o "/tmp/arduino_build_433355/BlinkWithoutDelay_HSE_Bypassx.ino.elf" "-L/tmp/arduino_build_433355" -Wl,--start-group "/tmp/arduino_build_433355/sketch/customclock.c.o" "/tmp/arduino_build_433355/sketch/BlinkWithoutDelay_HSE_Bypassx.ino.cpp.o" "/tmp/arduino_build_433355/core/PeripheralPins.c.o" "/tmp/arduino_build_433355/core/variant.cpp.o"  "-L/home/kimballr/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Lib/GCC/" -larm_cortexM0l_math -Wl,--whole-archive "/tmp/arduino_build_433355/../arduino_cache_805852/core/core_STM32_stm32_Nucleo_64_Nucleo_64_board_NUCLEO_F030R8,upload_method_MassStorageMethod_606682308e20143982ec828e068e3363.a" -Wl,--no-whole-archive -lc -Wl,--end-group -lm -lgcc --specs=nano.specs
"/home/kimballr/.arduino15/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-objcopy" -O binary  "/tmp/arduino_build_433355/BlinkWithoutDelay_HSE_Bypassx.ino.elf" "/tmp/arduino_build_433355/BlinkWithoutDelay_HSE_Bypassx.ino.bin"
Sketch uses 7564 bytes (11%) of program storage space. Maximum is 65536 bytes.
Global variables use 4064 bytes (49%) of dynamic memory, leaving 4128 bytes for local variables. Maximum is 8192 bytes.

Of course you would have to make this work with the different OS types. You would also have to deal with finding the users preference sketch home directory. I just hard coded it in the example above to use my $HOME/Arduino directory.

Seems doable (I actually have this working ) if you care to open yourself to all kinds of user problems when they do bad things : )

ARDUINO_ARCH_STM32

is it possilble to add general definition for all STM32 boards like ARDUINO_ARCH_STM32?
actualy i have to check for multiple boards: e.g.
#if defined(STM32F4xx) || defined(STM32F0xx) || defined(STM32F3xx) and so on.

EDIT:
which architecture flag (eg. avr, sam, samd...) should i use to mark a libary (in library.properties) compatible with STM32 platform?

Pin name PXn should match Arduino pin numberin Dx

I have an LED connected to D34(PC6). My code works when I use D34 just fine but then it doesn't work if I use PC6 instead of D34. Both of these should be the same thing. There seem to be an issue when using the processor pin names.

This is necessary for those building products based on the nucleo board and want to use the processor pin name instead of the "Arduino" Dxx pin names.

I am using the blink LED code example.

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.