Commit Graph

17782 Commits (eba1dc6dd6cbe233a862cac3c48dcbbd4d04deb8)

Author SHA1 Message Date
Martin Kojtal 85ef7a008f cellular: fix tests that astyle breaks
Ignore TEST_GROUP by AStyle. As this uses macro, is not visible to formatter.
By default, it assumes it is a function and treats methods as blocks inside a
function (inlined {}). We ignore it.

We might just not format UNITTESTS in the future if we face similar issues
in the future.
2018-07-31 13:15:57 +01:00
TomoYamanaka 87496df078 Add the clear process of "inited" flag in lp_ticker_free()
I added "lp_ticker_inited = 0" in lp_ticker_free() of lp_ticker.c, so
re-initialization will work.
2018-07-31 19:22:04 +09:00
TomoYamanaka 52cbc33d44 Implementation of LPTICKER feature for Renesas mbed boards
Although other venders implement this feature by using RTC, in my H/W(RZ_A1), I cannot use RTC because it does not satisfy the spec of LP Ticker (ms order and low frequency between 8 KHz and 64 KHz).
Therefore I implemented this feature by creating 1024 division by MTU2(Multi function Timer pulse Unit 2) in order to satisfy this spec.
As a result of investigating, the most unaffected channel among MTU2 placed on GR-PEACH and GR-LYCHEE was channel 3, so I use channel 3 for this feature.

- mbed_drv_cfg.h
  I added a macro of MTU2 channel to this file for commonalizing code for GR-PEACH and GR-LYCHEE, and referenced it's macro at us_ticker.c.
- targets.json
  I added a macro for enabling LP Ticker.
- mtu2.c mtu2.h
  I defined fuction of MTU2's clock supply and stop.
  Because MTU2 is utilized by pwm driver too, those function were referenced at lp_ticker driver and pwm driver.

- lp_ticker.c lp_ticker_init()
  In order to satisfy the LP Ticker spec, I implemented by creating 1024 division by MTU2.
  When an interrupt is required, it will be set with ticker_set_interrupt().

- lp_ticker.c lp_ticker_free()
  This function stops the counting and powerdown the lp_ticker.

- lp_ticker.c lp_read()
  This function returns the timer counter of MTU2.

- lp_ticker.c lp_ticker_set_interrupt()
  In order to satisfy specifications, I implemented lp_ticker_set_interrupt() function.

- lp_ticker.c lp_ticker_fire_interrupt()
  In order to satisfy spec, I implemented lp_ticker_fire_interrupt() function.
  Also I added GIC_EnableIRQ for allowing the interrupt at end of function.

- lp_ticker.c lp_ticker_get_info()
  To satisfy the spec, I implemented lp_ticker_get_info() function. The value of freq includes rounding off.
2018-07-31 19:22:03 +09:00
Mika Leppänen d35f5b08ec Removed device emac check from emac greentea tests
DEVICE_EMAC is defined only for boards with default Ethernet emac.
It is not defined for example for Realtek RTL8195AM board that
does not have Ethernet. Removed the check for device emac from emac
greentea tests.
2018-07-31 13:18:17 +03:00
Antti Yli-Tokola 20f647435a Update mbed-coap version to 4.5.1
Fixes error: IOTCLT-2883 - Blockwise observations not completing
2018-07-31 10:31:09 +03:00
cyliangtw 2fcbcf1789
Initialized return value of numaker_emac link-out 2018-07-31 12:01:43 +08:00
Jimmy Brisson fb42bb0439 Stabilize macro ordering in mbed_config.h 2018-07-30 11:05:32 -05:00
Jimmy Brisson 28064f1319 Use hash to determine changes to command files 2018-07-30 10:41:58 -05:00
Naveen Kaje db91e7ed02 nrf_drv_twi: remove redundant nrf_drv_disable call in nrf_drv_twi_uninit
i2c_api implementation for NRF52 does a disable() followed by uninit().
The uniinit() implementation in NRF drivers layer makes another call to
disable. This throws off the state of the I2C instance leading to an
assert. Since the disable is only invoked from the I2C API layer for
Nordic, remove this redundant call.

Signed-off-by: Naveen Kaje <Naveen.Kaje@arm.com>
2018-07-30 09:18:43 -05:00
bcostm 9598dd9f12 STM32: remove uart force_reset at init 2018-07-30 14:52:31 +02:00
Hasnain Virk c7f3585e28 Clear distinction b/w class A & C data paths 2018-07-30 15:25:37 +03:00
Hasnain Virk d76f6c07e9 Making recv timing error and preamble length configurable
We had a bug especially in the reception path. Our recv window opening
delays were being calculated on the premise that the radio has to capture
5 preamble symbols out of 8 transmitted by the base station. However, in PHY
layer while setting radio rc settings, we were setting preamble length to be 8.
Preamble length register needs to be configured differently for Uplink and Downlink.
For uplink, we wish to transmit 8 preamble symbols whereas in the reception path we need
to receive 5 preamble symbols at least out of 8.
Alongwith that the maximum range of timing error may vary from platform to platform as it
is based upon the crystal in the chip. We have now made these parameters configurable and
have loaded them with the most optimal defaults.
2018-07-30 15:25:36 +03:00
Hasnain Virk 24c5c58d4f Mark an error in post processing if ack not recvd
If an ack is not received after maximum retries, we need to mark an error
which was missing from the post processing sequence.
2018-07-30 15:25:18 +03:00
Hasnain Virk 31aaea6749 [IOTCELL-1181] Fixing incorrect NetID causing ABP Failures
The issue rose up when using ARMC6. A test case didn't initialize NetID
parameter for ABP while using connect(params) API. NetID is the first 7 bits
of the Device Address. It makes sense to actually remove the net-id parameter
from ABP settings as the stack can deduce it from device address. However, the ABP
structure is exposed in public APIs, so we can't really do that at the moment.
Simpler fix is to move the mask that helps us to extract first 7 bits of the device address
is exposed in lorawan_types.h and the user can use it to deduce correct net-id.
2018-07-30 15:02:35 +03:00
Ashok Rao 8c07fcd09f Changing default SPI CS pin to SD card on MTB 2018-07-30 12:23:37 +01:00
Martin Kojtal 80d58e5572 iar: remove nxp duplicate definitions
Fixes #7634
2018-07-30 11:49:47 +01:00
deepikabhavnani feda35503b Remove debug print 2018-07-27 13:40:43 -05:00
Senthil Ramakrishnan 6221e6fa23 Optimize the configuration for RTX evr events to disable the ones not in use 2018-07-27 13:05:16 -05:00
Jimmy Brisson fc97d77b0d Remove file before moving over it
Windows is dumb sometimes
2018-07-27 10:06:11 -05:00
Jimmy Brisson 4da77916d5 Reduce include paths further
by 0.45% for Mbed Cloud Client
2018-07-27 09:43:30 -05:00
Martin Kojtal cde18aa0bc cellular: astyle fix 2018-07-27 13:33:20 +01:00
Nis Madsen 5567ac3be6 MPS2 platform: Enable interrupt on rx for UART 2018-07-27 14:11:27 +02:00
Hasnain Virk 465fb447e5 AS923: Using LoRa modulation comatible DR as default
DR7 is used for FSK in AS932 region. As a default max DR, we should use a LoRa modulation
compatible data rate. Ofcourse if a device wishes to use FSK, it can set DR7 using set_data_rate() API
and turning off ADR, or an NS can configure a new channel for the device utilizing DR7.
2018-07-27 15:04:31 +03:00
Hasnain Virk b0b026126c [IOTCELL-1181] Using higher data rates to connect
The stack was trying to connect with default data rates which happened to be
the lowest data rates in a specific region. In the beginning device and NS do
not have agreed upon tx rx parameters and there can be synchronization issues.
When we use lower datarates, we may end up having a minute and a half long
transmissions that hnot only blocks the channel for a long time but also reduce
the chance of proper synch between device and NS. That's why we have decided to
begin with higher data rates and gradually decrease datarate if we do not hear
from the network server.
2018-07-27 15:04:31 +03:00
Hasnain Virk 36a4c557b7 [IOTCELL-1182] User TX priority over automatic uplinks
In the case when an automatic uplink was queued and the user do have something send,
we should give priority to user data instead od automatic uplink message.
2018-07-27 15:04:31 +03:00
Kimmo Vaisanen 668c6ab6fa Lora: Fix cancel_sending
This commit fixes some bugs from cancel_sending() method:
-  System crashed if method was called before initialization.
   Now LORAWAN_STATUS_NOT_INITIALIZED will be returned.
