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 !
LPC4330
- Giovanni
- Site Admin
- Posts: 14461
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1077 times
- Been thanked: 922 times
- Contact:
Re: LPC4330
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...
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...
- Giovanni
- Site Admin
- Posts: 14461
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1077 times
- Been thanked: 922 times
- Contact:
Re: LPC4330
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:
What tools you use for developing? Is MCU compatible with OpenOCD and non LPC's jtag probes?
Re: LPC4330
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.
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.
Who is online
Users browsing this forum: No registered users and 1 guest