Commit Graph

70 Commits (master)

Author SHA1 Message Date
Hari Limaye f4e5359710 GPIO: Use uintptr_t for gpio_irq_api context
The HAL gpio_irq_api stores object IDs, which serve as a form of context
for the dispatch of the interrupt handler in the drivers level
InterruptIn Class. The way this is achieved is that the InterruptIn
Class casts its address to uint32_t, which is stored as the ID.
This results in compilation failure when the size of an object pointer
is greater than uint32_t, for example when building on a PC for unit
testing.

In order to allow Unit Testing of the InterruptIn Class, we replace the
use of uint32_t with uintptr_t (type capable of holding a pointer),
which allows portability and expresses intentions more clearly.
In aid of this latter goal, we also replace the use of the name "id"
with "context", to improve clarity - these are addresses of the context
related to that callback.
2022-01-26 18:12:52 +00:00
George Psimenos 61cfaa15cd Update UART pin names & add MBED_CONF_TARGET_STDIO_UART overrides 2021-03-23 11:17:17 +00:00
George Psimenos 885cdef5f7 Add standard pin-names validation script & tests 2021-03-18 17:01:53 +00:00
Martin Kojtal 87cededeee
Merge pull request #14348 from harmut01/baremetal_arm_fm
Add bare metal support to ARM FM targets
2021-03-03 08:54:42 +00:00
Harrison Mutai da4c528659 Add bare metal support to ARM FM targets
Modify scatter files to specify heap load region and add small libraries
to list of supported libraries in target.json.
2021-02-25 09:59:41 +00:00
Hugues Kamba 2c3481297c CMake: Create CMSIS library targets to remove dependency on MBED_TARGET_LABELS
This goes towards eventually removing reliance on targets.json to specify
the requirements of Mbed targets.
2021-02-19 13:39:32 +00:00
Martin Kojtal 1516c57bf8 ARM FM CMake: fix CMakeLists names 2021-02-15 09:23:54 +00:00
Martin Kojtal 950baa2fe6
CMake fvp mps2: fix linking to arm-fm 2021-02-14 19:44:28 +00:00
Martin Kojtal 26d7b4d9d5
CMake Arm FM: fix linking libraries with arm-fm
Co-authored-by: Hugues Kamba-Mpiana <41612201+hugueskamba@users.noreply.github.com>
2021-02-14 19:43:39 +00:00
Martin Kojtal bfb36b68a6 CMake ARM FM: fix targets naming 2021-02-11 14:48:55 +00:00
Martin Kojtal 302c86041f ARM FM: refactor CMake targets 2021-02-11 14:44:35 +00:00
Hugues Kamba ec9c6cbc02 CMake: Add support for all ARM's FM Mbed targets
Add CMakeLists.txt files so all ARM's FM Mbed targets can be built with CMake
2020-11-25 14:55:17 +00:00
Harrison Mutai 4fad1112e5 Add SPDX license identifier to Arm files
Add license identifier to files which Arm owns the copyright to,
and contain either BSD-3 or Apache-2.0 licenses. This is to address
license errors raised by scancode analysis.
2020-10-15 10:47:27 +01:00
Jaeden Amero 612b148fd4 stack: armc: Workaround config passing bug
Workaround a bug where the boot stack size configuration option is not
passed on to armlink, the Arm Compiler's linker. Prefer
MBED_CONF_TARGET_BOOT_STACK_SIZE if present, as this is what the
configuration system should provide. Fall back to MBED_BOOT_STACK_SIZE
if MBED_CONF_TARGET_BOOT_STACK_SIZE is not defined, as in the case of
buggy tools. If both MBED_CONF_TARGET_BOOT_STACK_SIZE and
MBED_BOOT_STACK_SIZE are not defined, then we fall back to a hard-coded
value provided by the linkerscript. See
https://github.com/ARMmbed/mbed-os/issues/13474 for more information.
2020-09-10 10:08:38 +01:00
Jaeden Amero 39e69d328d Use boot stack size from config system
To allow overriding of the boot stack size from the Mbed configuration
system, consistently use MBED_CONF_TARGET_BOOT_STACK_SIZE rather than
MBED_BOOT_STACK_SIZE.

