Skip to content

Conversation

@dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Dec 11, 2019

Use preprocessor macros to define the size and position of flash regions. This reduces all the different linker .ld files to a single template file, boards/common.template.ld.

The needed preprocessor values are made available in ports/*/ld_defines.c. . At build time, that file is run through the C preprocessor, generating ld_defines.pp. Then tools/gen_ld_files.py reads ld_defines.pp, common.template.ld, and generates common.ld in the board build directory.
(There is provision for more than one template file, but so far, we only need one).

I also did a lot of cleanup and refactoring of the mpconfigboard.mk files, moving a number of definitions to common places.

This is working for atmel-samd and nrf. stm32f4 and cxd56 remain to be done.

Testing: I built and tested various atmel-samd boards, and they seem to work. I built some nrf boards, and tested the CPB builds with the central/peripheral demo.

pca10059 doesn't work properly, but it didn't work before either (see #2339). We can debug that separately.

This is preparatory to storing bonding information on nrf.

@dhalbert dhalbert requested a review from tannewt December 11, 2019 02:23
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor things. Overall this looks like an awesome improvement! Thanks!

@dhalbert
Copy link
Collaborator Author

@tannewt ok, ready for re-review

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, looks good! Lets make sure and warn folks to back up their files on non-Express boards with the next release.

@dhalbert dhalbert merged commit 10183d5 into adafruit:master Dec 12, 2019
@dhalbert dhalbert deleted the ld-cleanup branch December 12, 2019 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants