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

WIP/RFC: Add support for the Texas Instruments Tiva TM4C123GLX ARM Cortex-M4F MCU #1787

Closed
wants to merge 6 commits into from

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Oct 9, 2014

This adds basic support for the TI TM4C123GH6PM MCU and the TM4C123GLX Launchpad development board based on it.

TM4C123GH6PM is a Cortex-M4F based chip with 32kiB Ram, running at up to 80 MHz.
As a special feature it provides 'ROM Functions', similar to BIOS calls, that are always present on the chip and that can be called using a memory table.

There are 6 32 bit general purpose timers and 6 64 bit general purpose timers.
Timers can be 'split' into two half-with timers (16/32bit). Prescaler is only available in half-with mode when counting down, when counting up it will extend the range by 8 bit.

There is also a currently unused 24 bit SysTick timer (also with no prescaling, only variable interrupt periods within the 24bit range)

I used stm32f4 as a template for this port.

working so far:

  • UART (tx only)
  • timers (32bit timers in full width mode are exported through hwtimer, no prescaler), tests/vtimer_msg crashes after ~53s

Depends on #1709 to run properly

@benpicco benpicco added State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: drivers Area: Device drivers and removed Area: drivers Area: Device drivers labels Oct 9, 2014
caddr_t res = heap_top;

if (((incr > 0) && ((heap_top + incr > &_eheap) || (heap_top + incr < res))) ||
((incr < 0) && ((heap_top + incr < &_sheap) || (heap_top + incr > res)))) {
Copy link
Member

Choose a reason for hiding this comment

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

cpu/tm4c123/syscalls.c:92: style (unsignedLessThanZero): Checking if unsigned variable 'incr' is less than zero.

Copy link
Contributor

Choose a reason for hiding this comment

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

Where is the signature from? It should be void *_sbrk_r(struct _reent *ptr, ptrdiff_t incr);

@LudwigKnuepfer
Copy link
Member

file has an unknown license header: 'cpu/tm4c123/include/tm4c123gh6pm.h'

@benpicco
Copy link
Contributor Author

gnaa, I missed that!
Now that sucks quite a bit. I asked in the TI forum if the licence for the CMSIS header is really meant to be that way, but I'm afraid they are not going to change that.

That would mean I can't use cortex-m4_common or at least I'd have to fork it so it uses TivaWare headers instead of standard CMSIS :(

@miri64
Copy link
Member

miri64 commented Oct 10, 2014

I'm not an expert (and as we all no: sentences that start like this are not really constructive) but I highly dought, that a bunch of type definitions is licensable. In case of doubt: just change the names ;-P

@LudwigKnuepfer
Copy link
Member

@haukepetersen your input on CMSIS here ;)

@thomaseichinger
Copy link
Member

maybe #1697 with this file could be of interest in this context.

@haukepetersen
Copy link
Contributor

Hm, that license reads rather restrictive... What we did earlier with some STM standard lib was to include it only as external pkg in RIOT, so we didn't include the files in question directly into RIOT. The nicest solution would actually be to write CMSIS-style headers for TI MCUs ourself, but that would be a shitload of work... I'm not sure of the best solution in this case here...

@OlegHahm
Copy link
Member

OlegHahm commented Dec 2, 2014

How do we proceed with this one?

@OlegHahm OlegHahm added this to the Release 2014.12 milestone Dec 2, 2014
@jnohlgard
Copy link
Member

@benpicco Are there any .svd files available for the MCU under a different license? It should be possible to auto-generate the CMSIS style headers from those.

@benpicco benpicco force-pushed the tiva-integration branch 2 times, most recently from c95e010 to d2d599f Compare December 10, 2014 15:03
benpicco and others added 5 commits December 10, 2014 16:04
Add TI's Cortex M4 'tiva'
compared to other implementations, 2500 seems to be insanely high anyway
The 32bit timer overflows every 53s, shift it down and count the interrupts for a greater range
got to shed off 488 bytes somewhere :(
@OlegHahm OlegHahm assigned jnohlgard and unassigned haukepetersen Dec 17, 2014
@OlegHahm OlegHahm modified the milestones: Release 2014.12, Release NEXT MAJOR Dec 18, 2014
@OlegHahm
Copy link
Member

@benpicco, ping!?

@benpicco
Copy link
Contributor Author

The only .svd files I could find came with the very CMSIS headers (TI forum)

An option would be to use TI driverlib instead of CMSIS and create a tiva-c architecture as TI did for Contiki - but I'm currently not working on this, so you might as well close this pull request.

@jnohlgard jnohlgard closed this Jan 7, 2015
@jnohlgard
Copy link
Member

Closed upon request. Open a new PR if we find any license-compatible headers that we can use.

@OlegHahm OlegHahm modified the milestone: Release 2015.12 Dec 18, 2015
@tmick0
Copy link

tmick0 commented Dec 18, 2015

Is anybody still working on this? I had forked benpicco's work myself and got some basic functionality up on the EK-TM4C1294XL. But now I'm thinking about downgrading to the TM4C123G for my project, and I'm curious whether I will be able to use it with a more recent RIOT than 2014.12...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR Platform: ARM Platform: This PR/issue effects ARM-based platforms State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants