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

LM4F initial support #74

Merged
merged 9 commits into from Jan 7, 2013
Merged

LM4F initial support #74

merged 9 commits into from Jan 7, 2013

Conversation

mrnuke
Copy link
Contributor

@mrnuke mrnuke commented Dec 29, 2012

This is a cherry pick of the most important commits needed to get LM4F working properly with libopencm3, as well as a basic example.
I've picked these from my stellaris branch. I consider these commits to be well tested.

/* This file is part of the libopencm3 project.
*
* It was generated by the irq2nvic_h script.
*
Copy link
Member

Choose a reason for hiding this comment

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

This file shouldn't be committed, it it's generated every time by the build scripts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for catching that. I will push an updated fix soon.

Create lm4f code infrastructure from the lm3s infrastructure.

As far as the interrupt table is concerned, don't create an irq.yaml. Just
include the LM3S nvic.h. The LM3S vector table seems to be compatible with the
LM4F

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Fix three distinct issues were present with
examples/lm4f/Makefile.include:
1. Architecture flags were not being passed to the linker. This caused the linker
to link against the wrong libraries when trying to use any C library, causing
hard faults.
2. -lc and -lnosys were not linked against. Try using printf() without -lnosys
3. The makefile erroneously specified -mcpu=cortex-m3 instead of m4.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Specify the -mfloat-abi=hard and -mfpu=fpv4-sp-d16 flags so that FPU
is enabled by default.
While this compiles with FPU support, in order to use the floating point types,
the FPU must be explicitly enabled at runtime.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Add an "#ifdef(LM4F)" clause to include/libopencm3/dispatch/nvic.h
and lib/dispatch/vector_nvic.c. This compiles in the vector table
and allows interrupts to be used.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
The LM4F provides new registers for system control. Each peripheral
now has its own clock gating control register. The LM4F still supports
the legacy registers for backwards compatibility.

Use SYSCTL_RCGCGPIO instead of SYSCTL_RCGC to enable the GPIO.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
There was no reference to LM4F in in the doc/ subdirectory. Add the needed
infrastructure to generate focumentation for LM4F.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
esden added a commit that referenced this pull request Jan 7, 2013
Merge remote-tracking branch 'mrnuke/lm4f_initial'
@esden esden merged commit 400891f into libopencm3:master Jan 7, 2013
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.

None yet

3 participants