Commit Graph

55 Commits (a78554ebfac88da6d4f621c32ad5c0c29ff9b45f)

Author SHA1 Message Date
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
Qinghao Shi f2aae22f92 Refactoring memory regions definitions for MPS2_M0 targets
* align MPS2_M0 FVP target with other MPS2 targets
* moved memory_zones.h
* chnage the flash_api.c where referencing the old memory_zones
* modify mbed_rtx.h to use the memory_zones definations as INITIAL_SP
* all linker scripts reference the definitions from memory_zones.h
* tool chains use predefined 1K as ISR Stack size
* ARM Complier 5 and GCC will auto calculated heap size
* IAR use predefined 2MiB as heap size
2018-08-06 01:48:53 +01:00
Qinghao Shi 6f92504467 Refactoring memory regions definitions for MPS2_M0P targets
* added memory_zones.h
* all linker scripts reference the definitions from memory_zones.h
* tool chains use predefined 1K as ISR Stack size
* ARM Complier 5 and GCC will auto calculated heap size
* IAR use predefined 2MiB as heap size
2018-08-06 01:43:45 +01:00
Qinghao Shi 8fc384296e Refactoring memory regions definitions for MPS2_M7 targets
* added memory_zones.h
* all linker scripts reference the definitions from memory_zones.h
* tool chains use predefined 1K as ISR Stack size
* ARM Complier 5 and GCC will auto calculated heap size
* IAR use predefined 2MiB as heap size
2018-08-06 01:42:33 +01:00
Qinghao Shi 7159329efc Refactoring memory regions definitions for MPS2_M4 targets
* added memory_zones.h
* all linker scripts reference the definitions from memory_zones.h
* tool chains use predefined 1K as ISR Stack size
* ARM Complier 5 and GCC will auto calculated heap size
* IAR use predefined 2MiB as heap size
2018-08-06 01:42:15 +01:00
Qinghao Shi a9f44812ca Refactoring memory regions definitions for MPS2_M3 targets
* added memory_zones.h
* all linker scripts reference the definitions from memory_zones.h
* tool chains use predefined 1K as ISR Stack size
* ARM Complier 5 and GCC will auto calculated heap size
* IAR use predefined 2MiB as heap size
2018-08-06 01:41:35 +01:00
Qinghao Shi f207944341 enable HAL FLASH API on Fast Models MPS2 targets 2018-07-19 14:41:21 +01:00
Qinghao Shi 43242589de add comments about TIMER modes and set TIMER2 off by default 2018-06-15 16:26:00 +01:00
Qinghao Shi 3ba635d233 change us_ticker_inited to static 2018-06-12 11:31:16 +01:00
Qinghao Shi 0c8527f5c1 add disable interrupt function in us_ticker_free() 2018-06-11 12:01:49 +01:00
Qinghao Shi 810d534c07 update us_ticker driver and revert CMSDK headers changes 2018-06-11 11:49:02 +01:00
Qinghao Shi ad668a74dd Enable new HAL us_ticker API on fast model MPS2 platform 2018-06-08 11:39:02 +01:00
Qinghao Shi 304b584040 remove ethernet driver as it is not compatible 2018-05-22 11:24:50 +01:00
Qinghao Shi f35ba494ca remove empty lines and redundant variables 2018-05-21 18:43:37 +01:00
Qinghao Shi aab82a78b3 reformat coding styles based on coding guidelines 2018-05-21 15:37:37 +01:00
Qinghao Shi 76dc715a0e FastModels: add FVP_MPS2_M7 target support
add cmsis drivers and toolchain scripts for FVP_MPS2_M7
2018-05-14 11:34:50 +01:00