Fixes #10319
2020-09-10 10:08:38 +01:00
Kevin Bracey fb6aa3ef4f Clean up ARM toolchain heap+stack setup in targets
ARM Compiler 6.13 testing revealed linker errors pointing out
conflicting use of `__user_setup_stackheap` and
`__user_initial_stackheap` in some targets. Remove the unwanted
`__user_initial_stackheap` from the targets - the setup is
centralised in the common platform code.

Looking into this, a number of other issues were highlighted

* Almost all targets had `__initial_sp` hardcoded in assembler,
  rather than getting it from the scatter file. This was behind
  issue #11313. Fix this generally.
* A few targets' `__initial_sp` values did not match the scatter
  file layout, in some cases meaning they were overlapping heap
  space. They now all use the area reserved in the scatter file.
  If any problems are seen, then there is an error in the
  scatter file.
* A number of targets were reserving unneeded space for heap and
  stack in their startup assembler, on top of the space reserved in
  the scatter file, so wasting a few K. A couple were using that
  space for the stack, rather than the space in the scatter file.

To clarify expected behaviour:

* Each scatter file contains empty regions `ARM_LIB_HEAP` and
  `ARM_LIB_STACK` to reserve space. `ARM_LIB_STACK` is sized
  by the macro `MBED_BOOT_STACK_SIZE`, which is set by the tools.
  `ARM_LIB_HEAP` is generally the space left over after static
  RAM and stack.
* The address of the end of `ARM_LIB_STACK` is written into the
  vector table and on reset the CPU sets MSP to that address.
* The common platform code in Mbed OS provides `__user_setup_stackheap`
  for the ARM library. The ARM library calls this during startup, and
  it calls `__mbed_user_setup_stackheap`.
* The default weak definition of `__mbed_user_setup_stackheap` does not
  modify SP, so we remain on the boot stack, and the heap is set to
  the region described by `ARM_LIB_HEAP`. If `ARM_LIB_HEAP` doesn't
  exist, then the heap is the space from the end of the used data in
  `RW_IRAM1` to the start of `ARM_LIB_STACK`.
* Targets can override `__mbed_user_setup_stackheap` if they want.
  Currently only Renesas (ARMv7-A class) devices do.
* If microlib is in use, then it doesn't call `__user_setup_stackheap`.
  Instead it just finds and uses `ARM_LIB_STACK` and `ARM_LIB_HEAP`
  itself.
2019-10-23 14:53:49 +03:00
Qinghao Shi bdff628a6c FASTMODEL: add a comment for TRNG simulation 2019-09-30 16:43:44 +01:00
Qinghao Shi 5089d9de87 FASTMODEL: update trng based on comments 2019-09-30 16:30:51 +01:00
Qinghao Shi 4bbbad3d79 FASTMODEL: add simulated TRNG implementation to fastmodel 2019-09-27 15:58:28 +01:00
Filip Jagodzinski 86149e59d6 FVP_MPS2: Fix serial_init when FC is not used
After adding DEVICE_SERIAL_FC guards to serial_api.h
serial_set_flow_control is not available. In case of this
implementation, this function is a no-op and may be safely removed.
2019-07-09 16:05:04 +02:00
Martin Kojtal 149d53cc89
Merge pull request #10619 from jamesbeyond/fm-iap
Fastmodel: enable flashIAP and kvstore
2019-07-02 14:23:00 +01:00
Maciej Bocianski fcde82ba4f HAL I2C: adds missing DEVICE_I2C guards 2019-06-19 23:08:55 +02:00
Qinghao Shi 153ea175e8 correct CMSDK for M0Plus due to MPU is not presented 2019-06-07 18:35:25 +01:00
Qinghao Shi 07c3d90a5c FastModel: change Fastmodel memory layout regions from 3 to 2
- change memoryzones.h
 - change linker scripts for each toolchains
