Commit Graph

1163 Commits (3f4d30de567ff3351004c7c88d26dae7d0e4b2bd)

Author SHA1 Message Date
Kevin Bracey 0f98338153 Improve efficiency and formatting of ITM output
SerialWireOutput was outputting 1 character per 32-bit write to the
ITM stimulus port. This is inefficient, and causes processing problems
with some viewers due to them receiving 3 NUL bytes between each
desired character.

Rework to allow us to be more efficient, and eliminate those NUL bytes:

* Retain existing mbed_itm_send() and clarify it's a single 32-bit write.
* Add new mbed_itm_send_block() that is appropriate for sending
  character data, and modify SerialWireOutput to use it.
* Move "wait for FIFO ready" check to before the write, rather than
  after.

One minor correction - FIFOREADY is a single bit of the register read.
Don't interpret reserved bits.
2018-07-04 10:16:28 +03:00
Martin Kojtal 483427a285 hal: astyle update 2018-06-29 10:36:36 +01:00
Przemyslaw Stekiel 307021ec23 Add testing requirements to HAL CRC header file. 2018-06-07 10:17:21 +02:00
Marc Emmers b01b173214 Only schedule mbed_ticker interrupt if queue->head is changed
Reverts change from commit 1057720114
2018-05-30 11:36:20 +02:00
Bartek Szatkowski 93a7db5d84 Add clarification to rtc_free doxygen 2018-05-25 12:49:11 -05:00
Przemyslaw Stekiel 5a79655d05 Modify rtc_api.h header file - update tests specification. 2018-05-25 12:49:11 -05:00
Russ Butler 1f97f11373 Add documentation and test the HAL RTC API
Add requirements, tests, an example implementation and additional
function documentation to the HAL RTC API.
2018-05-25 12:37:19 -05:00
Russ Butler 77637682a0 Keep RTC API prototypes even when not enabled
Keep the prototypes in rtc_api.h even when DEVICE_RTC is not defined.
This allows devices that aren't fully compliant with the RTC API to
still use the header and prototypes.
2018-05-25 12:33:43 -05:00
Bartek Szatkowski efd307fa79 Rename new occurrences of LOWPOWERTIMER to LPTICKER 2018-05-25 12:33:43 -05:00
Bartek Szatkowski 95559ad3e1 Change LPTICKER spec to allow clock freq starting at 4kHz 2018-05-25 12:32:39 -05:00
Marc Emmers ce79492154 Updated types according to header changes 2018-05-25 12:29:55 -05:00
Marc Emmers d35b29830b Changed struct position to try to maintain binary compatibility
Changed comment because a lot of numbers are divisible by 2
2018-05-25 12:29:55 -05:00
Marc Emmers 1aaef7bc12 mbed_ticker_api remove specific case for 32768 in favor of all frequencies divisible by 2 2018-05-25 12:29:55 -05:00
jeromecoutant 12b3df7773 #6536 rebase correction 2018-05-25 12:26:05 -05:00
Bartek Szatkowski ba963b4453 Rename lp_us tests to common and hf to microsecond 2018-05-25 12:20:09 -05:00
Bartek Szatkowski 6e9f04bf2f Rename DEVICE_LOWPOWERTIMER to DEVICE_LPTICKER
That's to match DEVICE_USTICKER.
2018-05-25 12:20:09 -05:00
Przemyslaw Stekiel f55f9d36fb lp_ticker test - provide lp ticker glitch test case
Test that lp ticker does not glitch backwards due to an incorrectly implemented ripple counter driver.
2018-05-25 12:18:55 -05:00
Steven Cartmell 18943a9693 Add lp/us ticker free() function implementation for NRF5 2018-05-25 12:17:49 -05:00
Steven Cartmell 2894152efe Add free function to lp/us ticker HAL API 2018-05-25 12:17:49 -05:00
Przemyslaw Stekiel a8eee0fb1a Modify requirement for the ticker_init function.
Current version:
The function ticker_init resets the internal count and disables the ticker interrupt.

Proposed version:
The function ticker_init allows the ticker to keep counting and disables the ticker interrupt.

This is a result of the following discussion:
https://github.com/ARMmbed/mbed-os/pull/5233#pullrequestreview-86677815
2018-05-25 12:17:49 -05:00
Przemyslaw Stekiel 0ae7b82c07 Add minor modifications of lp/us tickers tests desctiption in ticker header files.
Add one potential bug to the test description.
Fix test function names to be consistant with desctiption and test header.
Fix typos.
2018-05-25 12:04:32 -05:00
Russ Butler 03d7141797 Add documentation for the HAL Ticker API
Add documentation and test header for the HAL Ticker API.
2018-05-25 12:04:32 -05:00
Przemyslaw Stekiel be98bc003e Add Sleep test specification to sleep_api.h. 2018-05-25 12:03:37 -05:00
Martin Kojtal b7682183b8 Sleep: add time requirements for sleep
Sleep - within 10us
Deepsleep - within 10ms

Note about mbed boards with interface, moved to lpc176x, as they are target related,
should be documented in the target documentation.

The tests will come as separate PR, to conform to this updates to sleep API.
2018-05-25 12:03:37 -05:00
Amanda Butler 824466d18c Copy edit crc_api.h
Copy edit file, mostly for American spelling and consistent tense across files.
2018-05-24 17:53:36 +01:00
Steven Cartmell 5e98eea1a0 HAL CRC: Add additional thread safety notes to the API 2018-05-24 17:51:49 +01:00
Steven Cartmell eb202a29c1 HAL CRC: Update function documentation with new config parameter 2018-05-24 17:51:49 +01:00
Steven Cartmell 1da75e5e85 HAL CRC: Fix code to match coding conventions 2018-05-24 17:51:49 +01:00
Steven Cartmell 8e14b5977b HAL CRC: Add bit width parameter to crc_config_t 2018-05-24 17:51:49 +01:00
Steven Cartmell e1ca2b32fc Add CRC configuration options to HAL API 2018-05-24 17:51:49 +01:00
Steven Cartmell 167d3f9a1e HAL CRC: Return early when calling compute with null or 0 size buffer 2018-05-24 17:51:48 +01:00
Steven Cartmell df93c0151c Remove support for 7/8 bit CRC polynomials for K64F 2018-05-24 17:51:48 +01:00
Steven Cartmell e0d98bfe2c Adapt MbedCRC class to support Hardware CRC
- Move CRC polynomial enum into HAL layer, so it's accessible from platform
  implementations

- Add enum to CRC class to indicate which mode the CRC class should use:
  HARDWARE, TABLE, or BITWISE

- Add calls to HAL Hardware CRC API to each of the compute functions when the
  class is in HARDWARE mode.

- Add missing constructor call to template constructor, and remove const from
  delegating constructor.
2018-05-24 17:50:12 +01:00
Steven Cartmell bad3aa0b6b Add Hardware CRC HAL API specification headers
Define the HAL API header for the Hardware CRC module. This set of functions
allows hardware acceleration of a subset of CRC algorithms for supported
platforms by providing access to the hardware CRC module of certain platforms.

The API is defined as four separate functions:

  - hal_crc_is_supported(polynomial)

    Indicates to the caller if the specific CRC polynomial is supported.

  - hal_crc_compute_partial_start(const uint32_t polynomial)

    Initializes the hardware CRC module with the given polynomial.

  - hal_crc_compute_partial(*data, size)

    Writes an array of bytes to the CRC module to be appended to the calculation

  - hal_crc_get_result()

    Applies the final transformations to the data and returns the result to the
    caller.
