Commit Graph

10 Commits (5c7de756611e3692d364f166e42ab5490cd65362)

Author SHA1 Message Date
Maciej Bocianski ec839f0931 MSP432_LAUNCHPAD: keep interruptVectors symbol in LTO builds
Add a "used" attribute to interruptVectors to fix ARMC6 build with
the "-flto" flag.
(Error: L6236E: No section matches selector - no section to be FIRST/LAST. )

This attribute, attached to a function/variable, means that code must be emitted
for the function even if it appears that the function is not referenced.
2020-02-04 12:29:57 +01:00
Maciej Bocianski a761ec57fd CC3220SF_LAUNCHXL: keep ulDebugHeader symbol in LTO builds
Add a "used" attribute to ulDebugHeader (placed in signature_section section)
to fix ARMC6 build with the "-flto" flag. (Error: L6236E: No section matches
selector - no section to be FIRST/LAST. )

This attribute, attached to a function, means that code must be emitted
for the function even if it appears that the function is not referenced.
2020-02-04 12:29:54 +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
Andreas Terstegge e16394cf09 Final source code cleanup. Smaller changes in system_msp432p401r.c 2019-09-03 11:19:32 +02:00
Andreas Terstegge 8853453ce3 First version of MSP432 support for mbed OS
Removed private TODO file.

Fixed cmsis.h so that renaming of CS and DIR_H is not necessary any more.

Leave pinmap.h unchanged although it should include stdint.h
Moved stdint.h to PinNames.h instead, where it is also used.

Reworked system startup (clock configuration) to be more flexible
(different clock sources for MCLK and SMCLK, configurable clock dividers).

Fixed Copyright headers

Changed default clock settings for MSP432 Launchpad to
MCLK 48 MHz (HFXT) and SMCLK 24 MHz (HFXT)

Remove mbed_rtx.h

Added common mbed_rtx.h file (merge with lastest master)

Added support for IAR toolchain

Fixed some astyle problems.

Added support for ARM C5/C6 toolchains

Small changes to us_ticker implementation after port testing.

Changed default clock configuration to DCO (MCLK 48MHz, SMCLK 24MHz).
De-configured the LFXT crysal, because this made the system_reset() test to time out.

Removed MPU from device_has list. Changed clock source to HFXT.

Reworked startup_msp432p401r.c -> now only one startup file for all compilers.
Changed all linker scripts to delete VECTORS stuff (not needed).

Moved position of MSP432 in targets.json so TI stuff is in one block.
2019-09-03 11:19:31 +02:00
Lin Gao cae7427717 Cosmetic changes to incorporate review feedback 2019-08-14 11:09:11 -05:00
Lin Gao c36980c370 Fix a build break with ARM compiler 2019-07-31 11:51:20 -05:00
Lin Gao eebe00b9d1 Implement PWMOUT 2019-07-30 11:09:44 -05:00
Lin Gao 2a06ae20cc Added missing pinmap definitions. Fixed target JSON config to avoid treating cc3220sf a target 2019-07-23 14:52:50 -05:00
Lin Gao e74fbcd79e Add CC3220SF_Launchxl to Mbed OS 2019-07-17 13:19:32 -05:00