Post by ***@yahoo.com [nuttx]First problem IAR EW it's file names in IDE must not match. I'm not found better solution than to rename the files manually.
"apps/builtin/builtin.c" as "builtin_app.c";
"nuttx/arch/arm/src/board/stm32_spi.c" as "stm32_selectspi.c";
"nuttx/libc/signal/sig_pause.c" as "sig_pause_libc.c".
This is just the tip of the iceberg. For example,
$ find configs -name stm32_spi.c
configs/cloudctrl/src/stm32_spi.c
configs/fire-stm32v2/src/stm32_spi.c
configs/hymini-stm32v/src/stm32_spi.c
configs/maple/src/stm32_spi.c
configs/mikroe-stm32f4/src/stm32_spi.c
configs/nucleo-f303re/src/stm32_spi.c
configs/nucleo-f4x1re/src/stm32_spi.c
configs/nucleo-l476rg/src/stm32_spi.c
configs/olimex-stm32-p107/src/stm32_spi.c
configs/olimexino-stm32/src/stm32_spi.c
configs/shenzhou/src/stm32_spi.c
configs/spark/src/stm32_spi.c
configs/stm3210e-eval/src/stm32_spi.c
configs/stm3220g-eval/src/stm32_spi.c
configs/stm3240g-eval/src/stm32_spi.c
configs/stm32f3discovery/src/stm32_spi.c
configs/stm32f429i-disco/src/stm32_spi.c
configs/stm32f4discovery/src/stm32_spi.c
configs/stm32f746g-disco/src/stm32_spi.c
configs/stm32ldiscovery/src/stm32_spi.c
configs/stm32_tiny/src/stm32_spi.c
configs/viewtool-stm32f107/src/stm32_spi.c
Nothing will be contributed upstream until all ARM configurations build correctly. There is are some test files in https://groups.yahoo.com/neo/groups/nuttx/files in test-files.zip. The script doarm.sh in the ZIP file would have to execute without error before anything is incorporated upstream.
Post by ***@yahoo.com [nuttx]#pragma section = ".bss"
__sfb(".bss") // begin
__sfe(".bss") // end
__sfs(".bss") // size
I do not permit explicit #pragmas anywhere in the code. Similar, I don't permit GCC-isms in the common code (although I have allowed them in ARM code). And specific compiler differences should be defined in include/nuttx/compiler.h
Other differences in assembler pseudo-operations can be handled with C pre-processor macros (see below)
Post by ***@yahoo.com [nuttx]Last, directive #define in asm not equivalent in c.
"IAR Assembler guide: You must not mix assembler language and C-style preprocessor directives.
Conceptually, they are different languages and mixing them might lead to unexpected
behavior because an assembler directive is not necessarily accepted as a part of the C
preprocessor language."
In stm32_vectors.s definition of disclosed in the manual.
That is not really true. The C preprocessor has its own syntax and can be used with any file. The NuttX and GCC convention is the files ending with .S are assembly language files that must first be run through the C pre-processor. Files ending in lower case .s are pure assembly language files. NuttX uses all .S files and will continue to do so.
If you use the GCC compiler to assemble .S files, it will automatically run the C pre-processor, generate the .s file, then assembly that. But that is just a convenience built into GCC; You can use the C pre-processor and .S file with any assembler.
For example, look at the z8 code at arch/z80/src/z8. That uses the ZiLOG toolchain and certain does not use .S files directly. Rahter it just adds another target. To assemble and assembly language file, this target is used:
$(AOBJS) $(HEAD_OBJ): %$(OBJEXT): %$(ASMEXT)
$(call ASSEMBLE, $<, $@)
where ASMEXT will be .asm for that machine (vs .s for GCC). But some of the assembly language files are .S files:
$ find . -name *.S
./z8/z8_head.S
./z8/z8_restorecontext.S
./z8/z8_saveusercontext.S
./z8/z8_vector.S
Those get assembled with an intermediate step that runs the C-preprocessor and converts the .S file to a .asm file:
$(HEAD_GENSRC) $(GENSRCS) : %$(ASMEXT): %.S
$(Q) $(CPP) $(CPPFLAGS) $< -o $@.tmp
$(Q) cat $@.tmp | sed -e "s/^#/;/g" > $@
$(Q) rm $@.tmp
This is a good thing for you. Most of the time, I see separate assembly language files for GCC and IAR tools. But with .S files, you can define assembler differences in a header file (like include/nuttx/assembler.h). Then just include that at the beginning of the .S file:
#include <nuttx/assembler.h>
And in that file you can define compiler differnces like:
#ifdef __GCC__
# define __SBSS .bss
# define __EBSS
#else
# define __SBSS \
#pragma section = ".bss"
__sfb(".bss") // begin
# define __EBSS \
__sfe(".bss")
#endif
And in the .S file you can replace .bss with __SBSS then the .S file should compile with both GCC and IAR.
Post by ***@yahoo.com [nuttx]Question: what is fp (frame pinter) in file "nuttx\arch\arm\src\armv7-m\vfork.s" line 124.
This definition is equivalent to the r11 register?
Yes, fp is a standard ARM alias for r11.
Greg