Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile.dep: process cpu dependencies and fix stm32_common #9892

Closed
wants to merge 5 commits into from

Conversation

cladmi
Copy link
Contributor

@cladmi cladmi commented Sep 6, 2018

Contribution description

This adds processing cpu dependencies and fixes for periph_flashpage with stm32_common.
The Makefile.dep include from periph/Makefile.dep has also been removed.

I can split them in different PRs if wanted.

I added a test commit that should be removed to show the problem.

Testing procedure

Compiling the given test is fixed by the PR, it can be tested with the first commit alone:

make -C tests/periph_flash_test_stm32_common/ BOARD=iotlab-m3  RIOT_CI_BUILD=1

make: Entering directory '/home/cladmi/git/work/RIOT/tests/periph_flash_test_stm32_common'
Building application "tests_periph_flash_test_stm32_common" for "iotlab-m3" with MCU "stm32f1".

/usr/lib/gcc/arm-none-eabi/8.2.0/../../../../arm-none-eabi/bin/ld: /home/cladmi/git/work/RIOT/tests/periph_flash_test_stm32_common/bin/iotlab-m3/stm32_common_periph.a(flashpage.o): in function `_unlock_flash':
/home/cladmi/git/work/RIOT/cpu/stm32_common/periph/flashpage.c:58: undefined reference to `_unlock'
/usr/lib/gcc/arm-none-eabi/8.2.0/../../../../arm-none-eabi/bin/ld: /home/cladmi/git/work/RIOT/tests/periph_flash_test_stm32_common/bin/iotlab-m3/stm32_common_periph.a(flashpage.o): in function `flashpage_write_raw':
/home/cladmi/git/work/RIOT/cpu/stm32_common/periph/flashpage.c:202: undefined reference to `_lock'
/usr/lib/gcc/arm-none-eabi/8.2.0/../../../../arm-none-eabi/bin/ld: /home/cladmi/git/work/RIOT/tests/periph_flash_test_stm32_common/bin/iotlab-m3/stm32_common_periph.a(flashpage.o): in function `_unlock_flash':
/home/cladmi/git/work/RIOT/cpu/stm32_common/periph/flashpage.c:58: undefined reference to `_unlock'
/usr/lib/gcc/arm-none-eabi/8.2.0/../../../../arm-none-eabi/bin/ld: /home/cladmi/git/work/RIOT/tests/periph_flash_test_stm32_common/bin/iotlab-m3/stm32_common_periph.a(flashpage.o): in function `_erase_page':
/home/cladmi/git/work/RIOT/cpu/stm32_common/periph/flashpage.c:142: undefined reference to `_lock'
collect2: error: ld returned 1 exit status
make: *** [/home/cladmi/git/work/RIOT/tests/periph_flash_test_stm32_common/../../Makefile.include:431: /home/cladmi/git/work/RIOT/tests/periph_flash_test_stm32_common/bin/iotlab-m3/tests_periph_flash_test_stm32_common.elf] Error 1
make: Leaving directory '/home/cladmi/git/work/RIOT/tests/periph_flash_test_stm32_common'

Also, the stm32_common/periph/i2c_X handling is still working:

This works both in master and with this PR

make -C tests/periph_i2c/ BOARD=iotlab-m3
make -C tests/periph_i2c/ BOARD=nucleo-f070rb

ar t tests/periph_i2c/bin/nucleo-f070rb/stm32_common_periph.a  | grep 'i2c_..o'
i2c_1.o
ar t tests/periph_i2c/bin/iotlab-m3/stm32_common_periph.a  | grep 'i2c_2.o'
i2c_2.o

Issues/PRs references

Found in #9342 main PR
Part of the main issue "dependencies declared in cpu/board Makefile.include" #8713

Allow handling full dependencies in cpu
Prepare to move some dependencies out of Makefile.include
Makefile.dep should never be included in a module Makefile.

It is now directly included by the main Makefile.dep trough
cpu/CPU/Makefile.dep.
It allows module (not in the application) which require the periph_flashpage
feature to correctly also require periph_flash_common
@cladmi cladmi added CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: cpu Area: CPU/MCU ports labels Sep 6, 2018
@cladmi cladmi requested a review from aabadie September 6, 2018 10:02
@cladmi
Copy link
Contributor Author

cladmi commented Sep 7, 2018

The approach cannot work because in

include $(RIOTBASE)/Makefile.dep
the CPU is not known, so it should be done by the board Makefile.dep with hardcoded cpu.

I will do another PR in this direction.

@cladmi cladmi closed this Sep 7, 2018
@cladmi cladmi deleted the pr/make/cpu/makefile.dep branch September 7, 2018 11:57
@cladmi
Copy link
Contributor Author

cladmi commented Sep 10, 2018

Hardwriting this would mean re-adding again some hardwriten duplication of the CPU variable, I will try something addressing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: cpu Area: CPU/MCU ports CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants