Skip to content
This repository was archived by the owner on Jul 6, 2019. It is now read-only.

hal: k20 - flash config section addition #217

Merged
merged 1 commit into from
Nov 14, 2014
Merged

Conversation

0xc0170
Copy link
Contributor

@0xc0170 0xc0170 commented Nov 3, 2014

This is as I described in #212. Tested with pyOCD and binary mbed cmsis-dap interface (binary flashing)

@bharrisau
Copy link
Contributor

LGTM. Just get @bgamari to confirm it all looks fine on his toolchain.

@bgamari
Copy link
Contributor

bgamari commented Nov 4, 2014

I'll test it when I get home. I am a bit worried, however, that k20's layout.ld will now fall out of sync with the linker script used by the rest of the platforms. What could we do about this?

@0xc0170
Copy link
Contributor Author

0xc0170 commented Nov 4, 2014

All kinetis device would be out of sync. I believe there are other chips which have some specific sections, so would need to override generic layout. Like this kinetis targets and I recall also lpc1768 has two ram AHBSRAM0/1.

I'll look at linkers commands if there's anything we can leverage.

@bharrisau
Copy link
Contributor

Just another instance where a more flexible linker would be useful. I think
the MCHCK project is doing something to split sections up so that code can
be fit into the gap before the 0x400 FCFG field.
On 04/11/2014 4:20 pm, "Martin Kojtal" [email protected] wrote:

All kinetis device would be out of sync. I believe there are other chips
which have some specific sections, so would need to override generic
layout. Like this kinetis targets and I recall also lpc1768 has two ram
AHBSRAM0/1.

I'll look at linkers commands if there's anything we can leverage.


Reply to this email directly or view it on GitHub
#217 (comment).

@0xc0170
Copy link
Contributor Author

0xc0170 commented Nov 4, 2014

@bharrisau yes, there are plenty of space, mainly for cortex m0 kinetis devices which have just dozen of vectors, thus I used to place there some code to fill that gap.

Can you elaborate on "another instance"?

@farcaller
Copy link
Member

a bit worried, however, that k20's layout.ld will now fall out of sync with the linker script used by the rest of the platforms

There's really nothing we can do, layout_common is "common" just to some extent, I don't think it's possible to INCLUDE within SECTIONS, right? Extracting the discard part would be nice, otherwise.

@bgamari
Copy link
Contributor

bgamari commented Nov 4, 2014

We could use a preprocessor to generate our linker scripts. If I'm not mistaken libopencm3 does something along these lines.

@0xc0170
Copy link
Contributor Author

0xc0170 commented Nov 4, 2014

I propose to create an issue for generic ld, where we can continue discussing it? And can add a comment to K20 ld or TODO as I noticed are used in this project.

@bgamari looks like they do https://github.com/libopencm3/libopencm3/blob/master/ld/linker.ld.S

@bgamari
Copy link
Contributor

bgamari commented Nov 4, 2014

@0xc0170 by the way, I got home a bit late last night to check the patch. Tonight I'm going to make an effort to get home before 23:00 and do some testing.

Concerning OpenOCD's behavior, the code that you cite certainly suggests that overlapping sections are handled properly. I wonder what was causing the behavior I observed earlier? I was flashing the blink_k20 example with gdb's load command and openocd.

@0xc0170
Copy link
Contributor Author

0xc0170 commented Nov 10, 2014

Any progress here? Shall it be merged, to fix FCG config ?

Another pull request #219 vectors, is refactoring isr vectors for k20, I would like to see there FCG included. 😄

@bgamari
Copy link
Contributor

bgamari commented Nov 14, 2014

Quite sorry about the rather ridiculous review period. Seems to work on my end.

@0xc0170 thanks for working this out!

bgamari added a commit that referenced this pull request Nov 14, 2014
hal: k20 - flash config section addition
@bgamari bgamari merged commit 1d1b6dd into hackndev:master Nov 14, 2014
@0xc0170 0xc0170 deleted the fix_#212 branch December 24, 2014 11:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants