Commit Graph

54 Commits (e3a34a57e1ae60a19699196291d4d1a656fdb156)

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
int_szyk 3c2ed16fce Fix TT_M3HQ build problem with SPI 2019-08-16 14:55:49 +02:00
int_szyk ce58505fa4 fix TT_M3HQ build problem with i2c 2019-08-16 14:55:49 +02:00
Martin Kojtal a56247317e
Merge pull request #10798 from ThunderSoft123/master
TARGET_TT:Add GPIO INT pin with PT1
2019-07-05 08:57:34 +01:00
ThunderSoft_mbed_os edeeb33ba7
Update gpio_irq_api.c 2019-06-26 22:33:31 +08:00
ThunderSoft_mbed_os 24384a0fa0
Update gpio_irq_api.c 2019-06-23 22:00:51 +08:00
Maciej Bocianski fcde82ba4f HAL I2C: adds missing DEVICE_I2C guards 2019-06-19 23:08:55 +02:00
panyz0725@thundersoft.com 4f107cc061 Add GPIO INT pin with PT1 2019-06-10 09:46:04 +08:00
panyz0725@thundersoft.com ed81f8e428 Setting wisely pin mode for TT_M3HQ 2019-06-06 10:16:31 +08:00
panyz0725@thundersoft.com e0eefaed99 Modifiying file PinNames.h 2019-05-27 11:02:43 +08:00
Martin Kojtal cfb107912b
Merge pull request #10616 from ThunderSoft123/master
Fix bug Operator new[] out of memory
2019-05-23 21:40:10 +01:00
panyz0725@thundersoft.com 6aeb048e62 Fixing bug error 0x8001011F 2019-05-22 14:18:28 +08:00
Martin Kojtal f859289634
Merge pull request #10489 from kjbracey-arm/gpio_api_nc
gpio_api.h: Clarify desired behaviour for NC
2019-05-21 14:36:49 +01:00
Anna Bridge 6a6dd02172
Merge pull request #10578 from ThunderSoft123/master
Modify PinName file to keep correspondence with spec
2019-05-16 10:59:25 +01:00
panyz0725@thundersoft.com a6c52d3865 Modify PinName file to keep correspondence with spec 2019-05-14 20:04:25 +08:00
Kevin Bracey e6e3614bd8 TT: Cope correctly with NC GPIO 2019-05-02 12:16:34 +03:00
Cruz Monrreal e1736cd06f
Merge pull request #9571 from mprse/fix_9523_rtos_less_issue
Update to 2-region model for HEAP and Stack Memory
2019-02-26 22:50:19 -06:00
panyz0725@thundersoft.com 1a1904644a Add api about I2C and SPI .... 2019-02-25 14:23:37 +08:00
panyz0725@thundersoft.com 3c1d938abf Add ARM_LIB_STACK to resolve CI Error 2019-02-25 11:03:32 +08:00
panyz0725@thundersoft.com 12e4adab99 Add USER_BUTTON and SPI in file PinNames.h 2019-02-25 11:03:32 +08:00
panyz0725@thundersoft.com 1dadab7e5a Add license in file cmsis_nvic.h 2019-02-25 11:03:32 +08:00
panyz0725@thundersoft.com db5d6963ef Modify license about file GPIO, SPI and system 2019-02-25 11:03:32 +08:00
panyz0725@thundersoft.com 217d2ce1fe Modify license 2019-02-25 11:03:31 +08:00
panyz0725@thundersoft.com ec9fd55c8f Update code 2019-02-25 11:03:31 +08:00
panyz0725@thundersoft.com 003a75bd26 Add "SPDX-License-Identifier: Apache-2.0" 2019-02-25 11:03:31 +08:00
panyz0725@thundersoft.com 7e265c81bd Add platform TT_M4G9 2019-02-25 11:03:31 +08:00
Deepika c6a72f2cd7 TARGET_TT: Setup heap limit and size 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 be492fe07a Add HAL API for pwmout pinmap
Add the function pwm_pinmap to all targets.
2019-02-08 09:10:19 -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 3bd3aca6db Add HAL API for analog out pinmap
Add the function analogout_pinmap to all targets.
2019-02-08 09:10:05 -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 d97c4d5506 [TT] Support boot stack size configuration option 2019-01-08 15:32:07 +01:00
panyz0725@thundersoft.com 2c25b45417 Set __ICFEDIT_size_cstack__ =1k 2018-12-21 10:03:09 +08:00
ThunderSoft_mbed_os 79e57f0869 Update us_ticker.c 2018-12-21 10:03:09 +08:00
ThunderSoft_mbed_os 7718186a03 Update spi_api.c 2018-12-21 10:03:09 +08:00
ThunderSoft_mbed_os d421a165e4 Update sleep.c 2018-12-21 10:03:09 +08:00
ThunderSoft_mbed_os d883eb8f83 Update pwmout_api.c 2018-12-21 10:03:09 +08:00
ThunderSoft_mbed_os 076b5a64b0 Update port_api.c 2018-12-21 10:03:09 +08:00
ThunderSoft_mbed_os 35d088e5ba Update pinmap.c 2018-12-21 10:03:09 +08:00
ThunderSoft_mbed_os 5c706251c6 Update objects.h 2018-12-21 10:03:08 +08:00
ThunderSoft_mbed_os 07b23d84b0 Update i2c_api.c 2018-12-21 10:03:08 +08:00
ThunderSoft_mbed_os 198fe703b8 Update gpio_object.h 2018-12-21 10:03:08 +08:00
ThunderSoft_mbed_os df5fe31bac Update gpio_api.c 2018-12-21 10:03:08 +08:00
ThunderSoft_mbed_os a04498c4bc Update device.h 2018-12-21 10:03:08 +08:00
ThunderSoft_mbed_os 7c20ed8396 Update analogout_api.c 2018-12-21 10:03:08 +08:00
ThunderSoft_mbed_os 87293ce15c Update analogin_api.c 2018-12-21 10:03:08 +08:00
ThunderSoft_mbed_os 425d7e164f Update PortNames.h 2018-12-21 10:03:08 +08:00
ThunderSoft_mbed_os 39ee74e4d6 Update PinNames.h 2018-12-21 10:03:08 +08:00