Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Servo doesn't adjust speeds correctly on continuous rotation servos #120

zsup opened this issue Feb 23, 2014 · 4 comments


Copy link

commented Feb 23, 2014

At RobotsConf, many people were working with the Servo library using robots driven by continuous rotation servos. Theoretically the way they should work is that servo.write(0) should turn one direction, servo.write(90) should stop the servo, and servo.write(180) should turn the other direction. This worked correctly if the servo was calibrated appropriately.

However, in the case above, servo.write(91) should move very slowly in one direction, and servo.write(89) should move very slowly in the other direction. This behavior was not observed; instead, it seemed like servo.write functions always moved the continuous rotation servo at full speed, but just in different directions.

@zsup zsup added the bug label Feb 23, 2014


This comment has been minimized.

Copy link

commented Apr 21, 2015

Anyone know if this has been resolved? cc: @satishgn, @technobly


This comment has been minimized.

Copy link

commented Apr 27, 2015

@m-mcgowan I don't have any continuous rotation servos on hand to test this on, but I'm guessing this is most likely an issue with the servo if it doesn't move slowly at pulse widths near "center". Also, for that to properly work, the servo would need to be precisely calibrated to the pulse width that servo.write(90) outputs as "center". Based on the tolerance of the servo PWM output, this may not be completely in line with what the servo expects.

It would be best to analyze this problem by sending me a few of the servos that were used at RobotsConf that had issues... hopefully they are servos with a decent datasheet. I'll use a scope and figure it out :)

EDIT: Got some servos ordered to test. Will report back soon... if you don't hear anything in the next 7 days ping me!


This comment has been minimized.

Copy link

commented Jun 17, 2015

Ok so I nabbed up the two servos continuous rotation that Adafruit sells and tested them. They work fine! The issue is well stated as @zsup said where servo.write(90); does not make the servo stop. However, I was able to make these servos stop, creep in either direction and go all of the way to full speed; but the center position value varied between them. The large standard size servo needed to be set to exactly 95 to be stopped, where 94 and 96 would creep in either direction. The micro servo was stopped between 90 and 98, and would creep in either direction at 89 and 99.

Each servo responds a little differently, and I think this could just be a tolerance issue. Every RC Transmitter I've ever known has analog or digital trimmers on the different output channels, which essentially sets the neutral output pulse value. Similar concepts could be implemented in the software to make something like servo.write(90+trim); actually stop servo.

What the user needs is a straight forward way to control a servo and determine what values stop the servo, and make it creep in either direction or move and full speed in either direction. What to do with the range of values in between is really up to the user to implement, eg., proportional control or a low - med - high setting... etc..

What follows is a modified version of Tinker that allows you to control a servo using the Particle iOS or Android app.

1. Program the Tinker Servo app to your Photon or Core

2. Hook up the servo

  • CONTROL to D0 pin
  • VCC to VIN pin
  • GND to GND pin

3. Open the Particle or Spark Core app and set up the pins

  • D0 = analogWrite (a 0 - 180 control slider for corse servo position adjustment)
  • A2 = analogRead (tap to increment and return the current servo position by 1)
  • A1 = analogRead (tap to only return the current servo position)
  • A0 = analogRead (tap to decrement and return the current servo position by 1)

4. Use it!

Using the above controls, you can very easily play with your servo and characterize its output, based on input servo.write(pos) values (0 - 180). You can find the center off value, creep and full speed values. Values greater than 180 on the D0 slider will be bound to 180, but still display in the iOS or Android app as the higher value. Tap A1 to confirm the servo is set to 180. Tap A2 to increment the value by 1, or tap A0 to decrement it by 1.

Tinker Servo app

 * @file    application.cpp
 * @authors Satish Nair, Zachary Crockett, Mohit Bhoite and Brett Walach
 * @version V1.0.0
 * @date    16-June-2015
 * @brief   Tinker Servo application
  Copyright (c) 2013-2015 Particle Industries, Inc.  All rights reserved.

  This program 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 program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this program; if not, see <>.

/* Includes ------------------------------------------------------------------*/  
#include "application.h"

/* ========================
 * ======================== 
Servo myservo;  // create servo object to control a servo
                // a maximum of eight servo objects can be created
int pos = 0;    // variable to store the servo position

/* Function prototypes -------------------------------------------------------*/
int tinkerDigitalRead(String pin);
int tinkerDigitalWrite(String command);
int tinkerAnalogRead(String pin);
int tinkerAnalogWrite(String command);

/* This function is called once at start up ----------------------------------*/
void setup()
    //Setup the Tinker application here

    //Register all the Tinker functions
    Spark.function("digitalread", tinkerDigitalRead);
    Spark.function("digitalwrite", tinkerDigitalWrite);

    Spark.function("analogread", tinkerAnalogRead);
    Spark.function("analogwrite", tinkerAnalogWrite);

    /* ========================
     * ======================== 
    myservo.attach(D0);  // attaches the servo on the D0 pin to the servo object

/* This function loops forever --------------------------------------------*/
void loop()
    //This will run in a loop

 * Function Name  : tinkerDigitalRead
 * Description    : Reads the digital value of a given pin
 * Input          : Pin 
 * Output         : None.
 * Return         : Value of the pin (0 or 1) in INT type
                    Returns a negative number on failure
int tinkerDigitalRead(String pin)
    //convert ascii to integer
    int pinNumber = pin.charAt(1) - '0';
    //Sanity check to see if the pin numbers are within limits
    if (pinNumber< 0 || pinNumber >7) return -1;

        pinMode(pinNumber, INPUT_PULLDOWN);
        return digitalRead(pinNumber);
    else if (pin.startsWith("A"))
        pinMode(pinNumber+10, INPUT_PULLDOWN);
        return digitalRead(pinNumber+10);
    return -2;

 * Function Name  : tinkerDigitalWrite
 * Description    : Sets the specified pin HIGH or LOW
 * Input          : Pin and value
 * Output         : None.
 * Return         : 1 on success and a negative number on failure
int tinkerDigitalWrite(String command)
    bool value = 0;
    //convert ascii to integer
    int pinNumber = command.charAt(1) - '0';
    //Sanity check to see if the pin numbers are within limits
    if (pinNumber< 0 || pinNumber >7) return -1;

    if(command.substring(3,7) == "HIGH") value = 1;
    else if(command.substring(3,6) == "LOW") value = 0;
    else return -2;

        pinMode(pinNumber, OUTPUT);
        digitalWrite(pinNumber, value);
        return 1;
    else if(command.startsWith("A"))
        pinMode(pinNumber+10, OUTPUT);
        digitalWrite(pinNumber+10, value);
        return 1;
    else return -3;

 * Function Name  : tinkerAnalogRead
 * Description    : Reads the analog value of a pin
 * Input          : Pin 
 * Output         : None.
 * Return         : Returns the analog value in INT type (0 to 4095)
                    Returns a negative number on failure
