Skip to content

Fix NXP LPCxxxx i2c_start() handling of repeated start #1776

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

Merged
merged 1 commit into from
Jun 3, 2016
Merged

Fix NXP LPCxxxx i2c_start() handling of repeated start #1776

merged 1 commit into from
Jun 3, 2016

Conversation

adamgreen
Copy link
Contributor

@adamgreen adamgreen commented May 25, 2016

In repeating start scenarios, there was a bug in the I2C driver for
various NXP LPCxxxx parts which could allow an extra I/O from the
previous operation to leak through. The scenario I encountered which
triggered this bug went like so:

  • The higher level application code would first do an I2C write that
    doesn't send a stop bit (use repeating start instead.)
  • The higher level application code would then issues an I2C read
    operation which begins with a call to i2c_start().
  • i2c_start() would clear the SI bit (interrupt flag) at the top of
    its implementation.
  • i2C_start() would then get interrupted right after clearing the SI
    bit.
    • While the CPU is off running the ISR code, the I2C peripheral
      repeats the last byte written to I2CDAT and then sets the SI bit to
      indicate that the write has completed.
    • The ISR returns to allow the i2c_start() to continue execution.
  • i2c_start() would then set the STA bit but it is too late.
  • i2c_start() waits for the SI bit to be set but it is already set
    because of the completed byte write and not because of the repeated
    start as expected.

For me this bug would cause strange interactions between my ISRs and
the code using I2C to read from the MPU-6050 IMU. I would be getting
valid orientation data and then all of a sudden I would start receiving
what looked like random values but I think it was just reading from the
incorrect offset in the device's FIFO.

It appears that atleast one other person has seen this before but it
was never root caused since it required specific timing to reproduce:
https://developer.mbed.org/forum/bugs-suggestions/topic/4254/

This bug can be found in most of the NXP I2C drivers and this commit
contains a fix for them all. I however only have the LPC1768 and
LPC11U24 for testing.

My fix does the following:

  • No longer clears the SI bit in the i2c_conclr() call near the
    beginning of the i2c_start() function. It was this clear that
    previously caused the problem as described above.
  • The second part of the fix was to instead clear the SI bit after
    the STA (start) bit has been set with the i2c_conset() call.
  • The clearing of the SI bit should be skipped if there isn't an
    active interrupt when first entering i2c_start(). If you clear
    the SI bit when there isn't an active interrupt then the code
    is likely to skip over the interrupt for the start bit which was
    just sent and then allow the I2C peripheral to start sending the
    slave address before it has even been loaded into the I2CDAT
    register.

My Repro Case
I wrote two samples to reproduce this bug and verify that it was fixed by this change. The master sample is expected to be connected to a device which is running the slave sample.

Master test code which is a modified version of what I found in https://github.com/mbedmicro/mbed/blob/master/libraries/tests/mbed/i2c_master/main.cpp I modified it to read registers using repeated starts like I was doing with the MPU-6050 sensor. I then schedule an ISR to trigger at a random time in the range of when I expect the repeated start to occur:

#include "mbed.h"
//#include "test_env.h"
void notify_completion(bool wasTestSuccessful) {
    printf("Test completed - %s\n", wasTestSuccessful ? "PASSED" : "FAILED");
}

#define ADDR (0x90)

#if defined(TARGET_KL25Z)
I2C i2c(PTE0, PTE1);
#elif defined(TARGET_nRF51822)
I2C i2c(p22,p20);
#elif defined(TARGET_FF_ARDUINO) || defined(TARGET_MAXWSNENV)
I2C i2c(I2C_SDA, I2C_SCL);
#elif defined(TARGET_EFM32LG_STK3600) || defined(TARGET_EFM32GG_STK3700) || defined(TARGET_EFM32WG_STK3800)
#define TEST_SDA_PIN PD6
#define TEST_SCL_PIN PD7
I2C i2c(TEST_SDA_PIN, TEST_SCL_PIN);
#elif defined(TARGET_EFM32ZG_STK3200)
#define TEST_SDA_PIN PE12
#define TEST_SCL_PIN PE13
I2C i2c(TEST_SDA_PIN, TEST_SCL_PIN);
#elif defined(TARGET_EFM32HG_STK3400)
#define TEST_SDA_PIN PD6
#define TEST_SCL_PIN PD7
I2C i2c(TEST_SDA_PIN, TEST_SCL_PIN);
#elif defined(TARGET_SAMR21G18A)
#define TEST_SDA_PIN PA16
#define TEST_SCL_PIN PA17
I2C i2c(TEST_SDA_PIN, TEST_SCL_PIN);
#elif defined(TARGET_SAMD21J18A)
#define TEST_SDA_PIN PA08
#define TEST_SCL_PIN PA09
I2C i2c(TEST_SDA_PIN, TEST_SCL_PIN);
#else
I2C i2c(p28, p27);
#endif

#define I2C_MICROSECONDS_PER_BIT (1000000 / 100000)

void isrHandler(void);

int main() {
    Timeout timeout;
    bool success = true;
    char counter = 0;
    char reg = 0xA5;
    char expectedCounter = 0x5A;
    char writeCommand[] = { reg, expectedCounter };
    char readCommand[] = { reg };

    // Initialize counter.
    i2c.write(ADDR, writeCommand, sizeof(writeCommand), false);

    for (int i = 0 ; i < 1000000 ; i++) {
        // Schedule a Timeout object to fire
        // ~(1 start bit + 8 address bits + 1 ack bit + 8 reg bits + 1 ack bit) = 2*8 + 3*1 = 16+3 = 19 I2C bit periods.
        // Attempting to fire an interrupt between ack of register byte and repeated start. This used to cause
        // problems since the I2C engine would send the register byte again rather than the repeated start due to a bug
        // in the I2C driver which would clear the SI (interrupt) bit too early in i2c_start().
        int triggerOffset = rand() % (8 * I2C_MICROSECONDS_PER_BIT);
        int triggerTime = (15 * I2C_MICROSECONDS_PER_BIT) + triggerOffset;
        timeout.attach_us(isrHandler, triggerTime);

        // Read out counter where a repeated start is used for the read after the write.
        i2c.write(ADDR, readCommand, sizeof(readCommand), true);
        i2c.read(ADDR, &counter, sizeof(counter));
        if (counter != expectedCounter) {
            success = false;
            break;
        }
        expectedCounter++;
    }

    notify_completion(success);
}

void isrHandler(void)
{
    // Waste 2 I2C bytes worth of time in this ISR handler.
    wait_us(16 * I2C_MICROSECONDS_PER_BIT);
}

Slave test code which is a modified version of what I found in https://github.com/mbedmicro/mbed/blob/master/libraries/tests/mbed/i2c_slave/main.cpp I modified it to support a register read/write protocol similar to MPU-6059 sensor. A write to the register sets an 8-bit counter and a read returns an auto-incremented version of the counter.

#include "mbed.h"

#define ADDR (0x90)

#if defined(TARGET_KL25Z)
I2CSlave slave(PTE0, PTE1);
#elif defined(TARGET_LPC4088)
I2CSlave slave(p9, p10);
#elif defined(TARGET_SAMR21G18A)
I2CSlave slave(PA16, PA17);
#elif defined(TARGET_SAMD21J18A)
I2CSlave slave(PA08, PA09);
#else
I2CSlave slave(p28, p27);
#endif

int main() {
    char command[2];
    char counter = 0;

    slave.address(ADDR);

    while (1) {
        // Read register address and its new value if a write register request.
        bool wasWriteRequest = false;
        int i2cState = slave.receive();
        switch (i2cState) {
        case I2CSlave::WriteAddressed:
            memset(command, 0xFF, sizeof(command));
            wasWriteRequest = !slave.read(command, sizeof(command));
            break;
        default:
            continue;
        }

        // Handle the register write now if both register address and register value were written at once.
        if (wasWriteRequest) {
            counter = command[1];
            continue;
        }

        // Now waiting for repeated start to begin register read.
        bool registerReadDone = false;
        while (!registerReadDone) {
            i2cState = slave.receive();
            switch (i2cState) {
            case I2CSlave::ReadAddressed:
                slave.write(&counter, sizeof(counter));
                counter++;
                registerReadDone = true;
                break;
            case I2CSlave::WriteAddressed:
                registerReadDone = true;
                break;
            case I2CSlave::WriteGeneral:
                registerReadDone = true;
                break;
            }
        }
    }
}

I couldn't get the slave code to work without a small modification to the i2c_slave_read() function as well. I am not that confident in this change so I just list the diff here for anyone trying to run this repro case.

diff --git a/external/mbed/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC176X/i2c_api.c b/external/mbed/libraries/mbed
index c7eea7c..68617d8 100644
--- a/external/mbed/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC176X/i2c_api.c
+++ b/external/mbed/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC176X/i2c_api.c
@@ -346,8 +346,8 @@ int i2c_slave_read(i2c_t *obj, char *data, int length) {
         status = i2c_status(obj);
         if((status == 0x80) || (status == 0x90)) {
             data[count] = I2C_DAT(obj) & 0xFF;
+            count++;
         }
-        count++;
     } while (((status == 0x80) || (status == 0x90) ||
             (status == 0x060) || (status == 0x70)) && (count < length));

In repeating start scenarios, there was a bug in the I2C driver for
various NXP LPCxxxx parts which could allow an extra I/O from the
previous operation to leak through. The scenario I encountered which
triggered this bug went like so:
* The higher level application code would first do an I2C write that
  doesn't send a stop bit (use repeating start instead.)
* The higher level application code would then issues an I2C read
  operation which begin with a call to i2c_start().
* i2c_start() would clear the SI bit (interrupt flag) at the top of
  its implementation.
* i2C_start() would then get interrupted right after clearing the SI
  bit.
  * While the CPU is off running the ISR code, the I2C peripheral
    repeats the last byte written to I2CDAT and then sets the SI bit to
    indicate that the write has completed.
  * The ISR returns to allow the i2c_start() to continue execution.
* i2c_start() would then set the STA bit but it is too late.
* i2c_start() waits for the SI bit to be set but it is already set
  because of the completed byte write and not because of the repeated
  start as expected.

For me this bug would cause strange interactions between my ISRs and
the code using I2C to read from the MPU-6050 IMU. I would be getting
valid orientation data and then all of a sudden I would start receiving
what looked like random values but I think it was just reading from the
incorrect offset in the device's FIFO.

It appears that atleast one other person has seen this before but it
was never root caused since it required specific timing to reproduce:
  https://developer.mbed.org/forum/bugs-suggestions/topic/4254/

This bug can be found in most of the NXP I2C drivers and this commit
contains a fix for them all. I however only have the LPC1768 and
LPC11U24 for testing.

My fix does the following:
* No longer clears the SI bit in the i2c_conclr() call near the
  beginning of the i2c_start() function. It was this clear that
  previously caused the problem as described above.
* The second part of the fix was to instead clear the SI bit after
  the STA (start) bit has been set with the i2c_conset() call.
* The clearing of the SI bit should be skipped if there isn't an
  active interrupt when first entering i2c_start(). If you clear
  the SI bit when there isn't an active interrupt then the code
  is likely to skip over the interrupt for the start bit which was
  just sent and then allow the I2C peripheral to start sending the
  slave address before it has even been loaded into the I2CDAT
  register.
@0xc0170
Copy link
Contributor

0xc0170 commented May 25, 2016

cc @toyowata @neilt6 (you guys did some i2c for NXP), please have a look

@neilt6
Copy link
Contributor

neilt6 commented May 25, 2016

