Commit Graph

38110 Commits

Author SHA1 Message Date
Xiang Xiao
8807a52de6 tools/gencromfs: Change the generated code to Apache license
and ensure the code confirm the coding style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-09 14:43:56 +01:00
Xiang Xiao
4de69080d0 tools/gencromfs: Call dump_nextline immediately after dump_hexbuffer
to handle the temporary file switch correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-09 14:43:56 +01:00
Masayuki Ishikawa
56181c0bdd boards: spresense: Update wifi/defconfig
Summary:
- Add CONFIG_EXAMPLES_TCPBLASTER_GROUPSIZE=500
- Remove CONFIG_EXAMPLES_TCPBLASTER_SERVER_PORTNO=10001
- Add CONFIG_EXAMPLES_TCPBLASTER_TARGET2=y

Impact:
- This commit affects spresense:wifi only

Testing:
- Tested tcpclient and tcpserver

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-09 07:39:43 -05:00
leomarradke
ca62cb6b76 Style fixes 2020-08-08 17:33:24 -03:00
leomarradke
e7073df8d6 arch: samd5e5 : Add watchdog timer drivers.
boards: metro-m4  Add support for starting the watchdog timer on the metro-m4.

Testing:
- Build check only

Signed-off-by: Leomar Mateus Radke  <leomar@falker.com.br>
2020-08-08 17:33:24 -03:00
Xiang Xiao
f618de9c97 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-08 17:30:26 -03:00
Xiang Xiao
4c706771c3 sched/wdog: Replace all callback argument from uint32_t to wdparm_t
and alwasy cast the argument of wd_start to wdparm_t

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-08 17:30:26 -03:00
Masayuki Ishikawa
3b76666a1e drivers: usbdev: Fix default value for RNDIS_NWRREQS
Summary:
- Change default value for RNDIS_NWRREQS based on NET_TCP_WRITE_BUFFERS

Impact:
- This commit affects RNDIS use cases

Testing:
- spresense:rndis with CONFIG_NET_TCP_WRITE_BUFFERS=y

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-08 05:36:07 -05:00
Peter Van Der Perk
974787270c Added SocketCAN Device driver porting guide 2020-08-07 13:14:30 -06:00
David Sidrane
3683a72b0e sim:Add nshcromfs 2020-08-07 09:29:44 -05:00
Masayuki Ishikawa
9a1391d36b boards: spresense: Enable CONFIG_RTC_HIRES in wifi/defconfig
Summary:
- This commit enable COFNIG_RTC_HIRES

Impact:
- This commit affects spresense:wifi configuration only

Testing:
- spresense:wifi with getprime

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-07 09:30:52 +01:00
Masayuki Ishikawa
fead8d2034 arch: cxd56xx: Fix cxd56_rtc.c when compiled with CONFIG_RTC_HIRES=y
Summary:
- This commit fixes compile errors

Impact:
- This commit affects cxd56_rtc.c only

Testing:
- spresense:wifi with CONFIG_RTC_HIRES=y

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-07 09:30:52 +01:00
Masayuki Ishikawa
b483d0d4eb arch: imxrt: Fix ethernet configuration in Kconfig
Summary:
- Fix typo in Kconfig so that we can configure IMXRT_ENET_NRXBUFFERS.

Impact:
- imxrt family with ethernet configuration

Testing:
- imxrt1060-evk:netnsh

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-06 22:18:23 -07:00
Masayuki Ishikawa
456c47643a boards: esp32-core: Fix CI errors in netnsh/defconfig
Summary
- This commit should fix CI errors

Impact
- No impact

Testing
- Build check only

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-06 19:02:09 -07:00
Alan C. Assis
b815f4935c Add Ethernet netnsh board configuration example 2020-08-06 19:47:02 -03:00
Alan C. Assis
6ea7b29088 Add ESP32 Ethernet device driver
This driver was implemented by Dong Heng<dongheng@espressif.com>
and reviewed by Alan Carvalho de Assis
2020-08-06 23:35:16 +01:00
Xiang Xiao
e1d3627bb1 sched/wdog: Change the default value of MAX_WDOGPARMS from 4 to 2
since the maximum number of argument pass to wd_start in the whole
code base is 2 and change CONFIG_MAX_WDOGPARMS in some defconfig
from 1 to 2 oherwise pthread_condclockwait will fail

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib6cb28b8c0722058849e7be916e164513431d21c
2020-08-06 10:36:22 -06:00
raiden00pl
ab6ddb8f99 arch/arm/src/stm32/stm32_adc.c: fix ADC setup logic
Increase the initialization counter after initialization is complete, otherwise the logic in adc_reset() will not execute correctly
2020-08-06 16:38:20 +01:00
David Sidrane
b6194bc0bf tools/gencromfs: partial fix coding standard violation
Remaining violation seem to be an issue with the
   tool parsing  outptr[- lit - 1] = lit - 1
2020-08-06 08:36:03 -05:00
David Sidrane
fbd5712761 Fix Breakage from 91ed14c6
PR 1372 vfs/stat: Make the flag defintion more confirm POSIX
   standard. Silently broke the cromfs. This was due to the
   necessary replication of the S_xxxx flags of the NuttX
   sys/stat.h. The unfortunate outcome was most likely caused by
   fact, that a grep of S_xxxx did not match the tools/gencromfs.c

   To insure this sort of thing does not happen again, comments
   have been added the will match search.
2020-08-06 08:36:03 -05:00
David Sidrane
bca0f3e275 sys/stat:Make comment match code 2020-08-06 08:36:03 -05:00
SPRESENSE
385e555da8 wireless: gs2200m: Add flags member
Add flags member to take recv() flags from daemon.
2020-08-06 16:57:18 +09:00
David Sidrane
deeac10134 stm32l4:serial fix coding standard violation 2020-08-06 01:03:34 -05:00
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
David Sidrane
5a76767cd7 tioctl:Define 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
Xiang Xiao
5c67eac27f libc: Change index/rindex from macro to function
to avoid the confliction with the same name variable

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-05 04:39:03 -07:00
David Sidrane
2eccc960a9 fs_cromfs:Remove duplicate case intorduced by 67ef70d 2020-08-04 21:20:25 -05:00
David Sidrane
0cc3f95bb4 nucleo-144:stm32_bbsram make coding standard compliant 2020-08-04 21:20:05 -05:00
David Sidrane
ed5d00edd8 board_crashdump:use consistent type from outer function for file name 2020-08-04 21:20:05 -05:00
Gregory Nutt
188d4b0fb4 user-space memalign() must not be called from within the OS.
drivers/net/ftmac100.c, libs/libc/stdlib/lib_aligned_alloc.c

A continuation of PRs #1507, #1510, and #1512.  See Issue #1481 for additional information.
2020-08-04 22:45:47 +01: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
Gregory Nutt
3cad9f498f drivers/mkrd.c
drivers/net/telnet.c
 drivers/wireless/bluetooth/bt_uart_bcm4343x.c
 drivers/wireless/ieee802154/mrf24j40/mrf24j40.c

Kernel memory was allocated using kmm_malloc() or kmm_zalloc() but freed with with the user-space allocator free().  In the FLAT build, this is bad style, but not harmful because there is only a single, heap and malloc() and kmm_malloc() map to the same function.

But that is not true in the case of the PROTECTED or KERNEL builds.  In those cases, there are separate heaps.  kmm_malloc() will allocate from the kernel heap.  free() will attempt to free the kernel memory from the user heap and will cause an assertion (or other obscure failure if assertions are disabled).
2020-08-04 13:00:53 -05: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
YAMAMOTO Takashi
123a31e3a2 drivers/usbhost/hid_parser.c: nxstyle fixes 2020-08-03 22:52:31 -05:00
YAMAMOTO Takashi
59ba52aee8 drivers/usbhost/hid_parser.c: Fix out of range array accesses
Found by clang-check:

usbhost/hid_parser.c:278:26: warning: Assigned value is garbage or undefined
                usage[i] = usage[i + 1];
                         ^ ~~~~~~~~~~~~
usbhost/hid_parser.c:321:34: warning: Assigned value is garbage or undefined
                        usage[i] = usage[i + 1];
                                 ^ ~~~~~~~~~~~~
2 warnings generated.
2020-08-03 22:52:31 -05:00
YAMAMOTO Takashi
4f7745ae1c net/tcp/tcp_timer.c: Remove redundant assignments
Found by clang-check:

tcp/tcp_timer.c:185:15: warning: Value stored to 'result' is never read
              result = tcp_callback(dev, conn, TCP_TIMEDOUT);
              ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tcp/tcp_timer.c:264:23: warning: Value stored to 'result' is never read
                      result = tcp_callback(dev, listener, TCP_TIMEDOUT);
                      ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tcp/tcp_timer.c:300:19: warning: Value stored to 'result' is never read
                  result = tcp_callback(dev, conn, TCP_TIMEDOUT);
                  ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings 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
Masayuki Ishikawa
ea1ce2bcb6 boards: lc82345-xgevk: Replace license header with Apache License 2.0
Summary:
- This commit replaces license header under lc823450-xgevk

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
0e610caec8 fs/procfs: Handle /proc/xxx/group/ correctly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic9f4c38a3baf199712c5497c094dc7af84deee2c
2020-08-03 21:00:18 +01:00