Commit Graph

896 Commits

Author SHA1 Message Date
Nathan Hartman
4716fc929d arch/stm32h7 - Fix HEAP clobbering static data in SRAM4
Normally, statically allocated data goes in .bss, followed by the
initial stack, followed by HEAP. However, any data that is statically
allocated in SRAM4 with __attribute__ ((section (".sram4"))) will
clobber, and be clobbered by, the HEAP.

On STM32H7, BDMA can only access SRAM4. Therefore any BDMA buffers (or
any other data) placed in SRAM4 will expose this problem. In one case,
this manifested as a failure of NSH to start, because the SPI6 BDMA
buffers clobbered the /dev/console inode structs, which the OS
allocated earlier.

This PR ensures that only the rest of SRAM4, after any static data, is
added to the heap. This PR also allows SRAM4 to be completely excluded
from the heap by a new Kconfig, CONFIG_STM32H7_SRAM4EXCLUDE, similar
to what CONFIG_STM32H7_DTCMEXCLUDE does for the DTCM region.

Change required in linker scripts:

Every STM32H7 linker script must replace this:

    .sram4 :
    {
    } > sram4

with this:

    .sram4_reserve (NOLOAD) :
    {
        *(.sram4)
        . = ALIGN(4);
        _sram4_heap_start = ABSOLUTE(.);
    } > sram4

or link will fail with: undefined reference to '_sram4_heap_start'.

The Release Notes should document this for users with out-of-tree
boards.

arch/arm/src/stm32h7/Kconfig:

    * Add config STM32H7_SRAM4EXCLUDE to allow excluding all of SRAM4
      from the HEAP.

arch/arm/src/stm32h7/stm32_allocateheap.c:

    * Only when including SRAM4 in the heap, define HAVE_SRAM4,
      SRAM4_START, SRAM4_END, and SRAM4_HEAP_START.

    * Add "Private Data" section.

    * Add extern for_sram4_heap_start, which must be defined in the
      board's linker script.

    * arm_addregion(): Only add SRAM4 to the heap when configured to
      do so, i.e., unless CONFIG_STM32H7_SRAM4EXCLUDE is defined, and
      only add the portion of SRAM4 that is past any static data.

boards/arm/stm32h7/nucleo-h743zi/scripts/flash.ld:
boards/arm/stm32h7/nucleo-h743zi/scripts/kernel.space.ld:
boards/arm/stm32h7/nucleo-h743zi2/scripts/flash.ld:
boards/arm/stm32h7/stm32h747i-disco/scripts/flash.ld:
boards/arm/stm32h7/stm32h747i-disco/scripts/kernel.space.ld:

    * Update all in-tree STM32H7 board linker scripts as described in
      "Change required in linker scripts" above.

Testing:

    * Successfully built all of the following configurations:

      nucleo-h743zi2:jumbo
      nucleo-h743zi2:nsh
      nucleo-h743zi:nxlines_oled
      nucleo-h743zi:elf
      nucleo-h743zi:otg_fs_host
      nucleo-h743zi:nsh
      nucleo-h743zi:netnsh
      nucleo-h743zi:pwm
      stm32h747i-disco:nsh

    * Tested with custom board.

    * nxstyle.

References:

[1] See the dev@nuttx.a.o mailing list discussion started 2021/03/25:
    "How to ensure HEAP will not overlap static DMA buffer?"
    https://lists.apache.org/thread.html/recf2bb9043f8c9f53c10917e2adb2ec64fe35dc5e6f9a695a7ac6ecc%40%3Cdev.nuttx.apache.org%3E

[2] See arm_addregion() in arch/arm/src/stm32h7/stm32_allocateheap.c

Thanks to Gregory Nutt and David Sidrane for suggestions and reviews.
2021-03-30 17:22:46 -03:00
raiden00pl
eced2779b6 boards/nucleo-f446re: register button 2021-03-30 01:15:23 -05:00
Roberto Bucher
590ee65fa7 Integration of pysimCoder with NUTTX 2021-03-29 21:38:58 -03:00
Brennan Ashton
4851d232c0 usbhost: Do not disable usb monitor if usb host is enabled but dev is not 2021-03-28 23:34:01 -05:00
Brennan Ashton
ffe5ac7c45 board: Add support for nucleo-h743i2 2021-03-28 23:28:49 -05:00
Alin Jerpelea
32894cda1c arch: arm: sam: fix Mixed Case Errors
fix Mixed Case Errors to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-28 13:34:50 -07:00
Abdelatif Guettouche
ed8fb9d96e boards: Refresh configs to add CONFIG_BCH when necessary.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-03-23 21:01:56 -03:00
Roberto Bucher
9a2cb311a3 File for the integration of pysimCoder with NUTTX 2021-03-23 20:37:56 -03:00
Xiang Xiao
0bbb720be2 boards/arm/imxrt: Fix nxstyle warning in imxrt1060-evk/src/imxrt_boot.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-03-23 13:57:31 +01:00
Masayuki Ishikawa
9cce09e58a boards: Remove SCHED_INSTRUMENTATION from all SMP related configs
Summary:
- This commit removes SCHED_INSTRUMENTATION which has been used
  to debug NuttX SMP kernel

Impact:
- None

Testing:
- Tested with ostest

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-03-22 19:47:56 -07:00
Alin Jerpelea
fe64ed54b9 boards: arm: stm32: fix Mixed case identifier
Mixed case identifier fix to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
ee0861ae7a arch: arm: fixes for nxstyle errors
Nxstyle error fixes to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
1863dca88a boards: Author David Sidrane: update licenses to Apache
David Sidrane has submitted the ICL and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Xiang Xiao
e14c458747 mm/heap: Move semaphore related declaration to private header
since other subsystem doesn't need call these function anymore

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Idfb217c412db62d9f17f427310b75bb78785dc50
2021-03-22 15:35:32 +01:00
Alin Jerpelea
b8175f2841 boards: nxstyle fixes
nxstyle fixes to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-20 19:22:58 -07:00
Alin Jerpelea
8843d0f55b boards: Author Sebastien Lorquet: update licenses to Apache
Sebastien Lorquet has submitted the ICL and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-20 19:22:58 -07:00
Alin Jerpelea
e8e2a0875a boards: Alan Carvalho de Assis: update licenses to Apache
Alan Carvalho de Assis has submitted the ICL and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-20 19:22:58 -07:00
Alin Jerpelea
1ad3a22ad5 board: stm32: Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-20 19:22:58 -07:00
raiden00pl
8bf3c5efb9 boards/stm32: add initial support for b-g431b-esc1 board 2021-03-20 21:07:20 -03:00
Xiang Xiao
a0fae8c4d6 boards/arm/stm32l4: Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-03-20 09:58:01 +01:00
Gregory Nutt
2775cadcd2 Increase the system timer rate:
-CONFIG_USEC_PER_TICK=10000
+CONFIG_USEC_PER_TICK=1000

A system timer with a 10 MS period is not sufficient to run the dual thread sporadic scheduler test since the timings in that test are also around 10 MS.  Apparently there is a race condition when both sporadic thread's budgets complete on the same clock time.  This change does not eliminate the race, but reduces its effect greatly.
2021-03-19 23:18:28 -07:00
Alin Jerpelea
aa66d91604 boards: nxstyle fixes
nxstyle fixes to pass CI.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-19 23:01:46 -07:00
Alin Jerpelea
a255a2794b boards: Alan Carvalho de Assis: update licenses to Apache
Alan Carvalho de Assis has submitted the SGA and we can migrate the
 licenses to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-19 23:01:46 -07:00
Alin Jerpelea
b8b7144041 boards: stm32f7: fix Mixed case identifier errors
Fix the Mixed case identifier errors found on stm32f7 family

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-19 23:01:46 -07:00
Alin Jerpelea
66d312985c boards: sama5: fix Mixed case identifier errors
Fix the Mixed case identifier errors found on sama5 family

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-19 23:01:46 -07:00
Alin Jerpelea
3ce3b1e1c5 boards: lpc54xx: fix Mixed case identifier error
Fix the Mixed case identifier errors found on lpc54xx family

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-19 23:01:46 -07:00
Alin Jerpelea
c2dd3832b3 boards: lpc31xx: fix Mixed case identifier error
Fix the Mixed case identifier errors found on lpc31xx family

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-19 23:01:46 -07:00
Xiang Xiao
2e887a1c22 board/arm/mbed: Fix the typo error
regression by:
commit 6f14299dd0
Author: Alin Jerpelea <alin.jerpelea@sony.com>
Date:   Thu Mar 18 09:57:48 2021 +0100

    boards: nxstyle fixes

    nxstyle fixes to pass the CI check

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-03-19 08:49:59 -07:00
Gregory Nutt
ca3925e531 Add configuration for testing the Sporadic Scheduler.
This PR is the companion to #apache/incubator_nuttx_apps/620 .  See that PR for further information.

No impact is anticipated

Tested using the (new) stm32f4discovery:sporadic configuration.
2021-03-19 16:31:35 +01:00
Alin Jerpelea
6f14299dd0 boards: nxstyle fixes
nxstyle fixes to pass the CI check

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-18 22:58:27 -07:00
Alin Jerpelea
40cd67eee6 boards: arm: Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-18 22:58:27 -07:00
Michael Jung
2dbfa54150 stm32l5: Optional LSE xtal drive strength ramp-up
Ported from stm32f7/h7: If configured this way, ramp-up the LSE crystal
oscillator driving strength until the LSE starts up.

Signed-off-by: Michael Jung <mijung@gmx.net>
2021-03-18 19:59:41 -07:00
Jiuzhu Dong
59eb4fa8d6 fs: delete NFILE_DESCRIPTORS for allocating dynamically
Change-Id: Id06d215063796d222b9792d25ab2d6742167729f
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-17 06:46:42 -07:00
YAMAMOTO Takashi
4494a2a501 boards/arm/samv7/samv71-xult/src/sam_bringup.c: CONFIG_BCH 2021-03-17 01:25:16 -07:00
YAMAMOTO Takashi
dd86f7d461 boards/arm/samv7/same70-xplained/src/sam_bringup.c: CONFIG_BCH 2021-03-17 01:25:16 -07:00
YAMAMOTO Takashi
ed10984e06 boards/arm/sama5/sama5d4-ek/src/sam_at25.c: CONFIG_BCH 2021-03-17 01:25:16 -07:00
YAMAMOTO Takashi
19edcab554 boards/arm/stm32l4/stm32l476vg-disco/src/stm32_appinit.c: CONFIG_BCH 2021-03-17 01:25:16 -07:00
Gustavo L F Walbon
f616c72ee2 lpc17xx_40xx/mbed : refresh defconfig
The toolchain used was the buildroot instead of the current the GNU as
default.

Signed-off-by: Gustavo L F Walbon <gustavowalbon@gmail.com>
2021-03-16 19:40:24 -07:00
Michael Jung
b3ab373f3a stm32l5: Fix findings with latest nxstyle
Fix some incorrect relative file paths in ASF headers found with the
latest version of nxstyle.

Signed-off-by: Michael Jung <mijung@gmx.net>
2021-03-16 12:04:00 -07:00
Michael Jung
9b679a7860 stm32l562e-dk: Board Support
Support for the STMicroelectronics STM32L562E-DK development board. This
is a proof-of-concept port that demonstrates running NuttX as the
Non-Secure TrustZone domain companion to TrustedFirmware-M.

Signed-off-by: Michael Jung <mijung@gmx.net>
2021-03-16 12:04:00 -07:00
Michael Jung
70c9d38437 nucleo-l552ze: Board Support
Support for the STMicroelectronics NUCLEO-L552ZE-Q development board.

Signed-off-by: Michael Jung <mijung@gmx.net>
2021-03-16 12:04:00 -07:00
Yuichi Nakamura
5699dd86eb boards/raspberrypi-pico: Pico Display Pack (ST7789 LCD) support 2021-03-16 06:35:04 -03:00
raiden00pl
8cf752db55 nucleo-f446re: refactor bringup logic for consistency with other boards 2021-03-15 09:12:29 -07:00
raiden00pl
16a0b8ab94 nucleo-f446re: move clock configuration to board.h for consistency with other boards 2021-03-15 09:12:29 -07:00
raiden00pl
dab6140082 nucleo-f302r8: refactor bringup logic for consistency with other boards 2021-03-15 09:12:29 -07:00
Masayuki Ishikawa
d6badc32b3 boards: sam4cmp-db: Fix style warnings in sam4cmp-db.h
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-03-14 22:23:05 -07:00
Masayuki Ishikawa
2b1b0a188d boards: arm: Author Masayuki Ishikawa: Update license to Apache
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-03-14 22:23:05 -07:00
Alan C. Assis
837fa3c0ac stm32f4discovery: Add support to LCD1602 2021-03-14 20:14:40 -07:00
Alan C. Assis
0fb2059fd9 stm32/common: Common LCD1602 based on PCF8574 Backpack 2021-03-14 20:14:40 -07:00
Alan C. Assis
43bce6d9b0 stm32f4discovery: Add support to LCD ST7789 2021-03-14 20:05:33 -07:00