@0xc0170 I don't recall contributing to the NXP I2C implementations so I can't help you there, but I believe I've encountered the bug @adamgreen is referring to.

@toyowata
Copy link
Contributor

@0xc0170 I will have a look.

@toyowata
Copy link
Contributor

toyowata commented May 27, 2016

I only tested this with LPC1768 target and the following test cases are failed.

  • Test case failed:

[ 19] MBED_A19: I2C EEPROM read/write test

{{timeout;15}}
{{host_test_name;default_auto}}
{{description;I2C EEPROM read write test}}
{{test_id;MBED_A19}}
{{start}}
I2C: I2C Frequency: 400000 Hz
I2C: Write 0x66 at address 0x0000 test ...
I2C: Read data from address 0x0000 test ...
Test 0 failed at read, i2c_stat is 0x01
Test 1 failed at read, i2c_stat is 0x01
Test 2 failed at read, i2c_stat is 0x01
Test 3 failed at read, i2c_stat is 0x01
Test 4 failed at read, i2c_stat is 0x01
Test 5 failed at read, i2c_stat is 0x01
Test 6 failed at read, i2c_stat is 0x01
Test 7 failed at read, i2c_stat is 0x01
(snip)

[ 25] MBED_A25: I2C EEPROM line read/write test

{timeout;15}}
{{host_test_name;default_auto}}
{{description;I2C EEPROM line read write test}}
{{test_id;MBED_A25}}
{{start}}
I2C: I2C Frequency: 400000 Hz
I2C: Lines pattern write test ... [OK]
I2C: Write errors: 0 ... [OK]
I2C: Lines pattern read test ... [FAIL]
I2C: Read errors: 1000/1000 ... [FAIL]
EEPROM: Pattern match errors: 1000/1000 ... [FAIL]
{{failure}}
{{end}}
  • Test case not failed, but I didn't get expected value (x, y, z axis data tied to zero)

[ 13] MBED_A13: I2C MMA7660 accelerometer

{{timeout;15}}
{{host_test_name;default_auto}}
{{description;I2C MMA7660 accelerometer}}
{{test_id;MBED_A13}}
{{start}}
x: 0.000000, y: 0.000000, z: 0.000000
x: 0.000000, y: 0.000000, z: 0.000000
x: 0.000000, y: 0.000000, z: 0.000000
x: 0.000000, y: 0.000000, z: 0.000000
x: 0.000000, y: 0.000000, z: 0.000000
{{success}}
{{end}}

Does this PR require to change whole existing application/test code?

@adamgreen
Copy link
Contributor Author

Thanks for looking at it. It should have required no changes to existing code.

It looks like the repeated start is failing for those test cases...the thing I was actually trying to fix by removing a timing hole that would sometimes cause it to fail. It must be a bug introduced by my change since the only thing I could think of that would cause that problem if not my code is that the wrong I2C device was connected to the p28/p27 pins. If there were missing pull-ups or no I2C device there at all, different errors would be generated.

I guess I will have to order an I2C EEPROM to repro locally so that I can see what is going on under the debugger. It's strange that I would have broken repeated start for the EEPROM and accelerometer as I did test the change with the MPU-6050 IMU and it worked on that device.

@toyowata
Copy link
Contributor

@adamgreen

I didn't fully apply your patch in my test last time. I picked some of them, but not all. Sorry my bad.
I am going to test again next week.

@adamgreen
Copy link
Contributor Author

@toyowata As long as you pulled the whole change for hal/targets/hal/TARGET_NXP/TARGET_LPC176X/i2c_api.c from this PR then that should have been enough to test on the LPC1768. Just pulling part of the changes to that file would likely cause problems.

I have ordered the EEPROM so that I can reproduce the problem here locally. I suspect it will arrive by the end of the week.

@toyowata
Copy link
Contributor

@adamgreen

Last time, I only picked a part of code by manually and it was a problem. Sorry my bad.
I applied whole patch of this PR into my local repo and tested again.

  • LPC1768
{{timeout;15}}
{{host_test_name;default_auto}}
{{description;I2C MMA7660 accelerometer}}
{{test_id;MBED_A13}}
{{start}}
x: 0.046882, y: 0.000000, z: 1.031411
x: 0.093765, y: 0.000000, z: 0.937647
x: 0.093765, y: 0.046882, z: 0.984529
x: 0.046882, y: 0.000000, z: 0.984529
x: 0.046882, y: 0.046882, z: 0.984529
{{success}}
{{end}}

{{timeout;15}}
{{host_test_name;default_auto}}
{{description;I2C EEPROM read write test}}
{{test_id;MBED_A19}}
{{start}}
I2C: I2C Frequency: 400000 Hz
I2C: Write 0x66 at address 0x0000 test ...
I2C: Read data from address 0x0000 test ...
EEPROM: Test result ... [OK]
{{success}}
{{end}}

{{timeout;15}}
{{host_test_name;default_auto}}
{{description;I2C EEPROM line read write test}}
{{test_id;MBED_A25}}
{{start}}
I2C: I2C Frequency: 400000 Hz
I2C: Lines pattern write test ... [OK]
I2C: Write errors: 0 ... [OK]
I2C: Lines pattern read test ... [OK]
I2C: Read errors: 0/1000 ... [OK]
EEPROM: Pattern match errors: 0/1000 ... [OK]
{{success}}
{{end}}
  • LPC11U68
{{timeout;15}}
{{host_test_name;default_auto}}
{{description;I2C MMA7660 accelerometer}}
{{test_id;MBED_A13}}
{{start}}
x: 0.046882, y: -0.703235, z: 0.750117
x: 0.093765, y: -0.703235, z: 0.797000
x: 0.046882, y: -0.656353, z: 0.843882
x: 0.046882, y: -0.703235, z: 0.750117
x: 0.000000, y: -0.703235, z: 0.797000
{{success}}
{{end}}

