Skip to content
Snippets Groups Projects
Commit 795d965c authored by Nikolay Amiantov's avatar Nikolay Amiantov
Browse files

Improve bootloader-update build process

parent 781d4129
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ splash_screen = custom_target( ...@@ -13,7 +13,7 @@ splash_screen = custom_target(
], ],
) )
executable( elf = executable(
name + '.elf', name + '.elf',
'main.c', 'main.c',
'mscmem.c', 'mscmem.c',
...@@ -39,3 +39,11 @@ build_image = [files('./build_image.sh'), python3] ...@@ -39,3 +39,11 @@ build_image = [files('./build_image.sh'), python3]
# build_multi_image.sh # build_multi_image.sh
build_multi_image = [files('./build_multi_image.sh'), python3] build_multi_image = [files('./build_multi_image.sh'), python3]
bootloader_bin = custom_target(
name + '.bin',
build_by_default: true,
output: name + '.bin',
input: elf,
command: [build_image, '@INPUT@', '@OUTPUT0@'],
)
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
/***** Includes *****/ /***** Includes *****/
#include "card10.h" #include "card10.h"
#include "bootloader-9251ea6.h" #include "bootloader.h"
#include "display.h" #include "display.h"
#include "gfx.h" #include "gfx.h"
#include "pmic.h" #include "pmic.h"
...@@ -59,8 +59,8 @@ int main(void) ...@@ -59,8 +59,8 @@ int main(void)
ret = FLC_Write( ret = FLC_Write(
0x10000000, 0x10000000,
sizeof(bootloader_data), bootloader_bootloader_bin_len,
(uint32_t *)bootloader_data (uint32_t *)bootloader_bootloader_bin
); );
if (ret != E_NO_ERROR) { if (ret != E_NO_ERROR) {
printf("FLC_Write failed with %d\n", ret); printf("FLC_Write failed with %d\n", ret);
......
name = 'bootloader-update' name = 'bootloader-update'
header = custom_target(
'bootloader.h',
output: 'bootloader.h',
input: bootloader_bin,
command: [xxd, '-i', '@INPUT@', '@OUTPUT0@'],
)
header_dep = declare_dependency(
sources: [header],
)
elf = executable( elf = executable(
name + '.elf', name + '.elf',
'main.c', 'main.c',
dependencies: [libcard10, max32665_startup], dependencies: [libcard10, max32665_startup, header_dep],
link_whole: [max32665_startup_lib, board_card10_lib], link_whole: [max32665_startup_lib, board_card10_lib],
link_args: [ link_args: [
'-Wl,-Map=' + meson.current_build_dir() + '/' + name + '.map', '-Wl,-Map=' + meson.current_build_dir() + '/' + name + '.map',
......
...@@ -54,6 +54,7 @@ version_hdr = custom_target( ...@@ -54,6 +54,7 @@ version_hdr = custom_target(
) )
jq = find_program('jq', required: false) jq = find_program('jq', required: false)
if jq.found() if jq.found()
compile_commands = custom_target( compile_commands = custom_target(
'compile_commands_tidy.json', 'compile_commands_tidy.json',
...@@ -68,6 +69,8 @@ if jq.found() ...@@ -68,6 +69,8 @@ if jq.found()
) )
endif endif
xxd = find_program('xxd')
subdir('lib/') subdir('lib/')
subdir('bootloader/') subdir('bootloader/')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment