Commit Graph

16107 Commits

Author SHA1 Message Date
David Sidrane
68b11c9fed stm32h7:serial fix coding standard violation 2020-08-06 01:03:34 -05:00
David Sidrane
acb90ea449 stm32f7:serial fix coding standard violation 2020-08-06 01:03:34 -05:00
David Sidrane
7ef4f53dff stm32f0l0g0:serial_v2 fix coding standard violation 2020-08-06 01:03:34 -05:00
David Sidrane
ed51cbee18 stm32f0l0g0:serial_v1 fix coding standard violation 2020-08-06 01:03:34 -05:00
David Sidrane
579fbe2e52 stm32l4 serial:Add SINGLEWIRE PUSHPULL option 2020-08-06 01:03:34 -05:00
David Sidrane
48c81522f9 stm32h7 serial:Add SINGLEWIRE PUSHPULL option 2020-08-06 01:03:34 -05:00
David Sidrane
d61f14dd3c stm32f7 serial:Add SINGLEWIRE PUSHPULL option 2020-08-06 01:03:34 -05:00
David Sidrane
156024671e stm32f0l0g0 serial:Add SINGLEWIRE PUSHPULL option 2020-08-06 01:03:34 -05:00
David Sidrane
749dbce431 stm32 serial:Add SINGLEWIRE PUSHPULL option 2020-08-06 01:03:34 -05:00
Johannes Schock
a32912040f Several nxstyle fixes. 2020-08-05 08:55:54 -03:00
Johannes Schock
c760db7fd0 Kinetis K28 USBHS USB-Host. 2020-08-05 08:55:54 -03:00
Gregory Nutt
d09f6aaa72 Correct more improper use of malloc(), zalloc(), and free()
malloc() and free() should never be used within the OS. This will work in the FLAT build because there is only a single heap, but will cause problems in PROTECTED and KERNEL build modes where there are separate heaps for user and kernel memory.

Typically kmm_malloc(), kmm_zalloc(), and kmm_free() should be called within the kernel in those build modes to use the kernel heap.

Memory is never free.  Possible memory leak:

    ./boards/arm/cxd56xx/common/src/cxd56_crashdump.c:  pdump = malloc(sizeof(fullcontext_t));

Memory allocated with malloc(), but freed with kmm_free():

    ./drivers/usbhost/usbhost_composite.c:  cfgbuffer = (FAR uint8_t *)malloc(CUSTOM_CONFIG_BUFSIZE);

Memory is never freed in these cases.  It is allocated in the driver initialization logic, but there is no corresponding uninitialization logic; memory is not freed on error conditions:

    ./arch/arm/src/lc823450/lc823450_i2s.c:  priv = (struct lc823450_i2s_s *)zalloc(sizeof(struct lc823450_i2s_s));
    ./arch/arm/src/sam34/sam_spi.c:  spics = (struct sam_spics_s *)zalloc(sizeof(struct sam_spics_s));
    ./arch/arm/src/sama5/sam_spi.c:  spics = (struct sam_spics_s *)zalloc(sizeof(struct sam_spics_s));
    ./arch/arm/src/samv7/sam_spi.c:  spics = (struct sam_spics_s *)zalloc(sizeof(struct sam_spics_s));

Memory is allocated with zalloc() but freed on error conditions with kmm_free():

    ./arch/arm/src/sama5/sam_ssc.c:  priv = (struct sam_ssc_s *)zalloc(sizeof(struct sam_ssc_s));
    ./arch/arm/src/samv7/sam_ssc.c:  priv = (struct sam_ssc_s *)zalloc(sizeof(struct sam_ssc_s));
    ./arch/arm/src/stm32/stm32_i2s.c:  priv = (struct stm32_i2s_s *)zalloc(sizeof(struct stm32_i2s_s));

Memory is never freed:

    ./drivers/spi/spi_bitbang.c:  priv = (FAR struct spi_bitbang_s *)zalloc(sizeof(struct spi_bitbang_s));
2020-08-04 20:41:43 +01:00
Gregory Nutt
2dae970ec6 Fix cases where memory is allocated using malloc()
arch/arm/src/cxd56xx/cxd56_gnss.c, arch/arm/src/xmc4/xmc4_spi.c,
 crypto/blake2s.c, drivers/lcd/pcf8574_lcd_backpack.c, drivers/lcd/st7032.c

User space memory should not be used within the OS and, when it is absolutely necessary to use user-space memory, it should be allocated using kumm_malloc().
2020-08-04 20:40:57 +01:00
YAMAMOTO Takashi
0b90ad3dd4 arch/sim/src/sim/up_exit.c: Appease a clang-check warning
clang-check complained like the following.
While this is not a real bug, it's easy to appease.

sim/up_exit.c:68:21: warning: Value stored to 'tcb' during its initialization is never read
  FAR struct tcb_s *tcb = this_task();
                    ^~~   ~~~~~~~~~~~
1 warning generated.
2020-08-03 22:52:31 -05:00
Masayuki Ishikawa
16cd363cb0 arch: lc823450: Replace license header with Apache License 2.0
Summary:
- This commit replaces license header under lc823450

Impact:
- No impact

Testing:
- Build check only

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-03 21:03:41 +01:00
Xiang Xiao
2a2dd35339 arch/sim: Fix warning: implicit declaration of function ‘pthread_yield’
https://stackoverflow.com/questions/32174861/why-implicit-declaration-of-pthread-yield-with-lpthread-while-all-ok-with-pthr

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-01 14:31:49 +09:00
Alan C. Assis
c06d3e1b0a xtensa/esp32: Add SPI Flash device driver
ESP32 runs code in a SPI Flash, so users can also use it to store
data directly or mount some parts into a filesystem.

