Commit Graph

17 Commits (240758db42aaa42b2abd50daea5033c3cc7e80dc)

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
Jaeden Amero a848cd6987 psa: Update LPC55S69 and MUSCA_A1 TF-M binaries
Rebuild the TF-M binaries for the LPC55S69 and MUSCA_A1 using the latest
service updates. This allows the boards to use the PSA Crypto API 1.0b3.
2019-09-02 17:11:00 +01:00
Oren Cohen 63487533aa Update secure binaries 2019-05-22 17:31:49 +03:00
Martin Kojtal a115c9333f gpio: indent fix 2019-05-22 17:17:27 +03:00
Gabor Kertesz 40627a5220 Fix last issues
Imports working McuBoot for reset.
Updates microsec ticker driver.
Default baudrate is set to 115200 to see TF-M boot messages.
Stack top is set to scatter file dependent and not hard-coded.
2019-05-22 17:17:26 +03:00
Michael Schwarcz bde2557629 Update secure binaries for ARM_MUSCA_A1_S 2019-05-22 17:17:26 +03:00
Michael Schwarcz 0fc629ce45 MUSCA_A1_NS: Add IAR support 2019-05-22 17:17:25 +03:00
Michael Schwarcz ef9c2721a0 Fix PinMap_UART_XX 2019-05-22 17:17:25 +03:00
Michael Schwarcz 1a182df19f Add serial_tx_pinmap() and serial_rx_pinmap() to serial_api.c 2019-05-22 17:17:25 +03:00
Michael Schwarcz c83ef8a444 Add license files 2019-05-22 17:17:24 +03:00
Michael Schwarcz 84bde31ea0 Increase Secure RAM by 4K
- 68KB Secure
- 60KB Non-secure
2019-05-22 17:17:24 +03:00
Michael Schwarcz 71683cbaa7 Fix secure linker script 2019-05-22 17:17:24 +03:00
Michael Schwarcz cebf30a701 Increase secure heap size to 0x4000 2019-05-22 17:17:24 +03:00
Michael Schwarcz 0701fb1c58 Move us_ticker.c to NS side 2019-05-22 17:17:23 +03:00
Michael Schwarcz 96268d91ef Updates after rebase
- postbuild: Use find_secure_image and update prebuilt binaries
- Add CMSIS driver headers
- Align with 2-region memory model
2019-05-22 17:17:23 +03:00
Michael Schwarcz a5fd9176bb Update target license headers
- Add SPDX identifiers and update dates
2019-05-22 17:17:22 +03:00
Michael Schwarcz ff1c769c7e Add ARM_MUSCA_A1 as a new target platform
Musca-A1 is a Cortex-M33 based target with security extension enabled.

- ARM_MUSCA_A1 is the non-secure target running mbed-os.
- ARM_MUSCA_A1_S is the secure target running TF-M.
- TF-M sources were imported and patched in previous commits.
- TF-M secure bootloader (McuBoot) for MUSCA_A1 is submitted by a pre-built binary.
- A post-build hook concatenates The secure and non-secure binaries,
  signs it and then concatenates the bootloader with the signed binary.
2019-05-22 17:17:20 +03:00