Skip to content

Commit ff19445

Browse files
Support for Arm Cortex-M7 (NUCLEO-F767ZI) (#36)
* limit the scope of `with` in nix Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> * fix multi targets of libopencm3 string concatanation in nix Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> * support for cortex-m7 Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> * update build ci for m7 Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> * refactor tests script interface by removing the emulate flag Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> * support for cortex-m7 in the tests script Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> * remove boards that are not supported Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> * rename stm32f767zi -> nucleo-f767zi Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> * output flash output if verbose flag is on Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> * merge shared_options and shared_args for tests script cli Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> * nucleo-f767zi: do not use CCM Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu> * take median value for speed benchmark Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> --------- Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu> Co-authored-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
1 parent 48d5029 commit ff19445

File tree

8 files changed

+232
-359
lines changed

8 files changed

+232
-359
lines changed

.github/workflows/build.yaml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,19 @@ jobs:
2525
- name: Build targets
2626
shell: nix develop .#ci -c bash -e {0}
2727
run: |
28-
make
29-
make RNG=NISTKAT nistkat
28+
make_platform() {
29+
echo "::group::make platform $1"
30+
make PLATFORM="$1"
31+
echo "::endgroup::"
32+
33+
echo "::group::make platform $1 nistkat"
34+
make PLATFORM="$1" RNG=NISTKAT nistkat
35+
echo "::endgroup::"
36+
}
37+
38+
make_platform stm32f4discovery
39+
make_platform nucleo-f767zi
40+
3041
- name: Build for emulation on QEMU
3142
shell: nix develop .#ci -c bash -e {0}
3243
run: |
@@ -38,15 +49,15 @@ jobs:
3849
id: func_test
3950
shell: nix develop .#ci -c bash -e {0}
4051
run: |
41-
tests func -e -v stm32f4discovery
52+
tests func -v mps2-an386
4253
- name: Speed test
4354
id: speed_test
4455
shell: nix develop .#ci -c bash -e {0}
4556
if: |
4657
success()
4758
|| steps.func_test.conclusion == 'failure'
4859
run: |
49-
tests speed -e -v stm32f4discovery
60+
tests speed -v mps2-an386
5061
- name: Stack test
5162
id: stack_test
5263
shell: nix develop .#ci -c bash -e {0}
@@ -55,7 +66,7 @@ jobs:
5566
|| steps.func_test.conclusion == 'failure'
5667
|| steps.speed_test.conclusion == 'failure'
5768
run: |
58-
tests stack -e -v stm32f4discovery
69+
tests stack -v mps2-an386
5970
- name: Nistkat test
6071
shell: nix develop .#ci -c bash -e {0}
6172
if: |
@@ -64,4 +75,4 @@ jobs:
6475
|| steps.speed_test.conclusion == 'failure'
6576
|| steps.stack_test.conclusion == 'failure'
6677
run: |
67-
tests nistkat -e -v stm32f4discovery
78+
tests nistkat -v mps2-an386

flake.nix

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,39 @@
1919
perSystem = { pkgs, ... }:
2020
let
2121
libopencm3 = pkgs.callPackage ./libopencm3.nix {
22-
targets = [ "stm32/f4" ];
22+
targets = [ "stm32/f4" "stm32/f7" ];
2323
};
24-
core = with pkgs; [
25-
# formatter & linters
26-
nixpkgs-fmt
27-
shfmt
28-
astyle # 3.4.10
24+
core = builtins.attrValues {
25+
libopencm3 = libopencm3;
2926

30-
# build dependencies
31-
gcc-arm-embedded-13 # arm-gnu-toolchain-13.2.rel1
32-
python311
33-
qemu # 8.1.5
34-
libopencm3
27+
inherit (pkgs)
28+
# formatter & linters
29+
nixpkgs-fmt
30+
shfmt
31+
astyle# 3.4.10
3532

36-
yq
37-
python311Packages.pyserial # 3.5
38-
python311Packages.click
39-
];
33+
# build dependencies
34+
gcc-arm-embedded-13# arm-gnu-toolchain-13.2.rel1
35+
python311
36+
qemu# 8.1.5
37+
38+
yq;
39+
40+
inherit (pkgs.python311Packages)
41+
pyserial# 3.5
42+
click;
43+
};
4044
in
4145
{
42-
devShells.default = with pkgs; mkShellNoCC {
43-
packages = core ++ [
44-
direnv
45-
nix-direnv
46+
devShells.default = pkgs.mkShellNoCC {
47+
packages = core ++ builtins.attrValues {
48+
inherit (pkgs)
49+
direnv
50+
nix-direnv
4651

47-
# debug dependencies
48-
openocd # 0.12.0
49-
];
52+
# debug dependencies
53+
openocd; # 0.12.0
54+
};
5055

5156
shellHook = ''
5257
export OPENCM3_DIR=${libopencm3}
@@ -55,7 +60,7 @@
5560
'';
5661
};
5762

58-
devShells.ci = with pkgs; mkShellNoCC {
63+
devShells.ci = pkgs.mkShellNoCC {
5964
packages = core;
6065

6166
shellHook = ''

hal/devices.data

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# SPDX-License-Identifier: Apache-2.0
22
stm32f407vg stm32f4 ROM=1024K RAM=128K
33
stm32f4 END ROM_OFF=0x08000000 RAM_OFF=0x20000000 CPU=cortex-m4 FPU=hard-fpv4-sp-d16
4+
stm32f767zi stm32f7 ROM=2048K RAM=384K
5+
stm32f7 END ROM_OFF=0x08000000 RAM_OFF=0x20010000 CPU=cortex-m7 FPU=hard-fpv5-sp-d16

0 commit comments

Comments
 (0)