-  Method returned LORAWAN_STATUS_BUSY error when no send request was pending.
   LORAWAN_STATUS_OK should be returned in this case.
-  LORAWAN_STATUS_BUSY is now returned if backoff timer is just about to be
   dispatched (time_left returns 0).
2018-07-27 13:30:27 +03:00
Cruz Monrreal 8292affb53
Merge pull request #7609 from bremoran/patch-2
Make location meaningful in print_error_report
2018-07-26 22:07:22 -05:00
Cruz Monrreal 639285a0e2
Merge pull request #7608 from theotherjimmy/fix-make
Tools: Correct `win_to_unix` path handling
2018-07-26 15:53:23 -05:00
Cruz Monrreal cc506eed14
Merge pull request #7603 from OpenNuvoton/nuvoton_override_gcc_sbrk
Nuvoton: Replace __wrap__sbrk with overriding _sbrk
2018-07-26 12:54:45 -05:00
Cruz Monrreal 8755e56fd6
Merge pull request #7567 from theotherjimmy/managed-update-image
Tools: Generate update images with managed bl mode
2018-07-26 10:51:40 -05:00
Cruz Monrreal 5d4f636bb1
Merge pull request #7578 from VeijoPesonen/conn_failure_tolerance
Makes Greentea TCP test cases to timeout less in connection errors
2018-07-26 10:29:48 -05:00
Cruz Monrreal dcd358f3e7
Merge pull request #7558 from theotherjimmy/tc-arm-v8m
Tools: Select compiler based on arch version
2018-07-26 10:27:21 -05:00
Cruz Monrreal c5680b5b9d
Merge pull request #7584 from SenRamakri/sen_wait_us_Enhancement
Minor enhancement to wait_us
2018-07-26 10:26:17 -05:00
Brendan Moran 96fbd02f8c
Make location meaningful in print_error_report
`handle_error` calls `MBED_CALLER_ADDR()`, but this is always a location from within platform/mbed_error.c. This is because `handle_error` is declared static. This does not cause the function to be inlined however. Instead, it is called by each function within mbed_error.c. For example, mbed_error yields this code:

```
000625c8 <mbed_error>:
   625c8:       b510            push    {r4, lr}
   625ca:       460c            mov     r4, r1
   625cc:       4611            mov     r1, r2
   625ce:       461a            mov     r2, r3
   625d0:       9b02            ldr     r3, [sp, #8]
   625d2:       f7ff feff       bl      623d4 <handle_error>
   625d6:       b968            cbnz    r0, 625f4 <mbed_error+0x2c>
   625d8:       4620            mov     r0, r4
   625da:       f7ff ff67       bl      624ac <print_error_report.constprop.0>
   625de:       f7ff fea8       bl      62332 <core_util_is_isr_active>
   625e2:       b910            cbnz    r0, 625ea <mbed_error+0x22>
   625e4:       f7ff fe9f       bl      62326 <core_util_are_interrupts_enabled>
   625e8:       b908            cbnz    r0, 625ee <mbed_error+0x26>
   625ea:       bf30            wfi
   625ec:       e7fd            b.n     625ea <mbed_error+0x22>
   625ee:       2001            movs    r0, #1
   625f0:       f000 f948       bl      62884 <__wrap_exit>
   625f4:       4800            ldr     r0, [pc, #0]    ; (625f8 <mbed_error+0x30>)
   625f6:       bd10            pop     {r4, pc}
   625f8:       80ff010f        .word   0x80ff010f
```

Note that at `625d2` there is a bl to handle error. That replaces the LR, which means that ALL calls to mbed_error will report a location of 0x625d6 or 0x625d7 (user vs. supervisor). I do not expect that this was the intention of the code. The simplest fix is to change line 99:

```C
static inline mbed_error_status_t handle_error(mbed_error_status_t error_status, unsigned int error_value, const char *filename, int line_number)
```

