Commit Graph

40 Commits (ca80cd22f739b877385806e76878ba4a211b3b1e)

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
Jan Jongboom 49e970560d GigaDevice targets can return ninitialized variable in CAN driver 2019-03-07 16:41:42 +01:00
deepikabhavnani 0ff2d42143 Heap and stack size picked from linker files,export symbols not needed 2019-02-28 19:54:38 -06:00
deepikabhavnani 0dc5561991 Guard RAM start and size defines 2019-02-28 19:54:38 -06:00
deepikabhavnani e731a1589f Target_GigaDevice: Add ARM_LIB_STACK and ARM_LIB_HEAP section
Instead of user defined symbols in assembly files or C files,
use linker scripts to add heap and stack - this is inconsistent
with ARM std linker scripts
2019-02-28 19:54:38 -06:00
Deepika 25a127e97b target_Gigadevice: 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 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 7e8695a2c5 Add HAL API for can pinmap
Add the functions can_rd_pinmap and can_td_pinmap to all targets.
2019-02-08 09:10:10 -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
Martin Kojtal f4aaebde2f
Merge pull request #9203 from ChazJin/gd32e10x
Add GD32_E103VB as new target
2019-01-14 08:31:49 +00:00
c_jin 4d9c4343a0 Support boot stack size configuration option 2019-01-11 18:04:56 +08:00
Przemyslaw Stekiel 14f6cddc6f [GigaDevice] Support boot stack size configuration option(GD32_F450ZI) 2019-01-11 09:51:39 +01:00
c_jin 75d4705d60 adjust directory structure for device 2019-01-11 09:54:47 +08:00
c_jin c9ec3632ce Add GD32_E10X as new target 2019-01-11 09:44:22 +08:00
Cruz Monrreal 2454b25eba
Merge pull request #9092 from mprse/stack_unification_sec_try
Interrupt stack size unification + test
2019-01-10 16:08:44 -06:00
c_jin 970bc24c1c adjust directory structure for device 2019-01-09 19:03:34 +08:00
c_jin be65ebd038 add SPDX indentifier, modify 450zi.icf file and static definition in us_ticker.c 2019-01-09 19:03:33 +08:00
c_jin 04c0e4fe5c add button definitions 2019-01-09 19:03:33 +08:00
c_jin c31ecd8e40 modify the 'INITIAL_SP' for GD32F450ZI 2019-01-09 19:03:33 +08:00
c_jin 5a1108e742 Add GD32_F450ZI as new target 2019-01-09 19:03:33 +08:00
Przemyslaw Stekiel 4ee9378297 [GigaDevice] Support boot stack size configuration option 2019-01-08 15:32:07 +01:00
Alastair D'Silva aa80b7c70a Don't use define checks on DEVICE_FOO macros (partner code)
The DEVICE_FOO macros are always defined (either 0 or 1).

This patch replaces any instances of a define check on a DEVICE_FOO
macro with value test instead.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
2018-12-20 20:02:29 +11:00
c_jin 6ac625d474 Style Format for GD32F30x standard peripheral files 2018-12-07 17:00:10 +08:00
c_jin 881561ac5e Error resolve, bug fix and 2 new targets information add
1. Resolve the Error: L6218E: Undefined symbol flash_get_erase_value
2. Bug fix (ADC, USART, etc.)
3. Modify the wrong name (TATGET_GigaDevice-->TARGET_GigaDevice)
4. Add new targets (GD32-F450ZI and GD32-E103VB) support to target.json
5. Add INITIAL_SP macro for GD32-F450ZI and GD32-E103VB
2018-12-06 19:43:20 +08:00
c_jin 62e34ecb38 Add SPDX identifier 2018-11-21 11:38:53 +08:00
c_jin 5a15f810a6 Error modification 2018-11-19 09:41:17 +08:00
chao_king 36a27326c2
Delete startup_gd32f30x_cl.s 2018-11-18 20:37:22 +08:00
chao_king 2b90f34ed7
Delete startup_gd32f30x_cl.s 2018-11-18 20:37:06 +08:00
chao_king db27eab41c
Delete startup_gd32f30x_cl.s 2018-11-18 20:36:43 +08:00
chao_king 612662117c
Delete startup_gd32f30x_cl.s 2018-11-18 20:36:00 +08:00
chao_king b6e455c428 Add it to replace startup_gd32f30x_cl.s 2018-11-18 19:31:45 +08:00
chao_king 16ff28db31 Add it to replace startup_gd32f30x_cl.s 2018-11-18 19:31:45 +08:00
chao_king 0728dde170 Add it to replace startup_gd32f30x_cl.s 2018-11-18 19:31:45 +08:00
chao_king c8cadd6f12 Add it to replace startup_gd32f30x_cl.s 2018-11-18 19:30:32 +08:00
chao_king d2779a6a3b Delete a button definition 2018-11-18 19:30:32 +08:00
chao_king 1afb50d7a7 Re add target support for GD32F307VG
1. Mainly change TARGET_Gigadevice --> TARGET_GigaDevice
2. Add license header
2018-11-18 19:26:04 +08:00