Is mpconfigport.h included in every micropython source file?
If yes, can we rely on this behavior going forward?
[SOLVED]Is mpconfigport.h included in every micropython source file?
[SOLVED]Is mpconfigport.h included in every micropython source file?
Last edited by jickster on Tue Nov 21, 2017 9:12 pm, edited 1 time in total.
Re: Is mpconfigport.h included in every micropython source file?
What/why are you really asking?
You can run the following command (under linux) from inside the build directory to get a list of the files which don't include mpconfigport.h:
The files listed come from lib/libm, lib/libc and the HAL.
The *.P files are the dependency files which are produced by the compiler.
You can run the following command (under linux) from inside the build directory to get a list of the files which don't include mpconfigport.h:
Code: Select all
find . -name '*.P' -exec fgrep -L mpconfigport.h {} \;
The *.P files are the dependency files which are produced by the compiler.
Re: Is mpconfigport.h included in every micropython source file?
I need to tell my linker to place the archive containing the micropython objects in a certain section like so
Code: Select all
.dflash_code :
{
*\ATI_micropython.dlb:* // this is my archive file
} >dflash
https://stackoverflow.com/questions/473 ... in-section
The brute-force method of doing this is to add
Code: Select all
__attribute__((section(".dflash_code")))
I'd like to assign that to a macro but it looks like there's no one .h included by every .c file.
Re: Is mpconfigport.h included in every micropython source file?
That's definitely something that you should be able to do in the linker script file. I know that linker script files are very picky about having the syntax exactly right, and tend to silently ignore stuff it doesn't like.
I think that you should modify your linker script to look like this:
The \ is probably being treated not as a directory seperator, so I'd eliminate it and make sure you specify a -L option containing the directory with the ATI_micropython.dlb file in it. I'm assuming you only want code in the dflash_code section. If you want more, then specify each section type that you want on a separate line. If you specify all sections then you'll get debug stuff and lots of other stuff that you don't want.
I think that you should modify your linker script to look like this:
Code: Select all
dflash_code :
{
ATI_micropython.dlb:*(.text*)
} >dflash
Re: Is mpconfigport.h included in every micropython source file?
I figure it out: there was a section above that was placing all *.text into the wrong section; since it appeared first in the linker file, it took precedence over my .dflash_code entry.dhylands wrote: ↑Tue Nov 21, 2017 8:02 pmThat's definitely something that you should be able to do in the linker script file. I know that linker script files are very picky about having the syntax exactly right, and tend to silently ignore stuff it doesn't like.
I think that you should modify your linker script to look like this:The \ is probably being treated not as a directory seperator, so I'd eliminate it and make sure you specify a -L option containing the directory with the ATI_micropython.dlb file in it. I'm assuming you only want code in the dflash_code section. If you want more, then specify each section type that you want on a separate line. If you specify all sections then you'll get debug stuff and lots of other stuff that you don't want.Code: Select all
dflash_code : { ATI_micropython.dlb:*(.text*) } >dflash
I moved my .dflash_code above it and it works now.