int tinkerAnalogRead(String pin)
    //convert ascii to integer
    int pinNumber = pin.charAt(1) - '0';
    //Sanity check to see if the pin numbers are within limits
    if (pinNumber< 0 || pinNumber >7) return -1;

        return -3;
    else if (pin.startsWith("A"))
        /* ==================================
         * A2 Increments and returns position
         * A1 only returns position
         * A0 Decrements and returns position
         * ================================== 
        if (pinNumber == 2) {
            if (pos < 180) pos++;
            myservo.write(pos); // tell servo to go to position in variable 'pos'
            return pos; // Returns current servo D0 position
        else if (pinNumber == 1) {
            return pos; // Returns current servo D0 position
        else if (pinNumber == 0) {
            if (pos > 0) pos--;
            myservo.write(pos); // tell servo to go to position in variable 'pos'
            return pos; // Returns current servo D0 position
        return analogRead(pinNumber+10);
    return -2;

 * Function Name  : tinkerAnalogWrite
 * Description    : Writes an analog value (PWM) to the specified pin
 * Input          : Pin and Value (0 to 255)
 * Output         : None.
 * Return         : 1 on success and a negative number on failure
int tinkerAnalogWrite(String command)
    //convert ascii to integer
    int pinNumber = command.charAt(1) - '0';
    //Sanity check to see if the pin numbers are within limits
    if (pinNumber< 0 || pinNumber >7) return -1;

    String value = command.substring(3);

        /* ========================
         * ======================== 
        if (pinNumber == 0) {
            pos = value.toInt();
            if (pos > 180) pos = 180;
            myservo.write(pos); // tell servo to go to position in variable 'pos'
        else {
            pinMode(pinNumber, OUTPUT);
            analogWrite(pinNumber, value.toInt());
        return 1;
    else if(command.startsWith("A"))

        pinMode(pinNumber+10, OUTPUT);
        analogWrite(pinNumber+10, value.toInt());
        return 1;
    else return -2;
m-mcgowan added a commit that referenced this issue Aug 22, 2015
@m-mcgowan m-mcgowan referenced this issue Aug 22, 2015

@m-mcgowan m-mcgowan added this to the 0.4.5 milestone Aug 22, 2015


This comment has been minimized.

Copy link

commented Aug 28, 2015

Implemented with Servo.trim(), which provides the finest control by allowing the length of the pulse to be adjusted.

@m-mcgowan m-mcgowan closed this Aug 28, 2015

m-mcgowan added a commit that referenced this issue Dec 2, 2015
Squashed 'communication/lib/mbedtls/' changes from 7e3e6a9..785f0ab
785f0ab debug output for filtered cloud UDP packets uses correct offsets.
696d757 suppress debug output when UDP receive is a timeout
12ba427 ignore timeouts when reading from UDP on the photon and return 0 bytes received.
7f3cfc3 filter out packets not from the correct IP and port.
dfdebe6 parse port from server address info
5bbde46 `MODULAR_FIRMWARE` is a conditional optional define rather than always being defined as 0/1.
d05747a consistent  error return values from the handshake.
0084162 ec key generation tweaks
3204b2d outline hello method
9403eda have the CoAPChannel first, to add IDs to messages without IDs, which is then passed to the reliable CoAP send/receive channel.
5188d37 factor out  context initialization
872e8c1 ensure the message has a registered ID (not just encoded in the raw buffer) when passed through the CoAP channel.
b395866 use the reliable CoAP channel for the DTLSProtocol message channel
25f4d91 tests for Message::set_confirm_received()
ebd93cc Trim mbedtls config to remove unnecessary features
0d9db79 Chunk ACK needs to follow channel for CON/NON
8e71b98 Merge branch 'develop' into feature/comms-lib-refactor
5bd920c when an ACK is received from the server, the original CON message is removed form the store. Subsequent ACK messages with the same ID are ignored. test to verify the client and server message ID namespaces are separate.
3679c7e separate send/receive message namespaces in CoAPReliableChannel and tests.
8ba2616 establish() test for CoAPReliableChannel
b72dec4 factor out base interface Channel for simply sending and receiving messages without message creation.
00ece36 synchronous sending of a CoAP message for cases where we want explicit delivery sequencing
61d65d7 test for confirmable message received and resending application response.
8e3a40c tests the message retransmit logic and timeout.
eace327 CoAPMessageStore owns the objects stored in it. adds allocation counter for CoAPMessage to track memory leacks.  computation of  transmit timeouts.
ff466ac confirmable messages are answered also with a reset
301a7d7 determine if a system tick timepoint has passed, with rollover handling.
a288364 factors out CoAPMessageStore from the reliable CoAP channel, inject current time.
dfc4475 configurable ping interval and timeout
4d76864 also reset when send/receive fails post-handshake
97e9ca1 attempts to reinitialize the context, and delays setting up the server public key for session negotiation.
edb4b7a Fix UpdateDone to PUT
6a740b2 Don't send empty ACK for each chunk when doing Fast OTA
82e6ef0 Unbreak DTLS handshake
cd39b65 does not clear the message buffer for DTLS so that the OTA bitmap can be stored.
3134d49 removes acknowledgement of chunks received in fast ota mode
d342956 clear DTLS context when establishing a connection.
1e58d0e Fix empty ack length
e2e157b acknoweldge Hello message if it is confirmable.
0abc432 confirmable message is added to the store for resending, and removed when the acknowledgement is received.
eb6c125 events are confirable over unrelaible transport
d90694c updates documentation.
fd876cd function_return message is confirmable over unreliable transport
efe7ca6 update_done and update_ready is confirmable over unreliable transport
7c24d2b adds `is_unreliable()` to message channel so that the protocol can provide different messages for reliable vs unreliable transports.
c46568a adds a confirmable flag for events
a3c82d1 moves event CoAP message into Messages class.
66fcfb6 OTA buffer was being overwritten in the last 2 bytes with 0x0010 (16) by the response message which hasn't added the necessary offset for the 2 packet length bytes.  Moved the response() implementation to the BufferMessageChannel so that the needed space can be injected.
7f92875 fast OTA working with CRC checking disabled.
1f6ce85 C-compatibility for protocol selector code
8106567 warning on receive error in communications LightSSL
289a24e removes templates from ChunkedTransfer and replaces with callbacks provided by a abstract class. Fixed up message ids for CoAP messages.
1289f33 moves Messages functions into the .cpp file
613280f FIRM-281 - adds test case
8673210 FIRM-281 - subscribe messages sent
684e868 protocol test for product details
b03fb1a return error if read fails.
f4d820d virtual define OTA update suppoert. wip. writes output to "output.bin" file in working directory.
c9fcb4a error code 35 is not a critical error and simply means no data available, retry later.
5c30364 build fixes when PARTICLE_PROTOCOL not defined
e84239d reverted use of config from node-mbedtls-client which causes a handshake failure (error is unsupported feature.)
b090916 fix for virtual device pinning cpu. (HAL delay functions were not being used, so delay() was busy waiting.)  Requires rebuilding boost via ci/ and a clean build of gcc main.
16b659c Merge commit '6ed23a0c8f65e377a39845c344b1095f359eb1d0' into feature/comms-lib-refactor
6ed23a0 Squashed 'communication/lib/mbedtls/' changes from 106b313..7e3e6a9
03619c3 confirmable message pending test
aaeedc5 debug logging during cloud connection for udp
25f0957 initial tests for CoAPMessage and CoAPReliability classes
30c9a9a fixup tests. message parsing requires at least 4 bytes.  TRANSPORT_ERROR -> IO_ERROR.
7cf0644 moved mbedtls config file out of mbedtls source tree
2f9b087 Fix variable return ack message id and token
720720e non blocking boost send/receive
17b2c84 missing file from prev commit
790f564 fix up message id for function call ack
a787d8e bootloader flags for virtual device (prevents entering safe mode by default.)
39c3536 describe call had parameters inverted.
d2f7134 protocol.h -> protocol.cpp
6b3ef81 Remove non-working boost code to determine if bytes are available
5273b06 Don't compare UDP addresses on gcc platform
6c5c8ea for UDP comms, add device ID to hello message.
fc120b5 retrieve peer address and port in in virtual device socket_receivefrom()
241d619 include boost random library for virtual device
51c9a24 rand_hal -> rng_hal so that it overrides the template HAL definition
5e56b3d use boost RNG for virtual device
3ff1654 RNG for virtual device
c44a172 only use stdout on the cross compile platform. Electron monolithic builds.
0fd5336 move keylen() into a to public scope and provide the 3 arg version of extract_public_ec_key() for use by the stm32f2xx hal.   Photon monolithic compiles with both UDP and TCP.
1016df1 Fix debug output
a6ce4c1 We need to loop over mbedtls_ssl_handshake if insufficient data is cause of return
8aa1d55 returning 0 means EOF to mbedtls, return MBEDTLS_ERR_SSL_WANT_READ instead
27fc5c0 Fix location of mbedtls_ssl_setup
90840cb moved code from .h to .cpp file
799a636 virtual device fetch IP address from EC key
34ac9b3 make receivefrom non-blocking under gcc
9975458 add DTLS timer
f75f504 fixing EC key generation (the key is generated at the end of the buffer) plus determining the exact key size from the oversized buffers passed to DTLSProtocol::init().  Moving some key functions from .h to .cpp files to make debugging work.
ce9625c HAL_PLATFORM_CLOUD_TCP define to explicitly include/exclude the TCP communications stack. This was initially needed to avoid having two modules called bignum.o which confuses gdb.
e873703 unit tests now compile for electron
78c674a create the protocol instance in Spark_Protocol_init() so that the system has had time to setup the TCP/UDP selection configuration.
46690e3 virtual device UDP implementation
82ded71 configurable port, udp send/receive callbacks.
f438067 UDP implementation on electron
93a8373 rename parse_device_pubkey_from_privkey -> extract_public_rsa_key. added extract_public_ec_key.  These are used in fetch_device_public_key()
9dc2867 handshake doesn't announce presence over UDP. (Ideally this should instead check if the server is on a local subnet or not.)
a2cf8fc virtual device configurable protocol
756ab83 build file for mbedtls
1be8ef8 avoid "unused function" warning when UDP comms is not compiled in.
e01e9f1 remove unrecognized warning pragmas when compiling with gcc 4.8.4
68649a7 ec key generation
27dc0fa TCP/UDP selection
8691cce use common newlib stubs
4665cb7 move WLanConfig to shared network. (It will later need renaming and refactoring, but in principle apart from the SSID it is independent of WiFi and is more related to IP networking.)
5c4ca70 comms-dynalib dependent on hal for platform config.
65e7145 AES in ROM so that we don't use 8K of ram.
5ede881 hal_platform.h header needed in comms dynalib
6ae939c factored out common code for newlib stubs across all platforms
4063e99 Merge pull request #730 from peterqu/dac-unit-test
6f374ee Merge pull request #728 from peterqu/bug-fix-issue#671
d7d8528 change platform ID
3f82b5a use common server address block size for primary and secondary stores.
be015da add test for github issue 671
ce8ab6a add include for memset
82ff0fa Merge remote-tracking branch 'spark/develop' into bug-fix-issue#671
a13f321 Login to Docker Hub only when having credentials
155e3b3 mbeddtls compiling on ARM. Tweaked config to reduce footprint.
c9063e0 Merge pull request #729 from suda/develop
4452984 Default DOCKER_HUB_EMAIL
6e564e7 Login to Docker Hub only when having credentials
a3d95c2 FIRM-271 - runtime selection of TCP or UDP comms.
f99ffca dtls message channel
5813bbf make Protocol a complete base class with virtual methods as needed so that multiple implementations can be used polymorphicly.
254a0ec configuration parameters for the type of protocol to create
e0e1f8f additional storage for alternative keys. HAL_PLATFORM_CLOUD_UDP define.  FIRM-271
167d9f7 fix issue #671 and #662
af664ef DTLS implementation compiling.
1a2cabe Merge commit 'ebd0ff435424eb430a26380a5f68337164a2ab67' into feature/comms-lib-refactor
ebd0ff4 Squashed 'communication/lib/mbedtls/' changes from f7a4688..106b313
867ca2b Merge commit 'd5469078bf3a3a90b9dc6a0651a62ddf901287fe' into feature/comms-lib-refactor
d546907 Squashed 'communication/lib/mbedtls/' changes from 0a0c22e..f7a4688
f5b8694 start of DTLS Protocol/Message Channel
a78897c Squashed 'communication/lib/mbedtls/' content from commit 0a0c22e
00c737f Merge commit 'a78897c62789452a814a2463aecbc675a00ff305' as 'communication/lib/mbedtls'
874e989 add additional pointer to send/receive callbacks so that additional context can be passed back. This is safe since the part1 is always the same or newer than the application. Additional parameters can be passed to a function - they are simply ignored by the callee.
74083e4 message debugging. Allow the channel to peek for the next message rather than blocking.
47c06ea CoAP message integer values
810f4cf CoAP Channel to manage message IDs. LighSSL adds decryption. Debug logging. LightSSL connects to the cloud.
41122df factored out common elements from newlib_stubs.cpp into shared stm32 directory
d0aaa94 cloudteset firmware and bats app - provides a smoke test of the cloud comms. wip.
3512d06 `make system` supported from modules folder
8114f68 factored lightssl channel to split cpp files for easier debugging.  misc improvements to new protocol implementation
8c512fc explicitly wait for HELLO response during CoAP handshake. misc fixes.
77f0c43 Merge pull request #723 from spark/feature/travis-docker
a2cf97e Merge pull request #721 from spark/feature/softpwrdown-fix
0197df4 Log in to Docker Hub
1d44256 Revert "Fake failing unit tests"
cbc8bfe Fake failing unit tests
78ed79a implement facade as LightSSLProtocol class. provide compile time selection of new/old implementation. refactoring code-complete. testing pending.
3d74fc6 compile-time selection of SparkProtocol or ParticleProtocol implementation.
86b642b external handle to a protocol instance declared as a typedef so that it can be changed at compile time.  SparkProtocol -> ProtocolFacade.
5673b78 wip on lightSSL  channel
9381548 a smarter, non-fairy-killing release script
907022e Fail if one of the tests fail
d4ce7c8 fix signed quantities that should be unsigned
68c0c4c fixes Soft Power Down and Listening Mode operation
70ec34b push message_id generation into message channel. message ids are only used by the application when sending a response, and not when sending a new request.
8d98fb2 object initialization
16e1d68 refactoring wip: chunked transfer, variables. all of new protocol implementation compiles.
9fb6636 refactoring wip: factored out functions, is compiling.
d0a72da refactoring wip: subscriptions factored out and compling
10b3add refactoring wip: chunked_transfer.h is compiling.  Message and MessageChannel interfaces solidifying.
caf984d Merge branch 'develop' into feature/travis-docker
d00669a Install Boost together with running tests
d35ca83 factored out more messages (coded_ack) and added tests for integer decoding functions.
b8eef98 ping send/acknowledge handling factored out and tested.  MessageChannel abstraction.
5239a65 added more CoAP messages
3efd173 run unit tests by defauilt
03bc637 static build for boost
6eafd6c clarification on running tests
9be3738 ignore warnings in boost library
587d24b avoid an error  with spark_deviceID returning a String, which isn't strictly compatible with C, but works in practice with ARM.
f3fde37 compiler options for profiling/code coverage
f2b8b33 factor out hello message
1a274b4 factor out message type decoding with tests
87f88a3 catch unit test framework for comms lib tests
8d5f89a fix compiler errors for comms lib tests. Fixes FIRM-176
c025f70 remove unused methods
5a37d1a factroed common networking HAL functions into a new header, which is used by both wifi and cellular dynalibs.  TCPClient example app builds on electron.
c2e8677 generic build of user-part module from `main`.  allows electron  modular application to be built from `main`
558fb0f gcc build fixups
d30ea68 system shutdown initiated with a double click, which runs on the system thread.
096811f cellular_cancel API
eaa1461 add electron to script, output in releases folder
1481165 added TYPE_ABORTED to parser for CPWROFF retry
87a6a6f address issue #711 - remove linker warning  about BACKUPRAM section when building the bootloader
5726c0f allow MDMParser::detach() to GPRS detach without saved IP
e19fbb4 added wiring_globals dependencies to system_part2 makefile
785830e Electron can maintain connection when STM32 resets or sleeps
0e44c6c fix for gcc build that doesn't ignore unused but undefined functions.
5dcf357 work in progress on implementation of soft power off.
deaf3d3 added wake up functionality for the fuel gauge
401655c move WLAN_CAN_SHUTDOWN behind accessor methods
dce5af9 FIRM-258 - IMEI is reported over serial when SIM card is not present.
6668d60 FIRM-256 - enable setup mode on the electron
bf3e739 fix for fuel gauge and power compile on non-electron platforms
7d6d0ee test apps
5f81df6 system versions update
e29e1f0 release script - name build artefacts using the platform name rather than numbers
b01ec4f added pmic and fuel gauge support in spark wiring using wire3
63b5a48 Merge upstream
9ab7b2d Remove verbose
1c70c1a Wget builder
e330877 Move files one level up
99dd22a added mention of I2C enhancement
52d3362 Show current dir
dcc1063 Use firmware-buildpack-builder
91172bb updatePending -> updatesPending to be consistent with the other similarly named methods.
968b031 update changelog to point to docs
858f482 fixing up some wiring/no_fixture tests
4b4ee10 pinAvailable() returns 0 when pin out of range
75c7ab2 pulseIn() waits for first edge of pulse
d75f06f bump versions for 0.4.7
3874b46 Merge branch 'feature/simple_variables' into release/0.4.7
3f5a739 `CriticalSection` class not available on the Core.
a648eba Add critical sections around I2C operations for increased reliability. Fixes #698
981d390 changelog for 0.4.7
1bfeed7 Particle.process() pumps application events only when threading is enabled.
dee8d45 fix for gcc build
05aa6e0 Simpler and consistent `Particle.varaible()` API.  No need for address-of `&` operator on any variable types.
5e6c3a2 support for `String` variables. Fixes #657
ceb23c2 rebuilt wiced libraries. (one of the PRs had a merge failure on a library and I want to be sure the libraries are all up to date.)
2b020d3 Merge pull request #703 from spark/feature/backup_ram_again
396e678 define bool __backup_ram_was_valid() for platforms that don't support backup RAM. Fixes the build for the Core and newhal.
77de71b test application for backup ram.
8257a60 save a 4 byte value in memory which is used to detect if the retained variables need initializing. The feature  `FEATURE_WARM_START` is derived from this, since  this appears to be the only reliable way to determine if the contents are still valid or not. (Without this, the backup regulator can still be active even when the device has been powered down for 45s, but the backup SRAM contents are not valid.)
5ca64ae PARTICLE_NO_RETAINED define to allow disabling of the `retained` keyword for libraries already using that name.
398e811 always enable the backup SRAM so that we can read/write data. This is done regardless of whether the backup regulator is enabled, so that the 4K of backup SRAM can be used even if retained variables aren't required.
ad25078 factor out backup ram declarations to reusable linker scripts.  system backup region is sized exactly to hold the system retained variables.
5856d2b generate an error if `retained` is used with the Core
4b94ecb Merge pull request #664 from spark/feature/backupram-fix
72f44bf include directive in linker scripts is case sensitive. fixes build.
1d7c66e add a user initialization hook that runs before all user constructors. This is used to initialize the backup ram when the backup regulator has not been enabled.
adff491 ubiquitous support for backup ram on stm32f2xx devices, both monolithic and modular. Fixes #667
a427e87 initialize backup sram only on first use
c97b29a Merge pull request #700 from spark/feature/i2c-fast-nack-timeout
d96c6a7 Merge pull request #694 from spark/feature/issue-680
e2555fc Merge pull request #696 from spark/feature/ota-update-control
0f227ae test application for OTA update control
82d8587 OTA update and reset control implemented and tested.  Firmware is ok, but the cloud seems to have a few issues when the UPDATE_BEGIN method isn't replied to immediately.
b6f0b0b Add more consistent alias for the HAL millis/micros function (parallels HAL_Delay_Microseconds)
b2f87f2 implementation of system flags
889d67b Merge pull request #702 from spark/feature/gcc-build
63f7971 Merge pull request #689 from spark/feature/issue-682
4cf52eb Merge pull request #699 from spark/feature/multithreading-feedback
9d7c4fb fix for build on the Core (CC3000 also has a socket.h header that conflicts with the HAL.)
54bb917 fix for compiling GCC target on linux and OSX
7e93d0c duplicate ymodem callback definition
849504c the LED functions should not be varadic in C
5116796 avoid warning of memset being called with size 0 (gcc build on linux.)
0e1869e compiler flags (difference with gcc and clang on OSX.)
091a020 Test using Docker
cb05b31 build boost libraries locally
7ee8d43 pin libboost to a specific version
7d8341d remove the default compiler and use the one we install to see if that helps gcc build
73d0401 libboost-asio-dev not found
45d3692 include boost libraries in travis
5085501 retained memory only compiled for the STM32F2xx platform (fixes gcc build.)
afc87ef fixup weak functions for serialEvent() for gcc
ae6b3a8 add missing HAL_Pulse_In() to GCC
8f4ba79 add GCC compile to build matrix
500d2a3 contribution guide wip
f96cfd5 packet size comparison was in the wrong place!
2a86b7c Wait for STOP bit to be sent before SW Reset
fa7651f Merge commit '3655bd448a88ed7ffc923fd10e0034b7400eb414' into feature/travis-ci
a87a229 allow the base build target directory to be specified. Fix recursive TARGET_PATH definition when TARGET_DIR is not defined with APPDIR
893aa52 Speed up I2C 100ms timeout on Slave_Address NACK - fixes #675
8578b7d added missing cellular dynalib to HAL so that the Cellular class can be exposed in wiring.
96fa6ce fix for 4-part FQDN's not resolving (bug in WICED that first attempted to recognize the address as a IP address written as a string, but didn't check for numeric conversion error so would convert any 4 part FQDN to the address and return success.)
8edd069 reduced size of stack for system thread. The 2 biggest stack use cases - connecting to the cloud and softap configuration, were tested.
1fa0f26 application to test when the application continually sends queued requests to the system.
dcc1bc6 With the thread priorities now equal for the application and system thread, listening mode (which runs the system thread continually) correctly time-slices with the application thread. fixes issue #670
556f40a fix for #652 - ensure that the shared pointer is retained with the thread's startup function, and ensure that the thread() constructor doesn't return until the thread has started executing, as required by the C++ constructor definition.
ae2141d comment out unused conditional variable implementation
4a8e33e pump cloud events even in MANUAL mode when system threading is enabled.
bc7c136 ensure threading variable is volatile since it's read/written to by separate threads
706d421 Ensure that the background task for each active object is executed even when the queue is continually being populated with other tasks.
3ea66cf assert that the type is 1 byte, since it's written to the DCT
d87a7a7 implicit PLATFORM_ID when building from modules
a0092e9 `Particle.process()` test case
8e02561 factored active object loop so that fetching from the queue is a separate function. This is invoked by Particle.process() when called on the application thread, allowing the application to pump it's own messages.  Addresses the issue raised in #659 where a never ending application loop will not be able to service cloud function calls.  The `system_internal` function provides a pointer to the ActiveObjectBase instance for the application thread so that we can test that the queue is serviced.
55a5b21 WiFi.dnsServerIP() / WiFi.dhcpServerIP()
a137615 logging when the cloud connection is terminated due to inactivity (system or application not pumping cloud events.)
8fc3f56 Merge pull request #656 from spark/feature/pulsein
a316e92 Merge pull request #681 from spark/feature/serialevent
9b30238 Merge pull request #691 from spark/feature/system-version-api
af77c9d pulseIn() for Photon/Core/Electron, with tests
275466b spark_process() needed for non-cloud builds too.
9205307 fix for issue #680.  When content length is specified, ensure subsequent packets are read as necessary.
42c3f7d Merge pull request #693 from spark/feature/electron-connection-behavior
159dbc4 fixes for tests on the P1
2c3c2be when exiting listening mode, used to revert to the previous wifi state (on/off). Now leaves WiFi on so long as there are credentials.  Helps avoid the white breathing LED reported in #682
ab2216b execute modular application constructors after freeRTOS has started to ensure all public APIs are callable.
8e02f00 ensure bootloader is write protected.
0fbda2a integration tests for System.version() api.
70ce3ea rename existing system_version_info to append_system_version_info
a3fedce fix compile error in BYTE_N macro
ad49a1a fix copypasta in usart code. addresses issue #682
f47cd29 Merge pull request #686 from spark/feature/virtual-device
3711e52 add INFO log, and increase numeric value space to allow additional log levels in future (plus allow finer granularity)
f302783 dns resolution, read device ID and device keys from configuration, and output in readable form to debug logs. gcc connecting to cloud.
2f0fbf2 integrate program options into gcc executable
248c28b add copyright preamble
69fda38 pins as const int now that gcc hal is all cpp
77e566d fixes for gcc compile (64-bit, unsupported optimize attribute, no system ticks support, missing override declaration)
a98ce5f first pass at mapping GPIO pins to files in the filesystem
837c066 GCC program configuration using boost options
990798b gcc implementation of Serial maps to stdin/stdout
c9cc338 gcc RTC based on boost time
865301b gcc hal wlan as cpp file
b6a9b43 hal template files renamed from .c -> .cpp
7e8ebb8 factor out gcc executable extension so it can be changed per OS
5600296 optimization disabled for debug build
3d75d79 additional logging and remove unnecessary check for null (the pointer is a char array in a struct, so can never be null.)
c5236f0 FIRM-151 - serialEventX() weak functions in user app to allow the application to know if there is serial data available.
96c7f73 fix for #665 with tests
b3ff5a0 Merge pull request #674 from munirent/electron-openocd-freertos
c4fe75e fix for #672 - the socket async notifications cause SOS's.
77f9327 Merge pull request #678 from r2jitu/patch-2
33e7f78 Merge pull request #676 from spark/feature/timers
5f5035d reduce socketSetBlocking timout and let URCs recv
bdce3c0 Setting _remoteIP by index doesn't set it as IPv4
472210e fix for newhal build.
5f8c794 Core constructors should be 4-byte aligned or the system hard-faults.
53784fc fixed typo in Timer destructor
290c639 Core constructors should be 4-byte aligned or the system hard-faults.
5088a32 virtual destructor on timer.
a92c8b8 expose timers in FreeRTOS
f10ddb7 Schedule the FreeRTOS SysTick
a68cf8b Add support for "info threads" in gdb for Electron
9c4b307 newlib intiializes constructors for the core using the same initialization block.
f6f31c1 ensure the bootloader calls C++ constructors. This fixes the problem with DCD not working from the bootloader on the Electron.
1bca94c Merge pull request #658 from munirent/clearer-variable-errors
edf3e57 Fix typo
f95cf1e String::format function
8919ffc fixes for SPARK_NO_CLOUD build
ca2d738 printfln -> printlnf in Catch tests
00d3eed Merge pull request #654 from munirent/clearer-variable-errors
56179f8 Make the errors clearer for Particle.variable()
a5f5832 Remove bad test
082c1fd Add slack notifications
4a61d52 fix for RTC conversion to unix time.
44d3c5e convert months to BCD format as required by the STM32F2 CMSIS api.
2e1199a http -> https for docs links
10ed41d added system version defines
dc15b3e updated links to documentation
446faca release script bumped to 0.4.6
e1e512b turn off the WiFi on the CC3000 when existing listening mode. This ensures the device connects to WiFi. (Without this it flashes green for 30 seconds until the network watchdog restarts the WiFi subsystem.)
ffc5775 changelog for 0.4.6
07ae12d added contributing notice
bc1a25e updated the Core button handling to be the same as for the photon.
53c1121 printfln has never felt right. printlnf ftw!
7252cb8 Turn on debug output by default and turn off ansi colors
adde3a9 no need for P1 flash in dynalib - it is linked directly into the user app from the `platform` module.
1386cee ensure system part1 is initialized. The startup order on the electron is different than the photon - HAL_Core_Config is called directly by the startup script rather than in the system_part2_pre_init() function. This is a bandaid and the real fix (tm) will follow when there is more time.
6c01d92 enable external flash in HAL on the P1
80f77dd Merge pull request #649 from spark/feature/core/system_interrupts
accdc45 Merge pull request #648 from spark/feature/electron-hw-flow-control
aefb334 make CFOD handling flash orange rather than red since it's not a hard error.
a2bb949 make multithreading common for photon and electron. (need to work around some FreeRTOS incompatibilities in createTask call.)
cf36b79 increased WiFi join retry from 1 to 3 to help resolve issue #620
7431f8d removed threading test code in deafult app. (this caused the core to hang since it tried to set threading active. fixed by always making threading inactive for platforms that don't have it compiled in.)
bd84286 Merge branch 'feature/non-blocking' into develop
2226f04 bump module versions
983a6f5 Merge pull request #647 from munirent/feature/wiring-thread
90f6dc9 Merge branch 'develop' of into develop
19971b5 Merge pull request #646 from spark/feature/core/freertos
d5f7fcc missing macro when compiling without platform threading
cfc19f2 Merge branch 'develop' into feature/non-blocking
9020bee Add Thread API and integration test
9fdb779 Work around a std::thread create bug
5d1ff89 system interrupt handlers on the core
ad32382 Prevent out of range task priorities
5aa87f5 events are handled in the system firmware (external to the communications lib) so that they can be handled on the application thread.
c24be33 Remove PeriodicWork for now
d40bfb9 HAL_Set_System_Config common for photon and electron.
8f3447a Fix docs typo
82719ff Change thread priorities to sensible defaults
f49073b Be a little more generous with the default new thread stack size
70ad509 Make isCurrentThread returns correct result if threading is disabled
e7ff028 Don't call Spark_Idle in delay from other thread
ae61b39 Updated Wiring Thread implementation
6102ae1 streamline active object message passing for async and sync cases. No more shared_ptr. queue stores pointers rather than shared_ptr instances to reduce size of queue required. conditional variable in Promise replaced with a semaphore since only one thread waiting.
a696302 semaphores in hal
b9d17e4 invert order of parameters. I clearly think this is preferable since it's what I used in the code....
753529d formatting
638c3c6 wait for thread to start.
45bd157 removed unused macros (early work in progress)
69bc197 a missing star
de15b81 add missing BACKUPSRAM memory def for electron
3794b54 stub out HAL_Set_System_Config for electron
c64102c Turn on hardware flow control and cellular low power mode
3030f9b thread yeild support
ec26943 Merge branch 'develop' into feature/non-blocking
a2fb6ea hooks to support freertos.  Can hook SysTick, PendSV and SVC interrupts.
5ca2d98 start of freertos
761c6bd ensure system info struct is initialized to 0 so that the HAL_System_Info function doesn't have to fill out all members. (The core was leaving the key/value pairs as they were, which pointed to invalid memory locations.)
b7ef29e add debugging info to hard fault handler for the core
3cc0af6 don't redefine stringify() if already present.
6ba9867 disable Serial1 in listening mode (only used for manufacturing). fixes #632
ff25e56 include multithreading on the urlurctron
6bd5649 allow event handlers registered with the cloud protocol to be called using a strategy. the actual function call will be managed by the enclosing system.
0433c9c system threading docuemntation
93a3907 added FreeRTOS openocd support for monolithic builds for photon and electron.
49867da fix for UDP.receivePacket() not working if setBuffer() is not called.
d3b1087 Merge pull request #603 from anujdeshpande/develop
5bc1c0f Merge pull request #608 from spark/feature/system-ticks
757f0d2 fix for newhal build and moved platform-specific code out of wiring and back into platform.
bc0ba98 `System.ticksDelay()`
a953e28 System.ticks() and System.ticksPerMicrosecond() - addresses #406
0724304 Merge pull request #606 from spark/feature/backupram
49d3b29 add missing methods to core/template/gcc hal
eaa046a System API for features.
0da8035 backup RAM features, and initialization of backup RAM on cold boot.
5f85f14 linker for backup RAM and `retained` declaration
8120763 feature get/set functions in hal
2ba58cd dynalib edit guidance
13a2ffd Merge pull request #609 from spark/feature/safemode-api
d08908d publish safemode event after handshake
cef6acd system events to control various types of device reset.
e4ded72 `System.enterSafeMode()` API to allow application or system code to trigger entering safe mode. FIRM-214
b02c2ee Merge pull request #626 from spark/feature/mcp23017
27c695d Merge pull request #633 from spark/feature/dct-control
0bb0745 rebase on develop
c808d4c `System.set()` API to specify configuration values.
c78aa47 implementation of #630. Application can set device keys and ssid prefix.
3f6bdc2 conditional compile for 4.8.4/4.9.3 arm gcc
c9b5090 remove async notifications on disconnect - just until we can verify this isn't causing a hard fault.
6f1c79f Merge pull request #639 from spark/feature/travis-build-matrix
c7b0fa1 bump bootloader version. Contains P1 DFU fix.
8f9616b fix newhal build (and include this in our CI test suite)
1812c61 fix for P1 bootloader. After adding Serial Flash, the DFU MAL implementation wasn't being included, causing DFU to fail.
3df9749 Merge pull request #611 from spark/feature/button-events
4f3ba49 Merge pull request #641 from spark/feature/electron/dcd
c7a6239 Add some color :sparkles:
b8f396f Switch back to script based build
f2a241c Remove unnecessary code in
aea9454 Switch to particle-cli
e6a5e37 Remove unnecessary builds
81e70a1 Expand the matrix because travis doesn't support it for env vars
3fb950f Attempt at using travis build matrix
96fa622 fixup compiler errors
de8a8cc don't cancel button after 10 seconds.
7c5b5bb `System.buttonPressed()` to determine how long the mode button has been pressed.
d9f5c57 fixed includes.
5d93c39 DCD implementation for configuration persistence.
2776917 signed/unsigned mismatch
5d70194 Merge pull request #637 from spark/feature/electron/rtos-malloc
dbdd443 fix for the travesty of travis build errors
8ccdc66 more headers to please the travisty
4896ae3 Add headers to try to fix travis build error.
1e89644 Configurable DNS resolution. FIRM-224
0248291 Merge pull request #638 from spark/feature/photon/persist-antenna-select
8ababaf fixing compiler warnings
c36e93b Merge pull request #636 from spark/feature/electron-led-states
f329522 save the antenna selection persistently so that safe-mode works.  addresses #618
71eab82 DCD implementation, mock flash interface and tests
1aa051a factored out duplicated application dct defintiions from electron HAL and use the common dct.h from platform.
ed038ab change log + license header
bb34206 ensure malloc() can return NULL when heap is exhausted. Add mutex for malloc in preparation for multithreading.
368b11c Merge pull request #607 from spark/feature/printf
a029fa5 move globals to wiring_global so compile succeeds with optimizations disabled.
964a441 unit tests for Print.printf()
68fc11f increase default buffer size and use that in all buffer size tests.
d43500a Move connection code to get proper led states
b0c5082 Use MDM_SOCKET_ERROR when looking for available sockets instead of 0
ebaa509 Fix LAC and Cell ID parsing
3d7024d Merge pull request #619 from spark/feature/variable-typecheck
4516ee9 Merge pull request #622 from spark/feature/cloud-connection-status
44f1f13 Merge pull request #634 from spark/feature/electron-modular
0eb523d fixes for all optimizations disables. The compiler seems to ignore inline functions so they fail at link time.  Moved required wiring globals from wiring to wiring_globals library. `-O0` now builds.
fc9c0be modular firmware for electron (squashed)
fb71830 factored out common parts of photon system-part1. electron system-part1
d0ac65b FreeRTOS integration. Single threaded for now.
ba342c3 FreeRTOS distribution (only GCC/ARM_CM3 port)
f48b739 start main freeRTOS task.
f0f9c27 replaced WiFI-specific calls with generic methods on NetworkInterface class.  Removed use of template HAL layer (which showed the electron was still implicitly defining some WLAN functions.)
75e09c0 updated build matrix to also compile some key tests
396cd0e Merge pull request #592 from spark/feature/rtc-electron-fix
0b3de5d Fix RTC issue on Electron - override RTC alarm interrupt handler
3c700fe Implementation of thread-safe socket layer
ab6dbef Merge branch 'develop' into feature/non-blocking
12a4a89 fix for #628 - point latest release to github releases.
ed3b5fc test and fix for #629 - map() not linked with correct linkage.
f0ad68a DCT only writes if the existing data is different.
ea643e7 fix for more than 2 credentials causing unpredictable results.
4679e54 FreeRTOS threading support in OpenOCD
5eb4b78 fix for #566. Photon now exits listening mode quickly in all cases I could try.  Fix is in WICED - when looping over multiple stored APs, it would only exit after all were tried. Now it exits immediately and doesn't retry further APs.
d16b7e7 changelog
50a037a flip polarity of flag for os_thread_scheduling().
3a62bf6 Merge branch 'develop' into feature/non-blocking
e612520 Merge pull request #631 from monkbroc/patch-1
44b8c60 Don't modify registers in HardFault_Handler
3f19ec8 clarification
48755a1 Update from @pre
ddb8b84 changelog
9978a4e fix a typo
5368b18 contribution from @pra in the community. Thanks!
5df8e43 set default SPI SS pin and separate HAL SPI into mutable and immutable state.
3d96dba use correct default pin in SPI for the different SPI interfaces. Addresses #623
bd47535 Merge pull request #624 from kennethlimcp/fix/typo
14b81ba fixed "balaced" typo
693aa0e fix for gcc build. const instance requires a user provided constructor, apparently. Only check size of enums for device platforms.
6235f24 fix for SPARK_CLOUD=n build.  Thanks CI build for checking all the stuff I don't!
02dc8b6 Merge pull request #621 from spark/feature/electron-socket2
2ef0948 addresses #616 - revert to breathing green when the cloud isn't serviced for 15 seconds.  In automatic mode, the system will try to reconnect once the background loop is executed again. Semi-automatic and manual mode requires the application code to call `Particle.connect()`.
1036912 Merge branch 'develop' into feature/electron-socket
54c1de9 strict typechecks for Particle.variable(). Catches cases like
f6ccc66 Cloud function executed on application thread. Tested that this interrupts the application loop().  The function invocation and function return are handled on the system thread. FIRM-85
bbdc9dd enable openocd threaded debugging
426729c fixed pointer indirection with condition variable. Passes a pointer for all cases apart from construction, when it's a pointer pointer (to receive the dynamically created instance.)
c2c6e6b Reactivate PDP context if network deactivates
eaeb157 when exiting listening mode, only attempt to connect if WiFi was previously active.
7611434 easier button hooks and button events. Pushing the setup button when in setup for (>3 and <8s) exist setup mode.
319b1de Wire.reset() to reset the I2C bus - addresses #598
9392f93 Wire.end() fixes
70ea166 updated wiced DNS resolver in softAP mode with and
491b2be system-part2 makes use of wiring utilities, but we don't want to include the SPI and I2C globals since that brings in a lot of unnecessary code. Previously the symbols SPARK_WIRING_NO_I2C/SPI were used to exclude these globals, but since this applies to a shared library, the build would then break when compiling other modules (e.g. the application) that requires I2C or SPI (Typically undefined reference to Wire.)  The fix is to separate out the globals into a new module so that only the modules that need the wiring globals get them by depending on the new wiring_globals project.
83bffcb polarity of queue take/put was inverted, causing a hard-fault.
88ac7f3 Merge branch 'develop'  (0.4.5 release) into feature/non-blocking
a422698 Serial.printf/printfln
bba379f Merge branch 'release/v0.4.5' into develop
72b855b fix a typo in system_mode() due to similarly named variables. This was causing the default mode to remain as DEFAULT rather than automatic. This bug has existed in all versions of 0.4.x - surprising no-one has noticed until now!
18d873f SPI.transfer() not linked. Checking gihub history, this was never added.
d763c50 primitive release scripts
15c6b60 Merge branch 'release/v0.4.5' into develop
0176385 disable LTO for the core since it introduces instability in the cloud (but not locally)
e729350 setting the unix time calls mallic, which is not allowed in this early startup phase.  fixes #601
5f8c1fa fixes solid green LED when wifi connection goes down in automatic mode, and ensures network watchdog is set before attempting to connect (On the photon connection is synchronous, so the watchdog is cleared via a callback. If it's intiialized at the end then the net watchdog is re-armed incorrectly.)
c1f649a move the network watchdog to network_connect so failed wifi connections are retried after 30s always, even in semi automatic mode when the application calls WiFi.connect()
3b7a0de ensure like signed/�unsigned comparison. 4.9.3 compiler versions generate an error here. (but not mine, 4.8.4)
809e4b2 Switch to latest branch before attempting to build
82df5a6 changelog
6ade6b4 reinstate CFOD handling for Photon. Tested on Core and Photon.
85ed93e fix for signed/unsigned arithmetic in handling the microseconds part of the delay, which caused some very large delays to be incorrectly computed.
dee1f9d fixes issue (private repo) 99 - Core restarts when wifi drops. This was due to attempting to close the cloud socket on notification from the CC3000 of the wifi disconnect, causing a deadlock.
750a024 Don't issue QoS commands if not a 3G module
31e3e46 Merge branch 'release/v0.4.5-rc.2' into develop
dfa5642 Merge pull request #591 from spark/feature/hidden-ssid
8a8dedd bumped version prior to release
f105795 updated bootloader to include the DFU mode fix. And removed the features flags since this could disable DFU.
4ff04ac move appending the separator to TARGET_PATH until after has been evaluated, since it may update TARGET_PATH. This fixes an issue where TARGET_PATH=abcd would lead to an output file abcdabcd.bin. rather than abcd/abcd.bin.
d3cee2c remove the bogus error message from dfu-util in leave mode. fixes #599
815e221 Set wakeup pin mode when entering standby. Fixes #595
817c052 check platform is modular in all modular scripts
b3063c2 setup wifi notification handler in initial activate.
19bd586 iccid was truncated based on imei size
4266f04 simplify tinker_electron app
1fd6a35 start of debugging output from cellular_hal (wip)
451f52f grammy grams
e332dc6 added constructor for WiFiAccessPoint so that application code doesn't have to remember to initialize and set the size member.
c39a1f9 setCredentials accepts Cipher without needing to specify ssid length and password length.
58d51ff renamed system events to use fewer bits in the encoding, and instead focus on categories of events rather than individual events.
a63470e updates to CellularClass for wiring API (wip)
42424d1 more updates to socket_test app, added tinker for electron with USB serial debugging turned on by default
d2bf94a use stored credentials when connecting
f65627e added CellularCredentials struct with set/get functions
4c26adc added inet_gethostbyname implementation, rename inet_hal_new.cpp to inet_hal.cpp after template enforcement and inet_hal.c is removed
70c9aa6 updated debugging info in system_cloud_internal.cpp
0883877 fixed return values, timeouts and max sockets in socket_hal
6ca5521 increased rx/tx buffer size, improved registerNet() network resolution, debugging output working now for socket functions
bc795d1 adding dct changes from photon, padded out wifi section for alignment
bedb824 Prefixed SPI clock constants with `SPI_CLK_` to create more distinctive names than simply `ARDUINO`
18b92ee test cases for WiFi.scan() API.  Added more overloads for flexible calling.
5a40c2b added Servo.setTime() implementation and API test
b92fa56 improvements to static IP api.
290972d updating socket test app
9d3f9bf updating electron serial info
c518d46 fix for copying key value - misplaced subtraction, cleanup
8ded4cb updating socket test app
22bc4d3 added back auto key generation, r/w keys
66e0534 fixed ordering issue with elements, non static functions.
680e85a added attached, activated. CellularNetworkInterface wired up and hardcoded to ATT APN for testing.
cb13043 fix for copying key value - misplaced subtraction
9534544 system describe includes imei/iccid on photon and electron. on electron it's real, on photon it's fake data.
20aeb72 improved network registration ability
be6a02f reworking promises/futures to use our own classes which are much simpler than the STL versions (we don't need exceptions.)
883d52f APN now defaults to our custom
5a246f8 sweet new debugging options
94baa37 bumped versions
ca3dfd6 Update
7a19db7 non-verbose output in make to reduce size of logs.
9b4759c always run the background loop when not in automatic mode. This means the application code is not blocked when attempting to connect to the cloud fails in MANUAL AND SEMI-AUTOMATIC modes.  #366, #367
73a8161 reworked time formatting so that Time.format() uses `strftime` and replaces `%z` with our own handling of the timezone. This ensures that Core users don't pay for the flash cost of strftime if they're not using it. #455
3e272cf refactor WiFi/Cellular classes
73278b7 refactor system networking into class hierarchy in preparation for Cellular network.
e7075fe factored out network behavior  from the C dynalib API into a class hierarchy to allow polymorphic implementation for different network types.
dd88680 added missing license declaration
74fa682 removed wlan_setup() from system task (which should be network agnostic)
6c2201d refactor cellular_hal, MDMParser and wiring CellularClass on/off/connect/disconnect
299b70f added new FeaturesEnabled_SysFlag flag to DCT asserts
35e47c8 beginnings of Cellular network in wiring and HAL cellular API.
73df5a4 retrieve device identifiers from HAL and send after each handshake. addresses FIRM-199
811a9c4 retrieve IMEI/ICCID in setup mode
6e0a914 electron socket hal implementation (first cut)
1326647 Merge pull request #593 from spark/feature/electron-parser
346ff7c bumped bootloader version and included in HAL for photon/P1
b3e3646 added APP=socket_test test app
14ad9f7 windows to unix line endings, no code changes
3cc305b windows to unix line endings, no code changes
20c3fa6 bootloader does not display factory reset modes  if there is no factory reset image available. Additional system flags to allow the application to control bootloader modes.
ab3b90b added MDMParser::pdp() method to setup PDP context
d97da50 increase USART baudrate to 115200 :fire:
52942ac fixed timeout macro sign, was immediately timing out
13d6052 USART3 Tx/Rx IRQ fixed
b576f4b add product macros to default tinker.
7b81cdc initialize USART3 with interrupts disabled, fixed purge routine.
d271523 rename SOCKET_ERROR, IPPROTO_TCP, IPPROTO_UDP due to clash with system macro
082e09d WiP on multithreading and reworking the active object queue to use a shared pointer to Message class for polymorphic behavior. Switching over to electron work.
f77b207 Merge branch 'develop' into feature/non-blocking
0f829ee reworked computing divisor from master clock, with unit tests.
15846b1 SPI clock speed fixes.
21ce198 typo in hal_spi dynalib. added new SPI APIs to compile test.
da997e1 fix duplicate MDMElectronSerial electronMDM;   (When it's defined in a header without 'extern' the instance is defined in each source module that includes the header.)
e660d4d remove putc/getc macros that interfere with the MDM code
f2d0354 electron parser wip
96631c0 notes on failing freeMemory test on the core.
94501f8 String(Printable) API compile test. removed debug info to Serial in Printable to string test.
272c8c9 remove formatting API on the Core since `strftime` takes 8+KBytes of flash even if the optional formatting isn't used.
338107e enable/disable context switching for timing-sensitive operations. This allows the `delay(1)` test to succeed on the Photon.
b21a96a waitFor/waitUntil swapped in meaning from original proposal.  excluded tests to make the Core fit.
68c5847 rework delay() to be more precise by using micros() to extend the delay to correspond with the fractional part of the millisecond elapsed from when the delay started().  Accurate on the Core.  Addresses #260.
1367919 `String(Printable)` constructor so printables can be easily converted to a string.  Fluent API on String so method calls can be chained.
2042446 Ensure that system falls back to default IP on CC3000 when DNS goes awry so that Cores continue to connect to the cloud to receive the deep update.
23032df `clear()` method on `IPAddress` class
7f5ce1b only post subsystem event for Core
470bfa9 prompt for cipher before prompting for password
5b7866a FIRM-155 prompt for the Security Cipher if it cannot be determined automatically. This makes it possible to connect to offline and hidden networks via Serial setup.
ddc3ab2 script to build the current zipfile
c44a537 Merge pull request #590 from kennethlimcp/patch-3
3fbeba6 returns typo
4583342 signed all inf files with provider set to "Particle"
2b1584b FIRM-200 delay() simply delays with multithreading.
d02f8d2 Added a map of system module version IDs to system firmware releses
dce6c93 unifying USB Device MFG strings to "Particle"
eab9b9e Merge pull request #570 from spark/feature/spi-clock
54f52aa fixed time formatting with fractional hour timezone. #455 Thanks @ScruffR
ac641a2 enable LTO by default to keep size down. Will test on staging.
256b687 removed code that may have got added during the electron merge.
9edb0b1 update core i2c_hal.c with reserved parameter on I2C functions
245cefa source the SPI reference from HAL, keyed by SPI peripheral
16235dc #454, `SPI.setClockSpeed`, `SPI.setClockDividerReference` for more portable SPI clock speeds.
7ca5c97 electron bootloader compiles. pull in the DCT implementation from electron HAL. (Cannot link the HAL due to duplicate USB descriptor in HAL and in bootloader.)
bef29c0 changelog for default SPI being 15MHz on the photon for SPI and SPI1.
4d1b097 Merge pull request #583 from spark/feature/SPI1_default_speed_changed
f82b5ec Merge pull request #588 from spark/develop-feature/electron-merge
ebf5fcb PLATFORM=electron compiles in `main`.  Added Wiring_Cellular for conditional Cellular functionality. CellularSetupConsole added.
e166e24 remove IRQ handlers defined in the common stm32f2 hal
9bbd15b remove some warnings in the API tests
fd39c52 Moved new I2C function signatures to end of dynalib and added compatibility shims for older firmware. added reserved parameter for future expansion on the I2C dynalib functions
81e124d WiP - application thread from main, as active object.  Hooked spark_function, spark_variable to work on the system thread (since these are one-off operations.)
6af583e platform headers (concurrent_hal_impl.h) required by system so removing the conditional.
1f5ac9f Merge branch 'feature/electron' into develop-feature/electron-merge
3798358 Merge branch 'feature/electron' of into feature/electron
a767a67 Fixed missing interrupt handler issues...
e0c6824 merged feature/electron into develop
033b664 common main() entrypoint for bootloader and system firmware
4ebd579 holy fatfinger batman
888fbab Fix tone_hal build issue for photon
358fc50 Merge pull request #584 from spark/feature/i2c_multiple_interface_support
cec9ade Updated template and core's i2c_hal (similar to photon's changes)
d2b2307 Removed old i2c3_hal.h includes. PMIC & FuelGuage PASS using Wire3
c3971a6 Updated FuelGauge class methods using Wire3(I2C3 peripheral) instance
1fb4962 Updated PMIC class methods using Wire3(I2C3 peripheral) instance
56bee2a Updated TwoWire class methods, new instances Wire1 and Wire3 added
7263b9e Conditional Wiring_WireN defines added to electron platform
1fcce6f HAL_I2C_Init API added to hal_dynalib_i2c.h
b243ca4 Important: I2C HAL re-engineered to support multiple interfaces
ae58e06 Delete redundant i2c3_hal files since i2c_hal would be extended (WIP)
3c86f80 additional files for threading
742b38c extended system-part2 SRAM by 2K. Need to find out what causes this large jump in static SRAM usage.
c20fce5 run setup/loop regardless of system state when system threading enabled.
ba19617 System threading conditionally compilable so is a no-op on non-threaded platforms.
1757888 system threading working.
13934a9 wip - synchronous calls / marshalling
8a657ef rewrite os_thread_xxx() functions to use FreeRTOS directly so they are compatible with the Electron too.  Replaced cpp:channel with a RTOS queue just to investigate if that was the cause of the SOS. Current state: Device completes handshake then SOS's.
637379b imported cpp::channel (Go Channels) as the backbone for the ActiveObject implementation. Implemented required APIs from gthread to support STL concurrency primitives required by cpp:channel.
afa7db5 separated spark_cloud into spark_cloud_internal so we can clearly see what is user facing and what is not.
3f4520b SYSTEM_THREAD macro, implementation and tests
5e99386 dynalib modules can be implemented in C++
3ac6fb1 SYSTEM_THREAD macro
0e23434 Generate I2C STOP after slave addr NACK, I2C SW reset all timeouts
7dbfc6e Wire.endTransmission() returns unique values
ff76ffd Core i2c_hal correction : address << 1 required since it's removed from STM32F1 driver
d10cdf9 I2C hal fix for Core (Similar to that was done for Photon)
b9db392 Important: Improved I2C Master Byte Receive API method
d7ff6a6 Added I2C error management code to monitor and clear error events
e2adef6 Improved I2C hal code for STM32F2 series
95998a1 Added I2C_BUFFER_LENGTH in i2c_hal.h for partial arduino compatibility. Fixes #475.
f381b65 Factor cloud implementation into API functions and internal functions.
45e1383 module_system_part2.c -> cpp so that we can include headers with namespaces in.
203a7cb All SPI interface speed defaults to 15Mbit/s
2f062f4 changelog
ac88ec1 simple account for network latency when computing time. addresses #581
0986ce0 Added clock configuration tool's application note
d923512 Merge branch 'develop' of into develop
a3c15be Added Clock configuration tool for STM32F2xx microcontrollers
0f61f66 reworked static IP API - useStaticIP/useDynamicIP
82a81b4 update changelog
819cbc2 Merge pull request #568 from spark/feature/wifi-scan
1af94a4 WiFiAccessPoint::ssid_size -> ssidLength, and max_data_rate -> maxDataRate.
347ab9e erase result output struct so that unassigned data is 0.  (wifi scan channel is not reported by the cc3000 so this is unassigned.)
64ad8cf WiFI.scan for the Core
5bff614 #567 - WiFi.scan function
b0b0c56 Merge pull request #571 from spark/feature/tcp_peer
171182d TCPClient.rmoteIP update changellog
e911fe0 #551 TCPClient.remoteIP() to retrieve the IP address of the peer. (Typically the client that connected to a server socket.)
8009968 fix debug log referencing size rather than buffer_size
eb42fdf Merge pull request #578 from spark/feature/wait_for
6b83757 Merge pull request #572 from spark/feature/time_format
e2e5a8d Merge pull request #575 from spark/feature/servo_trim
9566269 tweaked API names as agreed with the team
926b29c Merge pull request #556 from spark/feature/fast-pin-using-bit-band
97f6009 Updated Core's interrupts_hal using the newly added gpio_pin_source
1ec21c8 HAL_RTC_Configuration() conditional code correction
b4817c1 Updated HAL_RTC_Configuration() - Fixes #480, #580
7e37113 start to factor out OTA module handling from photon to shared stm32 folder so it can be used on the Core.
00c129a optional flag to not set the LED in network_on. On the core, the LED briefly goes blue while connecting to wifi.
9f8cfd9 platform header included just to be sure
11473a0 fix for FIRM-194 - P1 USB descriptor updated, and changed company from Spark Devices to Particle IO to match the descriptor in the Windows driver.
50684c9 Signed USB driver for the P1
460e605 make travis-ci build matrix output more verbose to assist in diagnosing severity of build failure
ec997f8 Merge branch 'feature/build-matrix-bugfix' into develop
235bf4d Disabling USE_BIT_BAND : Bitbanding is much slower! as per @pkourany
75f73c2 removed deprecation warning on Spark. This was mistakenly introduced in 0.4.4. Will be removed for 0.4.5 (when many Core users will upgrade) and re-instroduced in 0.4.6 when we will publicly deprecate Spark APIs in firmware, and remove the deprecated APIs in 0.5.0
4c98931 fix regression in bootloader.
9ea71cb Merge pull request #543 from munirent/feature/wiced_last_error
bb4021b Add a method to retrieve the last error on a socket
98b851a remove warnings in api tests. missing header. (Is being included indirectly, but make it explicit.)
2553b34 waitFor proposed implementation. #415
d2bdad1 Regression test and fix for #577 - timeStr() not concatenatable.
f6deabd #455 - configurable format to Time.timeStr(), and a generic time formatter `Time.format(time_t, format_spec)` based on `strftime()`.  Complete with API and unit tests.
7c3d9cc fix for broken Build on the core - socket_join_multicast/socket_leave_multicast didn't declare parameters. This caused gcc to fail.
c63329b fix and tests for #576 - sprintf floating point support was not compiled in due to a logic inversion in the makefile.
91faefc basic release build script.
c071773 missing file - should have been in previous commit.
145a487 map network interface to WICED WLAN interface constants in sockets layer.
2889d30 remove unfinished merge delimiters from recent PR
71bfef4 Merge pull request #573 from stevie67/develop
1e260f7 fix for #249 - add Particle.h header.
66362cb fix for #120 - provide a setTrim() method that users can minutely adjust the servo timing. Untested.
0f49b51 allow cipher to be passed to WiFi.setCredentials, which is needed in the Photon to fully specify the credentials, and not require scanning the AP. #574
0929892 Fixed merge conflict.
451da05 Merge remote-tracking branch 'spark/develop' into develop
d182e33 this was not working as a result of flags. Before sleep, network_off() is called, which doesn't set the deliberate disconnect flag. In taking down wifi, HAL_WLAN_notify_disconnected is called, which then sets up a network watchdog for 2 seconds. When the 5 second timeout causes wifi to wake up, the watchdog has tripped, and this causes the exceptional path through manage_network() (same as when wifi is reset.)  The combination of flags meant manage_network() did nothing and never restarted wifi on the background loop.
d46c972 Update changelog. Remove warnings in api tests.
0df1758 Ensure LED Signaling (Application Control) is turned off when the system needs to control the LED. Fixes #362, #472, and #544
c5d13b5 add BusFault and MemManage panics to the photon
a2f651f factored WiFiCredentialsReader into a generic base class and a WiFi-specific subclass.
0315184 rename WiFiCredentialsReader class to SystemSetupConsole
9e268ef rename wifi_credentials_reader to system_setup
0952c42 Merge pull request #451 from spark/feature/static_ip
c301783 Merge pull request #452 from spark/feature/udp-dynamic-buffer
ea3fa03 static IP support
6f87408 remove deprecation warnings, and fix use of VERSION_STRING define which must now be stringified before use since it's passed from make.
75b764d UDP.setBuffer() for explicit buffer management. This seems more managable than overloading begin() with that.
41cca9d implementation of dynamically allocated UDP buffers
8e8f95b Add directions on where to find help building the develop branch.
ab94de5 bump version string (but not version ID so we don't block automatic updates of the final release of 0.4.5)
fdc6979 Added unit test, pass if to wiced calls, extended return value doc
4a7eb05 missing ` (sigh)
5c78cfe github markdown fix - anchors in lowercase. #564
a598c18 Recipes and Tips section in build docs
d7b4146 Merge remote-tracking branch 'spark/develop' into develop
63be76f Merge pull request #534 from munirent/feature/event-handlers-in-objects
6492505 fix for #563 - the scaling operation was causing values greater than 4294.965149 to be incorrectly converted due to overflow. Using 64-bit precision fixes this.
75e42b2 clear the network config when the network is disconnected so that the background loop re-establishes the details on the next connection. Addresses #560.
8c2c417 fix for #588 - ensure the connect flag is cleared.
13469d8 signed electron USB driver
556ce50 Address review comments
c06836d CortexM3 Bit-Band access to perform fast GPIO atomic read-modify-write
5971bf8 Added gpio_pin_source to PIN_MAP in Core's pinmap_hal
7a2106c Change Spark in comment to Core
2b65627 Renamed join/leave multicast to camel caps
3cde3a2 Added joining and leaving multicast groups
b49030e set ANT_INTERNAL as the default, bump versions for release.
690322a return success from UDP.begin()
2978a3f fixes #552 - UDP.begin/write now return expected values.
f6550ca Merge pull request #549 from pkourany/patch-2
d144e7a Added link to debug build docs
e7aadf6 Update fast_pin.h
c747f9c store version string in one place (build/
ec28f84 bumped version
86f59bb ANT_AUTO is the default since it prevents photons with only an external antenna from connecting.
4ab10b7 fixing a typo -
f89e23b Add pinReadFast(_pin)
2c8b5d0 Merge pull request #548 from spark/feature/otastress
466962f brief docs on how to use
d41f66b removed default antenna selection
ddf9e20  the address of spark_receive_last_bytes_received is always > 0. The intent is to always read if the previous read was successful. Yet removing the & causes the cloud to never connect, being stuck in a slow flashing cyan forever.
28db6fc don't send chunk missed messages when not in fast OTA mode since these can lead to duplicate chunks, and a corrupted mage (since chunks are not indexed.)
258dc26 OTA stress test
9acd451 added socket locks
2c98d1c FIRM-184 - XHR headers on all HTTP responses during SoftAP.  Requires changes to WICED.
bf33533 updated test application with newer test functions
e1c98c4 regression: output filename when specifying APPDIR should match the last directory in APPDIR.
a8295a6 fix for missing slash separator when specifying TARGET_DIR
d09f8a2 rename bootloader main() to application_start() temporarily for electron
593dc21 Add new feature C++ handler #534 to changelog
54fcd90 Check handler_data in event_handler_exists
ec614e3 Add C++ handlers and handler_data to subscribe
f1d2773 Add tests for C++ handler Spark.function, Spark.subscribe, attachInterrupt
99349b8 changelog for #545
a3c4ed1 Fixes randomly inverted RX, TX PWM. Thanks @janne68!
6b0ffb1 remove rundunant socket count for http server and increase task stack size to avoid hard fault. HTTP SoftAP test passed.
c735044 revert to minimum version of 4.8.4 for arm gcc. The libraries have a different suffix (_s for 4.8.4, _nano for 4.9.3) so the suffix is conditional on the version.
5e3ebbf reverted fix for #542. The full fix requires more time than is available before making the release candidate.
9d922de github, you mad about tabs bro?
47ed5e7 fixed tabs, commented out debugging pauses
bc0f142 added more test commands to serial3 app
ed40ffc compiled wiced libraries with interruptable AP join.
8182282 added `PARTICLE` define to all builds as part of #421
6874c11 update changelog with recent fixes
073f331 updated electron test firmware and pmic library
de1ca0a attachInterrupt() fix for electron's C0 pin
94bcb08 P1 has normal RF switch logic
76be005 TEST=wiring/no_fixture fail fix (should pass now)
0ee169c fixes #542 - register a callback handler with WICED but also double check that the socket hasn't already been disposed of. There is a race condition inside WICED where the dispose callback is called after the socket has been deleted.
f6be5b2 wlan_connection_finalize() is now fully cancellable - either when joining the wifi network or retrieving a DHCP allocated IP address. This will make the setup button more responsive when connecting to WiFi.
b67fd7c WICED libs updated with cancellable network connect and `wiced_wlan_connectivity_initialized` function.
a8912ca if write returns an error code, stop writing. Return a positive (non-zero) result if data already succesfully writen, return the error code is no data was written.
3ab6ef7 close the TCP client socket using both available methods in WICED. Fixes #536.
46e6133 Stop existing TCPServer before trying to create a new one.
63943d7 Clean up any existing connection in TCPClient/TCPServer.  Prompted by issue #538
79e7438 Calling WiFi.connect() when the system was connected to the cloud caused a green LED.  Fix is to add additional checks that WiFi isn't already connected.
5e93e30 only delete sockets that were in the list. This ensures that when the system closes sockets (e.g. when WiFi is taken down) then a subsequent client calling socket_close() won't cause a double-delete.
c9c3436 re-instate socket dispose now that the double-free problem in wiced_delete_tcp_socket is worked around.
683d4ea `STARTUP()` macro as a convenient way to declare code that executes very early in the startup process.
8f417c6 fix for recursive definition of TARGET_PATH when specifying APPDIR
dfa55cc additional unit tests
f647661 allow the RGB.onChange handler to be removed.  Note that this presently causes a memory leak.
5c4912d fixup unit tests, removing compiler warnings and test errors.
0f742b8 `System.freeMemory()` API
73ddc6d `Spark.` --> `Particle.`
2fa9708 Merge pull request #539 from munirent/feature/wiced-tcp-connect-crash-fix
5417ffa Cleaning up the documentation :pencil2:
687f67b Add I2C…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.