summaryrefslogtreecommitdiff
path: root/fw/btl/meson.build
blob: 8ca1eb364eff80cf4e84b33f1e1658a06d6da3ce (plain)
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
external_project = import('unstable-external_project')

external_project.add_project(
  configure_zephyr,
  configure_options: [
    '--source-tree', bootloader_firmware,
    '--build-tree', meson.current_build_dir() / 'build',
    '--board', board,
    '--zephyr-base', zephyr,
    '--zephyr-modules', ';'.join(zephyr_modules),
    '--extra-config', meson.current_source_dir() / 'bootloader.conf',
    '--signing-key', signing_key,
  ],
  verbose: true,
)

bootloader = custom_target('bootloader',
  output: ['bootloader.bin'],
  command: [
    build_zephyr,
    '--build-tree', meson.current_build_dir() / 'build',
    '--binary-name', 'zephyr.bin',
    '--target-name', 'bootloader.bin',
  ],
  build_by_default: true,
  install: true,
  install_dir: '/',
)

flash_bootloader = custom_target(
  build_always_stale: true,
  build_by_default: false,
  command: [
    'st-flash',
    '--connect-under-reset',
    'write',
    meson.current_build_dir() / 'bootloader.bin',
    '0x8000000',
  ],
  depends: bootloader,
  output: ['flash'],
)