-
Notifications
You must be signed in to change notification settings - Fork 2k
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
mips: clean up pic32 makefiles #8248
Conversation
d70c339
to
89ababd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes basically ends up being only moving the include $(RIOTCPU)/mips32r2_common
things but has a meaning regarding cpu dependency.
Travis and Murdock also complains with whitespaces errors, github shows them too.
Another thing I wanted to do last time, was to move the include $(RIOTCPU)/mips_...
and $(RIOTMAKE)/arch/mips
in more specific to more generic order to the bottom of the file, this way, the local CPU includes will be before the common ones.
It would then match https://github.com/RIOT-OS/RIOT/blob/master/cpu/stm32f1/Makefile.include and https://github.com/RIOT-OS/RIOT/blob/master/cpu/samd21/Makefile.include
Quickly look through the files, I think it would not break anything. But not sure.
If it does, the solution is to lazy define variables in the common makefiles that could be set in the specific file.
What do you think ?
export INCLUDES += -I$(RIOTCPU)/mips_pic32_common/include | ||
|
||
USEMODULE += mips_pic32_common | ||
USEMODULE += mips_pic32_common_periph | ||
|
||
USEMODULE += periph_common | ||
USEMODULE += periph_hwrng | ||
|
||
export OFLAGS += -O ihex \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these OFLAGS
should stay in the mips_pic32mx/z
Makefile.include as they are specific to the ldscript used there.
This way all the --change-section-lma
for both boards are also not merged here.
I do not really understand why they are needed and not automatically calculated from the elf file, as in other cpus. But I may be missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not really understand why they are needed and not automatically calculated from the elf file,
as in other cpus. But I may be missing something.
Its a weird quirk of the Microchip MPLAB programmer. Other programming tools or elf loaders don't require this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the part I do not understand technically why :) But its completely fine to have it has its needed.
As I said however, I would still keep it in the specific CPU as its specific to the ldscript.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok fine to do that, but there were complaints about duplication in the makefiles, it works this way you just get a few more warnings about missing section names (you will always get one warning unless compiling C++ code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think making mips32r2_common and mips32r2_generic solved almost all of them, like what is now in mips32r2_common/Makefile.include
was duplicated as not included.
I also thought that making mips_pic32_common include mips32r2_common would remove more duplication but in practice not that much.
I did not check enough and these two OFLAGS lines where indeed different for the board.
However, now the fact that pic32_common are indeed mips32r2_common too is explicit.
@@ -1,7 +1,31 @@ | |||
include $(RIOTCPU)/mips32r2_common/Makefile.include | |||
|
|||
export INCLUDES += -I$(RIOTCPU)/mips_pic32_common/include | |||
|
|||
USEMODULE += mips_pic32_common | |||
USEMODULE += mips_pic32_common_periph | |||
|
|||
USEMODULE += periph_common | |||
USEMODULE += periph_hwrng |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you clean up the Makefiles what is this line supposed to do? If this is a dependency it should go into a Makefile.dep. If it means that the hardware has an hwrng on board, it should be FEATURES_PROVIDED += periph_hwrng
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no Idea how RIOT's make system is supposed to actually work, Its not really documented very well, I mean what is the difference between 'USEMODULE' and 'FEATURES_PROVIDED' and does it matter which you use ?
In answer to your question (on another thread) yes PIC32 devices support HWRNG and a driver is implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The FEATURES_PROVIDED list the features that a particular board can offer, while the USEMODULE explicitly tells the build system to build that support. FEATURES_PROVIDED is set by the board and CPU makefiles, while the application and its dependencies decide whether it should be compiled in or not. This is done in Makefile.dep for implicit dependencies and additional application specific dependencies are listed in the main Makefile for the application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, FEATURES_REQUIRED is used by an application to state that it needs a particular set of hardware/driver features in order to run properly. See the Makefiles in tests/periph_xxx for an example of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The features in Makefile.features
for all cpu of the mips family have been added by 28a2028
And may not be complete.
I think in this case, it should just also be added to the mips_pic32_common/Makefile.features
:
FEATURES_PROVIDED += periph_hwrng
Is that right @gebart ?
But this could be a different PR, "update features for mips cpus".
204dcd1
to
08df934
Compare
@cladmi, are you happy now ? Can you sign off on the review. |
Sorry I was not there a few days and took me some time to review. I would not remove |
1713156
to
72432e2
Compare
Make pic32m* depend on pic32_common which depends on mips32r2_common. Remove some duplication. This addresses some issues in RIOT-OS#8052.
72432e2
to
0133de6
Compare
Sorry I did not see that you updated the commit. Just say "done" below my answer to trigger me next time :) |
Make pic32m* depend on pic32_common which depends on mips32r2_common.
Remove some duplication.
This addresses some issues in #8052.