Commit Graph

36361 Commits

Author SHA1 Message Date
Gregory Nutt
3b53cd1e57 include/nuttx: Fix improper use of inline
I finally figured out why the ez80 code has gotten so big.  It is because people have been put putting big inline functions in header files.  That is a violation of the coding standard, since only c89 compatibility is required in all common code. But we have been tolerating inline function it because include/nuttx/compiler.h defines 'inline' to be nothing for C89 compilers.

As a result, static inline functions declared within a C file not so bad; the inline qualifier is ignored, if not supported, but otherwise all is well.

But it is catastrophic in header files.  Those static inline functions are included as static functions and implemented in EVERY file that includes those header files, even if the functions are never called.  That makes the code base huge!So there is another PR coming to fix some of the worst offenders.

This commit fixes two of the worst offenders I have encountered so far:  include/nuttx/sempahore.h and cache.h.  But there may be a few other changes needed.  Under include/nuttx there are still inline functions thread.h, inclue/nuttx/list.h, mutex.h, tree.h, and include/nuttx/crypto/blake2s.h with no protection for compilers that do not handler the inline qualifier.  Otherwise we are clean.

With the changes to these two header files, the size of the z20x build is reduced by about 40%.  And incredible size savings.
2020-03-02 22:06:04 +01:00
Xiang Xiao
de480b01b6 fs/nfs: Add the simplest RPCAUTH_UNIX support
Since most NFS server disable RPCAUTH_NULL to improve the security
2020-03-02 15:04:20 -06:00
Xiang Xiao
7794214a7d fs/nfs: Support both IPv6 and TCP
And correctly handle the retransmission
2020-03-02 15:04:07 -06:00
Xiang Xiao
6c77829940 fs/nfs: Should return the partial transfer bytes in nfs_read/nfs_write 2020-03-02 15:03:53 -06:00
Gregory Nutt
2524837d79 boards/z80/ez80/z20x/: Correct naming of project files. 2020-03-02 21:28:29 +01:00
Gregory Nutt
e814977c0f boards/z80/ez80/z20x/: Add W25 bootloader
The SD boot loader was not satisfactory because 1) the SD slot is on an optional board and, hence, cannot be part of a fundamental solution.  And 2) it is too big.

The only storage on borard is the Winbond W25 SPI-bsed FLASH.  This commit adds support for a bootload to 1) read code in HEX format from a serial port and write it to the W25 FLASH, or 2) read code in binary form from the W25 FLASH into SRAM and execute the loaded program.

boards/z80/ez80/z20x/configs:  Added w25boot configuration
boards/z80/ez80/z20x/src:  Add bootloader logic, w25_main.c.  Add logic to manage shared SRAM memory map so that the loaded program does not clobber the bootloader memory.  Add logic to recover the bootloader memory into the heap after the loaded program as started.
boards/z80/ez80/z20x/scripts:  Rework scripts and configuration to support a bootloader and program build.  The boolloader cannot use all of SRAM; the program must not clobber the SRAM region used by the bootloader.
2020-03-02 14:05:09 -03:00
Xiang Xiao
915f094a74 NFS bug fix and improvement (#412)
* fs/nfs: Remove all nfs_checkmount call.  The check just waste cpu cycle since nobody will set nm_mounted to false, and remove the unused fields(nm_mounted and n_flags) and related flags too
* fs/nfs: Fix the definition not confirm to RFC 1813 and other minor issue(unused, typo, duplication, alignment...)
* fs/nfs: Always represent error with negative number and remove the unused arguments from function
* fs/nfs: Set socket receive timeout with nfs_args->timeo and fix warning:

nfs/nfs.h:59:28: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define NFS_TIMEO          (1 * NFS_HZ)   /* Default timeout = 1 second */
                            ^
nfs/nfs_vfsops.c:1857:23: note: in expansion of macro 'NFS_TIMEO'
   nprmt.timeo       = NFS_TIMEO;
                            ^
                       ^~~~~~~~~

* fs/nfs: Update the file attribute correctly in nfs_filetruncate and simplify the attrbitue conversion between NFSv3 and NuttX
* fs/nfs: Remove the unfinished and buggy EXCLUSIVE creation mode
* fs/nfs: Call nfs_fsinfo in nfs_bind instead of nfs_statfs since we should update the buffer size before transfer happen, and handle the attribute existence variance correctly.
* fs/nfs: Shouldn't insert node into list again in nfs_dup and fix other typo issue
* fs/nfs: Should skip . and .. in nfs_readdir
* fs/nfs: Remove the unnecessary dynamic allocation and the duplicated root handle storage
2020-03-01 14:55:01 -06:00
Gregory Nutt
350adb236f boards/z80/ez80/z20x/: Add support for W25 FLASH. 2020-03-01 14:50:37 +01:00
Gregory Nutt
029680fb50 boards/z80/ez80/z20x: Remove the nsh_flash configuration.
The nsh_flash configuration is too big and will never fit into the eZ80F92's small internal FLASH.
2020-03-01 14:50:37 +01:00
Gregory Nutt
7d1b35b768 boards/z20x/ez80/20x: Updates
boards/z80/ez80/z20x:  Add SPI chip selects for all available SPI definces.
2020-03-01 14:50:37 +01:00
y-sugino
a754c25776 boards/arm/stm32/stm32f4discovery: Fix build errors
Fix these build errors:

CC:  stm32_romfs_initialize.c
{standard input}: Assembler messages:
{standard input}:498: Error: can't resolve `.rodata' {.rodata section} - `.Ltext0' {.text section}
{standard input}:499: Error: can't resolve `.rodata' {.rodata section} - `.Ltext0' {.text section}
{standard input}:502: Error: can't resolve `.rodata' {.rodata section} - `.Ltext0' {.text section}
{standard input}:503: Error: can't resolve `.rodata' {.rodata section} - `.Ltext0' {.text section}
2020-03-01 06:53:29 -06:00
David Sidrane
fd3148dba6
imxrt: Adds the ability to run from OCRAM (#407)
* imxrt: GPIO make tables const
* imxrt: Call out to board to set up FlexRAM
* imxrt: Add Knob for adding the ROM bootloaders 40Kib of RAM to heap
* imxrt: imxrt1060-evk:Add the ability to run from OCRAM
2020-03-01 06:05:42 -06:00
David Sidrane
4a4b2853c2
Add USB Device support for i.MX RT (#408)
* arch/arm/src/imxrt/imxrt_usbdev.c: Add USB Device support for i.MX RT (USB OTG1)

Based on the LPC43xx USB Device driver.

* imxrt:usbotg Nxstyle fixes

Co-authored-by: thomasactia <61285689+thomasactia@users.noreply.github.com>
2020-02-29 14:03:52 -08:00
Gregory Nutt
41ef33bded eZ80: Fix optimization issues
board/z80/ez80/*/scripts/Make.defs:  Fix optimization definition use in assembly flags.  It was using the compiler optimization settings instead of the assembler optimization settings.  Hence, enabling optimization would could cause assembler command line errors.

arch/z80/src/ez80/Toolchain.defs:  Back out some work arounds.  Now compiler optimization flags can again set set without assembler command line errors.

boards/z80/ez80/z20x/README.txt:  Trivial update to size/optimization discussion.
2020-02-29 12:43:28 -03:00
Joshua Lange
0ce4e15363 Improvements to STM32H7: (i,w)WDG Flash, Ethernet, ADC, etc 2020-02-29 12:33:25 -03:00
Gregory Nutt
e309128313 boards/z80/ez80/z20x/README.txt: Update README. 2020-02-29 09:24:23 +01:00
macman88
43dfbdb348 Battery monitor support (#404)
* Adding support for BQ769x0 Battery Monitor IC (Work In Progress)
* Additional changes to support BQ769x0
* Store cell count and chip type when setting up
* Added shutdown, limits, charge/discharge switch, and clear faults operations
* Added support for current measurement; some cleanup
* Updated temperature reporting.  Fixed negative current reporting.
* When setting safety limits, update limit structure with actual values used.
* Added note on battery limit structure
* Updates to BQ769x0.  Re-ordered fault reporting, added fault cache, added ordered fault clearing
2020-02-28 18:18:50 -06:00
macman88
922e67c7cc MCP9844 shutdown mode support (#403)
* Added shutdown support to the MCP9844 sensor driver.
* Clean up debug messages
* Clean up comments and formatting
2020-02-28 16:21:56 -06:00
Adam Feuer
cbd3e704dc formatting comments 2020-02-28 13:39:36 -06:00
Adam Feuer
6b4f9038d4 fix for SAMA5D2 serial console
authored by Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2020-02-28 13:39:36 -06:00
Gregory Nutt
8c00e43c1a arch/z80/src/ez80: Fix eZ80F92 Interrupt Controller
The eZ80F92 interrupt controller is very different from the eZ80F91.  The eZ80F91 has:

1. Four byte interrupt vectors
2. The vector base address register is 16-bit so the vector table can lie in RAM

Whereas the eZ80F92 has:

1. Two byte interrupt vectors
2. An 8-bit vector base address

This means that the vectors must lie in the first 16-bits of FLASH and there must be a "trampoline" to get to interrupt handlers outside of the first 64-Kb of FLASH.
2020-02-28 19:45:28 +00:00
Gregory Nutt
774bd6f0fc Merge branch 'pr396' 2020-02-28 07:51:45 -06:00
YAMAMOTO Takashi
09d659d275 xtensa: Fix up_schedule_sigaction
This fixes various crashes in ostest.
2020-02-28 07:51:18 -06:00
YAMAMOTO Takashi
34b17ec5cb xtensa: Fix up_schedule_sigaction
This fixes various crashes in ostest.
2020-02-28 07:48:16 -06:00
YAMAMOTO Takashi
119a38ce10 xtensa: Fix typos and comments 2020-02-28 11:33:29 +01:00
Masayuki Ishikawa
5f41c94e56 boards: stm32f4discovery: Remove CONFIG_NET_LOCAL=y from wifi/defconfig
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-02-28 09:54:04 +01:00
Masayuki Ishikawa
860e07317c boards: spresense: Remove CONFIG_NET_LOCAL=y from wifi/defconfig
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-02-28 09:54:04 +01:00
Masayuki Ishikawa
0bd17b2c9c include: audio: Remove packed_struct from struct ap_buffer_s
NOTE: This change suppresses unaligned access warnings with arm gcc9

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-02-27 23:31:41 -06:00
Gregory Nutt
161104c76a eZ80/z20x: Correct uninitialized stack memory
arch/z80/src/ez80/Toolchain.defs:  Correct some CFLAGS when optimization suppressed.

arch/z80/src/ez80/Kconfig arch/z80/src/ez80/ez80_emac.c:  Remove configuration option for selecting EMAC RAM address.  This is duplicated and possibly conflicting.  The correct address for the RAM is provided in the linker command file.  The RAM should be configured once and using this single definitions.

arch/z80/src/ez80/ez80_startup.asm and arch/z80/src/ez80/ez80f9*_init.asm.  Move RAM and FLAH intialization out of MCU-specific logic to common start-up logic.  We cannot call any functions until SRAM is initialized and the stack is properly initialized because the return address is stored on the stack.  Use internal SRAM for the IDLE stack to avoid the chicken'n'egg problem.

boards/z80/ez80/z20x/configs/sdboot/sdboot.zdsproj:  Discuss build environments.
2020-02-27 22:53:27 +01:00
Xiang Xiao
c161dc07a9 syslog/file: Remove syslog_dev_uninitialize return value
To simplify the initializition process
2020-02-27 08:02:50 -06:00
Masayuki Ishikawa
b48e0a6e55 boards: spresense: Change CONFIG_FAT_MAXFNAME and CONFIG_NAME_MAX
CONFIG_FAT_MAXFNAME is set to 255 and CONFIG_NAME_MAX is set to 765
which can support max file name including Japanese characters.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-02-27 08:58:08 +01:00
Masayuki Ishikawa
0cb7dfde79 arch: risc-v: Fix a warning in common/up_exit.c
common/up_exit.c:198:1: warning: 'noreturn' function does return
2020-02-27 08:55:55 +01:00
Masayuki Ishikawa
f6b3e79d61 arch: lc823450: Remove unused variable in lc823450_cpustart.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-02-27 08:55:25 +01:00
Gregory Nutt
1521037083 arch/z80/src/Makefile.zdsii*: Correct libraries for eZ80F92
These makefiles set the the ZiLOG runtime libraries for the eZ80 parts.  The setup was, however, conditioned on CONFIG_ARCH_EZ80_EZ80F91 and, so, was not working for the eZ80F92 part (CONFIG_ARCH_EZ80_EZ80F92).

With this change, the z20x board FINALLY builds and links correctly with no errors.
2020-02-26 21:08:20 +00:00
Gregory Nutt
fa5179a51a arch/z80/src/ez80/ez80f92_handlers.asm: Trivial typo fix. 2020-02-26 21:08:20 +00:00
Gregory Nutt
fcee2f5a53 arch/z80/src/ez80/ez80_timerisr.c: Use Kconfig MCU configurations.
Don't use MCU selection from compiler.  It appears that we must compile ez80f92 code as ez80f91 so the comiler MCU selection is incorrect.  Instead, use the selected CPU part from the configuration.
2020-02-26 21:08:20 +00:00
Gregory Nutt
b63024dc7b arch/z80: Make MCU selection menus more like other archs 2020-02-26 21:08:15 +00:00
Gregory Nutt
a9610e16bd boards/z80/ez80/z20x: Update CFLAGS and linker scripts.
arch/z80/src/ez80/Toolchain.defs:  Update some CFLAGS to match CFLAGS from ZDS-II IDE.  Apparently, we must say that the CPU is an eZ80F91 event when compiler for eZ80F92.
boards/z80/ez80/z20x:  Update linker scripts.
2020-02-26 21:12:01 +01:00
YAMAMOTO Takashi
930e2788cc xtensa: Use ar and nm from the toolchain
This fixes build on macOS, where native ar is incompatible.
2020-02-26 10:47:26 -06:00
YAMAMOTO Takashi
0650658980 esp32-core/README.txt: Fix a URL and a typo 2020-02-26 10:28:38 -06:00
YAMAMOTO Takashi
aa40e28862 Make it clear the timestamp of pass1 directory is not important 2020-02-26 10:20:10 -06:00
Xiang Xiao
852fc8b9d9 Revert "Fix make target dependencies"
This reverts commit 5f540d79a1.
2020-02-26 07:31:40 -06:00
YAMAMOTO Takashi
5f540d79a1 Fix make target dependencies
"all" and "depend" targets should not be made concurrently.
I occasionally see APPDIR build failures because of this.
2020-02-25 21:09:32 -06:00
Adam Feuer
cdc61a08e0
arch/arm/src/sama5/sam_gmac: Prevent txtimeout from always firing and fix txbuffer leak during high-volume sends 2020-02-25 23:10:04 +01:00
Nathan Hartman
8ee6be0780 net/icmp/icmp_input.c: Fix memset() implicit decl warning 2020-02-25 12:17:55 -06:00
YAMAMOTO Takashi
9a8169acdf armv7-m: Fix syscall stack alignment
This fixes "df -h" with PROTECTED build.  Tested on qemu.

Reference:
	aapcs32 "6.2.1 The Stack/Stack constraints at a public interface"
2020-02-25 12:05:53 -06:00
Gregory Nutt
1f1356a2f5 net/icmp/icmp_input.c: Clear sin_zero
This should have been part of commit 861efdf8a3 but was overlooked.
2020-02-25 09:32:54 -06:00
patacongo
861efdf8a3
net/: Whenever the network initializes an IPv4 address, it must clear sin_zero. 2020-02-25 15:53:39 +01:00
chao.an
42d97079de net/netlink/netlink_route.c: Correct the return value 2020-02-25 07:33:18 -06:00
YAMAMOTO Takashi
d52628979a Suppress "'noreturn' function does return" warnings
up_pthread_start and up_task_start.
2020-02-25 04:07:02 -06:00