Skip to content

Commit

Permalink
Merge branch 'release/v0.4.6' into latest
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mcgowan committed Oct 2, 2015
2 parents 2eaeefe + f95cf1e commit 830375c
Show file tree
Hide file tree
Showing 347 changed files with 36,260 additions and 6,376 deletions.
78 changes: 75 additions & 3 deletions .travis.yml
Expand Up @@ -2,22 +2,94 @@ language: cpp
before_install:
- sudo apt-get update
install:
- npm install -g spark-cli
- ./ci/install_arm_gcc.sh && ./ci/install_gcc.sh
# TODO: switch to particle-cli instead of spark-cli - ./ci/create_spark_cli_json.sh
- npm install -g particle-cli
- './ci/install_arm_gcc.sh && ./ci/install_gcc.sh'
# - ./ci/create_spark_cli_json.sh

script:
- ./ci/unit_tests.sh
# - 'if [ "${UNIT_TEST}" = "y" ]; then ./ci/unit_tests.sh; else cd $DIR && make -s clean all DEBUG_BUILD=$DEBUG_BUILD PLATFORM=$PLATFORM COMPILE_LTO=$COMPILE_LTO TEST=$TEST SPARK_CLOUD=$SPARK_CLOUD APP=$APP; fi'
- ./ci/enumerate_build_matrix.sh
# TODO - ./ci/integration_tests.sh
# TODO - ./ci/test_memory_available_with_real_core.sh

#after_success: ./ci/update-gh-pages.sh

env:
# matrix:
# - UNIT_TEST=y
# - DIR=main TEST=wiring/api PLATFORM=photon COMPILE_LTO=n
# - DIR=main TEST=wiring/api PLATFORM=core COMPILE_LTO=n SPARK_CLOUD=n
# - DIR=main TEST=wiring/api PLATFORM=P1 COMPILE_LTO=n
# - DIR=main TEST=wiring/no_fixture PLATFORM=photon COMPILE_LTO=n
# - DIR=main TEST=wiring/no_fixture PLATFORM=P1 COMPILE_LTO=n

# # expansion of matrix
# # dir=MAIN (monolithic)
# # DEBUG_BUILD=y
# # PLATFORM=core SPARK_CLOUD=y
# - DIR=main DEBUG_BUILD=y PLATFORM=core SPARK_CLOUD=y APP= COMPILE_LTO=y
# - DIR=main DEBUG_BUILD=y PLATFORM=core SPARK_CLOUD=y APP=tinker COMPILE_LTO=y
# - DIR=main DEBUG_BUILD=y PLATFORM=core SPARK_CLOUD=y APP=blank COMPILE_LTO=y
# # SPARK_CLOUD=n
# - DIR=main DEBUG_BUILD=y PLATFORM=core SPARK_CLOUD=n APP= COMPILE_LTO=y

# # PLATFORM=photon SPARK_CLOUD=y
# - DIR=main DEBUG_BUILD=y PLATFORM=photon SPARK_CLOUD=y APP= COMPILE_LTO=n
# - DIR=main DEBUG_BUILD=y PLATFORM=photon SPARK_CLOUD=y APP=tinker COMPILE_LTO=n
# - DIR=main DEBUG_BUILD=y PLATFORM=photon SPARK_CLOUD=y APP=blank COMPILE_LTO=n

# # PLATFORM=P1 SPARK_CLOUD=y
# - DIR=main DEBUG_BUILD=y PLATFORM=P1 SPARK_CLOUD=y APP= COMPILE_LTO=n
# - DIR=main DEBUG_BUILD=y PLATFORM=P1 SPARK_CLOUD=y APP=tinker COMPILE_LTO=n
# - DIR=main DEBUG_BUILD=y PLATFORM=P1 SPARK_CLOUD=y APP=blank COMPILE_LTO=n

# # PLATFORM=electron SPARK_CLOUD=y
# - DIR=main DEBUG_BUILD=y PLATFORM=electron SPARK_CLOUD=y APP= COMPILE_LTO=n
# - DIR=main DEBUG_BUILD=y PLATFORM=electron SPARK_CLOUD=y APP=tinker COMPILE_LTO=n
# - DIR=main DEBUG_BUILD=y PLATFORM=electron SPARK_CLOUD=y APP=blank COMPILE_LTO=n

# # DEBUG_BUILD=n
# # PLATFORM=core SPARK_CLOUD=y
# - DIR=main DEBUG_BUILD=n PLATFORM=core SPARK_CLOUD=y APP= COMPILE_LTO=y
# - DIR=main DEBUG_BUILD=n PLATFORM=core SPARK_CLOUD=y APP=tinker COMPILE_LTO=y
# - DIR=main DEBUG_BUILD=n PLATFORM=core SPARK_CLOUD=y APP=blank COMPILE_LTO=y
# # SPARK_CLOUD=n
# - DIR=main DEBUG_BUILD=n PLATFORM=core SPARK_CLOUD=n APP= COMPILE_LTO=y

# # PLATFORM=photon SPARK_CLOUD=y
# - DIR=main DEBUG_BUILD=n PLATFORM=photon SPARK_CLOUD=y APP= COMPILE_LTO=n
# - DIR=main DEBUG_BUILD=n PLATFORM=photon SPARK_CLOUD=y APP=tinker COMPILE_LTO=n
# - DIR=main DEBUG_BUILD=n PLATFORM=photon SPARK_CLOUD=y APP=blank COMPILE_LTO=n

# # PLATFORM=P1 SPARK_CLOUD=y
# - DIR=main DEBUG_BUILD=n PLATFORM=P1 SPARK_CLOUD=y APP= COMPILE_LTO=n
# - DIR=main DEBUG_BUILD=n PLATFORM=P1 SPARK_CLOUD=y APP=tinker COMPILE_LTO=n
# - DIR=main DEBUG_BUILD=n PLATFORM=P1 SPARK_CLOUD=y APP=blank COMPILE_LTO=n

# # PLATFORM=electron SPARK_CLOUD=y
# - DIR=main DEBUG_BUILD=n PLATFORM=electron SPARK_CLOUD=y APP= COMPILE_LTO=n
# - DIR=main DEBUG_BUILD=n PLATFORM=electron SPARK_CLOUD=y APP=tinker COMPILE_LTO=n
# - DIR=main DEBUG_BUILD=n PLATFORM=electron SPARK_CLOUD=y APP=blank COMPILE_LTO=n


# # DIR=modules (modular)
# # DEBUG_BUILD=y
# - DIR=modules DEBUG_BUILD=y PLATFORM=photon COMPILE_LTO=n
# - DIR=modules DEBUG_BUILD=y PLATFORM=P1 COMPILE_LTO=n
# # DEBUG_BUILD=n
# - DIR=modules DEBUG_BUILD=n PLATFORM=photon COMPILE_LTO=n
# - DIR=modules DEBUG_BUILD=n PLATFORM=P1 COMPILE_LTO=n

