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

Postby pierre » Mon Sep 01, 2014 6:17 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: LPC4330

Postby Giovanni » Mon Sep 01, 2014 6:46 pm

Nice to know, thanks :)

Giovanni

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

Re: LPC4330

Postby pierre » Tue Sep 02, 2014 3:54 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: LPC4330

Postby Giovanni » Tue Sep 02, 2014 3:56 pm

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
Location: Minsk, Belarus
Been thanked: 7 times

Re: LPC4330

Postby barthess » Sat Sep 27, 2014 5:05 pm

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

Postby pierre » Wed Oct 01, 2014 2:14 pm

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.


Return to “LPC Support”

Who is online

Users browsing this forum: No registered users and 3 guests