Commit Graph

1204 Commits

Author SHA1 Message Date
Xiang Xiao
d056834605 Add CONFIG_NDEBUG Kconfig to control NDEBUG definition
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-16 12:03:07 -08:00
Alan Rosenthal
8defb843aa Remove duplicate linker script definitions
## Summary
A lot of linker scripts were listed twice, once for unix, once for windows.

This PR cleans up the logic so they're only listed once.

 ## Impact
Any opportunity to use a single source of truth and reduce lines of code is a win!

 ## Testing
CI will test all build
2022-02-17 02:55:25 +08:00
Michael Jung
fd8b087012 Fix JLinkGDBServer crash attaching to target
If attaching to a target that is already running JLinkGDBServer calls
RTOS_GetNumThreads() without a prior call to RTOS_UpdateThreads().  So
do this within RTOS_GetNumThreads() if g_plugin_priv.ntcb has not yet
been initialized.

Note: If after attaching the debugger to the target, the target is
resumed and then stopped again, the RTOS_UpdateThreads is actually
called.  Thus, we are not running on stale thread data in this case.

I also changed PLUGIN_VER to API_VER and its value to 101, as
RTOS_GetVersion() does not query the version of the plugin, but the API
version implemented by the plugin, which in our case is 1.1.

Signed-off-by: Michael Jung <mijung@gmx.net>
2022-02-15 23:05:15 +08:00
Michael Jung
0a37744826 Fix jlink-nuttx build with GCC 10.2
The packed-attribute on the tcb_info_s type was misplaced, which caused
incompatible memory layout between host and target.  According to
current GCC documentation:

> You may specify type attributes in an enum, struct or union type
> declaration or definition by placing them immediately after the struct,
> union or enum keyword.  You can also place them just past the closing
> curly brace of the definition, but this is less preferred because
> logically the type should be fully defined at the closing brace.

I also added jlink-nuttx.so to the .gitignore list and updated nxstyle
to ignore the camel case function names required by JLinkGDBServer.

Signed-off-by: Michael Jung <mijung@gmx.net>
2022-02-15 13:48:52 +01:00
Juha Niskanen
176d78938f tools/Unix.mk: silence output from version.sh
This fixes error:

  tools/Unix.mk:49: *** missing separator. Stop.

that can happen if version.sh is invoked on a git repository
that contains no tags.

See https://github.com/apache/incubator-nuttx/issues/5324

Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2022-02-15 02:01:50 +08:00
Anton Potapov
8f6be5e4ce Fix configure.sh for custom apps dir. 2022-02-14 21:28:07 +08:00
Xiang Xiao
d426875fcf tools/mkconfig: Remove the unnecessary config option correction
since Kconfig can handle the dependence correctly for us

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-09 14:34:38 -03:00
zouboan
ad3f16358e enable sparc's daily ci and eliminate some warnings 2022-02-03 14:43:21 +01:00
zouboan
09d57de7ec add sparc toolchain to linux docker 2022-02-03 13:20:39 +08:00
Xiang Xiao
7dfa768552 tools/nxstyle: add Segger RTT prototype name into white list
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-01 11:26:46 +01:00
Peter Kalbus
61acceb1ca Detect host CPU on MacOS/Linux running on ARM. 2022-01-29 20:49:50 -03:00
chao.an
11f04e516a drivers/segger: download the RTT/SystemView from github
RTT:
https://github.com/SEGGERMicro/RTT/archive/refs/tags/V7.54.zip

SystemView:
https://github.com/SEGGERMicro/SystemView/archive/refs/tags/V3.30.zip

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-29 17:26:04 +08:00
chao.an
3fc18d50b8 tools/nxstyle: add Segger System View prototype name into white list
Reference:
https: //github.com/SEGGERMicro/SystemView/blob/master/SYSVIEW/SEGGER_SYSVIEW.h

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-29 17:26:04 +08:00
Gustavo Henrique Nihei
b0d24f53c4 xtensa: Add initial support for ESP32-S3
Co-authored-by: Alan Carvalho de Assis <alan.carvalho@espressif.com>
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-01-27 13:46:50 -03:00
Petro Karashchenko
7b5af90565 tools/mkromfsimg.sh: add attribute to set minimum 4 bytes aignment for romfs image data
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-27 23:50:47 +08:00
Gustavo Henrique Nihei
281ec4682f docker/linux: Add ESP32-S3 toolchain and binaries
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-01-27 10:01:17 -03:00
zhuyanlin
6578461cc8 tcbinfo: add packet align to struct tcbinfo
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-01-27 17:36:27 +08:00
zhuyanlin
8f1c6ee7bc tools/jlink-nuttx: update tcbinfo follow nuttx arch tcbinfo_s
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-01-27 17:36:27 +08:00
Alexander Lunev
c45534f41b tools/nxstyle: fixed "Mixed case identifier found" errors related to sim/wpcap 2022-01-27 10:37:32 +08:00
chao.an
e518a9f031 tools/Config.mk: suppress all normal output for cmp
Fix build break:
make: *** No rule to make target 'byte', needed by 'differ'.  Stop.

Regression by:
-----------------------------------------------------
|commit 0951f70df6
|
|    Improve dependencies for include/nuttx/version.h
-----------------------------------------------------

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-26 14:45:32 +01:00
Petro Karashchenko
48211f90d3 ci: select ARMV7A_TOOLCHAIN_GNU_EABIL for ARMv7-A based builds
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-25 20:24:28 +08:00
Alan Rosenthal
35905302d3 Cleanup boards/Makefile
Changes:
There was logic in `tools/Config.mk` which was duplicated in `boards/Makefile`.
This PR removes the duplicated logic in boards/Makefile
2022-01-24 11:17:55 +08:00
Xiang Xiao
9c74380b11 tools/ci: Enable build sim:cxxtest
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-20 18:01:54 +08:00
Xiang Xiao
2763f67640 tools/ci: Remove testlist/all.dat
since it isn't used anymore and mismatch with other *.dat

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-20 14:46:56 +08:00
YAMAMOTO Takashi
ec54c4e30d tools/ci/testlist/sim-01.dat: Enable libcxxtest for macOS 2022-01-20 01:16:56 +08:00
Petro Karashchenko
630c209bbc tools: add option to reuse boards common files for custom boards
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-19 12:09:37 +01:00
Petro Karashchenko
87e5b1b87c tools/mkromfsimg.sh: fix build error in case if romfs is used
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-19 12:09:22 +01:00
Alan C. Assis
dfd972a534 z80: Fix z80sim build system 2022-01-15 11:37:28 +08:00
Gustavo Henrique Nihei
42ffae2d2d tools/esp: Fix App image alignment when Flash Encryption is enabled
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-01-05 17:04:19 -03:00
Gustavo Henrique Nihei
10a8dc9f22 tools/esp: Prevent reset after flash when Flash Encryption is enabled
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-01-05 17:04:19 -03:00
Gustavo Henrique Nihei
6053de27ce tools: Fix parallel build issue due to missing dependency
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-01-05 23:27:30 +08:00
Alan Rosenthal
f4d74b52d8 Rename tools/Makefile.* to have the .mk extension
This PR renames `tools/Makefile.*` to have the `.mk` extension. This PR also updates `README.md` and other files that references the other files.
Note: Skipped Makefile.host for this PR since it caused failures in CI for the sim build

