forked from apache/nuttx
-
-
Notifications
You must be signed in to change notification settings - Fork 1
203 lines (168 loc) · 6.97 KB
/
bl602.yml
File metadata and controls
203 lines (168 loc) · 6.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
## Build upstream NuttX every day and test...
## - Auto-deploy to BL602 after build, capture the UART output and look for errors
## - Use an SBC to auto-flash BL602 over UART (USB)
## - SBC will toggle GPIO 8 to set the flashing mode
## - SBC will restart BL602 before and after flashing
## Why are we doing this? So that we can pick a stable upstream version of NuttX to merge into our fork of NuttX
## See https://github.com/lupyuen/remote-bl602
name: Daily Build of NuttX for BL602
permissions:
## Allow publishing of GitHub Release
contents: write
on:
## Run every day at 0:30 UTC, because 0:00 UTC seems too busy for the scheduler
schedule:
- cron: '30 0 * * *'
## Run on every commit
## push:
## branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Build Tools
run: |
sudo apt -y update
sudo apt -y install \
bison flex gettext texinfo libncurses5-dev libncursesw5-dev \
gperf automake libtool pkg-config build-essential gperf genromfs \
libgmp-dev libmpc-dev libmpfr-dev libisl-dev binutils-dev libelf-dev \
libexpat-dev gcc-multilib g++-multilib u-boot-tools util-linux \
kconfig-frontends \
wget
- name: Install Toolchain
run: |
wget --no-check-certificate https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz
tar -xf xpack-riscv-none-elf-gcc-*.tar.gz
- name: Checkout Source Files
run: |
mkdir nuttx
cd nuttx
git clone https://github.com/apache/incubator-nuttx nuttx
git clone https://github.com/apache/incubator-nuttx-apps apps
- name: Update BL602 Pins
run: |
## BL602 Pin Definitions and Bringup
board=nuttx/nuttx/boards/risc-v/bl602/bl602evb/include/board.h
bringup=nuttx/nuttx/boards/risc-v/bl602/bl602evb/src/bl602_bringup.c
## Preserve the Pin Definitions and Bringup
cp $board nuttx/nuttx/nuttx.board
cp $bringup nuttx/nuttx/nuttx.bringup
cat $board
- name: Build
run: |
## Add toolchain to PATH
export PATH=$PATH:$PWD/xpack-riscv-none-elf-gcc-13.2.0-2/bin
cd nuttx/nuttx
## Dump the git hash
hash1=`git rev-parse HEAD`
pushd ../apps
hash2=`git rev-parse HEAD`
popd
echo NuttX Source: https://github.com/apache/nuttx/tree/$hash1 >nuttx.hash
echo NuttX Apps: https://github.com/apache/nuttx-apps/tree/$hash2 >>nuttx.hash
cat nuttx.hash
## Show the GCC version
riscv-none-elf-gcc -v
## Configure the build
./tools/configure.sh bl602evb:nsh
## Enable errors, warnings, info messages and assertions
kconfig-tweak --enable CONFIG_DEBUG_ERROR
kconfig-tweak --enable CONFIG_DEBUG_WARN
kconfig-tweak --enable CONFIG_DEBUG_INFO
kconfig-tweak --enable CONFIG_DEBUG_ASSERTIONS
## Enable GPIO errors, warnings and info messages
kconfig-tweak --enable CONFIG_DEBUG_GPIO
kconfig-tweak --enable CONFIG_DEBUG_GPIO_ERROR
kconfig-tweak --enable CONFIG_DEBUG_GPIO_WARN
kconfig-tweak --enable CONFIG_DEBUG_GPIO_INFO
## Enable SPI errors, warnings and info messages
kconfig-tweak --enable CONFIG_DEBUG_SPI
kconfig-tweak --enable CONFIG_DEBUG_SPI_ERROR
kconfig-tweak --enable CONFIG_DEBUG_SPI_WARN
kconfig-tweak --enable CONFIG_DEBUG_SPI_INFO
## Enable Floating Point
kconfig-tweak --enable CONFIG_LIBC_FLOATINGPOINT
## Enable Compiler Stack Canaries
kconfig-tweak --enable CONFIG_STACK_CANARIES
## Enable NuttX Shell commands: cat, help, ls
kconfig-tweak --disable CONFIG_NSH_DISABLE_CAT
kconfig-tweak --disable CONFIG_NSH_DISABLE_HELP
kconfig-tweak --disable CONFIG_NSH_DISABLE_LS
## Enable GPIO
kconfig-tweak --enable CONFIG_DEV_GPIO
kconfig-tweak --set-val CONFIG_DEV_GPIO_NSIGNALS 1
## Enable GPIO Test App
kconfig-tweak --enable CONFIG_EXAMPLES_GPIO
kconfig-tweak --set-str CONFIG_EXAMPLES_GPIO_PROGNAME "gpio"
kconfig-tweak --set-val CONFIG_EXAMPLES_GPIO_PRIORITY 100
kconfig-tweak --set-val CONFIG_EXAMPLES_GPIO_STACKSIZE 2048
## Enable SPI
kconfig-tweak --enable CONFIG_BL602_SPI0
kconfig-tweak --enable CONFIG_SPI
kconfig-tweak --enable CONFIG_SPI_EXCHANGE
kconfig-tweak --enable CONFIG_SPI_DRIVER
kconfig-tweak --enable CONFIG_SPI_CMDDATA
## Previously: Enable UART1
## kconfig-tweak --enable CONFIG_BL602_HAVE_UART1
## kconfig-tweak --set-val CONFIG_UART1_BAUD 9600
## Enable I2C0 and Sensor Test App
kconfig-tweak --enable CONFIG_BL602_I2C0
kconfig-tweak --enable CONFIG_I2C
kconfig-tweak --enable CONFIG_I2C_DRIVER
kconfig-tweak --enable CONFIG_MM_CIRCBUF
kconfig-tweak --enable CONFIG_SENSORS
kconfig-tweak --set-val CONFIG_SENSORS_NPOLLWAITERS 2
kconfig-tweak --enable CONFIG_DEBUG_I2C
kconfig-tweak --enable CONFIG_DEBUG_I2C_ERROR
kconfig-tweak --enable CONFIG_DEBUG_I2C_WARN
kconfig-tweak --enable CONFIG_DEBUG_I2C_INFO
kconfig-tweak --enable CONFIG_DEBUG_SENSORS
kconfig-tweak --enable CONFIG_DEBUG_SENSORS_ERROR
kconfig-tweak --enable CONFIG_DEBUG_SENSORS_WARN
kconfig-tweak --enable CONFIG_DEBUG_SENSORS_INFO
kconfig-tweak --enable CONFIG_TESTING_SENSORTEST
kconfig-tweak --set-str CONFIG_TESTING_SENSORTEST_PROGNAME "sensortest"
kconfig-tweak --set-val CONFIG_TESTING_SENSORTEST_PRIORITY 100
kconfig-tweak --set-val CONFIG_TESTING_SENSORTEST_STACKSIZE 4096
## Preserve the build config
cp .config nuttx.config
## Run the build
make
## Dump the disassembly to nuttx.S
riscv-none-elf-objdump \
-t -S --demangle --line-numbers --wide \
nuttx \
>nuttx.S \
2>&1
- name: Upload Build Outputs
uses: actions/upload-artifact@v4
with:
name: nuttx.zip
path: nuttx/nuttx/nuttx*
- name: Zip Build Outputs
run: |
cd nuttx/nuttx
zip nuttx.zip nuttx*
- name: Get Current Date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: upstream-${{ steps.date.outputs.date }}
draft: false
prerelease: false
generate_release_notes: false
files: |
nuttx/nuttx/nuttx.zip
nuttx/nuttx/nuttx
nuttx/nuttx/nuttx.S
nuttx/nuttx/nuttx.bin
nuttx/nuttx/nuttx.map
nuttx/nuttx/nuttx.hex
nuttx/nuttx/nuttx.config
nuttx/nuttx/nuttx.bringup
nuttx/nuttx/nuttx.board
nuttx/nuttx/nuttx.manifest
nuttx/nuttx/nuttx.hash