2019-06-06 18:54:59 +01:00
Kevin Bracey fd68691ce3 ARM SSG/FM: Cope correctly with NC GPIO 2019-05-02 12:16:34 +03:00
Qinghao Shi 916ec21197 FastModel: Add SPDX License Identifier 2019-04-08 11:50:22 +01:00
Qinghao Shi 0374309946 FastModel: refactor us_ticker code, make names intuitive
- reanme US_TICKER_TIMER1 to US_TICKER_COUNTER
 - reanme US_TICKER_TIMER2 to US_TICKER_INTERRUPT
2019-04-03 16:37:08 +01:00
Qinghao Shi 8ebb363618 FastModel: add HAL sleep implementation 2019-04-03 16:37:08 +01:00
Qinghao Shi 5c06f99396 Fastmodel: add HAL low-power ticker implementation 2019-04-03 16:37:08 +01:00
Senthil Ramakrishnan 45c727ee6f Workaround(recommended by compiler team) for FVP_MPS2 targets to use ARM Compiler 6 2019-03-01 13:40:42 -06:00
Deepika 8b02a60b94 TARGET_ARM_FM: Set the heap size and limit 2019-02-19 15:49:49 -06:00
Russ Butler 8669417e7b Add HAL API for spi pinmap
Add the functions to get spi pinmaps to all targets.
2019-02-08 09:10:37 -06:00
Russ Butler 34c176654d Add HAL API for serial pinmap
Add the functions serial_tx_pinmap, serial_rx_pinmap, serial_cts_pinmap
and serial_rts_pinmap to all targets.
2019-02-08 09:10:28 -06:00
Russ Butler 22a89773fa Add HAL API for i2c pinmap
Add the functions i2c_master_sda_pinmap, i2c_master_scl_pinmap,
i2c_slave_sda_pinmap and i2c_slave_scl_pinmap to all targets.
2019-02-08 09:10:12 -06:00
Russ Butler 4818f88d73 Add HAL API for analog in pinmap
Add the function analogin_pinmap to all targets.
2019-02-08 09:09:51 -06:00
Przemyslaw Stekiel 55b1c664bc [ARM_FM] Support boot stack size configuration option 2019-01-08 15:32:01 +01:00
Qinghao Shi 55bd5d5c44 FastModel: rename SMM_MPS2.h to FVP_MPS2.h 2019-01-02 22:32:04 +00:00
Qinghao Shi a7de0a5991 FastModel: share the same MPS2 platform header to all targets 2019-01-02 22:12:07 +00:00
Qinghao Shi f0f2a5d440 FastModel: remove SMSC9220 related definitions from SDK 2019-01-02 22:07:03 +00:00
Qinghao Shi f8edab12f4 fix uninitialized handler pointer in ethernet driver 2018-12-06 23:38:28 +00:00
Qinghao Shi d157e59267 reformat to following codeing style rules 2018-11-16 10:29:31 +00:00
Qinghao Shi bbe3b131dc add lan91c111 drivers for FVP MPS2 platfrom 2018-11-16 10:22:42 +00:00
Cruz Monrreal II 798ffd0d5a Merge branch 'fm_flash' of ssh://github.com/jamesbeyond/mbed-os into rollup 2018-11-13 17:26:48 -06:00
Qinghao Shi f7ff09d243 fix bug set a correct page size 2018-11-09 15:29:36 +00:00
Cruz Monrreal II a2bdc44eee Merge branch 'fm_sdk' of ssh://github.com/jamesbeyond/mbed-os into rollup 2018-11-08 13:24:16 -06:00
David Saada 542744d03c Support erase value in Flash HAL drivers, FlashIAP and block devices 2018-11-07 14:23:07 +02:00
Qinghao Shi 97ac4bb6ce Cosmetic coding changes of remove white space 2018-11-06 22:14:18 +00:00
Qinghao Shi be9e75cc47 update GCC startup script to align with armcc and iar 2018-11-06 22:11:09 +00:00
Deepika 2a8ae84cb1 ARM: Fix alignment of execute region to 8-byte boundary
--legacyalign, --no_legacyalign are deprecated from ARMC6 compiler, in order to
remove deprecated flags all linker files (GCC and IAR as well to have uniformity)
should strictly align to 8-byte boundary
2018-10-09 10:15:07 -05:00
Qinghao Shi f612ea0b47 replace hard-coded vector size with macro in linker scripts 2018-08-17 17:59:17 +01:00