By using a standard extension for Makefiles (https://www.file-extension.info/format/mk), editors will auto-format files.
This change will also improve developer ergonomics when searching for specific files

Verified locally that build still works, CI will verify more!
2022-01-05 18:33:16 +08:00
Alan Rosenthal
57a19de451 Improve dirlinks dependencies for Makefile.win
This PR improved dirlinks dependencies for Makefile.unix: https://github.com/apache/incubator-nuttx/pull/5069

This PR copies the changes into Makefile.win
2022-01-05 02:03:08 +08:00
Alan Rosenthal
0951f70df6 Improve dependencies for include/nuttx/version.h
`include/nuttx/version.h` is dependent on `.version`, which needs to run for every invocation of make, since git info can update at any time.
Currently the `.version` target is PHONY, thus making `include/nuttx/version.h` and `context` targets (and every target that depends on `context`) have to run every time.

This PR modifies `.version` so it's a real rule. Additionally, `tools/version.sh` is run every invocation of make. This maintains the current behavior while preventing some targets from needlessly running every time
2022-01-04 17:49:39 +01:00
Eero Nurkkala
b4d2944df7 tools/mpfs: prepare OpenSBI image
Polarfire Icicle board has only (128K - 256) bytes for the bootloader
in the non-volatile eNVM. This space is barely enough for running NuttX.
If OpenSBI is selected, it will be placed in DDR. This all means the
nuttx.bin file grows into gigabyte size, filling the unused space (ddr -
envm) with zeroes.

The memory layout is as follows:

MEMORY
{
    ddr  (rx)          : ORIGIN = 0x80000000, LENGTH = 4M
    envm (rx)          : ORIGIN = 0x20220100, LENGTH = 128K - 256
    l2lim  (rwx)       : ORIGIN = 0x08000000, LENGTH = 1024k
    l2zerodevice (rwx) : ORIGIN = 0x0A000000, LENGTH = 512k
}

OpenSBI library is used as a separate binary, which is stored into
eMMC or SD-card. It is then loaded into its precise location in DDR.

Thus, we separate OpenSBI from NuttX and end up with two images
by utilizing the objcopy options:

  --only-section=sectionpattern (-j in short)
  --remove-section=sectionpattern (-R in short)

This is only valid when CONFIG_MPFS_OPENSBI is set.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-01-04 19:45:14 +08:00
Alan Rosenthal
2366795786 Improve dependencies for dirlinks.
This PR updates the dependencies for `dirlinks` so they're all real files. This allows `dirlinks` rule to not have to be rerun every time.
This PR also changes the name from `dirlinks` to `.dirlinks`, since a file named `.dirlinks` is created to denote that all symlinks have been created

Changes:
* tools/link.sh
  * link.sh now detects broken symlinks. Previously, it would return `0` if the symlink existed, but didn't point to anything.

* tools/Makefile.unix
  * Added dependencies to symlinks as order-only prerequisites. See https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html
  * Removed `touch` from symlink recipes by specifying them as order only prerequisites.
  * Check Kconfig variables before adding directories as symlinks
  * Added rule for `$(TOPDIR)/arch/dummy/Kconfig`
  * Added rule for `$(ARCH_SRC)/board/board`
  * Added pattern rule (similar to `CONTEXTDIRS_DEPS`) for external folder dirlink dependencies
  * Use $(APPDIR) instead of $(CONFIG_APPS_DIR), since on line 64 $(APPDIR) is validated and `realpath` is called on the path
  * Added a rule `clean_dirlinks` to cleanup the symlinks in the correct order

* .gitignore
  * Added ignore rule for `.dirlinks`

Testing
Step 1: configure nuttx:
```
$ (cd tools && ./configure.sh -a ../incubator-nuttx-apps stm32f3discovery:nsh)
```
part of the configure step ends up calling `.dirlinks`.

Step 2: We can confirm that `.dirlinks` doesn't need to be run again by running with the question flag: `--question`
```
$ make .dirlinks --question
$ echo $?
0
```

Step 3: confirm `make` succeeds.
```
make
```
2022-01-03 17:12:18 +01:00
ligd
75aec04330 serial: add CONFIG_TTY_LAUNCH support
this allow user start new program from tty

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-01-01 20:38:26 +08:00
Gustavo Henrique Nihei
9e5e60ba48 esp32s2/esp32c3: Build MCUboot bootloader with Flash Encryption support 2022-01-01 20:37:44 +08:00
zhouliang3
1f53a058fa nuttx:Change fs strncpy to strlcpy to avoid losing'\0'
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2021-12-30 18:06:00 +08:00
Alan Rosenthal
88f07bd229 Remove .clean_context
These changes are from this PR: https://github.com/apache/incubator-nuttx/pull/5069
However I felt they were better as a stand only change.

The `.clean_context` dependency didn't make sense. It was a workaround to ensure that `context` was cleaned when the `.config` changed.
Rather than having a work around, this PR ensures that `clean_context` is run when the `olddefconfig` target is run

Verified locally by running: `tools/testbuild.sh -j 100 -e '-Wno-cpp -Werror' tools/ci/testlist/arm-01.dat`
2021-12-30 12:05:00 +08:00
Huang Qi
c2e8c92b25 arch/risc-v: Refine Toolchain.defs
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-12-28 00:30:10 -06:00
Petro Karashchenko
3ccb657dc2 nuttx: remove space befone newline in logs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-27 21:01:19 -06:00
ligd
10ccba6671 init: move USERMAIN_XX out of INIT_ENTRYPOINT
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-24 08:23:30 -06:00
Alan Rosenthal
5d07dc96a8 Improve Makefile.[unix|win]::context's dependencies
This pull request improves the dependencies for Makefile.unix::context rule.
* `include/math.h`, `include/float.h`, `include/stdarg.h`, `include/setjmp.h` are only added to `context`'s dependency if the Kconfig value is set. This prevents `context` from trying to make `include/math.h` only to find out there's no command to create the file.
* Instead of executing $(CONTEXTDIRS) in a for loop in the `context` rule, $(CONTEXTDIRS) are added as a dependency to `context` and a rule is created to create the targets. Real files are used, to prevent needlessly rebuilding the same `context` over and over and over again.
* Instead of making the directory `staging`, add it as an order-only dependency for `context`. this ensures the directory is only created if it doesn't exist.

Tested by running:
```
(cd tools && ./configure.sh -a ../incubator-nuttx-apps stm32f3discovery:nsh)
make context
```

First time running context:
```
➜  incubator-nuttx git:(improve-make-context) time make context
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx/tools'
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/tools'
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx'
make[2]: Entering directory '/home/user/code/fitbit/incubator-nuttx/boards'
make[2]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/boards'
make[2]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps'
make[3]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps/platform'
make[3]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps/platform'
make[3]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps/builtin'
make[3]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps/builtin'
make[2]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps'
make[2]: Entering directory '/home/user/code/fitbit/incubator-nuttx/graphics'
make[3]: Entering directory '/home/user/code/fitbit/incubator-nuttx/graphics/nxglib'
make[3]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/graphics/nxglib'
make[3]: Entering directory '/home/user/code/fitbit/incubator-nuttx/graphics/nxglib'
make[3]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/graphics/nxglib'
make[3]: Entering directory '/home/user/code/fitbit/incubator-nuttx/graphics/nxglib'
make[3]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/graphics/nxglib'
make[2]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/graphics'
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx'
Create .version
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx/tools'
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/tools'
Create version.h
LN: include/arch to arch/arm/include
LN: include/arch/board to /home/user/code/fitbit/incubator-nuttx/boards/arm/stm32/stm32f3discovery/include
LN: include/arch/chip to arch/arm/include/stm32
LN: arch/arm/src/board to /home/user/code/fitbit/incubator-nuttx/boards/arm/stm32/stm32f3discovery/../common
LN: arch/arm/src/board/board to /home/user/code/fitbit/incubator-nuttx/boards/arm/stm32/stm32f3discovery/src
LN: arch/arm/src/chip to arch/arm/src/stm32
LN: /home/user/code/fitbit/incubator-nuttx/drivers/platform to /home/user/code/fitbit/incubator-nuttx/drivers/dummy
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx/boards'
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/boards'
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps'
make[2]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps/platform'
LN: platform/board to /home/user/code/fitbit/incubator-nuttx-apps/platform/dummy
make[2]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps/platform'
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps'
make context  0.95s user 0.45s system 109% cpu 1.281 total
```
second time running context:
```
➜  incubator-nuttx git:(improve-make-context) time make context
Create .version
Create version.h
LN: include/arch/board to /home/user/code/fitbit/incubator-nuttx/boards/arm/stm32/stm32f3discovery/include
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx/boards'
make[1]: Nothing to be done for 'dirlinks'.
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/boards'
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps'
make[2]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps/platform'
LN: platform/board to /home/user/code/fitbit/incubator-nuttx-apps/platform/dummy
make[2]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps/platform'
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps'
make context  0.30s user 0.20s system 121% cpu 0.414 total
```
2021-12-22 16:10:13 -03:00
Gustavo Henrique Nihei
1c8e84b341 risc-v/esp32c3: Add Secure Boot support on top of MCUboot
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-21 07:02:40 -06:00
Gustavo Henrique Nihei
f542ab4564 xtensa/esp32s2: Add Secure Boot support on top of MCUboot
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-21 07:02:40 -06:00
Gustavo Henrique Nihei
d22a2aa7a0 xtensa/esp32: Refactor makefiles for compliance to Function Call Syntax
According to Make documentation:
- "Commas and unmatched parentheses or braces cannot appear in the text
  of an argument as written";
- "Leading spaces cannot appear in the text of the first argument as
  written".

Although in the current state it was not resulting in parsing issues, it
is better to fix it.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-21 07:02:40 -06:00
Gustavo Henrique Nihei
6c3223289f xtensa/esp32: Add Secure Boot support on top of MCUboot
This adds the capabitlity of building signed images on NuttX.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-21 07:02:40 -06:00
chao.an
d20bd62e08 libc/allsyms: Load all symbols for debugging
let the nuttx print out symbolic crash information and
symbolic stack backtraces. This increases the size of the nuttx
somewhat, as all symbols have to be loaded into the nuttx image.

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-13 08:31:13 -06:00
Xiang Xiao
1ba1f3f24b tools/size_report.py: Fix the lint error
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-05 16:55:52 +01:00