production board

13 Aug 2010

Howdy:

I have a program running on the mbed but I am trying to demonstrate that it can run on a production board. I am using the NGX board for now. If I download a simple led blink program using flash magic it works fine.  My problem is I have a larger program that won't run. The program has a lot of  printf commands that use the pc serial port which (I think) goes out the usb port.

I am using the usb port pins D+ and D- (host) for output of my application. Is there someway I can get a debug report out of the system? How does the serial output actually get back to the pc?  The schematic on the mbed I found a while back doesn't depict exactly how the usb connector on the mbed is connected. Is it connected to the D+ and D- also or is there some magic chip doing something?

Any help would be appreciated.

 

13 Aug 2010

If i remember well your printf would bo out by the Uart0. I might be mestaken, but im pretty sure it uses the Uart0

13 Aug 2010

There is a magic chip (actually another arm processor) which mediates between the mbed and the USB connection that you use for programming. It manages the usb filesystem and programs the flash of the main mbed procesor. It also routes console i/o over the same USB connection.

As far as the main processor is concerned, it's just writing to a UART, so you will need to connect to one of the UARTs on your board. I think Christian is right, and that printf uses UART0.

13 Aug 2010

Hi,

There is a page on porting an mbed design to a custom board here :

http://mbed.org/users/chris/notebook/prototype-to-hardware/

Hope this helps. If it doesnt, let me know why and i'll ammend!

Thanks,
Chris

13 Aug 2010

Thanks for the suggestions. What I actually did overnight which accomplished my debug thing is I connected the ground and txd3 pin of the ngx board to a small ft232-to-usb bob I had in my junk box. I had to lower the baud to 19.2k since I didnt want to bother with flow control. I opened another instnce of my serial monitor and watched for printf statements to come thru.  Wow. It worked . I modified the code from a program called test2.

13 Aug 2010

//print test msg for ngx dpm

#include "mbed.h"             

//Serial pc(USBTX, USBRX); /mbed used usb

wups: I hit the wrong key and ended the message prematurely. Here is the program. Actually its a modification of the" hello" program.

 

 

Serial pc (p9, p10); //txd3 rxd3  //ngx uses serial for now (txd3)which is p9,910 port on mbed)

int main() {
pc.baud(19200);
pc.printf("Print test message at 19200 baud. 38k was too fast\n"); 

}

14 Aug 2010

I am back to the original problem of the usb host program that runs on the mbed wont run on a ngx board. It cant seem to add endpoints. If someone who has access to the magic part could just show us how the usb pins are muxed or connected. Are the TGT_D+ AND TGT_D- connected directly to the usb pins or are they routed through another mux or something?

14 Aug 2010

Hi David,

Just wanted to clarify the setup to make sure I understood your question, and ensure you get a full picture of what is going on.

The LPC1768 target microcontroller has 4 UARTs. UART0 is connected directly to the mbed interface onboard, whos job it is to convert it to USB Serial so that you can access the UART through the same USB connection as is used for the MSD drag 'n' drop programming. The 3 other UARTs pin out on the DIP pins.

Note, the USB interface used for programming/serial debug provided by the mbed interface is totally separate from the USB on the LPC1768 target microcontroller, which pins out on the D+ and D- pins. This means you are free to use the LPC1768 USB interface as you wish; we intentionally don't use it, so you can! Here is the diagram:

When you say Serial pc(USBTX, USBRX), this means you are tying to UART0 and the pins connected to the mbed usb interface. So if you have a program that uses this, and you run it on a custom board, you'll see the characters on UART0, specifically P0.2 and P0.3.

In the same way, you'll only get anything from the LPC1768 USB if you are running some code on the LPC1768 that is using the USB peripheral, whether on the mbed or a custom board.

Hope this clarifies things and confirms what you are seeing.

Simon

15 Aug 2010

Simon:

Thank you for the full picture. I get it now. Great job.

19 Aug 2010

Hi Simon,

 

Thanks for that sketch. I've been wanting to know whether the mbed interface uses ISP (through UART0) or JTAG. I guess its the latter, right ?

With all the work that must have gone into mbed interface chip, I'd have loved to use it to program my own custom board. It would take away all the clunkyness of using FlashMagic.

So, hypothetically, if I could pull out all the JTAG pins and connectorize it, would I be able to program my own board ? Would the following signals be sufficient: TGT_TRST, TGT_TDI, TGT_TMS, TGT_TCK, TGT_TDO, TGT_RTCK, TGT_NRESET ? What does the TGT_JTAG_IRQ signal do ?

Do I need TGT_SBL_ISP ? I see that it dips once every time you hit the Reset button and it dips twice (with 1 sec delay) when you load a new program.

Thanks,

Zainul.

22 Aug 2010

Speaking of the clunkyness of using Flashmagic, I was using it but now am using the (new) $29 lpcxpresso 1768 board. It has a download feature that will directly flash a 1768 from a (external) bin file without using flashmagic at all. And its fast. No more dos conversion programs.

22 Aug 2010

I've also just got a 1768 lpcxpresso which builds and runs FreeRTOS straight out-of-the-box.

I haven't spotted the bin download feature. Could you kindly point me in the right direction?

22 Aug 2010

It's the little black chip icon about 3/4 of the way to the right side of the top bar.

22 Aug 2010

Thanks, David, I hadn't spotted that. Very useful.

24 Aug 2010

Hi,

Where i could buy the 29$ lpcxpresso 1768 board ?

THanks,

Chris

24 Aug 2010

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

I bought one a few days ago, and had it shippped by inexpensive (but untrackable) air mail. It arrived in the UK within three days.

24 Aug 2010

Thank you for the link.

I order one of them now.

Chris.

25 Aug 2010

In the US, I got mine from Digikey

25 Aug 2010

I've asked Farnell if they would stock them in the UK; they stock the mbed, and the other two LPCXpresso boards, but not (yet) the 1768. Signs are good that they will soon, though.