Skip to content

Commit

Permalink
meson: add summary output
Browse files Browse the repository at this point in the history
Provide formated configuration output to build, mostly for demo
  • Loading branch information
rg-silva committed Jun 29, 2023
1 parent e918bda commit a973ef2
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 6 deletions.
11 changes: 9 additions & 2 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ bmd_core_sources = files(
bmd_core_args = []

# Debug output handling
if(get_option('debug_output'))
debug_output = get_option('debug_output')
if debug_output
bmd_core_args += [
'-DENABLE_DEBUG=1'
]
endif

# RTT support handling
if get_option('rtt_support')
rtt_support = get_option('rtt_support')
if rtt_support
bmd_core_sources += files(
'rtt.c',
)
Expand All @@ -85,3 +87,8 @@ bmd_core = declare_dependency(
# TODO: when support for build as a host library is added, this can be conditional?
subdir('platform')
subdir('probe')

summary({
'Debug output': debug_output ? 'Yes' : 'No',
'RTT support': rtt_support ? 'Yes' : 'No',
}, section: 'Black Magic Debug')
6 changes: 6 additions & 0 deletions src/probe/96b_carbon/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ probe_bootloader = declare_dependency(
link_args: probe_96b_carbon_link_args,
dependencies: platform_stm32f4_dfu,
)

summary({
'Name': '96b Carbon',
'Platform': 'STM32F4',
'Bootloader': 'OEM Bootloader',
}, section: 'Probe')
6 changes: 6 additions & 0 deletions src/probe/f072/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@ probe_host = declare_dependency(
link_args: probe_f072_link_args,
dependencies: [platform_common, platform_stm32f0, fixme_platform_stm32_traceswo],
)

summary({
'Name': 'STM32F072',
'Platform': 'STM32F0',
'Bootloader': 'OEM ST Bootloader',
}, section: 'Probe')
6 changes: 6 additions & 0 deletions src/probe/f3/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@ probe_host = declare_dependency(
link_args: probe_f3_link_args,
dependencies : [platform_common, platform_stm32f3, fixme_platform_stm32_traceswo],
)

summary({
'Name': 'STM32F303',
'Platform': 'STM32F3',
'Bootloader': 'OEM ST Bootloader',
}, section: 'Probe')
10 changes: 9 additions & 1 deletion src/probe/f4discovery/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ probe_f4discovery_dfu_sources = files(
'usbdfu.c',
)

probe_f4discovery_dfu_serial_length = get_option('bmd_bootloader') ? '9' : '13'
bmd_bootloader = get_option('bmd_bootloader')

probe_f4discovery_dfu_serial_length = bmd_bootloader ? '9' : '13'

probe_f4discovery_args = [
f'-DDFU_SERIAL_LENGTH=@probe_f4discovery_dfu_serial_length@',
Expand Down Expand Up @@ -70,3 +72,9 @@ probe_bootloader = declare_dependency(
link_args: probe_f4discovery_commonn_link_args,
dependencies: platform_stm32f4_dfu,
)

summary({
'Name': 'STM32F407 Discovery',
'Platform': 'STM32F4',
'Bootloader': bmd_bootloader ? 'Black Magic Debug Bootloader' : 'OEM ST Bootloader',
}, section: 'Probe')
6 changes: 6 additions & 0 deletions src/probe/hydrabus/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,9 @@ probe_bootloader = declare_dependency(
link_args: probe_hydrabus_link_args,
dependencies: platform_stm32f4_dfu,
)

summary({
'Name': 'Hydrabus',
'Platform': 'STM32F4',
'Bootloader': 'OEM Bootloader',
}, section: 'Probe')
6 changes: 6 additions & 0 deletions src/probe/launchpad-icdi/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,9 @@ probe_host = declare_dependency(
link_args: probe_launchpad_icdi_link_args,
dependencies: [platform_common, platform_tm4c],
)

summary({
'Name': 'Launchpad ICDI',
'Platform': 'TM4C',
'Serial Number': serialno,
}, section: 'Probe')
7 changes: 7 additions & 0 deletions src/probe/native/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,10 @@ probe_bootloader = declare_dependency(
link_args: probe_native_common_link_args,
dependencies: platform_stm32f1_dfu,
)

summary({
'Name': 'Black Magic Probe (native)',
'Platform': 'STM32F1',
'Bootloader': 'Black Magic Debug Bootloader',
'Load Address': '0x8002000',
}, section: 'Probe')
12 changes: 11 additions & 1 deletion src/probe/stlink/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ endif

probe_stlink_dependencies = [platform_common, platform_stm32f1]

if probe == 'stlink' and get_option('stlink_swim_as_uart')
stlink_swim_as_uart = get_option('stlink_swim_as_uart')

if probe == 'stlink' and stlink_swim_as_uart
probe_stlink_args += [
'-DSWIM_AS_UART=1'
]
Expand All @@ -98,3 +100,11 @@ probe_bootloader = declare_dependency(
link_args: probe_stlink_common_link_args,
dependencies: platform_stm32f1_dfu,
)

summary({
'Name': probe == 'stlink' ? 'ST-Link' : 'BluePill',
'Platform': 'STM32F1',
'Bootloader': bmd_bootloader ? 'Black Magic Debug Bootloader' : 'OEM ST Bootloader',
'Load Address': probe_stlink_load_address,
'SWIM as UART': probe == 'stlink' and stlink_swim_as_uart ? 'Yes' : 'No',
}, section: 'Probe')
11 changes: 10 additions & 1 deletion src/probe/stlinkv3/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ probe_stlinkv3_dfu_sources = files(
'usb_f723.c',
)

probe_stlinkv3_load_address = get_option('bmd_bootloader') ? '0x08020000' : '0x08000000'
bmd_bootloader = get_option('bmd_bootloader')

probe_stlinkv3_load_address = bmd_bootloader ? '0x08020000' : '0x08000000'

probe_stlinkv3_args = [
'-DDFU_SERIAL_LENGTH=25',
Expand Down Expand Up @@ -73,3 +75,10 @@ probe_bootloader = declare_dependency(
link_args: probe_stlinkv3_common_link_args,
dependencies: platform_stm32f7_dfu,
)

summary({
'Name': 'STLINK-V3',
'Platform': 'STM32F7',
'Bootloader': bmd_bootloader ? 'Black Magic Debug Bootloader' : 'OEM ST Bootloader',
'Load Address': probe_stlinkv3_load_address,
}, section: 'Probe')
7 changes: 7 additions & 0 deletions src/probe/swlink/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,10 @@ probe_bootloader = declare_dependency(
link_args: probe_swlink_common_link_args,
dependencies: platform_stm32f1_dfu,
)

summary({
'Name': 'STM8S Discovery and STM32F103 Minimum System Development Board',
'Platform': 'STM32F1',
'Bootloader': 'Black Magic Debug Bootloader',
'Load Address': '0x8002000',
}, section: 'Probe')
9 changes: 8 additions & 1 deletion src/target/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ target_ti = declare_dependency(
dependencies: target_cortexm,
)

enabled_targets = get_option('targets')

enabled_target_deps = []
foreach target: get_option('targets')
foreach target: enabled_targets
enabled_target_deps += get_variable(f'target_@target@')
endforeach

Expand All @@ -164,3 +166,8 @@ bmd_targets = declare_dependency(
sources: target_common_sources,
dependencies: enabled_target_deps,
)

summary({
'Warning': 'Not all enabled targets may be listed here',
'Targets': enabled_targets,
}, section: 'Targets')

0 comments on commit a973ef2

Please sign in to comment.