The SPI Flash usually use SPI0.

This driver was implemented by Dong Heng dongheng@espressif.com
and modified to fix coding style by Alan Carvalho de Assis.
2020-07-31 23:37:30 +01:00
Masayuki Ishikawa
4ea94c67b1 arch: lc823450: Fix style violations
Summary:
- Fix style violations under lc823450

Impact:
- Some APIs were changed but all files are included

Testing:
- Build check only

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-30 20:53:02 -05:00
Masayuki Ishikawa
336bd8c3a2 arch: lc823450: Fix style violations
Summary:
- Fix style violations under lc823450
- NOTE: still some files need to be fixed

Impact:
- Some register naming were changed but all files are included

Testing:
- Build check only

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-30 00:07:31 -05:00
Masayuki Ishikawa
22a9b497b1 arch: lc823450: Fix style violations in lc823450_syscontrol.h
Summary:
- Fix style violations in lc823450_syscontrol.h

Impact:
- This commit affects register naming in syscontrol.
- So some files such as lc823450_start.c lc823450_mux.c were also changed.

Testing:
- Build check only

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-30 00:07:31 -05:00
Xiang Xiao
b330b3ac0c arch/sim: Fix the linkage of up_irqinitialize mismatch
include/arch/irq.h💯20: note: previous declaration with ‘C++’ linkage
  100 | static inline void up_irqinitialize(void)
      |                    ^~~~~~~~~~~~~~~~
In file included from include/ctype.h:45,
                 from include/libcxx/ctype.h:38,
                 from include/libcxx/cctype:38,
                 from include/libcxx/cwctype:53,
                 from include/libcxx/cwchar:106,
                 from include/libcxx/string:510,
                 from libcxx/src/debug.cpp:13:
include/nuttx/arch.h:1343:6: error: conflicting declaration of ‘void up_irqinitialize()’ with ‘C’ linkage
 1343 | void up_irqinitialize(void);
      |      ^~~~~~~~~~~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I0e0963a3465f9dabdaca6534a55b9c2c41f4bc64
2020-07-30 12:50:39 +09:00
Xiang Xiao
28eed285c8 sched: The secondary idle threads should call nx_idle_trampoline
because nx_task_idle doesn't call sched_note_start. To avoid the
same error happen again in the furture, nx_task_idle is removed.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-29 16:03:13 +09:00
Xiang Xiao
7a32a396b0 arch/sim: Move share memory allocation to up_hostmemory.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-28 15:41:19 +01:00
Alan C. Assis
cb1d11a499 ESP32: Add driver support to I2C
This driver was implemented by Dong Heng <dongheng@espressif.com>
and modified to fix coding style by Alan Carvalho de Assis.

Co-authored-by: Abdelatif Guettouche <abdelatif.guettouche@gmail.com>
2020-07-28 14:31:55 +01:00
Masayuki Ishikawa
904ec767f7 arch: lc823450: Fix nxstyle violations
Summary:
- This PR fixes style violations for lc823450.
- NOTE: I will fix more style violations in separate PR later.

Impact:
- No impacts.

Testing:
- I checked build test only.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-28 06:07:31 -05:00
SPRESENSE
e249a2f82f Makefile: Fix Make.dep not updated by config changes
Make.dep file should be updated by .config changed after first make.
There are 2 cases affected for this problem:

 1) Add source files by config symbol
 2) Include header files in #ifdef directive