{{timeout;15}}
{{host_test_name;default_auto}}
{{description;I2C EEPROM read write test}}
{{test_id;MBED_A19}}
{{start}}
I2C: I2C Frequency: 400000 Hz
I2C: Write 0x66 at address 0x0000 test ...
I2C: Read data from address 0x0000 test ...
EEPROM: Test result ... [OK]
{{success}}
{{end}}

{{timeout;15}}
{{host_test_name;default_auto}}
{{description;I2C EEPROM line read write test}}
{{test_id;MBED_A25}}
{{start}}
I2C: I2C Frequency: 400000 Hz
I2C: Lines pattern write test ... [OK]
I2C: Write errors: 0 ... [OK]
I2C: Lines pattern read test ... [OK]
I2C: Read errors: 0/1000 ... [OK]
EEPROM: Pattern match errors: 0/1000 ... [OK]
{{success}}
{{end}}
  • LPC1114FN28
{{timeout;15}}
{{host_test_name;default_auto}}
{{description;I2C MMA7660 accelerometer}}
{{test_id;MBED_A13}}
{{start}}
x: 0.046882, y: 0.000000, z: 0.984529
x: -0.187529, y: -0.093765, z: 1.031411
x: -0.234412, y: 0.000000, z: 0.984529
x: -0.281294, y: 0.046882, z: 0.937647
x: -0.375059, y: -0.046882, z: 0.937647
{{success}}
{{end}}

{{timeout;15}}
{{host_test_name;default_auto}}
{{description;I2C EEPROM read write test}}
{{test_id;MBED_A19}}
{{start}}
I2C: I2C Frequency: 400000 Hz
I2C: Write 0x66 at address 0x0000 test ...
I2C: Read data from address 0x0000 test ...
EEPROM: Test result ... [OK]
{{success}}
{{end}}

{{timeout;15}}
{{host_test_name;default_auto}}
{{description;I2C EEPROM line read write test}}
{{test_id;MBED_A25}}
{{start}}
I2C: I2C Frequency: 400000 Hz
I2C: Lines pattern write test ... [OK]
I2C: Write errors: 0 ... [OK]
I2C: Lines pattern read test ... [OK]
I2C: Read errors: 0/1000 ... [OK]
EEPROM: Pattern match errors: 0/1000 ... [OK]
{{success}}
{{end}}

I could not find any problem of this PR.

BTW, there are some missing targets such as LPC812, LPC824 and LPC1549. Didn't find any issue on these platforms?

@adamgreen
Copy link
Contributor Author

@toyowata Thanks for rerunning the tests. I appreciate it.

BTW, there are some missing targets such as LPC812, LPC824 and LPC1549. Didn't find any issue on these platforms?

I haven't read the user manuals for those parts but from what I see in the code, their I2C peripherals are different and their drivers don't share code or this particular bug.

@toyowata
Copy link
Contributor

@adamgreen

I haven't read the user manuals for those parts but from what I see in the code, their I2C peripherals are different and their drivers don't share code or this particular bug.

OK. Thank you very much for your answer.

@0xc0170 0xc0170 merged commit ff7d7aa into ARMmbed:master Jun 3, 2016
@adamgreen adamgreen deleted the i2cRepeatedStartFix branch June 3, 2016 07:52
@adamgreen
Copy link
Contributor Author

@toyowata Thanks for testing.
@0xc0170 Thanks for merging.

deepakvenugopal added a commit to deepakvenugopal/mbed-os that referenced this pull request Aug 9, 2018
…..4a188ea

