LPC4330

ChibiOS public support forum for topics related to the NXP LPC family of Cortex-M micro-controllers.
pierre
Posts: 8
Joined: Thu Aug 07, 2014 4:01 pm

Re: LPC4330

Post by pierre »

OK !

My USB interrupt :
- Gets a SETUP packet,
- Wakes up a thread with a semaphore, which ...
- Parses the SETUP request
- Queues some buffers into the endpoint with the data to send
- The endpoint ISR returns "transfer completed" messages to the thread via a Mailbox
- The thread reads the mailbox and ACK's the transfer to the PC via STATUS stage packet... or perhaps it will queue more buffers if there is more data to send or receive.

You'll probably be happy to know that the shortest request takes about 19µs (with the CPU at 120 MHz). I replaced a huge ugly insane state machine with clean threaded code which is much smaller and also faster ! :mrgreen:
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: LPC4330

Post by Giovanni »

Nice to know, thanks :)

Giovanni
pierre
Posts: 8
Joined: Thu Aug 07, 2014 4:01 pm

Re: LPC4330

Post by pierre »

There was a little mistake, I had left the NAK interrupt on, so the 19µs included about 4-5 useless IRQs. I fixed that.

Simplest USB request (OUT without data phase) is 7 µs... includes ISR waking thread via semaphore. That's 840 cycles total ! Crazy.
OUT with data phase has an extra context switch due to a mailbox (and it has to prime a buffer and wait for the PC to send a packet)... 20µs...

I think I like this OS a lot...
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: LPC4330

Post by Giovanni »

If we make it any faster there would be a violation of causality ;)

Giovanni
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: LPC4330

Post by barthess »

Very, very interesting MCU. It looks more interesting and powerfull than STM32F7xxx. Strange, how I miss it?
@pierre:
What tools you use for developing? Is MCU compatible with OpenOCD and non LPC's jtag probes?
pierre
Posts: 8
Joined: Thu Aug 07, 2014 4:01 pm

Re: LPC4330

Post by pierre »

NXP and their buddies EmbeddedArtists built an IDE called LPCXpresso, here :

http://www.embeddedartists.com/products/lpcxpresso

The debug/JTAG probe (LPC-Link2) is extremely cheap. I use this one, dunno if it's compatible with other probes.
Post Reply