Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
67687636
Unverified
Commit
67687636
authored
6 years ago
by
Gaëtan Harter
Committed by
cladmi
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
cortexm_common_ldscript: add test for linker FW_ROM_LEN
Compile an elf file with a length equals to half the rom length.
parent
7dad2e70
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/cortexm_common_ldscript/Makefile
+27
-4
27 additions, 4 deletions
tests/cortexm_common_ldscript/Makefile
with
27 additions
and
4 deletions
tests/cortexm_common_ldscript/Makefile
+
27
−
4
View file @
67687636
...
@@ -20,12 +20,12 @@ BOARD_WHITELIST += stm32mindev
...
@@ -20,12 +20,12 @@ BOARD_WHITELIST += stm32mindev
include
$(RIOTBASE)/Makefile.include
include
$(RIOTBASE)/Makefile.include
# # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # #
# # # # # # # # #
# Compile time tests for ROM_OFFSET #
# Compile time tests for ROM_OFFSET
and FW_ROM_LENGTH
#
# # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # #
# # # # # # # # #
COMPILE_TESTS
=
test-elffile-overflow test-elffile-fw_rom_length
COMPILE_TESTS
=
test-elffile-overflow test-elffile-fw_rom_length
COMPILE_TESTS
+=
tests-offsets
COMPILE_TESTS
+=
tests-offsets
tests-fw_rom_len
all
:
compile-tests
all
:
compile-tests
...
@@ -98,3 +98,26 @@ $(BINDIR)/$(APPLICATION)_offset_%.elf: ROM_OFFSET=$*
...
@@ -98,3 +98,26 @@ $(BINDIR)/$(APPLICATION)_offset_%.elf: ROM_OFFSET=$*
$(BINDIR)/$(APPLICATION)_offset_%.elf
:
$(ELFFILES_DEPS)
$(BINDIR)/$(APPLICATION)_offset_%.elf
:
$(ELFFILES_DEPS)
$(
Q
)$(
_LINK
)
-o
$@
$(
Q
)$(
_LINK
)
-o
$@
.PRECIOUS
:
$(BINDIR)/$(APPLICATION)_offset_%.elf
.PRECIOUS
:
$(BINDIR)/$(APPLICATION)_offset_%.elf
# Compile elf files with FW_ROM_LEN and verify the length is taken into account
# I arbitrarily do 'half' size because I needed to take a value and
# that it is similar to what is required for doing dual firmware in rom ota
tests-fw_rom_len
:
test-fw_len_half_rom
.PHONY
:
test-fw_len_half_rom
test-fw_len_half_rom
:
$(BINDIR)/$(APPLICATION)_fw_len_half_rom.elf
$(
Q
)
echo
-n
"Test compilation with half ROM length: "
$(
Q
)
\
TEST_FW_LEN
=
$$($(
PREFIX
)
readelf
--symbols
$^
2>/dev/null |
awk
'/_fw_rom_length/{printf "0x%s\n", $$2
}
'
)
;
\
EXPECT_FW_LEN
=
$$(
printf
"0x%08x"
$$(
(
$(
ROM_LEN_BYTES
)
/ 2
))
)
;
\
if
test
$${
TEST_FW_LEN
}
!=
$${
EXPECT_FW_LEN
};
then
\
echo
"[ERROR] Linker firmware length not used
$${
TEST_FW_LEN
}
!=
$${
EXPECT_FW_LEN
}
"
>
&2
;
\
exit
1
;
\
fi
$(
Q
)
echo
[
OK]
$(BINDIR)/$(APPLICATION)_fw_len_half_rom.elf
:
FW_ROM_LEN=$$(($(ROM_LEN_BYTES)/2))
$(BINDIR)/$(APPLICATION)_fw_len_half_rom.elf
:
$(ELFFILES_DEPS)
$(
Q
)$(
_LINK
)
-o
$@
.PRECIOUS
:
$(BINDIR)/$(APPLICATION)_fw_len_half_rom.elf
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment