mbed-os/targets/TARGET_Cypress/TARGET_PSOC6_FUTURE
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
..
TARGET_CY8C63XX Clean up ARM toolchain heap+stack setup in targets 2019-10-23 14:53:49 +03:00
TARGET_FUTURE_SEQUANA FUTURE_SEQUANA: Flatten PDL library paths 2019-04-08 16:31:17 +02:00
device FUTURE_SEQUANA: Clean up "unused variable" compiler warnings 2019-04-16 16:59:53 +02:00
PeripheralNames.h Move FUTURE_SEQUANA port to TARGET_PSOC6_FUTURE 2019-02-06 18:56:19 +02:00
PeripheralPins.h Move FUTURE_SEQUANA port to TARGET_PSOC6_FUTURE 2019-02-06 18:56:19 +02:00
PinNamesTypes.h Move FUTURE_SEQUANA port to TARGET_PSOC6_FUTURE 2019-02-06 18:56:19 +02:00
PortNames.h Move FUTURE_SEQUANA port to TARGET_PSOC6_FUTURE 2019-02-06 18:56:19 +02:00
analogin_api.c Add HAL API for analog in pinmap 2019-02-08 09:09:51 -06:00
analogout_api.c Add HAL API for analog out pinmap 2019-02-08 09:10:05 -06:00
flash_api.c FUTURE_SEQUANA: Fix flash_api bug introduced with e16d2d81d9 2019-04-16 11:20:11 +02:00
gpio_api.c Move FUTURE_SEQUANA port to TARGET_PSOC6_FUTURE 2019-02-06 18:56:19 +02:00
gpio_irq_api.c FUTURE_SEQUANA: InterruptIn implementation bug fix 2019-09-03 13:48:53 +02:00
gpio_object.h FUTURE_SEQUANA: Flatten PDL library paths 2019-04-08 16:31:17 +02:00
i2c_api.c HAL I2C: adds missing DEVICE_I2C guards 2019-06-19 23:08:55 +02:00
ipcpipe_transport.c FUTURE_SEQUANA: Flatten PDL library paths 2019-04-08 16:31:17 +02:00
ipcpipe_transport.h Move FUTURE_SEQUANA port to TARGET_PSOC6_FUTURE 2019-02-06 18:56:19 +02:00
lp_ticker.c FUTURE_SEQUANA: Flatten PDL library paths 2019-04-08 16:31:17 +02:00
mbed_rtx.h Move FUTURE_SEQUANA port to TARGET_PSOC6_FUTURE 2019-02-06 18:56:19 +02:00
objects.h PSOC6_FUTURE: Fix circular dependency for GPIO-IRQ 2019-07-25 11:04:16 +02:00
pinmap.c FUTURE_SEQUANA: SPI HAL fixes 2019-02-08 16:59:13 +01:00
port_api.c PSOC6: fix port_write API 2019-02-20 12:32:10 +02:00
psoc6_utils.c FUTURE_SEQUANA: Flatten PDL library paths 2019-04-08 16:31:17 +02:00
psoc6_utils.h FUTURE_SEQUANA: Flatten PDL library paths 2019-04-08 16:31:17 +02:00
pwmout_api.c Add HAL API for pwmout pinmap 2019-02-08 09:10:19 -06:00
rpc_api.h Move FUTURE_SEQUANA port to TARGET_PSOC6_FUTURE 2019-02-06 18:56:19 +02:00
rpc_defs.h Move FUTURE_SEQUANA port to TARGET_PSOC6_FUTURE 2019-02-06 18:56:19 +02:00
rtc_api.c Move FUTURE_SEQUANA port to TARGET_PSOC6_FUTURE 2019-02-06 18:56:19 +02:00
serial_api.c FUTURE_SEQUANA: Add missing serial_free() implementation 2019-07-31 13:28:31 +02:00
sleep_api.c Move FUTURE_SEQUANA port to TARGET_PSOC6_FUTURE 2019-02-06 18:56:19 +02:00
spi_api.c FUTURE_SEQUANA: SPI HAL API fixes. 2019-09-30 12:28:33 +02:00
us_ticker.c FUTURE_SEQUANA: Flatten PDL library paths 2019-04-08 16:31:17 +02:00