[En-Nut-Discussion] Ethernut on TI's Cortex-M3 (Stellaris LM3S...)

Philipp Burch phip at hb9etc.ch
Sat Oct 27 21:46:35 CEST 2012


Hi all,

it's been a few days since my last post here. I still didn't make huge 
progress with LM3S port, but at least the whole clock initialization and 
GPIO handling is now ok. I haven't extensively tested it yet, but the 
LED blinks at least ;)

So what I'm trying to do now is to add some code for the UART(s) to 
facilitate debugging. This is not a problem from the implementation's 
view, but I find it extremely hard to figure out where to correctly put 
the code into and which headers/defines to use.
Is there anyone who could shed some light onto how the whole device 
handling is done and how everything is linked together?
Example: There is a file uart.h and a usart.h. What is the difference? 
I'd expect them to be almost identical, with the only exception that a 
USART also supports synchronous interfaces. But the two headers do not 
seem to be similar in any way.

Could anyone point out the "usual way" to add support for existing 
devices to new platforms?

According to what I've seen in the source tree, I'd probably add UART 
support for the LM3S this way:

- Add some UART device to the LM3S family configuration.
- Create a header lm3s_uart.h which exports the available UARTs as 
DEV_UART0, DEV_UART1 and so on.
- Create a source file lm3s_uart.c which populates and exports a 
NUTDEVICE structure per device and implements the necessary callbacks.

Is this correct, or are there other levels of abstraction which should 
be taken into account?

Thanks,
Philipp

On 10/18/2012 01:40 PM, Ole Reinhardt wrote:
> Hi Philipp,
>
>> Ok, I got it. I've just been an idiot. In fact, I've even pointed my
>> mistake out before, have a look:
>
> Great that it works now :) I just started setting up my board. Anyway I
> will do so as I can test your code and better answer questions then.
>
> Bye,
>
> Ole
>
>


More information about the En-Nut-Discussion mailing list