2018-05-24 17:50:12 +01:00
Cruz Monrreal 527f9a12fd
Merge pull request #6983 from SenRamakri/sen_ErrorHandling_Push2
Standardized Error Handling and Error Codes
2018-05-24 10:57:00 -05:00
Kevin Bracey 13dcef63e3
Merge pull request #6847 from ARMmbed/feature-emac
Merge feature-emac branch into master
2018-05-24 16:47:04 +03:00
Martin Kojtal d8cb72a0a2
Merge pull request #6273 from bulislaw/update_cmsis_5.3
Update cmsis/rtx to version 5.3
2018-05-24 09:37:40 +02:00
Senthil Ramakrishnan 5ef6728c08 Splitting MBED_ERROR macros to support ones with/without error value argument 2018-05-23 12:21:28 -05:00
Senthil Ramakrishnan d4fe75731d Adding mbed prefixes to all macros and functions to avoid namespace conflicts 2018-05-23 12:21:10 -05:00
Senthil Ramakrishnan 147d9cac4e Test application/cases optimization for some low memory targets, macro changes and test fixes 2018-05-23 12:21:10 -05:00
Senthil Ramakrishnan 2e28dd95e1 Change set_error/set_error_fatal to warning/error, add itm support and other changes 2018-05-23 12:21:08 -05:00
Senthil Ramakrishnan 9041b475c6 Error handling/logging implementation and tests 2018-05-23 12:21:07 -05:00
Kevin Bracey 0386f73719 Networking update: general refactoring, unifying EMAC
Initial work by Bartek Szatkowski in https://github.com/ARMmbed/mbed-os/pull/4079,
reworked following review of https://github.com/ARMmbed/mbed-os/pull/5202 to
transform the entire system into C++, retaining the basic functionality.

Bartek's summary:

* Porting ethernet to EMAC
* Updating EMAC to enable multiple interfaces
* Untangling networking classes, making the abstractions a bit clearer to follow, etc
* General refactoring
* Removal of DEVICE_EMAC flag and introducing DEVICE_ETH and DEVICE_WIFI

Revisions since initial branch:

* Remove lwip depencies
* Correct doxygen warnings
* Remove emac_api.h, replace with C++ EMAC abstract class.
* Create OnboardNetworkInterface, and LWIP implementation.
* Mappings since #4079
     lwip-interface/nsapi_stack_lwip.c -> LWIPStack.cpp
     lwip-interface/ipstack_lwip.c -> LWIPInterface.cpp
     netsocket/mbed_ipstack.h -> OnboardNetworkStack.h
     hal/emac_api.h -> EMAC.h
* Reinstate use of EthInterface abstraction
* Correct and clarify HW address EMAC ops
* Restore MBED_MAC_ADDR implementation
* Integrate PPP support with LWIP::Interface.
* Convert K64F lwIP driver to K64F_EMAC.

To do:

* Convert emac_stack_mem.h to follow this pattern.
* Figure out DEVICE_ETH/EMAC
* Update all drivers to use EMAC
2018-05-22 11:44:45 +03:00
Deepika 029237b683 Addressed review comments
1. LP ticker limiation note
2. Use read_us in mbed_uptime function
3. Doxygen recommendations
4. Use us_timestamp_t instead uint64_t
5. Astyle changes
2018-05-15 11:36:08 -05:00
deepikabhavnani 3420ff7f9c CPU statistics addition
API to get CPU stats like sleep/deepsleep time, uptime and idle time.
These can be used by application to know the CPU Usage runtime.
2018-05-15 11:20:52 -05:00
Bartek Szatkowski 00a321846d Rename __DOMAIN_NS to DOMAIN_NS to match CMSIS 2018-05-14 12:18:21 +01:00
Martin Kojtal c6b6bab2f9
Merge pull request #6630 from OpenNuvoton/nuvoton_add_nonsecure_flash
Support secure/non-secure flash IAP for Cortex-M23/M33
2018-04-19 17:24:27 +02:00
ccli8 076a160ac1 Add comment for target_config/target_config_ns in flash IAP 2018-04-18 11:30:11 +08:00
Russ Butler 17892cbbb9 Add handling for synchronized low power tickers
Some low power tickers take multiple cycles of the low power clock
to set a compare value. Because of this if the compare value is set
twice back-to-back these implementations will block until that time
has passed. This can cause system stability issues since interrupts
are disabling for this time.

To gracefully support this kind of hardware this patch adds code
to prevent back-to-back writes to the hardware. It does this by
recording the low power clock cycle of the initial write. If any
writes come in too soon after this initial write the microsecond
ticker is used to schedule the new write in the future when the
hardware is ready to accept a new value.

To enable this feature on a target the macro LOWPOWERTIMER_DELAY_TICKS
must be set to the number of low power clock cycles that must elapse
between writes to the low power timer.
2018-04-16 17:36:07 -05:00
ccli8 7a7b634fda Refine code with MBED_NONSECURE_ENTRY in flash IAP 2018-04-16 16:59:14 +08:00