These 2 cases may not be included in Make.dep and this may prevent the
differential build from working correctly.
2020-07-28 03:59:45 -05:00
SPRESENSE
d560ce65ff cxd56xx: spresense: Add some improvements and fix bugs for Spresense board
- Add new functions of GNSS
- Support the lower PWM frequency
- Add CONFIG_CPUFREQ_RELEASE_LOCK
- Add high speed ADC support
- Add HPADC input gain configuration
- Add eMMC device
- Frame buffer support
- Fix SD/GNSS/sensor drivers not worked
- Build errors
- Fix nxstyle issues
2020-07-28 09:13:05 +02:00
Xiang Xiao
78862c51dc arch/sim: Fix the wrong sleep time calculation in sim_idle_trampoline
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-28 08:37:19 +09:00
Xiang Xiao
53f33a7ea2 arch/sim: Synchronize the creation of idle thread by semaphore
it's wrong to synchronize with mutex here

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-28 08:37:19 +09:00
Xiang Xiao
71a9d2402d arch/sim: Replace sigprocmask with pthread_sigmask in main thread
like other idle thread

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-28 08:37:19 +09:00
Xiang Xiao
f2446ecb90 arch/sim: unify the prefix(g_cpu_) for SMP related variables
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-28 08:37:19 +09:00
Masayuki Ishikawa
a58193aa9a arch: imxrt: Fix style violations in imxrt_enet.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-26 21:49:52 -07:00
Masayuki Ishikawa
9079d48646 arch: imxrt: Fix auto negotiation for KSZ8081 PHY
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-26 21:49:52 -07:00
Xiang Xiao
cc00d2b2b0 arch/sim: Call sched_note_cpu_* when SCHED_INSTRUMENTATION equal true
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-26 12:24:57 +01:00
Johanne Schock
8792ade0fe Several USB improvements.
Kinetis: Reworked USB driver for setup out data phase.
Freedom K28: New config nshsdusb, with RNDIS support
PL2303: Try to avoid clone detection.
General: various nxstyle fixes
General: license changed
2020-07-24 13:24:53 -03:00
Nakamura, Yuuichi
02718f0827 Syscall instrumentation build system support for Arm and RISC-V 2020-07-22 12:01:40 -05:00
Oleg
fd220e7a6c arch/arm/src/stm32f7/stm32_dma.c: fix debug ifdef 2020-07-22 13:37:02 +01:00
Xiang Xiao
b4b413e2f4 arch/arm/src/arm/Toolchain.defs: Append "-P -x c" for CPP macro
like other Toolchain.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-21 22:11:34 -07:00
Xiang Xiao
5efa93ec26 arch/Toolchain.defs: Change all ARCROSSDEV to CROSSDEV
ARCROSSDEV always equals to CROSSDEV, so it is no reason to keep ARCROSSDEV.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-20 23:50:59 -07:00
Alan C. Assis
ba274b999e Fix small formatting issues caused by VIM macro edition 2020-07-20 21:02:41 +01:00
raiden00pl
4152193e0a arch/arm/src/nrf52: add support for TIMER lowerhalf 2020-07-20 17:11:11 +01:00
Xiang Xiao
b329e2377d boards: Move toolchain related variables to Toolchain.defs
1.It make sense to let Toolchain.defs give the default value
2.The board can still change if the default isn't suitable
3.Avoid the same definition spread more than 200 Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic2649f1c7689bcf59c105ca8db61cad45b6e0e64
2020-07-20 17:10:37 +01:00
Xiang Xiao
7c54f51dc0 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-19 19:35:21 -07:00
Xiang Xiao
e1ecb3e27c libc: Don't define localtime[_r] to macro when CONFIG_LIBC_LOCALTIME not define
since libc++ declare these function in ctime by:
using ::localtime[_r];

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic0bb68b44c0cab838ab7cc34baee2aaa3ca8a9b5
2020-07-19 19:35:21 -07:00
Xiang Xiao
47f2090410 arch: Change --print-file-name=libgcc.a to --print-libgcc-file-name
Since the new option is more compatible with clang

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-19 18:26:31 -07:00
Alan C. Assis
79a3fd1932 ESP32: Add driver support to SPI Master and Slave
This driver was implemented by Dong Heng <dongheng@espressif.com>
and modified to fix coding style by Alan Carvalho de Assis.
2020-07-19 21:26:58 +01:00
Brennan Ashton
8319078887 AVR: Remove warning pragma from SPI freq function
The function for updating the spi frequency included a #warning
pragma because the divider registers are computed but not used
it is not clear what needs to be done here to implement this
but the warning has been removed and replaced with a comment
in the function.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-07-19 15:49:13 -03:00
Brennan Ashton
ff6e2e7b7d AVR: Fix warnings from pointer casts and prototype
There was broken logic around serial initialization function
prototype.  Pointers were also being cast directly to uint32
without first being cast to uintptr.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-07-19 15:49:13 -03:00
Xiang Xiao
d6827cab60 arch: up_assert shouldn't call exit directly
since exit will be only callable from userspace and change
the 1st argument from "const uint8_t *" to "const char *"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I86487d57210ab63109148232da71dbc4d60a563b
2020-07-19 01:21:36 +01:00
raiden00pl
774ea6eae7 arch/arm/src/nrf52: add a low-level RTC interface 2020-07-18 20:00:52 +01:00
raiden00pl
7db61992f9 arch/arm/src/nrf52: add a low-level TIMER interface 2020-07-18 20:00:52 +01:00
Anthony Merlino
f91372c09d stm32_tickless.c: Fix formatting issues. 2020-07-18 12:23:05 -05:00
Anthony Merlino
e5be32ac21 arch/stm32f7: Fixes bug in tickless driver where the compare register is set to a value less than the current time. 2020-07-18 12:23:05 -05:00
Adam Feuer
85811957c9 implement system reset on SAMA5D27
- makes nsh reboot command work

Squashed commit of the following:

commit 5193f6ae9623bfb4d3bed4ecf3d0fb9ae1bfb6e8
Author: Adam Feuer <adam@starcat.io>
Date:   Thu Jul 16 16:41:54 2020 -0700

    removed conflict tag that was missed

    - result of an incorrectly fixed bad merge

commit 731108ea7495655e96e516448887ca8c9ab354d1
Author: Adam Feuer <adam@starcat.io>
Date:   Thu Jul 16 16:12:30 2020 -0700

    implement system reset to make nsh reboot work

    Squashed commit of the following:

    commit 245d155cc58d31af412f2b832877736b2088b896
    Author: Adam Feuer <adam@starcat.io>
    Date:   Thu Jul 16 16:10:10 2020 -0700

        add Kconfig setting for system reset

    commit e7d5def8151821bf359c55c05ba1f59421b2371a
    Author: Adam Feuer <adam@starcat.io>
    Date:   Thu Jul 16 15:51:35 2020 -0700

         implement system reset to make nsh reboot work
2020-07-17 13:32:22 +01:00
Adam Feuer
65a866fbe2 support for SAMA5D27 SDMMC peripheral
- MMC and SD Card driver
- ported from imxrt_usdhc.c

Squashed commit of the following:

commit 46cbe18ad6a6e41ec2727d839f86f5670577878a
Author: Adam Feuer <adam@starcat.io>
Date:   Wed Jul 15 10:28:02 2020 -0700

    nxstyle change - Public Function Prototypes

    - instead of Public Functions

commit 486b7b62e83a78ae15b114e34846900d8fef8248
Author: Adam Feuer <adam@starcat.io>
Date:   Wed Jul 15 10:06:51 2020 -0700

    nxstyle changes

commit 28280d585a40aac99fd0e538295828ea013739b7
Author: Adam Feuer <adam@starcat.io>
Date:   Wed Jul 15 10:06:29 2020 -0700

    removing unused enum value

commit 7da6ba437e7e023d348e63c497732fea985a2d1b
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 21:17:49 2020 -0700

    CI build error fixes

    - unused vars
    - incorrect method calls

commit 145a73449b9d1eaed8a6cbf47cb53fb5b7a551f6
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 17:29:56 2020 -0700

    adding #defines to prevent unused var warning

commit 47ed2c08235816caded26a019cf33899daed1621
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 16:29:07 2020 -0700

    removing obsolete config values

commit b43f129c03a8bb8dc57ae6984d124ce9e9306196
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 09:58:42 2020 -0700

    removed obsolete config setting

commit 23e3af846ac24cac928442c7af86c5d0ef183ad3
Merge: 8b47330fe5 6f6d61eec4
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 09:53:12 2020 -0700

    Merge remote-tracking branch 'upstream/master' into feature/sama5d27-sdmmc-support

commit 8b47330fe5bb49bbd1991f2f3e2c69bdfb833d2c
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 09:51:56 2020 -0700

    replaced license headers with Apache License 2.0

commit 865e69b9a84d077ab9e05c2056dc7a515222c6c7
Author: Adam Feuer <adam@starcat.io>
Date:   Thu Jul 9 18:38:01 2020 -0700

    SAMA5D2x SDMMC peripheral support (SD Card driver)

    - reading and writing at 25 MHz and 50Mhz
    - UHS_SDR50, UHS_DDR50, and UHS_SDR104 are supported
    - ported from imxrt_usdhc.c
    - only tested on SAMA5D27

    Squashed commit of the following:

    commit e3122baef2feaeb32bb00798ae56310b2cc5c448
    Author: Adam Feuer <adam@starcat.io>
    Date:   Thu Jul 9 18:30:03 2020 -0700

        added sdmmcnsh defconfig and basic docs

    commit 12a290d7465a0a006473ba67893bf891a7bcea83
    Author: Adam Feuer <adam@starcat.io>
    Date:   Thu Jul 9 17:50:06 2020 -0700

        nxstyle changes

    commit 33409c0f63c328dc200150ba883327cadf0300b2
    Author: Adam Feuer <adam@starcat.io>
    Date:   Thu Jul 9 16:15:00 2020 -0700

        add short delay to in recvshortcrc

        - to allow SDMMC to respond

    commit 3be7a7fb6f79900042d1fdbef72810f364ac5f62
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Thu Jul 9 10:54:59 2020 -0700

        added SDR50 and SDR104 SDMMC bus modes

    commit 2888408866548ca53e582ea1525178a7733617b4
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Thu Jul 9 10:54:25 2020 -0700

        comment formatting cleanup

    commit 06cf2c39193971155eaa6f9c89a39a88b53964a8
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Thu Jul 9 10:34:01 2020 -0700

        removed unneeded comment

    commit ac89b69231bdf19563754865fda93d4bbbb4488d
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Thu Jul 9 10:30:23 2020 -0700

        code cleanup

        - removing custinfo() logging
        - remove duplicate #defines
        - move var declarations to the beginning of methods

    commit bcd4abec7935ee9023ab72edfb02685dbeee243c
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Wed Jul 8 16:34:31 2020 -0700

        handle SDMA Boundary Pause interrupt (DMAINT)

        - SDMMC_INT_DINT
        - add to waitints
        - add handler to sam_interrupt

    commit e9da026c1270e999df520ee2c60487195799f58c
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Tue Jul 7 16:07:34 2020 -0700

        Kconfig setting for SDMMC bus speed

        - 25 and 50 MHz
        - 50 MHz is the default

    commit 9edc636b7f18f981d653f85970c3af0b80801778
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Mon Jul 6 21:55:51 2020 -0700

        added HSEN bit change for high speed mode

        - above 26 MHz

    commit b8e91c95b0f7b2f8220f02b1eb42b6134e0660d0
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Mon Jul 6 21:28:03 2020 -0700

        added calloc to fix bug

        - not sure why this works.

    commit 1ceaf2f8487fe39d4d6fb21adecd57e4c4992e07
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Mon Jul 6 21:25:47 2020 -0700

        removing spurious typo characters

    commit 14ba51743bcca35686b07a76f5af17bcce078a5f
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 18:10:46 2020 -0700

        nxstyle changes

    commit d8af26df47b7840117de0d3a44ec548b3a72bc2b
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 17:01:11 2020 -0700

        nxstyle changes

    commit 0ae532bd62d02c5ac36aa2192f31fa1f7f1cde99
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 16:37:17 2020 -0700

        remove long lines in comments - nxstyle

    commit 3d025a84f8e9ddb7f7a4570504118d782dd5574c
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 16:36:52 2020 -0700

        removed custinfo logging

    commit 366b5d9d241a42d693583679cb49aa7bf25615aa
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 16:35:08 2020 -0700

        removed custinfo logging

    commit c74396e4a4943873c7de5b6ffee193787c39baef
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 16:34:36 2020 -0700

        fixed typo

    commit 7f51e99d7f4c1e5e0bf71a84fd0b2467157fea59
    Merge: c40f8c1039 2481b1bfd5
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 15:33:06 2020 -0700

        Merge remote-tracking branch 'upstream/master' into feature/sama5d27-sdmmc-support

    commit c40f8c10390ecefeb3a113046edd6740b07ab31b
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Thu Jul 2 22:08:20 2020 -0700

        SDMMC support for SAMA5D27