4a188ea Merge branch 'release_internal' into release_external
27ba18e removed ws resources from nanostack.
b693eae Merge pull request ARMmbed#1778 from ARMmbed/ws_bbr_update
543dd1e Renamed symbol to micro seconds.
ab5d98a Added ND proxy support to ws border router
f7c71c0 Remove new unittests from release external.
ac55c15 Merge branch 'release_internal' into release_external
f9b9e47 Fix GCC_ARM/ARM compiler warnings (ARMmbed#1777)
40efd39 Coverity tool reported error fix (ARMmbed#1776)
b063457 Merge pull request ARMmbed#1775 from ARMmbed/mac_header_trace_fix
b1fd538 Removed Debug trace support from common mac header class
90a36a6 coverity reported error fixes. (ARMmbed#1770)
9644114 Merge pull request ARMmbed#1774 from ARMmbed/debug_trace_fix
1e490f0 Removed debug trace which could be called at interrupt routine
1373a5f Clarify parameter name in phy_csma_params_t (ARMmbed#1773)
4a32a6c fixes for coverity tool reported issues. (ARMmbed#1772)
545d262 Update copyright year (ARMmbed#1771)
5ae07da address error handling fix. (ARMmbed#1769)
13c1ceb Clean multicast address when interface is shutdown
88bb7cc correct interface passed to address compare. (ARMmbed#1768)
53949a4 Thread device registers new address upon receipt of error notification. (ARMmbed#1767)
1653b06 replace ETX calculation for Wi-SUN
745c1dd refactor RPL dis sending
6e1cc58 Merge pull request ARMmbed#1764 from ARMmbed/mle_purge_fix
0b920d8 Fixed broken neighbor purge from list
a6f3a0d Thread network data handling refactored (ARMmbed#1762)
87cc2c9 Merge pull request ARMmbed#1763 from ARMmbed/mle_fixs
944f9ca Fix broken MLE neigbor list write operation.
833e740 updated address error payload (ARMmbed#1761)
2565170 Add CBOR parsing to simpleenrolment message
e38c70f fix duplicate address detection (ARMmbed#1760)
7648c1c Scope updated to three and prefix added to destination address. (ARMmbed#1758)
5612e08 DUA.ntf updates (ARMmbed#1752)
708bb3b pbbr stop removed to fix failing tests. (ARMmbed#1757)
1444c2f Add POC code for storing multicast address
684efef Fix MLR message handling
b691b78 context id update (ARMmbed#1753)
5635089 fix key sequence issues when keys are rotated
74db027 fix for sleepy node poll. (ARMmbed#1750)
49adf2e Link entry for neighbour (ARMmbed#1749)
5bad8ee Correct MAC neighbour table sizes for Thread (ARMmbed#1748)
3858eb0 valgrind reported error: fixed uninitialised variables. (ARMmbed#1747)
24ef520 Update licenses in new WS files (ARMmbed#1745)
77dccdf valgrind tool reported error fix: (ARMmbed#1746)
9ac47a8 Adjust WS build configurations (ARMmbed#1744)
c593e2b DUA.ntf to MTD child implemented (ARMmbed#1735)
3f5c6c1 Update missing SPDX identifiers to test files (ARMmbed#1743)
130fec4 Fix GCC_ARM linker error with some Thread builds (ARMmbed#1742)
65574a4 Merge pull request ARMmbed#1741 from ARMmbed/merge_koli_to_master
2dc41c0 Merge remote-tracking branch 'origin/koli'
2fc10b5 Put smarter dag max rank increment 2048. 0 affect a lot of troubles.
d311040 RPL print update, nud and aneighbour update
f9b23d4 Fix compiler warnings (ARMmbed#1740)
5a1f295 Merge pull request ARMmbed#1738 from ARMmbed/master_merge_to_koli
abee481 Fix merge compile problems
2c77c37 Merge branch 'master' into koli
32fe4b8 Increase too small maximum root path length (ARMmbed#1737)
03bc696 Fix LLC unit test's
3702f57 LLC data indication and fhss channel set update
45905fa Update DHCP service memory allocation (ARMmbed#1734)
9c9b9e3 Fix crash which will happen if address registration fail and operation is triggered again by NULL pointer.
cb83216 Enabled proper wi-sun security level 6.
7990fa9 Fix data for 6lowpan when mle is disabled.
501a612 Wi-sun trigle timer update:
47619c4 Function name code conventions fix.
1350bc5 mac_neighbor_info() macro defned for simplify code
41b84e4 Added check when weighting rule update must do network scan.
0215058 Fix ns_dyn_mem_init stub
33398ef Added Neighbor connected and trusted state update for wisun
24aa802 Integrate Mac neighbour table to Thread and 6Lowpan code
37c6342 Mac neighbour table update
7bb978e Thread Neighbor class update
26dd252 Removed almost duplicate mle entry discover for ll64
7a0aaa5 Rename some parameters which will help integration to new neighbor table.
3f905a1 Update nsdynmemLIB unit test stub (ARMmbed#1730)
2bd3e91 Return 0 instead of -1 on null pointer (ARMmbed#1728)
fde5104 Function parameter and name refactor.
e0f7dcf Updates to thread extension bootstrap (ARMmbed#1714)
13b3b05 Thread Neighbor and MLE API update
49ccb9d Removed threadNeighbour flag from mle_table_entry_t.
e142eec Removed unused holdTime parameter from mle_table_entry.
c8a99cb MLE service Update and integrate new features
726b08b Adjust NULL string tracing (ARMmbed#1726)
66636b8 Merge pull request ARMmbed#1724 from ARMmbed/IOTTHD-2537
2710836 Enable security to wi-sun with test security key.
8994bb2 MAC Security update
c56886f MAC: Fixed frame length when calling FHSS TX conditions
4eb5567 CCM & AES update for support multiple user and context.
7544ef3 added response to confirmable unicast. (ARMmbed#1722)
a8a5a90 duplicate address detection fix (ARMmbed#1720)
721c0b0 MLE service releases CCM library in error case (ARMmbed#1719)
d0467a0 Fix stack overflow (ARMmbed#1718)
7ea9001 Added support for multiple registrations in one message
0a36af3 WS IE library update and LLC data confirmation update
4352709 MAC enhanced ACK RX and TX support
0b7f9fe Update Thread child id request timeout handling (ARMmbed#1715)
3e8df0a added neighbor advertisement sending after dad complete. (ARMmbed#1713)
a46a363 updated multicast address registration timer (ARMmbed#1711)
7c6c482 Added target EID tlv to Dua response
2d3aff9 Delete parent mle-entry in case of parent lost or updated (ARMmbed#1707)
b43db5f duplicate address handling (ARMmbed#1709)
cb54705 Address generation changed to slaac based generation (ARMmbed#1708)
ee0306b changed coap message type to non-confirmable. (ARMmbed#1706)
776e0e5 Merge pull request ARMmbed#1705 from ARMmbed/IOTTHD-2531
d92b2f9 Thread advertisement adjustment (ARMmbed#1703)
f8d3d67 WS: Learn parent unicast dwell time
bd88fa0 WS Lib: Fixed byte order of fixed channel
1f9162d Merge pull request ARMmbed#1704 from ARMmbed/IOTTHD-2484
2e15944 FHSS unit tests: Datarate storage removed
e64bd19 FHSS: Implemented checking TX time
0ba4b9a Merge pull request ARMmbed#1700 from ARMmbed/IOTTHD-2483
1adb52b coap message type decided based on destination (ARMmbed#1702)
d1cf42d multicast handling updated(ARMmbed#1701)
44110a1 Thread bootstrap improvements (ARMmbed#1699)
34c0df9 FHSS unit tests: fixed tests after TX slot update
ddd7e92 FHSS: Calculate number of TX slots using defined slot length
eaf35d2 Lowered Thread advertisement speedup threshold values (ARMmbed#1691)
b67f2d8 Reset children when no response from parent (ARMmbed#1698)
3569c8a Mleid bbr fix (ARMmbed#1697)
1fc81fc Thread device learns weighting from advertisement (ARMmbed#1696)
ba98835 Merge pull request ARMmbed#1689 from ARMmbed/IOTTHD-2475
28307de Randomize channel used in fixed channel
3412f4a WS bootstrap: Moved calculating and setting FHSS hop to own function
51a498b reset Dodag if global address is lost.
c0e8cae Merge branch 'koli' into IOTTHD-2475
0ec37a6 Count the amount of configuration solicits
c8f5c8d FHSS unit tests: Updated FHSS config tests.
490384f FHSS unit tests: Test TX/RX slots
4fdbc09 FHSS: Calculate hop count using RPL rank
8f194f8 FHSS: Implemented TX slot calculation
b06b58a FHSS: Implemented setting hop count API
d73d210 FHSS: Moved own hop to common FHSS structure
caafff0 FHSS: Check TX slot for unicast frames
7406149 Merge pull request ARMmbed#1684 from ARMmbed/IOTTHD-2476
cc5f6d8 FHSS: validate received synch info.
c48f0ef Merge pull request ARMmbed#1687 from ARMmbed/disable_channel_traces
d5d1a13 Fixed trickle configuration for Discovery
eef3bd7 FHSS: Disable FHSS channel debugs for WS
fc74a31 Fixed unit test for support extensions.
e803974 FHSS and Mac extension enable update.
4859f16 MAC RF extension enable
e73e9b2 Merge pull request ARMmbed#1682 from ARMmbed/IOTTHD-2460
03f7105 fixed EAPOL parent selection
cbdd2a9 Fixed set channel unit test
ce1ab34 FHSS: Do not change channel during asynch transmissions
c0456a3 Defined own structure to give CSMA backoff symbol time and cca mode.
dff1e7d Merge pull request ARMmbed#1677 from ARMmbed/merge_MtoK
34dcbb6 Merge pull request ARMmbed#1674 from ARMmbed/IOTTHD-2443
3f9b34d Merge branch 'master' into koli
f578c26 Updated border router configuration
1ce2385 RF PHY extension update
32db0cd FHSS: Learn FHSS configuration from parent PA config
5974344 Merge pull request ARMmbed#1670 from ARMmbed/IOTTHD-2449
82a8bca FHSS: support FHSS created by application
67f578a Calculated RSL from neighbours
4aa6890 Merge pull request ARMmbed#1664 from ARMmbed/IOTTHD-2442
65e2fad Fixed uninitialized parameter use at rpl instance allocate.
4767dd5 Merge pull request ARMmbed#1666 from ARMmbed/fhss_is_bc_flag_fix
6ffc81a FHSS unit tests: Fixed tests
14e1597 Fixed missing TX ime calculation for pre-builded MAC packet send.
03f447a FHSS: Do not use broadcast queue when fixed channel
40f3685 FHSS: do not push asynch messages in broadcast queue
45daec9 FHSS: FHSS is on BC channel by default
2dbc92c FHSS: Remove failed handle after successful transmission
a152f45 Merge branch 'koli' into IOTTHD-2442
ea583c6 FHSS: Fixed updating broadcast synch
c3aa7d1 Select correct parent based on network size and route cost
7bf3994 Fixed Code style warning.
2e1f32f Fixed WS_NESTED_IE information discover return length check.
445745a LLC Neighbor, Mac packet rebuild, mac timer update and phy Extension.
6cb78ff Distribute and learn network size
bc4f46f Merge pull request ARMmbed#1656 from ARMmbed/IOTTHD-2441
7f94971 FHSS: Added random timeout before polling TX queue after channel change
b6e40af Merge pull request ARMmbed#1653 from ARMmbed/IOTTHD-2366
b28fcaa FHSS unit tests: Test failed TX allocation
fbe7795 Modified neighbour processing
b2cff91 FHSS: Use channel retries with WS
9b11201 FHSS: Moved TX fail handler in FHSS common
9fff108 Merge pull request ARMmbed#1650 from ARMmbed/merge_MtoK2
04797c2 Detect border router connection lost
5227398 Merge branch 'master' into koli
c0e8673 Merge pull request ARMmbed#1647 from ARMmbed/IOTTHD-2405
b7428e0 Merge pull request ARMmbed#1646 from ARMmbed/IOTTHD-2404
04449e8 FHSS unit tests: Test tx conditions and tx done callbacks
baaec35 Merge pull request ARMmbed#1644 from ARMmbed/ws_start_bc
69c1483 FHSS: Added excluded channels in neighbor table
92acbd2 WS: fixed merge conflicts
4e01969 Merge branch 'koli' into ws_start_bc
97200b3 Added version number increase in border router
27c8b65 FHSS: unit test update
6eb1255 FHSS: WS bootstrap to start broadcast schedule
659a1c4 FHSS: Write BT-IE
64f31b1 Merge pull request ARMmbed#1635 from ARMmbed/IOTTHD-2217
7706f2e FHSS: Do not return to RX channel when configured fixed channel
908eb17 Change RPL dis destination address to RPL address
666dbbf FHSS: Start broadcast schedule only if device is border router
98f9991 FHSS: Set neighbor info get function
126275b Merge pull request ARMmbed#1632 from ARMmbed/IOTTHD-2402
7fa2c2b WS: Learn channel function from parent
3980870 WS: Enable FHSS in bootstrap
ff72d95 Merge pull request ARMmbed#1629 from ARMmbed/cppcheck_fixes
85f1345 MAC: Check length pointer in ie vector length validate
672c4ef FHSS: Removed unnecessary fhss_api NULL
e5637fd FHSS: Initialize next_channel in broadcast channel calculation
cab9849 Send address registration to all PC parents (ARMmbed#1618)
5417936 Merge pull request ARMmbed#1623 from ARMmbed/mergeMtoK3
ad41972 Wait RPL to be ready before bootstrap is ready
a314db0 Merge branch 'master' into koli
f6ac06f Fhss ut improvements (ARMmbed#1622)
60a3b0f Fixed ETX update at LLC layer.
bb152ce Merge pull request ARMmbed#1617 from ARMmbed/IOTTHD-2321
49c213a FHSS unit tests: Added more tx handle tests
d5cc85a FHSS unit tests: Test removing parent info and get neighbor info
2d01008 FHSS unit tests: test setting parent BC info
681dedd Merge pull request ARMmbed#1613 from ARMmbed/IOTTHD-2320
7e59035 Fix broken unit test build.
6be455f WS ETX update
0efc062 ETX service update
e5aba03 WS PAN advert validation update
802ce3e WS bootstrap update
be296cd WS IE lib update
cfa5fd9 FHSS: Store parent broadcast info pointer
d0171be FHSS: Implemented get neighbor info and set/remove parent info callbacks
686ad9c Fix acynch --> asynch
b4059b8 WS neighbor class integrated to use new FHSS structures
c1b0d96 Merge pull request ARMmbed#1610 from ARMmbed/IOTTHD-2313
3d98860 FHSS: Implemented WS timing/schedule info structure
f96db0c Merge pull request ARMmbed#1607 from ARMmbed/merge_MtoK
72bb71f Fixed missing params after merging master to koli
d119df9 Merge branch 'master' into koli
8166585 Merge pull request ARMmbed#1602 from ARMmbed/IOTTHD-2311
90fbb45 Fixed LLC data unit test and add new functions to test
94e516f Integrated new WS IE header and payload API's
c553e8c WS ie library read update
7db0938 fixed mac_mlme valgrind errors.
4e2a743 Fixed thread test some of.
2680dd6 Fixed unstable unit test verified by valgrind.
18eda56 Merge pull request ARMmbed#1605 from ARMmbed/fhss_ut_valgrind_fix
eb96eae FHSS unit tests: fixed uninitialized varnings
27b7864 Fixed mac helper stub issues.
a88590f FHSS unit tests: Test tr51cf with excluded channels
3c9356a FHSS unit tests: Updated channel function tests
3a562d3 FHSS: Added excluded channels in channel function interface
b9606c9 FHSS: Static channel functions added
695e64c Merge pull request ARMmbed#1601 from ARMmbed/IOTTHD-2214
f973986 FHSS unit tests: Implemented FHSS common unit tests
2188af4 FHSS unit tests: Removed FHSS common functions from FHSS
e6bac6a Rename and refactor structures and function names.
b037628 Fixed unit test and stubs
8153fe3 Fixed Asynch request missing msdu_handle set at LLC.
1af46d8 WS bootstrap update
c771df0 LLC update UTT / BT information to ws neighbor and refresh mac neighbor
a43f6ad Mac helper API update:
14792db Ws neighbor hoping storage init integrated to interface init.
ae7945d Wi-sun neighbor hopping infor storage API definition
8f5c0bf FHSS: Removed fhss_beacon, fhss_beacon_tasklet and fhss_mac_interface
1e94358 Fixed unitest build.
3b9a4b0 Base Integration for Mac neighbor table to WS
7729e20 Mac neighbor table integrate to interface structure
2c6f30a Addede NULL check some of mac neighbor table check.
ed45fda Mac neighbor table unit test's.
0f85841 Added mac_neighbor_table stub's
fc4c97b Generic mesh neighbor table class.
4b81978 Process advertisement solicit and process response (ARMmbed#1592)
73c6bc1 Merge pull request ARMmbed#1589 from ARMmbed/IOTTHD-2218
057b6ec Omit NA sending in ARO success cases. Use ACK instead. (ARMmbed#1587)
4686668 ws_management_api unit tests (ARMmbed#1591)
9ae6511 FHSS unit tests: Implemented FHSS WS tests
8147217 Added trickle for Advertisement and processing of response (ARMmbed#1586)
c52b039 Merge pull request ARMmbed#1584 from ARMmbed/IOTTHD-2055
ac58048 FHSS: WS FHSS to use pre-set TX time
feeee0f FHSS: Synch callback to write ufsi
3e8112b Merge pull request ARMmbed#1578 from ARMmbed/IOTTHD-2286
4cd6c49 Merge pull request ARMmbed#1579 from ARMmbed/fhss_bug_fix
296a2f1 FHSS: Fixed scramble table bug
80e4270 FHSS: Added vendor defined CF support
24f418c Merge pull request ARMmbed#1575 from ARMmbed/IOTTHD-2288
a849c8d FHSS unit tests: Update FHSS tests
83bd90e FHSS: fhss_struct defined static
04ae3c3 FHSS: separated is_bc_callback to FHSS and WS
59fe586 FHSS: removed allocation of scramble table
1ca1d0b FHSS: Continued fhss_structure cleaning
036e19c Api Updates to LLC, ws_ie_lib and ws_info
192007b Fixed MAC Asynch message send and header build bug.
e0494b7 WS address registration callback for SLAAC (ARMmbed#1568)
93b7e32 FHSS: superframe handlers separated
ff66ae9 FHSS: Separate FHSS and WS parameters - Configuration structs moved
6ace69b Merge pull request ARMmbed#1573 from ARMmbed/fhss_cleaning1
07d4089 FHSS: Cleaning. Static functions. Separated tx fail and retry callbacks
8b9d39b Merge pull request ARMmbed#1571 from ARMmbed/fhss_callback_update
316b007 FHSS: removed unnecessary state set handler
db1ded0 WS LLC data service enabled to WS bootstrap.
c326e4a Fixed MPX header size calculation to MPX data request.
fa2d7d0 Removed Adaptation interface depency from LLC away.
4356ae8 separated BBR to own file (ARMmbed#1567)
75d93f8 Merge pull request ARMmbed#1564 from ARMmbed/IOTTHD-2213
19c4be6 FHSS: Separated tx done cb for FHSS and WS
3e326d1 FHSS: separated synch info write for FHSS and WS
15d4465 Function and parameter rename.
5af7992 Unit test for llc data service.
ffb3639 Fixed stubs.
3f66f6a LLC delete added for test purpose
b48cda0 Impelement LLC reset
47458c8 WS IE Lib unit test and fixed mac ie lib stub
6b6e509 MPX header module unit test.
55309e8 ws_llc_asynch_request() API update
5d9a379 Wisun spesific IE elemts write operation library.
c718985 FHSS: Calculate destination slot and ufsi
b4e1616 Merge pull request ARMmbed#1561 from ARMmbed/IOTTHD-2172
096aeef ws create interface and start rpl for poc (ARMmbed#1562)
77c851a FHSS: Added BSI in ws configuration
7d4a2f8 FHSS: Start broadcast schedule when bc intervals are known
e55ec8a FHSS: Prevent changing unicast channel when broadcast is active
b60b113 FHSS: Broadcast handler implemented
9bf1d1f WS Bootstrap skeleton (ARMmbed#1559)
3fb6390 Merge pull request ARMmbed#1560 from ARMmbed/mergeMtoK2
b78a370 Merge branch 'master' into koli
8b43c6e Merge pull request ARMmbed#1555 from ARMmbed/IOTTHD-2215
78314e8 FHSS: WS FHSS enable implemented
d04b818 FHSS: Compensation callback to return timeout value
472becb FHSS: FHSS configuration to union
b5f9e01 FHSS unit tests: Fixed after FHSS enable/down updates
2cbe6dc FHSS: Moved FHSS reset and down to FHSS module
4719187 FHSS: Separated FHSS enable functions for FHSS and WS FHSS
f4548d8 FHSS: Implemented WS configuration structure
7ace04b Initial commit for ws_bootstrap (ARMmbed#1556)
9e46cf9 Added malformed message check to nested IE discovery.
7f4c184 Added support for write and discover Nested IE elements.
e3d8150 SW MAC Asynch data request support
9a98177 Merge pull request ARMmbed#1552 from ARMmbed/cf_update
30075dd FHSS: TR51 channel function updated (bug in the spec?)
6b04d5a Merge pull request ARMmbed#1548 from ARMmbed/IOTTHD-2093
4249fad Integrated ws llc and mpx features.
a49bf11 Fix Const pointer wrong use.
3e1972f WS LLC module implementation base
957f270 MPX frame support
93f0ed7 MAC ie library update:
b2198b3 MPX support Integrate
2531c49 WS LLC and MAC MPX API definition and IE types definition.
a5493d2 FHSS: Do not send TX failure if TX in progress in channel change
958991a FHSS: Few FHSS functions to static
7237796 Merge pull request ARMmbed#1545 from ARMmbed/IOTTHD-2097
f794990 FHSS: Implemented destination channel change in TX handle callback
d2957a1 FHSS: fhss tx conditions callbacks added
c1e7300 FHSS: hard coded channel function
1d54c7d FHSS: fhss tx handle callbacks added
0cc1889 FHSS: Moved external API set to fhss and fhss_ws
c6cfb6c Merge pull request ARMmbed#1544 from ARMmbed/fhss_headers_refactored
1b4e203 FHSS: refactoring FHSS header files
e047723 Merge pull request ARMmbed#1541 from ARMmbed/IOTTHD-2171
5d98e3e FHSS: Added support for TR51 channel function
c8a9c7c FHSS: function to calculate nearest (larger or equal) prime number
5e70ec1 FHSS: ws struct to hold ws specific parameters
f2d7558 FHSS unit tests: Fixed tests
149f17b FHSS: Own create api for WS
e19de33 FHSS: WS to use Direct Hash channel function
fb99776 FHSS: Some cleaning
7a21ca1 FHSS: Added common superframe handler
a881580 FHSS: Added ws handler for FHSS state set
f7ab36c FHSS: Created FHSS state set handler
f6c61fc Added Copyrights
c445590 MAC IE element library
6e94b08 MCPS-Data-REQ API update
38aedc5 Remove commented code away.
663fd3e Fixed missing doxygen tags.
b9f7bf4 MAC functional updates and fix's:
2cef8ac Merge pull request ARMmbed#1538 from ARMmbed/mergeMtoK
321f700 Merge pull request ARMmbed#1534 from ARMmbed/IOTTHD-2047
146d7c4 Merge branch 'master' into koli
100db21 FHSS unit test: Added FHSS common to unit test makefile
37425ca FHSS: Separated common FHSS functions to own module
59b7b76 FHSS: Removed massive trace flags
60dfccb FHSS: Removed unnecessary channel functions
e456662 FHSS: Removed scramble table generation from fhss enable
b643622 Merge pull request ARMmbed#1532 from ARMmbed/IOTTHD-2049
b741f98 MCPS Data request API update.
c329f61 MAC API update and internal update
55861f3 FHSS unit tests: Fixed tests after API change
f9a31e9 FHSS API: Added callback to read synch info
f94b2ab FHSS: FHSS to use synch info callback
6830fd3 FHSS API: Added synch info write callback
ad5a1e1 Merge pull request ARMmbed#1527 from ARMmbed/IOTTHD-2095
3ed145f FHSS API: Added new configurations
0f9f0bb FHSS: Platform API to support multiple simultaneous timeouts
bf65e9c Unit tests: Added PHY extension stub
322167e MAC: RX time get function implemented
23d3a58 MAC: Created a function to set TX time
2384c33 PHY API: extension to support timestamp
209e49a Merge pull request ARMmbed#1528 from ARMmbed/IOTTHD-2046
89a85a8 FHSS: Added copyright headers, comments etc.
5d0f44e Unit tests: DH1CF channel function tests implemented
fbd5568 FHSS: DH1CF channel functions implemented
cf03db2 FHSS: Implemented tr51 channel functions
00af7f1 Unit tests: Created channel function unit tests

git-subtree-dir: features/nanostack/sal-stack-nanostack
git-subtree-split: 4a188ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants