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>
Restore OUTPUT_FORMAT and OUTPUT_ARCH for mips link scripts to fix Nightly build break logs:
p32-ld: pic32mx_head.o: compiled for a little endian system and target is big endian
p32-ld: pic32mx_head.o: endianness incompatible with that of the selected emulation
p32-ld: failed to merge target specific data of file pic32mx_head.o
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
mkdeps uses system() thus a shell to execute cc.
it doesn't work if you have something like
CFLAGS += -DMBEDTLS_USER_CONFIG_FILE="<mbedtls/user_config.h>"
because the shell interprets "<" as a redirect.
to fix it, we should do either
* make it shell-quote arguments
* or, stop using system()
this commit implements the former.
some platforms provide easy ways to do the former.
eg. https://netbsd.gw.com/cgi-bin/man-cgi?shquote++NetBSD-current
but unfortunately none of them seems available widely.
i guess the latter approach is more common.
eg. 4464250282/usr.bin/mkdep/mkdep.c (L137-L154)
but i might be a burden for windows. (i don't know)
arch/z80/src/Makefile: Correct inclusion of non-existent file. This was not a problem before because there was '-' before the include. Problem revealed with '-' removed.
arch/z80/src/ez80/Toolchain.defs: Apparently there are not too many '"' in path definition.
tools/incdir.c: No space between -usrinc: or -sysinc: and the list of paths.
and update the related stuff in libs/libc/libc.csv
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id695a7f07bf18a7b4e526297f9131c75ddb79d30
let toolchain decide the correct value base on the command line
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I342db6a88e4a161a322a8fea48a59e6ca7617ae6
Move global variable declaration out of include/nuttx/video/video.h and into the file where it is initialized. With some toolchains/environments, declaring globals in header files results in multiply defined symobl errors at link time. This corrects that build problem.
In the FLAT build if CONFIG_LIB_SYSCALL=y, then the function task_spawn() will be duplicated.: One version in libs/libc/spawn and one version in sched/task.
The version of task_spawn in lib/libc/spawn exists only if CONFIG_LIB_SYSCALL is selected. In that case, the one in sched/task/task_spawn.c should be static, at least in the FLAT build.
The version of task_spawn.c in libs/libc/spawn simply marshals the parameters into a structure and calls nx_task_spawn(). If CONFIG_LIB_SYSCALL is defined then nx_task_spawn() will un-marshal the data can call the real task spawn. This nonsense is only necessary because task_spawn has 8 parameters and the maximum number of parameters in a system call is only 6.
Without syscalls: Application should call directly in task_spawn() in sched/task/task_spawn.c and, hence, it must not be static
With syscalls: Application should call the marshalling task_spawn() in libs/libc/spawn/lib_task_spawn.c -> That will call the autogenerated nx_task_spawn() proxy -> And generate a system call -> The system call will the unmarshalling nx_task_spawn() in sched/task/task_spawn.c -> Which will, finally, call the real task_spawn().
The side-effect of making task_spawn() static is that it then cannot be used within the OS. But as far as I can tell, nothing in the OS itself currently uses task_spawn() so I think it is safe to make it conditionally static. But that only protects from duplicate symbols in the useless case mentioned above.
Reported by 권석근 <kwonsksj@gmail.com>:
I found a bug at "pty.c" during ssh server implementation.
When I turn on CONFIG_SERIAL_TERMIOS and OPOST|ONLCR on pty device
for nsh console's stdin/stdout (ssh shell service), I've got system crash.
Bugs at line 687 of pty.c, pty_write()
ntotal++;
when converting '\n' to '\r\n', pty_write() will return more than requested
(+1, for example) length. and this will break caller lib_fflush(), line 150
of lib_libfflush.c.
When she get (libfflush()) bytes_nwritten which is greater than nbuffer,
nbuffer goes to negative at line 150 and eventually destroys
*stream->fs_bufpos at line 163 of lib_libflush.c
Removing ntotal++; line 687 of pty.c will fix this bug.
BTW, nsh using ptm/pty as a ssh shell service works great with libssh +
mbedtls.
since the user may use math library from toolchain directly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I67ccc4830403e3c15a84a8f9b1420d9a10894ddf
Only Make.defs files tht followed the same pattern as the ARM Make.defs were modified. This excludes some of the sim and renesas Make.defs files and all of the z80 Make.defs files.
Before any other Make logic can be used, we must immediately build the tools/incdir binary. It will be used as soon as Make.defs is included and will generate errors otherwise.
Remove the other locations in the tools/incdir binary was being build from tools/Makefile.unix and tools/Makefile.win
This is a change suggested by Xiao Xiang in an email thread. Some make variables with depend on forking and shell and running a script to get the value of the variable. Using := we can force the calculation to occur only once. This leads to a small but consistent improvement in build performance.
This change really applies to ALL Make.defs files but is applied only to one here so that it can be thoroughly verified and possbily leveraged to other Make.defs files in the future.
1. If config.c is compiled on any platform other than Cygwin, then the variable wintools is not used.
2. Add more debug output so we can see what is going on in the PR checks.