Since `handle_error()` will be inlined, the link register will be kept the same, so `MBED_CALLER_ADDR()` will yield the expected result. However, there is no guarantee that the compiler will respect the `inline` keyword in all circumstances.

The result is that each function that wishes to report its caller must extract its caller. This code cannot be centralised.

I have modified `mbed_error.c` to report the caller of each error reporting function, rather than the error reporting function itself.
2018-07-26 16:21:17 +01:00
Jimmy Brisson 35498dc54c Correct abspath handling 2018-07-26 10:19:23 -05:00
Jimmy Brisson f9c6f21f2e Correct path handling after calls to `win_to_unix` 2018-07-26 09:51:18 -05:00
bcostm b47e599281 F1 ST CUBE V1.6.1: add I2C patches 2018-07-26 15:44:31 +02:00
ccli8 313f322cf7 [Nuvoton] Replace __wrap__sbrk with overriding _sbrk
With _sbrk being weak, we can override it directly rather than #if to support heap with
two-region model.
2018-07-26 15:47:25 +08:00
Veijo Pesonen dd6ec037d7 Makes Greentea TCP test cases to timeout less in connection errors
Made to prevent timeout if a single test case fails. The goal is that
each test case might wait only half of the remaining time reserved for
running TCP test cases.
2018-07-26 09:39:04 +03:00
Russ Butler 05d33b068d Remove unnecessary low power ticker rescheduling
Schedule the next OS tick inside of the ticker interrupt rather than
in the systick interrupt. Scheduling this while the ticker is
dispatching prevents an unnecissary rescheduling since this
rescheduling is done anyway when dispatching is finished.

This is particularly useful for the low power ticker on devices with
LPTICKER_DELAY_TICKS set to a non-zero value. This is because the low
power ticker cannot be reschduled immediately and needs to fall back
onto the microsecond ticker which temporarily locks deep sleep.

Note - the optimization in this commit is made possible by the commit:
"Don't reschedule ticker while dispatching"
2018-07-25 23:24:12 -05:00
Russ Butler e69ecaab57 Don't reschedule ticker while dispatching
Wait until dispatching is finished before scheduling the next ticker
interrupt. This prevents unnecissary calls to set_interrupt from
periodic elements being added back.

This is particularly useful for the low power ticker on devices with
LPTICKER_DELAY_TICKS set to a non-zero value. This is because the low
power ticker cannot be reschduled immediately and needs to fall back
onto the microsecond ticker which temporarily locks deep sleep.
2018-07-25 23:24:12 -05:00
Senthil Ramakrishnan 7cedccc488 Improved logic in wait_us to avoid division operation in sub-millisec case 2018-07-25 15:04:06 -05:00
Jimmy Brisson 76078f6a50 Include `-t ARM` support for v8m, armc6 targets 2018-07-25 11:48:14 -05:00
Jimmy Brisson 8be6a03a4b Correct test_api usage of build_project 2018-07-25 11:29:59 -05:00
Jimmy Brisson ac14e37a77 Correct result usage in reporting infra 2018-07-25 10:04:18 -05:00
bcostm 8ce35ba845 F1 ST CUBE V1.6.1
- stm32f1xx hal V1.1.2
2018-07-25 14:20:11 +02:00
Martin Kojtal b170e1c44d
Merge pull request #7587 from SeppoTakalo/fix-tpcserver-warning
Allow legacy TCPServer::accept() to override inherited Socket::accept()
2018-07-25 14:20:05 +02:00
Martin Kojtal 7adfcbef71
Merge pull request #7551 from M-ichae-l/realtek-rtl8195am-remove-DEVICE_EMAC
realtek rtl8195am remove DEVICE_EMAC
2018-07-25 14:18:57 +02:00
ccli8 caf06e83c1 [Nuvoton] Fix __user_setup_stackheap and ARM_LIB_STACK/ARM_LIB_HEAP cannot co-exist in RTOS-less build 2018-07-25 17:19:09 +08:00
Przemyslaw Stekiel c0ee843d63 Add lp/us ticker_free() functions stub.
This patch adds only empty stubs of `us_ticker_free()` and `lp_ticker_free()` for all boards where these functions are not implemented.
2018-07-25 08:58:38 +02:00