# # Photon minimal build
# - DIR=modules PLATFORM=photon COMPILE_LTO=n MINIMAL=y
global:
- secure: UM1+Ps1t21JfJaTFhuqkaY/U21j1Gfja6oSJTALcU0Y7zmo7TNyYMJwP+tbRfss7RBilWwUA8osr3sr6NXPREChojKpRQaRt52iD6wDfcxhsxGrpOU79cYO7FK1aQhCmhDGcnXahtxzbOGwS74jjTFW9U6TSveWa+EV1OgagLMc=
- secure: aJ+EUGgXIp8t0s/f3EEyiUjYXnzAlYW9+jukG240A2Wb/XnGp9Av/JE+wBnBeMv7eF+hxkODo99gDXPumV6uYQevIBtqiHWtAu7kyvCxUWXhSmag+Q89pCJO8QpUrcxra9UZ6i+zhFEfskBctBjlT9nMKoUsGSg4jMg6Kx71QsA=
- secure: Iq58mKqq5Nz4B6OEZu1nmnquhvlQncxT4T3f1x+M/0I6VW5xirMWFlpeke8QyyPOZlwNLDnB5QVjsR2UQspNIhMT4rCfDeCCr9AeinoMDmqPbzpmLLmtaUpz0uTZyJVx7+IRe9QtljPfbzlAxybmrx1HdCCw++F/+qhgFoGLi9o=
- secure: O8Zu2sWO63svmSTdOk+7Z7N2oUcg3N07WckMoy1m7AYmRZydX5hdVXlbagA06FCtpu1Kvvwc7QYB+1wpoxZYZnxt2mVetVsAcSpOz3c03LodM+yKaHm9luqLfQobuC7oyNdumpqMLsWiELM9rxEpIazYDYM2QI+lh7fTUTHnQ3s=
- secure: A83drTFobkGvgrPNwGwNS3ZSHX35iNELjH6W9h07pw/n1YSssBHxtLF8aVAEwfIF1VyUoHvQ4HYLNd+9RMyo162xxiWne+/4/gSFyUJNi11w3YX5bwodKPl7OwEO/YnJgHYk8YAAfdnZT4470Fpt6ytcOhEhMsB/IFeepMUiZZA=

notifications:
slack:
secure: VJ+tAeUzLkz4aMAshQ9ohXZb/1+DQ31kDpcZYDS5PZuXOujx57rzOBg4SKxB2awcmNS2JWlSMQRQtNUzfS15YNuLqgWVj57EQAy99QKsEvccOMELIwbpLtEyEInK5WrUk6vk9ymhk6MBT5+3JiQ4bAs5yvIxm+k8YCakV9QlnH4=
36 changes: 35 additions & 1 deletion CHANGELOG.md
@@ -1,8 +1,42 @@

## v0.4.6

