Page 1 of 1

LPCXpresso LPC11U14 (anyone working on it?)

Posted: Tue May 08, 2012 8:08 am
by jrbeis
Sorry if this question was already a topic here. But non of my entered keywords found an entry about the LPCXpresso LPC11U14 in this blog. If its already dicussed, please point me to it.
Does anybody work on support for this kind of board which can act as a USB device? The USB device driver for this CPU is currently not present in the ChibiOS and I would implement it, if not already done.
Another question: The internals (registers and their offsets) of the LPC11U14/201 seems to differ from other CPUs of the LPC11xx family (at least the IOCON register layout differs from the existing 'os/hal/platforms/LPC11xx' implementation). How to integrate this new CPU? Adding ifdefs into existing files? Or adding new files? Or adding complete new sub-directories with new files for this CPU?

Re: LPCXpresso LPC11U14 (anyone working on it?)

Posted: Tue May 08, 2012 8:39 am
by Giovanni
Hi,

Currently the HAL for the LPC1xxx devices is not "generic", each device has its own HAL implementation. I am planning to make a generic HAL for LPC1xxx much like the current STM32 HAL which support all sub-families in the STM32 family.

Basically there will be a generic LPC1xxx directory containing the common device drivers and specific directories for the various sub-families, the STM32 HAL is an example of this.

Register offsets are not really important, abstractions can be added to hide the details. More important are the vendor-provided header files, hopefully the headers will be consistent in naming or the huge work would be to rewrite those.

You could start from duplicating the LPC11xx HAL creating a LPC11Uxx directory and assessing the differences in headers, HAL unification could follow. About USB, of course it would be very appreciated but if I remember well LPC devices have a driver directly in ROM, probably a wrapper would be a simpler solution.

Giovanni

Re: LPCXpresso LPC11U14 (anyone working on it?)

Posted: Tue May 08, 2012 9:48 am
by jrbeis
Hi Giovanni,

thanks for the info. I will have a look into the STM32 tree.

> [...] if I remember well LPC devices have a driver directly in ROM, probably a wrapper would be a simpler solution

There are two different variants of the LPC11U CPUs are available: LPC11U1x which comes without the ROM based USB drivers and the LPC11U2x which comes with the USB drivers in their ROM. On the LPCXpresso LPC11U14 board the variant without the ROM based USB drivers is soldered. And I guess, if you want a USB device different from 'HID' class or 'Mass Storage' class you still need your own drivers (but I'm not sure yet).

Re: LPCXpresso LPC11U14 (anyone working on it?)

Posted: Wed May 09, 2012 11:13 am
by kpa
Just to say that I am also using this chip (LPC11U24) and I really need to have a working USB CDC class on it.
If you are going to made the port of Chibios for this chip I could help. Let me know.

kpa

Re: LPCXpresso LPC11U14 (anyone working on it?)

Posted: Wed May 09, 2012 11:23 am
by Giovanni
I have plans for a USB driver rework, basically it has to become simpler than the current one, the dualism between packet mode and transaction mode makes it harder to port, it will become transaction-mode only.

After this rework an USB implementation for LPC1xxx devices will simpler too.

My plan is to make an unified HAL for LPC1xxx devices after the 2.5.0 release and include it in 2.5.1. The USB driver could be developed in parallel and find its way in 2.5.1 too.

In the meantime I have to find one of those LPC11Uxx LPCXpresso boards.

Giovanni

Re: LPCXpresso LPC11U14 (anyone working on it?)

Posted: Wed May 09, 2012 11:51 am
by kpa
That's a great news. Do you already know when it's will be available ?

Thanks in advance

Re: LPCXpresso LPC11U14 (anyone working on it?)

Posted: Wed May 09, 2012 10:11 pm
by Giovanni
Hi,

About the USB driver I cannot know, it is being contributed.

The unified HAL will happen between 2.5.0 and 2.5.1, no date, the most I can tell is that it is in the to-do list.

Giovanni

Re: LPCXpresso LPC11U14 (anyone working on it?)

Posted: Mon May 14, 2012 5:46 pm
by Giovanni
I just ordered an LPCXpresso LPC11U14, expect at least basic support for this chip.

Giovanni

Re: LPCXpresso LPC11U14 (anyone working on it?)

Posted: Mon May 21, 2012 6:51 pm
by Giovanni
Hi,

Update, initial support for the LPC11U14 is working, the code is on the repository. So far HAL, PAL, Serial, SPI and GPT drivers have been added.

Test report:

Code: Select all

*** ChibiOS/RT test suite
***
*** Kernel:       2.5.0
*** Compiled:     May 21 2012 - 19:35:09
*** Compiler:     GCC 4.6.2
*** Architecture: ARMv6-M
*** Core Variant: Cortex-M0
*** Port Info:    Preemption through NMI
*** Platform:     LPC11Uxx
*** Test Board:   Embedded Artists LPCXpresso Base Board + LPC11U14

----------------------------------------------------------------------------
--- Test Case 1.1 (Threads, enqueuing test #1)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 1.2 (Threads, enqueuing test #2)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 1.3 (Threads, priority change)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 1.4 (Threads, delays)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.1 (Semaphores, enqueuing)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.2 (Semaphores, timeout)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.3 (Semaphores, atomic signal-wait)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.4 (Binary Semaphores, functionality)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.1 (Mutexes, priority enqueuing test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.2 (Mutexes, priority inheritance, simple case)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.3 (Mutexes, priority inheritance, complex case)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.4 (Mutexes, priority return)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.5 (Mutexes, status)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.6 (CondVar, signal test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.7 (CondVar, broadcast test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.8 (CondVar, boost test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 4.1 (Messages, loop)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 5.1 (Mailboxes, queuing and timeouts)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 6.1 (Events, registration and dispatch)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 6.2 (Events, wait and broadcast)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 6.3 (Events, timeouts)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 7.1 (Heap, allocation and fragmentation test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 8.1 (Memory Pools, queue/dequeue)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 9.1 (Dynamic APIs, threads creation from heap)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 9.2 (Dynamic APIs, threads creation from memory pool)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 9.3 (Dynamic APIs, registry and references)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 10.1 (Queues, input queues)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 10.2 (Queues, output queues)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.1 (Benchmark, messages #1)
--- Score : 129358 msgs/S, 258716 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.2 (Benchmark, messages #2)
--- Score : 101335 msgs/S, 202670 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.3 (Benchmark, messages #3)
--- Score : 101335 msgs/S, 202670 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.4 (Benchmark, context switch)
--- Score : 392488 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.5 (Benchmark, threads, full cycle)
--- Score : 78633 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.6 (Benchmark, threads, create only)
--- Score : 112313 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.7 (Benchmark, mass reschedule, 5 threads)
--- Score : 30576 reschedules/S, 183456 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.8 (Benchmark, round robin context switching)
--- Score : 245080 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.9 (Benchmark, I/O Queues throughput)
--- Score : 377360 bytes/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.10 (Benchmark, virtual timers set/reset)
--- Score : 350996 timers/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.11 (Benchmark, semaphores wait/signal)
--- Score : 591160 wait+signal/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.12 (Benchmark, mutexes lock/unlock)
--- Score : 354252 lock+unlock/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.13 (Benchmark, RAM footprint)
--- System: 404 bytes
--- Thread: 72 bytes
--- Timer : 20 bytes
--- Semaph: 12 bytes
--- EventS: 4 bytes
--- EventL: 12 bytes
--- Mutex : 16 bytes
--- CondV.: 8 bytes
--- Queue : 32 bytes
--- MailB.: 40 bytes
--- Result: SUCCESS
----------------------------------------------------------------------------

Final result: SUCCESS


The proposed work on the USB driver could start starting from this initial support. Please let me know if something else is needed.

Giovanni

Re: LPCXpresso LPC11U14 (anyone working on it?)

Posted: Mon Jun 25, 2012 9:57 pm
by jrbeis
Just read you comment. Thanks for you initial work. Working on the USB low level driver isn't such easy as I thought. Sorry, progress is only very slow.