Page 2 of 2

Re: LPC4330

Posted: Mon Sep 01, 2014 6:17 pm
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:

Re: LPC4330

Posted: Mon Sep 01, 2014 6:46 pm
by Giovanni
Nice to know, thanks :)

Giovanni

Re: LPC4330

Posted: Tue Sep 02, 2014 3:54 pm
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...

Re: LPC4330

Posted: Tue Sep 02, 2014 3:56 pm
by Giovanni
If we make it any faster there would be a violation of causality ;)

Giovanni

Re: LPC4330

Posted: Sat Sep 27, 2014 5:05 pm
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?

Re: LPC4330

Posted: Wed Oct 01, 2014 2:14 pm
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.