### FEATURES
- [photon] separate [System Thread](https://docs.particle.io/reference/firmware/photon/#system-thread)
- [core] Hooks to support FreeRTOS (optional library)
- Variables stored in [Backup RAM](https://docs.particle.io/reference/firmware/photon/#backup-ram)
- [printf/printlnf](https://docs.particle.io/reference/firmware/core/#printf-) on `Print` classes - `Serial`, `Serial1`, `TCP`, `UDP`
- `String.format` for printf-style formatting of to as `String`.
- [Wire.end()](https://docs.particle.io/reference/firmware/photon/#end-) to release the I2C pins. [#597](https://github.com/spark/firmware/issues/597)
- [Wire.reset()](https://docs.particle.io/reference/firmware/photon/#reset-) to reset the I2C bus. Thanks @pomplesiegel [#598](https://github.com/spark/firmware/issues/598)
- [System.ticks()](https://docs.particle.io/reference/firmware/core/#system-cycle-counter) to retrieve the current MCU cycle counter for precise timing.
- [System.enterSafeMode()](https://docs.particle.io/reference/firmware/core/#system-entersafemode-) to restart the device in safe mode.

### ENHANCEMENTS

- [photon] `WiFi.selectAntenna()` setting is persistent, so the last selected antenna is used when the
device is in safe mode. [#618]
- Detect when the cloud hasn't been serviced for 15s and disconnect, so device LED state accurately
reflects the connection state when the application loop has stalled. [#626](https://github.com/spark/firmwarwe/issues/626)
- Compile-time checks for `Particle.variable()` [#619](https://github.com/spark/firmwarwe/issues/619)
- [photon] Increased retry count when connecting to WiFi. [#620](https://github.com/spark/firmware/issues/620)
- Setup button events [#611](https://github.com/spark/firmware/pull/611)

### BUGFIXES

- `UDP.receivePacket()` would fail if `UDP.setBuffer()` hadn't been called first. Thanks @r2jitu.
- [photon] Default SS pin for SPI1 now set to D5. [#623](https://github.com/spark/firmware/issues/623)
- [photon] Long delay entering listening mode. [#566](https://github.com/spark/firmware/issues/566)
- [photon] Solid green LED when WiFi network cannot be connected to due to invalid key. (The LED now blinks.)
- [photon] Storing more than 2 Wi-Fi credentials would sometimes give unpredictable results.
- [photon] TX/RX pins did not work after entering listening mode. [#632](https://github.com/spark/firmware/issues/632)
- [photon] Improvements to I2C for MCP23017 / Adafruit RGBLCDShield. [#626](https://github.com/spark/firmware/pull/626)


## v0.4.5

### FEATURES
- `SPI.setClockDividerReference`, `SPI.setClockSpeed` to set clock speed in a more portable manner. [#454]https://github.com/spark/firmware/issues/454
- `SPI.setClockDividerReference`, `SPI.setClockSpeed` to set clock speed in a more portable manner. [#454](https://github.com/spark/firmware/issues/454)
- `WiFi.scan` function to retrieve details of local access points. [#567](https://github.com/spark/firmware/pull/567)
- `UDP.sendPacket`/`UDP.receivePacket` to send/receive a packet directly to an application-supplied buffer. [#452](https://github.com/spark/firmware/pull/452)
- Static IP Support [photon] - [#451](https://github.com/spark/firmware/pull/451)
Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,9 @@
# Contributions

All contributors must first sign the [Particle Individual Contributor License Agreement (CLA)](https://docs.google.com/a/spark.io/forms/d/1_2P-vRKGUFg5bmpcKLHO_qNZWGi5HKYnfrrkd-sbZoA/viewform), which is based on the Google CLA, and provides the Particle team a license to re-distribute your contributions.

Whenever possible, please follow these guidelines for contributions:

- Keep each pull request small and focused on a single feature or bug fix.
- Familiarize yourself with the code base, and follow the formatting principles adhered to in the surrounding code.
- Wherever possible, provide unit tests for your contributions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -11,7 +11,7 @@ To get started building firmware locally, see [Getting Started](docs/gettingstar

# Resources

- [Latest Release - 0.4.3](http://github.com/spark/firmware/releases/tag/0.4.3-rc2)
- [Latest Release](http://github.com/spark/firmware/releases/)
- [Changelog](CHANGELOG.md)


Expand All @@ -37,6 +37,7 @@ To get started building firmware locally, see [Getting Started](docs/gettingstar
- [Firmware Release Checklist](http://github.com/spark/firmware/wiki/Firmware-Release-Checklist)
- [System describe message](https://github.com/spark/firmware/wiki/Module-descriptor-format)
- [build test suite](build/test/readme.md)
- [System Threading](system/system-threading.md)
- [system versions and releases](system/system-versions.md)

### Modules
Expand Down
1 change: 1 addition & 0 deletions bootloader/build.mk
@@ -1,4 +1,5 @@
CFLAGS += -DUSE_STDPERIPH_DRIVER
CPPFLAGS += -std=gnu++11

ASRC += $(COMMON_BUILD)/arm/startup/startup_$(STM32_DEVICE_LC).S
ASFLAGS += -I$(COMMON_BUILD)/arm/startup
Expand Down
2 changes: 1 addition & 1 deletion bootloader/import.mk
@@ -1,5 +1,5 @@
BOOTLOADER_MODULE_PATH ?= $(PROJECT_ROOT)/bootloader
BOOTLOADER_VERSION ?= 4
BOOTLOADER_VERSION ?= 5
BOOTLOADER_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM)

# bring in the include folders from inc and src/<platform> is includes
Expand Down
4 changes: 4 additions & 0 deletions bootloader/src/core/dfu_hal.c
Expand Up @@ -165,3 +165,7 @@ static void IntToUnicode (uint32_t value , uint8_t *pbuf , uint8_t len)
pbuf[ 2* idx + 1] = 0;
}
}

void platform_startup()
{
}
5 changes: 4 additions & 1 deletion bootloader/src/electron/sources.mk
@@ -1,6 +1,9 @@
BOOTLOADER_SRC_COREV2_PATH = $(BOOTLOADER_MODULE_PATH)/src/electron
BOOTLOADER_SRC_ELECTRON_PATH = $(BOOTLOADER_MODULE_PATH)/src/electron
include $(BOOTLOADER_MODULE_PATH)/src/stm32f2xx/sources.mk

CSRC += $(call target_files,$(BOOTLOADER_SRC_ELECTRON_PATH)/,*.c)

CSRC += $(call target_files,$(BOOTLOADER_MODULE_PATH)/../hal/src/electron/,dct_hal.c)
CSRC += $(call target_files,$(BOOTLOADER_MODULE_PATH)/../hal/src/electron/,watchdog_hal.c)
CPPSRC += $(call target_files,$(BOOTLOADER_MODULE_PATH)/../hal/src/electron/,dcd_hal.cpp)
$(info $(CSRC))
25 changes: 25 additions & 0 deletions bootloader/src/electron/startup.c
@@ -0,0 +1,25 @@
/*
******************************************************************************
* Copyright (c) 2015 Particle Industries, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
******************************************************************************
*/

#include "dcd_flash.h"

void platform_startup()
{
dcd_migrate_data();
}
12 changes: 11 additions & 1 deletion bootloader/src/main.c
Expand Up @@ -30,6 +30,9 @@
#include "hw_config.h"
#include "rgbled.h"

void platform_startup();


/* Private typedef -----------------------------------------------------------*/
typedef void (*pFunction)(void);

Expand Down Expand Up @@ -113,6 +116,8 @@ int main(void)
// Setup SysTick Timer for 1 msec interrupts to call Timing_Decrement()
SysTick_Configuration();

platform_startup();

USE_SYSTEM_FLAGS = 1;

//--------------------------------------------------------------------------
Expand All @@ -139,7 +144,7 @@ int main(void)
}

uint8_t features = SYSTEM_FLAG(FeaturesEnabled_SysFlag);
// disabling this until we can be sure DCT corruption won't bite.
// disabling this until we can be sure DCT corruption won't bite.
if (true || (features!=0xFF && (((~(features>>4)&0xF)) != (features & 0xF))) || (features&8)) { // bit 3 must be reset for this to be enabled
features = 0xFF; // ignore - corrupt. Top 4 bits should be the inverse of the bottom 4
}
Expand Down Expand Up @@ -191,6 +196,11 @@ int main(void)
//Subsequent system reset or power on-off should execute normal firmware
HAL_Core_Write_Backup_Register(BKP_DR_01, 0xFFFF);
}
else if (BKP_DR1_Value == ENTER_SAFE_MODE_APP_REQUEST)
{
SAFE_MODE = 1;
HAL_Core_Write_Backup_Register(BKP_DR_01, 0xFFFF);
}
// Else check if the system has resumed from IWDG reset
else if (RCC_GetFlagStatus(RCC_FLAG_IWDGRST) != RESET)
{
Expand Down
3 changes: 3 additions & 0 deletions bootloader/src/photon/startup.c
@@ -0,0 +1,3 @@
void platform_startup()
{
}
1 change: 1 addition & 0 deletions build/arm/linker/linker_stm32f10x_common.ld
Expand Up @@ -199,3 +199,4 @@ SECTIONS
}

INCLUDE module_asserts.ld
ASSERT ( link_module_info_start - ORIGIN(APP_FLASH) == 268, "module info not where expected" )

0 comments on commit 830375c

Please sign in to comment.