2020-07-16 23:39:37 +01:00
Pavel Ionut Catalin
954ee9d5f3 Fixed AVR build issues 2020-07-16 15:41:40 -03:00
Xiang Xiao
4910d43ab0 build: Move the toolchain library setting to the common place
so all boards support C++ automatically
2020-07-16 15:38:08 -03:00
Brennan Ashton
aef6f4ae09 Add initial support for the QuickLogic EOS S3
The QuickFeather board added as an initial target.
These featrues are minimally implemented:
  * Clock Configuration -- All clocking registers are defined and
    configuration is used to setup the HSO, M4 Core, and M4 Perif
    clocks.  Additionally some clock debugging is stubbed for
    bringing out clock paths to IO pins.

  * UART -- The lowputc as well as the serial driver is implemnted
    for the single UART device. Currently the configuration is
    hard coded, but uses the proper interfaces to later fill in.

  * SysTick -- The system tick timer is implemented and clocking
    properly. Tickless mode is not yet implemented.

  * Interrupts -- The interrupt system is implemented and verified
    using the UART and SysTick systems.

  * GPIO -- GPIO and IOMUX systems are defined and implemented.
    This is verified using the UART as well as the Arch LED
    system.  The GPIO interupt system is stubbed out but not
    implemented.

  * Arch LEDS -- The blue LED as part of the RGB LED is configured
    and attached to the Arch LED system.  This indicates the device
    coming online as well as when a hardfault is triggered.

Applications and Testing:
  * There is a nsh configuration implemented that includes debug
    features as well as the ostest, getprime, and mem test.
    All of these have been run and verified.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-07-15 11:25:30 +01:00
Dave Marples
bc95500bab Add buttons support to iMXRT1060 2020-07-14 23:34:08 +01:00
Nakamura, Yuuichi
9db5d2aeea Fix nxstyle warnings 2020-07-13 00:46:55 -05:00
Nakamura, Yuuichi
f392d246d3 Fix note driver initialization 2020-07-13 00:46:55 -05:00
Xiang Xiao
dc55968678 arch/sim: Don't construct global C++ objects before main
otherwise the crash will happen because NuttX doesn't initialize yet

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Icc3f3fcd842a315bc68ae436d7a7a04aca1fc546
2020-07-11 15:06:09 -03:00
Xiang Xiao
19aaf7b357 arch/sim: Move the generation of nuttx-names.dat into nuttx target
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I04c612a56caee170742b07f87cea1b7feb4078c5
2020-07-11 15:06:09 -03:00
Xiang Xiao
f36bf5e079 arch/sim: Avoid build nuttx.rel and cleanrel concurrently
make can't guarantee the build order of prerequest with -jn where n > 1

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I772fcc0775d15b385f28fc0abeeff383b3a52622
2020-07-11 15:06:09 -03:00
chao.an
159053ab62 sim/c++: correct the compile flags
fix the following linker error:
nuttx.rel:(.eh_frame+0x93): undefined reference to `__gxx_personality_v0'

Change-Id: I94f43a15275194d42199c91f276e8848ad5189f6
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-07-11 15:06:09 -03:00
Xiang Xiao
9dff16e0e4 fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ieaf325c899d1c349d64dfa15bddcc32afd1fce42
2020-07-10 21:30:02 +01:00
Xiang Xiao
924ba84737 arch: call *_getsp in up_assert and board_crashdump
and remove the static up_getsp

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-09 13:51:09 +01:00
Xiang Xiao
4176a3828b arch/sim: implement sim_getsp
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-09 13:51:09 +01:00
Xiang Xiao
60b7b8b3f0 arch/x86: change up_getsp to x86_getsp
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-09 13:51:09 +01:00
Xiang Xiao
db02cea58c arch/x86_64: Change up_getrsp to x64_getsp
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-09 13:51:09 +01:00
Xiang Xiao
05f6445493 arch: Move *_getsp to the common place arch/arch.h
so other place can get the stack pointer easily

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-09 13:51:09 +01:00
Xiang Xiao
6b316edcda sim: add __cxa_atexit into the name list
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I81e75532db1953584124142763f9d07ddb788898
2020-07-09 15:17:12 +09:00
Beat Küng
a349595316 gpio: extend gpio_pintype_e for pulldown/up and opendrain
- fix code style
- fix bool conversion when calling go_read()
2020-07-07 08:34:25 -05:00
Xiang Xiao
67ef70d460 vfs/dirread: Should return the same file type as lstat
by extend the possible value of d_type for the special file

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-07 13:41:10 +01:00
Xiang Xiao
91ed14c631 vfs/stat: Make the flag defintion more confirm POSIX standard
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-07 13:41:10 +01:00
Gregory Nutt
2481b1bfd5 Do not ignore .asm files that are tracked. 2020-07-04 17:52:42 +01:00
Xiang Xiao
95aa3a11d1 arch/tms570: Remove the unused frac variable
and change the type of divb7 from float32_t to float

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-04 08:31:06 -07:00
Xiang Xiao
993591dca1 arch/x86_64: Fix Warning: ignoring changed section attributes
chip/intel64_head.S: Assembler messages:
chip/intel64_head.S:281: Warning: ignoring changed section attributes for .text
chip/intel64_head.S:485: Warning: ignoring changed section attributes for .bss

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-03 10:20:39 +01:00
Xiang Xiao
b984534255 lib/math: Remove float32 and float64 definition
since they aren't defined by standard and never supported by other POSIX OS

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-02 10:53:34 -03:00
Jari van Ewijk
b84ce844c6 S32K additional style fixes 2020-07-01 13:45:38 +01:00
Jari van Ewijk
3db090a210 S32K - Expand FlexTimer header file and add PWM support 2020-07-01 13:45:38 +01:00
Peter van der Perk
4a40a7c3d7 S32K148EVB netdev lateinit to support Enet & CAN at the same time 2020-06-30 12:46:50 -06:00
Peter van der Perk
eca1011b1e Expose xxx_caninitialize() correctly so it's usable in latedev init when there are multiple net devices 2020-06-30 12:46:50 -06:00
Jari van Ewijk
1306cbc16e S32K additional style fixes 2020-06-30 15:46:15 +01:00
Jari van Ewijk
86c151edf1 S32K Small Fixes:
- Typos / wrong names in s32k14x_irq.h, s32k1xx_memorymap.h and s32k1xx_pcc.h
- Wrong base address for port input disable register in s32k1xx_pin.c
- up_* still had to be changed to arm_* in some places
2020-06-30 15:46:15 +01:00
ligd
36a0978952 arch/risc-v/src/rv32im: update & complete risc-v rv32im arch
1. add schedulesigaction.c
2. add SYS_save_context handling
3. Skip ECALL instruction when up_swint()

Change-Id: Id52c6dd9ee1052441957b73463c00d3fd26555c5
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-06-30 09:31:21 -03:00
Jacob Dahl
b12b3072e8 Added support for STM32F412xx. Tested with the NUCLEO-F412ZG dev board as well as a custom board using the STM32F412CE. 2020-06-29 17:44:35 +02:00
Claudio Micheli
10f93b9d9b stm32l4: extend CAN ioctrl with NART/ABOM. Add RTR to CAN header
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2020-06-29 09:05:44 -03:00
Claudio Micheli
94e87bb6e8 stm32: extend CAN ioctrl with NART/ABOM. Add RTR to CAN header
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2020-06-29 09:05:44 -03:00
Claudio Micheli
7a346bee26 stm32f7: Add the option to include RTR in CAN header
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2020-06-29 09:05:44 -03:00
Beat Küng
f6039bbfa7 stm32f7: add CANIOC_SET_NART and CANIOC_SET_ABOM ioctl's to can driver 2020-06-29 09:05:44 -03:00
Matias Nitsche
861f80e853 stm32l4 RCC: configure flash wait states early, otherwise execution is corrupted when clock is increased before that 2020-06-28 13:25:05 -03:00
Matias Nitsche
c26521c38f stm32l4 dfumode: move initialization point of bootloader jump instruction to correct place 2020-06-26 09:59:40 -03:00
Matias Nitsche
d1c538b65c stm32l4: dfumode style fixes 2020-06-26 09:59:40 -03:00
Matias Nitsche
b4bea95a6a stm32l4: add support for booting into DFU mode 2020-06-26 09:59:40 -03:00
Ouss4
a7fdc4ba03 arch/arm/src/stm32/stm32f40xxx_i2c.c: Fix tracing enumeration.
Values used in the ISR were taken from STM32F7 but the enumeration was
not updated.
2020-06-26 09:51:09 -03:00
YAMAMOTO Takashi
05671fd8f1 vpnkit: set mac address when available
up_vpnkit network driver gets its mac address from the vpnkit.
it isn't available until a successful negotiation with the vpnkit.
2020-06-25 07:27:44 -05:00
YAMAMOTO Takashi
74d13d74b9 sim: Add more names to nuttx-names.in
Some of them are for the recent development. eg. rewind, ftw
Some of them were simply missing. eg. shutdown
2020-06-25 07:26:53 -05:00
Matias Nitsche
1115f0104b stm32l4 oneshot: style fix 2020-06-25 11:04:14 +01:00
Matias Nitsche
3c37d68735 stm32l4 oneshot: assert period > 0, otherwise the timer never fires 2020-06-25 11:04:14 +01:00
Gustavo Henrique Nihei
105d561a51 arch/arm/src/stm32f7: Refactor FMC functions for STM32F7
This refactor is based on the FMC architecture of STM32H7, with the
exception of the board specific definitions.
2020-06-24 10:51:02 -03:00
Gustavo Henrique Nihei
b06722cd7f boards/arm/stm32/stm32f769i-disco: Add support for external SDRAM 2020-06-24 10:51:02 -03:00
chao.an
f5039d0b23 sim: fix compile error caused by race condition
LD: nuttx.rel
objcopy: couldn't open symbol redefinition file nuttx-names.dat
         (error: No such file or directory)
Makefile: 297: recipe for target 'nuttx.rel' failed

Change-Id: Ic78f030b77c3468ddbb96d4fb0558edad3abc3ae
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-24 14:32:22 +01:00
David Sidrane
5cbebda133 kinetis:Ethernet fixed & better interrupt management
When any error was detected the buffers descriptors were
   blindly initialized. This caused the TX of the MAC to
   be in a bad state. The correct thing to do, we disable
   the MAC, init the bufffers and re-eanable the MAC.

   The interrupts were being throlled at the NVIC. This been
   cleaned up.
2020-06-21 14:16:26 -06:00
Huang Qi
a13ebe5975 arch/arm/stm32: Make SysTick as a Tickless clock source option
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2020-06-20 09:10:27 -03:00
David Sidrane
b64060f717 s32k1xx:flexcan clock_systimespec -> clock_systime_timespec 2020-06-19 00:27:52 +01:00
chao.an
6e8cf28e9c nuttx/names: add symbol name preprocessing support
Change-Id: I54e0b24391b6e08801e3f0b1799ed3fcc9188ae7
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-18 07:09:40 -06:00
chao.an
1a59e5ad0f sim/names: add munmap into naming list
Change-Id: Ideb6c538fafda3f031d3a0d976da85917ba64530
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-18 07:09:40 -06:00
chao.an
d96b22ae3c nuttx/names: add getchar into naming list
Change-Id: I04b9283250bd139201b2de766f7f5f30db992434
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-18 07:09:40 -06:00
qiaowei
1ab98da054 nuttx-names.dat: add strstr.
Signed-off-by: qiaowei <qiaowei@xiaomi.com>
Change-Id: Iab4bbe0ea3b12d819c790a4720d3d3c5534ad581
2020-06-18 07:09:40 -06:00
Matias Nitsche
67ab8ebb5f style fixes 2020-06-17 13:17:38 -03:00
Matias Nitsche
b7d18585dc stm32l4: add I2C timings for 48 MHz SYSCLK 2020-06-17 13:17:38 -03:00
Matias Nitsche
fa97e216e4 stm32l4: clocking fixes (would hang for MSI@48MHz on STM32L476) 2020-06-17 13:17:38 -03:00
Peter van der Perk
6a19f03756 FlexCAN C89 Style initialization 2020-06-16 15:35:43 -03:00
Peter van der Perk
ede6225c72 NXStyle fixes 2020-06-16 15:35:43 -03:00
Peter van der Perk
efbe4c89e2 S32K1XX Enhanced EEPROM block device driver 2020-06-16 15:35:43 -03:00
Peter van der Perk
4eecf8561f FlexCAN interrupt fixes, old compiler fixes
SocketCAN old compiler fix
2020-06-16 15:35:43 -03:00
Gregory Nutt
ed9532e31f CONFIG_SCHED_INSTRUMENTATION_SYSCALL should not available if the architecture does not support the required system hook note hooks. 2020-06-16 14:04:53 -03:00
Matias Nitsche
7ce175b614 style fixes 2020-06-16 01:00:45 +01:00
Matias Nitsche
2bdc0c5bc8 stm32l4 ADC: on 47x/48x parts, the ACSR register needs to be configured for ADC inputs to work 2020-06-16 01:00:45 +01:00
Matias Nitsche
9786e3a1a8 style fixes 2020-06-15 23:19:51 +01:00
Matias Nitsche
3f1e89e30f stm32l4 serial fix: clock divider for baud rate was not correctly set 2020-06-15 23:19:51 +01:00
Peter van der Perk
b5c5948e1c NXStyle fixes 2020-06-15 08:07:19 -06:00
Peter van der Perk
5f73dc89be Kinetis: Added FlexCAN driver with SocketCAN support 2020-06-15 08:07:19 -06:00
Peter van der Perk
ff76ef0725 s32k1xx: Added FlexCAN driver with SocketCAN support 2020-06-15 08:07:19 -06:00
chao.an
9153ca538b arch/renesas: fix nxstyle warning
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-15 07:19:41 -06:00
chao.an
332e5481ee arch/stackframe: fix heap buffer overflow
ASAN trace:
...
==32087==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf4502120 at pc 0x56673ca3 bp 0xff9b6a08 sp 0xff9b69f8
WRITE of size 1 at 0xf4502120 thread T0
    #0 0x56673ca2 in strcpy string/lib_strcpy.c:64

0xf4502120 is located 0 bytes to the right of 8224-byte region [0xf4500100,0xf4502120)
allocated by thread T0 here:
    #0 0xf7a60f54 in malloc (/usr/lib32/libasan.so.4+0xe5f54)
    #1 0x5667725d in up_create_stack sim/up_createstack.c:135
    #2 0x56657ed8 in nxthread_create task/task_create.c:125
    #3 0x566580bb in kthread_create task/task_create.c:297
    #4 0x5665935f in work_start_highpri wqueue/kwork_hpthread.c:149
    #5 0x56656f31 in nx_workqueues init/nx_bringup.c:181
    #6 0x56656fc6 in nx_bringup init/nx_bringup.c:436
    #7 0x56656e95 in nx_start init/nx_start.c:809
    #8 0x566548d4 in main sim/up_head.c:95
    #9 0xf763ae80 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18e80)

CALLSTACK:
    #8  0xf79de7a5 in __asan_report_store1 () from /usr/lib32/libasan.so.4
    #9  0x565fd4d7 in strcpy (dest=0xf4a02121 "", src=0xf5c00895 "k") at string/lib_strcpy.c:64
    #10 0x565e4eb2 in nxtask_setup_stackargs (tcb=0xf5c00810, argv=0x0) at task/task_setup.c:570
    #11 0x565e50ff in nxtask_setup_arguments (tcb=0xf5c00810, name=0x5679e580 "hpwork", argv=0x0) at task/task_setup.c:714
    #12 0x565e414e in nxthread_create (name=0x5679e580 "hpwork", ttype=2 '\002', priority=224, stack=0x0, stack_size=8192, entry=0x565e54e1 <work_hpthread>, argv=0x0) at task/task_create.c:143
    #13 0x565e42e3 in kthread_create (name=0x5679e580 "hpwork", priority=224, stack_size=8192, entry=0x565e54e1 <work_hpthread>, argv=0x0) at task/task_create.c:297
    #14 0x565e5557 in work_start_highpri () at wqueue/kwork_hpthread.c:149
    #15 0x565e3e32 in nx_workqueues () at init/nx_bringup.c:181
    #16 0x565e3ec7 in nx_bringup () at init/nx_bringup.c:436
    #17 0x565e3d96 in nx_start () at init/nx_start.c:809
    #18 0x565e3195 in main (argc=1, argv=0xffe6b954, envp=0xffe6b95c) at sim/up_head.c:95

Change-Id: I096f7952aae67d055daa737e967242eb217ef8ac
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-15 07:19:41 -06:00
Xiang Xiao
4fbbd2e3bf arch: Move PRIxMAX and SCNxMAX definition to include/stdint.h
like other related macro(e.g. INTMAX_MIN, INTMAX_MAX...)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8863599960b1a9b1c22ae9c35735a379a4c745b0
2020-06-10 08:24:47 +02:00
Xiang Xiao
7758eb8658 arch: Define INTx_C and UINTx_C macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia50ea8764880fabd3d878c95328632c761be6b43
2020-06-10 08:24:47 +02:00
David Sidrane
7e3c341b15 stm32h7:Fix compiler error stm32_bdma_capable 2020-06-09 20:08:50 +01:00
raiden00pl
8708e34b29 arch/arm/src/nrf52/nrf52_idle.c: disable WFI in up_idle 2020-06-09 13:12:09 +01:00
Huang Qi
2b0324c3bf boards/risc-v/k210/maix-bit: Add initial autoled support
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2020-06-08 10:53:29 +09:00
Huang Qi
bcd7ccc0b5 arch/risc-v/src/k210: Add basic gpiohs support
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2020-06-08 10:53:29 +09:00
Alan C. Assis
d41a2f87f0 Add support to STM32F411CE 2020-06-07 02:29:16 +01:00
Ouss4
a90f657743 arch/arm/src/stm32/stm32_hrtim.c: Fix nxstyle issues. 2020-06-06 15:46:51 -03:00
Ouss4
465a13c2cb arch/arm/src: Return ENOTTY when the ioctl command is not recognized. 2020-06-06 15:46:51 -03:00
David Sidrane
a793369815 stm32h7:DMA Add BDMA support
Apply suggestions from code review

Co-authored-by: Mateusz Szafoni <raiden00pl@gmail.com>
2020-06-06 19:17:15 +01:00
David Sidrane
a254023e74 stm32h7:SPI Locate SPI6 DMA buffers in sram4 2020-06-06 23:05:30 +08:00
David Sidrane
ddf2704915 stm32h7:Kconfig limit STM32H7_SPIn_COMMTYPE range to valid values 2020-06-05 21:07:54 +01:00
YAMAMOTO Takashi
36ae29c21c sim: Fix hostfs errno
Don't forget to convert the host convention (-1/errno) to
the nuttx kernel convention. (negative errno)
2020-06-05 19:49:35 +08:00
Ouss4
871d5c6b72 Fix PR 1188 nxstyle issues 2020-06-05 12:21:43 +08:00
Ouss4
1ca552716c arch/arm/src/stm32/stm32_i2s: Change the initialize function from
stm32_i2sdev_initialize to stm32_i2sbus_initiliaze, to be consistent
with the way other buses are initialized.
The stm32_i2sdev_initiliaze (similar to stm32_spidev_initialize for
example) is a board specific function that does any necessary
initialization that's board depedent.
2020-06-05 12:21:43 +08:00
Ouss4
a30b77cbb9 arch/arm/src/stm32/stm32.h: Include stm32_i2s.h 2020-06-05 12:21:43 +08:00
Ouss4
a098e03005 arch/arm/src/stm32/stm32_i2s.h: file hardware/stm32_i2s.h does not
exist.
2020-06-05 12:21:43 +08:00
Ouss4
1c17e5f3c3 arch/arm/src/stm32/Kconfig: Fix a trivial typo (I2C -> I2S) 2020-06-05 12:21:43 +08:00
Xiang Xiao
b4bd9427f7 arch: Rename _exit to up_exit to follow the naming convention
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2779a2a3ccb5426fe78714fdcc629b8dfbb7aaf6
2020-06-04 22:20:45 +01:00
Xiang Xiao
85b859fb8d arch: _exit should't call nxsched_resume_scheduler twice in SMP mode
utilize the call inside nxtask_exit instead, also move
nxsched_suspend_scheduler to nxtask_exit for symmetry

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I219fc15faf0026e452b0db3906aa40b40ac677f3
2020-06-04 22:20:45 +01:00
Jakob Haufe
c45289eb89 Fix typo in arch/arm/src/lpc17xx_40xx/Kconfig 2020-06-04 16:46:12 +01:00
Jukka Laitinen
fe44ce0f3f arch/arm/src/stm32h7/stm32_spi.c: Corrections for SPI master driver
This fixes the following 3 issues:

1. Wait for send to complete in exchange

Before shutting down the SPI, we have to wait for send to complete; not only
DMA, since DMA just puts data to the SPI fifo. It is not yet out of SPI.

When doing exchange with both send & receive this is not an issue because when
receive dma has completed, it is certain that also the send is.

This can be accomplished by completing the transfer in SPI TXC interrupt
instead of DMA callback.

2. Fix TXDMAEN and RXDMAEN placement

According to the spec, the RXDMAEN must be enabled before
enabling DMA requests for Tx and Rx in DMA registers, and TXDMAEN
after that.

Cleaner place to do this is in spi_dmarxstart and spi_dmatxstart, where
also the dma requests are enabled. This also handles properly the
simplex modes.

3. Remove bus signal glitches when shutting off SPI block

Use AFCNTR to avoid glitches in SPI lines while turning SPI block
on/off during calls to exchange.

Signed-off-by: Jukka Laitinen <jukka.laitinen@intel.com>
2020-06-03 07:06:30 -07:00
Jukka Laitinen
91779e997a arch/arm/src/stm32h7/hardware/stm32h7x3xx_spi.h: Fix nxstyle issues
Signed-off-by: Jukka Laitinen <jukka.laitinen@intel.com>
2020-06-03 07:06:30 -07:00