Jenkins: Add STM32F1 support (#972)

This commit is contained in:
tekka
2017-11-05 14:19:42 +01:00
committed by GitHub
parent 9663d4c6b7
commit b892aef6c3
6 changed files with 48 additions and 11 deletions
+32 -1
View File
@@ -26,7 +26,7 @@ def parseWarnings(String key) {
excludePattern: '''.*/EEPROM\\.h,.*/Dns\\.cpp,.*/socket\\.cpp,.*/util\\.h,.*/Servo\\.cpp, excludePattern: '''.*/EEPROM\\.h,.*/Dns\\.cpp,.*/socket\\.cpp,.*/util\\.h,.*/Servo\\.cpp,
.*/Adafruit_NeoPixel\\.cpp,.*/UIPEthernet.*,.*/SoftwareSerial\\.cpp, .*/Adafruit_NeoPixel\\.cpp,.*/UIPEthernet.*,.*/SoftwareSerial\\.cpp,
.*/pins_arduino\\.h,.*/Stream\\.cpp,.*/USBCore\\.cpp,.*/Wire\\.cpp, .*/pins_arduino\\.h,.*/Stream\\.cpp,.*/USBCore\\.cpp,.*/Wire\\.cpp,
.*/hardware/esp8266.*,.*/libraries/SD/.*''', .*/hardware/STM32F1.*,.*/hardware/esp8266.*,.*/libraries/SD/.*''',
healthy: '', includePattern: '', messagesPattern: '', healthy: '', includePattern: '', messagesPattern: '',
parserConfigurations: [[parserName: 'Arduino/AVR', pattern: 'compiler_'+key+'.log']], parserConfigurations: [[parserName: 'Arduino/AVR', pattern: 'compiler_'+key+'.log']],
unHealthy: '', unstableNewAll: '0', unstableTotalAll: '0' unHealthy: '', unstableNewAll: '0', unstableTotalAll: '0'
@@ -164,6 +164,37 @@ def buildArduinoMega(config, sketches, String key) {
} }
} }
def buildSTM32F1(config, sketches, String key) {
def fqbn = '-fqbn stm32duino:STM32F1:genericSTM32F103C:device_variant=STM32F103C8,upload_method=DFUUploadMethod,cpu_speed=speed_72mhz,opt=osstd'
config.pr.setBuildStatus(config, 'PENDING', 'Toll gate (STM32F1 - '+key+')', 'Building...', '${BUILD_URL}flowGraphTable/')
try {
for (sketch = 0; sketch < sketches.size(); sketch++) {
if (sketches[sketch].path != config.library_root+'examples/GatewayESP8266/GatewayESP8266.ino' &&
sketches[sketch].path != config.library_root+'examples/GatewayESP8266MQTTClient/GatewayESP8266MQTTClient.ino' &&
sketches[sketch].path != config.library_root+'examples/GatewayESP8266OTA/GatewayESP8266OTA.ino' &&
sketches[sketch].path != config.library_root+'examples/SensebenderGatewaySerial/SensebenderGatewaySerial.ino') {
buildArduino(config, fqbn, sketches[sketch].path, key+'_STM32F1')
}
}
} catch (ex) {
echo "Build failed with: "+ ex.toString()
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (STM32F1 - '+key+')', 'Build error', '${BUILD_URL}')
throw ex
} finally {
parseWarnings(key+'_STM32F1')
}
if (currentBuild.currentResult == 'UNSTABLE') {
config.pr.setBuildStatus(config, 'ERROR', 'Toll gate (STM32F1 - '+key+')', 'Warnings found', '${BUILD_URL}warnings2Result/new')
if (config.is_pull_request) {
error 'Termiated due to warnings found'
}
} else if (currentBuild.currentResult == 'FAILURE') {
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (STM32F1 - '+key+')', 'Build error', '${BUILD_URL}')
} else {
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (STM32F1 - '+key+')', 'Pass', '')
}
}
def buildEsp8266(config, sketches, String key) { def buildEsp8266(config, sketches, String key) {
def fqbn = '-fqbn esp8266:esp8266:generic -prefs build.f_cpu=80000000 -prefs build.mcu=esp8266' def fqbn = '-fqbn esp8266:esp8266:generic -prefs build.f_cpu=80000000 -prefs build.mcu=esp8266'
config.pr.setBuildStatus(config, 'PENDING', 'Toll gate (ESP8266 - '+key+')', 'Building...', '${BUILD_URL}flowGraphTable/') config.pr.setBuildStatus(config, 'PENDING', 'Toll gate (ESP8266 - '+key+')', 'Building...', '${BUILD_URL}flowGraphTable/')
+9
View File
@@ -109,6 +109,9 @@ def call(Closure body) {
stage('ESP8266 (tests)') { stage('ESP8266 (tests)') {
arduino.buildEsp8266(config, config.tests, 'Tests') arduino.buildEsp8266(config, config.tests, 'Tests')
} }
stage('STM32F1 (tests)') {
arduino.buildSTM32F1(config, config.tests, 'Tests')
}
stage('ArduinoUno (tests)') { stage('ArduinoUno (tests)') {
arduino.buildArduinoUno(config, config.tests, 'Tests') arduino.buildArduinoUno(config, config.tests, 'Tests')
} }
@@ -139,6 +142,12 @@ def call(Closure body) {
stage('ESP8266 (examples)') { stage('ESP8266 (examples)') {
arduino.buildEsp8266(config, config.examples, 'Examples') arduino.buildEsp8266(config, config.examples, 'Examples')
} }
// No point in building examples for STM32F1 yet
/*
stage('STM32F1 (Examples)') {
arduino.buildSTM32F1(config, config.tests, 'Examples')
}
*/
stage('ArduinoUno (examples)') { stage('ArduinoUno (examples)') {
arduino.buildArduinoUno(config, config.examples, 'Examples') arduino.buildArduinoUno(config, config.examples, 'Examples')
} }
+2
View File
@@ -105,7 +105,9 @@ _SPI;
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#if !defined(_BV)
#define _BV(x) (1<<(x)) //!< _BV() #define _BV(x) (1<<(x)) //!< _BV()
#endif
#if defined(__arm__) || defined(__linux__) #if defined(__arm__) || defined(__linux__)
#include <SPI.h> #include <SPI.h>
+2 -1
View File
@@ -126,7 +126,8 @@ void hwRandomNumberInit(void)
regs->SMPR1 |= ADC_SMPR1_SMP16; regs->SMPR1 |= ADC_SMPR1_SMP16;
uint32_t seed = 0; uint32_t seed = 0;
uint16_t currentValue, newValue = 0; uint16_t currentValue = 0;
uint16_t newValue = 0;
for (uint8_t i = 0; i<32; i++) { for (uint8_t i = 0; i<32; i++) {
const uint32_t timeout = hwMillis() + 20; const uint32_t timeout = hwMillis() + 20;
+2 -6
View File
@@ -1,4 +1,4 @@
/* /*
* The MySensors Arduino library handles the wireless radio link and protocol * The MySensors Arduino library handles the wireless radio link and protocol
* between your home built sensors/actuators and HA controller of choice. * between your home built sensors/actuators and HA controller of choice.
* The sensors forms a self healing radio network with optional repeaters. Each * The sensors forms a self healing radio network with optional repeaters. Each
@@ -38,13 +38,9 @@
#define snprintf_P snprintf #define snprintf_P snprintf
#define vsnprintf_P vsnprintf #define vsnprintf_P vsnprintf
#define strncpy_P strncpy #define strncpy_P strncpy
#define printf_P printf
#define yield() // not defined #define yield() // not defined
// emulated EEPROM (experimental)
#define EEPROM_PAGE_SIZE (uint16_t)1024
#define EEPROM_SIZE (uint16_t)2048
#define EEPROM_START_ADDRESS ((uint32_t)(0x8000000 + 128 * EEPROM_PAGE_SIZE - 2 * EEPROM_PAGE_SIZE))
#ifndef MY_SERIALDEVICE #ifndef MY_SERIALDEVICE
#define MY_SERIALDEVICE Serial #define MY_SERIALDEVICE Serial
#endif #endif
-2
View File
@@ -17,8 +17,6 @@
* version 2 as published by the Free Software Foundation. * version 2 as published by the Free Software Foundation.
*/ */
extern "C" void __libc_init_array(void);
// Force init to be called *first*, i.e. before static object allocation. // Force init to be called *first*, i.e. before static object allocation.
// Otherwise, statically allocated objects that need libmaple may fail. // Otherwise, statically allocated objects that need libmaple may fail.
__attribute__(( constructor (101))) void premain() __attribute__(( constructor (101))) void premain()