Commit Graph

1117 Commits (11b6a4eaf9f1b047e83c693f8d1e036f16a037d4)

Author SHA1 Message Date
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
ccli8 00147b504b Refactor code for non-secure flash check in flash IAP 2018-04-16 12:39:03 +08:00
ccli8 92d937dd46 Replace with MBED_NONSECURE_ENTRY for all-toolchain secure gateway functions in flash IAP 2018-04-16 09:59:03 +08:00
ccli8 a62c0796c5 Support secure/non-secure flash IAP for Cortex-M23/M33 2018-04-13 16:30:57 +08:00
Anna Bridge 773fb90670
Merge pull request #6373 from 0xc0170/fix_flash_docs
flash: add docs for user defined data
2018-03-28 15:55:35 +01:00
Cruz Monrreal ddf70f1dc9
Merge pull request #6377 from scartmell-arm/feature-deep-sleep-tracing-filename-fix
Replace runtime strip_path function with compiler intrinsic equivalents
2018-03-23 10:28:25 -05:00
Martin Kojtal e828b392bc flash: add docs for user defined data
This should make some of the data more clear to a user
2018-03-20 12:25:22 +00:00
Cruz Monrreal 9bebb8cb57
Merge pull request #6372 from bulislaw/fix_doxy_itm
Fix doxygen for ITM HAL
2018-03-19 11:18:47 -05:00
Steven Cartmell 9a0e8797b9 Refactor sleep tracing driver identifier to be pointer to the driver filepath.
The use of __FILE__ macro to get a usable identifier from the driver path
causes the path of the file to be stored in the .text region of the binary.
Given that this remains for the entire duration of the program, storing a
pointer to this string as an identifier is more efficient than copying the
contents of the string during lookup/insertion.
2018-03-15 17:23:36 +00:00
Cruz Monrreal 9cac3b2f6b
Merge pull request #6149 from bmcdonnell-ionx/typos
Fix typos in the files
2018-03-15 10:53:03 -05:00
Steven Cartmell bd63f93984 Replace runtime strip_path function with compiler intrinsic equivalents
Sleep manager tracing strips the path from filenames and uses the result as an
identifier to track drivers that unlock/lock sleep tracing. Replace the function
that strips the path from the string, replace this function with a new macro,
__FILENAME__ which performs the same action in a compiler specific manner.

- GCC_ARM, use __builtin_strrchr which is optimized out at compile time.
- ARM, use __MODULE__ which returns the filename without path.
- IAR, specifiy the --no_path_in_file_macros compiler flag.
2018-03-15 15:49:42 +00:00
Bartek Szatkowski a7d6c9d1df Fix doxygen for ITM HAL 2018-03-15 10:43:48 +00:00
Bartek Szatkowski d6f57bc3e8 Fix review comments and merge issues 2018-03-02 00:29:14 +00:00
Steven Cartmell 206cc299e0 Fix merge conflict mishap 2018-03-01 17:33:21 +00:00
Steven Cartmell fed5115624 Return pointer to sleep tracker array element instead of an index 2018-03-01 17:25:33 +00:00
Steven Cartmell 076548aa6b Split find/insert sleep tracker function into two seperate functions.
Throw an error when trying to unlock driver that was not previously locked.
2018-03-01 17:25:33 +00:00
Steven Cartmell bd23625d23 Rename SLEEP_STATS_ENABLED to SLEEP_TRACING_ENABLED 2018-03-01 17:25:33 +00:00
Steven Cartmell 5a4027b71d Remove newline printf from sleep manager 2018-03-01 17:25:15 +00:00
Steven Cartmell 21e5f1134d Remove '_PACKED' keyword from sleep statistic structure 2018-03-01 17:25:15 +00:00
Steven Cartmell 74bdf1c3a3 Rename SLEEP_PROFILING_ENABLED to MBED_SLEEP_STATS_ENABLED 2018-03-01 17:25:15 +00:00
Steven Cartmell 0f6b73ae0f Add optional tracing to sleep manager lock/unlock
Add tracing output to console to track when drivers lock and unlock deep
sleep. Tracing output is enabled by configuring the
'SLEEP_PROFILING_ENABLED' at compile time.

- Wrapped sleep_manager_lock/sleep_manager_unlock in a macro to
conditionally call tracing functions when 'SLEEP_PROFILING_ENABLED' is
set.
- Define a global structure to track driver names and how many locks
they hold in the sleep manager.
2018-03-01 17:24:53 +00:00
Bartek Szatkowski 4cb47df40a Add system_reset() function to Mbed OS 2018-02-28 16:42:34 +00:00
Brendan McDonnell c4f10aafee typos 2018-02-20 20:11:19 -05:00
Cruz Monrreal 0ceecb946d
Merge pull request #5956 from marcuschangarm/feature-hal-swo
[feature-hal-itm] Instrumented Trace Macrocell HAL API for SWO debug output
2018-02-16 16:08:12 -06:00
Marcus Chang bbf92fdf0d Instrumented Trace Macrocell (ITM) HAL API
HAL API for initializing the ITM and setting SWO debug output.
Actual debug output implemented as SWO FileHandle.
2018-02-16 08:24:31 -08:00
Przemyslaw Stekiel c2760be01c Fix for issue #6054 - interrupts scheduled in the past.
When ticker is not driven by the 1 MHz clock and HAL driver need to perform conversion between microseconds and ticks, then the interrupt might be scheduled in the past. For details see: https://github.com/ARMmbed/mbed-os/issues/6054.

This patch provides fix for such case. Interrupt is fired immidiatelly when last read tick is equal to the calculated tick when interrupt should be generated.
2018-02-15 12:30:24 +00:00
Przemyslaw Stekiel 6d3ba94f98 Provide fix for issue #5835 - Tickers update should be atomic
Synchronise only (and all) the public functions.
2018-01-22 13:29:31 +01:00
Steven Cartmell 061795c489 Move in_critical_section implementation into the HAL
- Add function to HAL hal_in_critical_section()
- Wrap assert in FEATURE_UVISOR macro
2018-01-09 10:41:29 +00:00
Steven Cartmell 04d2f3de78 Amend critical section function descriptions 2018-01-05 14:55:58 +00:00
Steven Cartmell e14bee5209 Fix potential race condition in critical section HAL API
Call underlying HAL implementation to enter critical section/disable interrupts
before incrementing the global critical section counter.

Modify HAL implementations to track first entrances to the critical section and
only update the saved state on first enter.
2018-01-05 14:55:58 +00:00
Steven Cartmell a07c07fa63 Update HAL API header information 2018-01-05 14:55:57 +00:00
Steven Cartmell 84391f0b64 Remove invalid assert and move uVisor warning to correct function 2018-01-05 14:55:57 +00:00
Steven Cartmell 07a394ee8b Add Critical Section HAL API specification
- Define header functions for Critical Section HAL API
  - hal_critical_section_enter()
  - hal_critical_section_exit()

- Add weak default implementation for HAL API. The default implementation
  matches the previous behaviour stored in mbed_critical:
  - The first call to enter a critical section stores the state of interrupts
    before disabling and each successive call re-disables interrupts.
  - The last call (non-nested) will restore the IRQ state that was set on the
    enter to the critical section. Nested calls are ignored.

- Add function 'core_util_in_critical_section' to User facing API to determine
  if the program is currently in a critical section, instead of depending on
  'core_util_interrupts_enabled'.
2018-01-05 14:53:51 +00:00
Przemyslaw Stekiel 5da5b28f96 Add API to set ticker IRQ handler.
This API is added primarily for testing purposes, to be able to test HAL drivers without using upper layers to handle ticker interrupt.
By default IRQ handler is set to ticker_irq_handler() for us ticker and lp ticker - original one.

Usage example (setting custom ticker irq handler):

void my_irq_handler(const ticker_data_t *const) {
 // handle interrupt
}

ticker_irq_handler_type old_handler = set_us_ticker_irq_handler(my_irq_handler);

Respectively for lp timer set_lp_ticker_irq_handler() API should be used.
2017-10-30 10:38:38 +01:00
Jimmy Brisson fad67559ae Merge pull request #5028 from c1728p9/ticker_api_changes
Update ticker to map closely to hardware
2017-10-13 09:18:02 -05:00
Jimmy Brisson 8beedcef83 Merge pull request #5019 from fkjagodzinski/fix-ticker_API_docs
Fix an incorrect comment in ticker API
2017-10-09 11:11:36 -05:00
Russ Butler 0d3714e9b7 Optimize 1MHz and 32KHz use cases
Add optimizations for the most common use cases of the
us ticker, 1MHz,  and the lp ticker, 32KHz.
2017-10-05 11:57:13 -05:00
Russ Butler ec55b82acf Update ticker to map closely to hardware
Allow tickers to specify their native frequency and number of bits.
This allows the conversion to happen in common code rather than in
each vendor's implementation.
2017-10-05 11:57:12 -05:00
Russ Butler 8183749948 Initialize the HAL ticker on first read
Initialize the ticker on the first call to ticker_read* if the
ticker has not been initialized already.
2017-09-29 09:18:58 +01:00
Martin Kojtal 26f9144c45 Merge pull request #5000 from 0xc0170/fix_flash_page_doc
flash: add note about program size
2017-09-22 11:28:54 +01:00
Martin Kojtal fcdb04351f Sleep: add deepsleep locks for !DEVICE_SLEEP
If a target do not support sleep (no DEVICE_SLEEP defined),
we provide empty deep sleep locking.
2017-09-07 15:35:04 +01:00
Martin Kojtal cb4e9b32a2 Sleep HAL: add sleep manager API
Sleep manager provides API to lock/unlock deepsleep. This API allows a user to
control deep sleep.

This API should be done via atomic operations (to be IRQ/thread safe).
2017-09-07 15:34:47 +01:00
Martin Kojtal 3f58d3ef48 flash: add note about program size
Program size - the writable page size that flash controller supports.
Plus fix program page description - multiple pages program
2017-09-06 07:54:18 +01:00
Filip Jagodzinski b1ff37cdee HAL: ticker_api: Fix outdated comment 2017-09-05 13:31:12 +02:00
Russ Butler 026df0b7cd Turn on doxygen for DEVICE_* features
Enable doxygen for all device features. Also fix the warnings that
showed up once this was enabled.
2017-08-11 15:47:44 -05:00
Jimmy Brisson 1f94ede86c Merge pull request #4744 from deepikabhavnani/spi_issue_4743
Allow user to set default transfer byte for block read
2017-07-24 14:45:30 -05:00
Deepika 1b797e9081 Closed review comments
1. Doxygen and Grammar related
2. Change dummy to spi_fill
3. Remove NXP driver and add default loop in spi block read (same as all
other drivers)
2017-07-21 09:46:22 -05:00