Reference Design Programming

04 Dec 2012

There is some good discussion in the "Reference Design" segment of the Cookbook as well as Chris Styles discussion of going from the mbed-to-hardware that is in the Handbook. The discussion by Chris is relative to how to set up the programming for Custom PCB using a separate mbed board.

I need to go from my working mbed dev board to a custom PCB so am studying these as well as the mbed schematics that are stored elsewhere.

I need to do the programming of my new custom PCB as is the goal of the tutorial article by Chris. My preference is that this programming work EXACTLY like its done on the mbed that I have used for the proto development system. That is, the custom PCB will have a USB connector that can be cross-used by the eventual PCB software application (e.g., for debugging and/or data transfer to a PC) as well for the LPC1768 programming function.

The custom PCB would have a push-button (or better: a jumper) that triggers accessing the latest downloaded .bin and loads it to LPC1768 memory. Essentially the reference desgn would mimic EXACTLY the mbed basic functionality that has worked so neatly during my development. This would require no JTAG (as in the current reference design) or Flashmagic bootloader as in Chris's discussion of programming.

I'll be happy to build up this alternative reference design and get it built using Eagle. But hopefully, I can get some feedback on the utility of this project!

Possibly the current Reference Design already has all this and I just cant see it!

04 Dec 2012

I have now reviewed more of the mbed doc and believe I see this mbed-to-custom-PCB more clearly. I was assuming that I could program the LPC1768 using the mbed dev board and compiler and then easily migrate to my own PCB. I thought I could just grab the mbed schematic into Eagle and rip out what I dont need ... Then do something pretty simple (like with the mbed) and get my web-hosted compiler code into the new PCB. Seems maybe this just isnt the case!

The magic behind the mbed ease-of-use is really mbedded in the "mbed Interface" chip. If you look on the back of the mbed board ... there it is! its a 64-pin chip. On the schematic, its listed as "mbed-IF01 IC1". But I dont see anywhere where this chip can be actually purchased for a custom PCB. also take a lok at the "mbed Interface". There's a lot going on there that will have to be replaced with your custom PC (I think).

So now I understand the article by Chris Styles "prototype to hardware" better. He should have started by saying: "Forget the mbed ease of use ... you are going to have to work to get to a custom PCB!" And learn a lot of new things as you go from the mbed proto board to a real useful PCB of your own design.

I am now wondering about the mbed vs. the NXP Expresso. At least there, the free Code Red tool set allows an ease of migration from the expresso demo/proto board right to a real custom PCB without learning a lot of new stuff.

Hopefully, someone can point out why I am all wrong here.

04 Dec 2012

Well you can use mbed code on the Expresso. You can use it on any LPC1768 since there is no special bootloader code. If you need a high number of hardware boards you could mail the mbed team for options. If you want to make an own board with exactly the mbed options, then why not just use the mbed directly?

The LPC11u24 variant offers drag and drop USB programming directly, so that could also be an option. And LPC1768 programming isnt that hard either from what I understand: you can do it via the serial port. So add an FTDI or similar IC and you can program it via USB. You do need some kind of hardware switch then, and of course it isnt drag and drop in windows, but you need to send it via a virtual serial port.

In the end there is no solution that offers all the mbed functionality, and also alot easier/smaller hardware wise. If that was possible they would have done that on the mbed in the first place.

04 Dec 2012

I am mostly a programmer and not a PCB builder. But the PCB build part of things has gotten a lot easier with mbed, Xpresso, Eagle, etc .. and of course I can get into this for < $100! I really like the web-hosted code as most of my development will now be open source .. so a mbed lib for all the world to use and revise is just perfect. But I still need a small board with a microSD, power stuff, headers for other parts (IMU & GPS) and using the $70 mbed is just too big and too costly. Nevertheless, mbed is perfect to get me started to prove the LPC1768 will do what I want.

So I need a good process to go from the mbed proto to the custom board. The mbed site seems to have three resources: (1) the mbed schematic ... but the reference to the "C1" stops me in my tracks ... this is of no use!! (2) Chris Styles "proto-to-hardware" ... discussion on the Handbook. This is a more how not to do it rather than how to do it! (3) The reference design on the Cookbook. Unfortunately there is no discussion of whats going on and how to use this.

Ideally, we need a "how to build a mbed" Reference Design. Maybe a combination of the Reference Design and Chris's discussion ... but leave out how NOT to do it!! The custom boatrd needs to have the FTDI to get the USB (the mbed Reference has this) as well as access to the nRESET and the ISP pin. It takes a lot if digging to figure this out. I had hoped not to have to look at the manual! I need a mbed Handbook/Cookbook article that describes a reference design with LPC1768 and the hardware stuff to let me use the bootloader. I will easily give up the JTAG debug functionality if I can just have the same USB debug functionality as the mbed hardware.

05 Dec 2012

Here is a youtube video that describes flashing the LPC1768 using hardware+software and software-only. http://www.youtube.com/watch?v=5TQLv97_bz0

It uses a freeware app called LPC21isp ... Has anyone used this?

The hardware mode seems very appropriate and may be an atternative to using FlashMagic. LPC21ist seems to work with the .bin as produced by the mbed compiler.

The hardware mode uses a jumper to set the isp pin low and a reset button on the custom PCB.

06 Dec 2012

I too am interested in a single PCB design that "embeds" the mbed design in it's entirety, add my own external circuits, and load code to it via USB and on line compiler as I do now. This results in a single clean PCB instead of a "sandwich" with the module and separate I/O board. I need many such PCB's for in house testing of products for my company.

Many reference processor circuit designs are fully documented with readily available parts.

I understand the proprietary nature of the interface chips, but my guess is that most folks are not interested in plagiarizing or profiting from a copy, but just need to implement a solution.

06 Dec 2012

This topic has gotten spread around a bit ... (my fault) There is also similar material under the "Reference Design" within the Cookbook. The secondary bootloader paper and the video there are very good discussions of how to easily set up the flashing of code right from the mbed compiler.

My most recent epiphany came when I went to my "real PCB guy" and he quoted me $15K/2mo for rolling me a PCB using his tools. So now my new plan is to buy a $5 perf board and solder down the mbed along with a DC/DC converter, relay, and a microSD card. Also I'll hand-solder the wires from my IMU and GPS receiver to the mbed connections. Really ugly but it will get me operational w/o the rats-nest of plug-board wires! This will fly in an airplane so a real stretch. Nevertheless I can be in the air next week.

11 Dec 2012

/media/uploads/thorlabs/simple_11u24.jpg James, Here is an example of a super simple circuit to get the processor (from the baby mbed) running on your own board. If you can deal with the lower horsepower, this is a great choice because you can program this via USB without any additional code/hardware. If you put this circuit on a pcb, put a jumper on JP1, and plug in the USB it will enumerate on the computer as a mass storage device with a firmware.bin file on it. You can just delete that one and paste your new one (from the mbed compiler) into the "drive", reboot without the jumper and it will run your code. (note there should be 10k ohm pull up resistors on P0.0, P0.1, P0.3 that are cropped in this image. You'll also have to convert the USB 5V to 3.3V for the processor). This is all hand solderable, but the NUF2042 will require a microscope and steady hands.

Doing this with the 1768 is more difficult if you want to load the code via USB. NXP app note AN10866 outlines it but I'm still figuring out how to do it.

Hope this helps, and if anyone has figured out how to run a secondary bootloader on the 1768, use the mbed compiler and load firmware directly via USB, let me know.

11 Dec 2012

there were also comments here along these lines: http://mbed.org/questions/105/Programming-the-Reference-Design/

There it references the same NXP note as well as very nice video showig the operation video. It sure seems that the secondary Boot Loader is the way to go. Key is it opens up the USB port (not just UART0) for the flashing and used a GPIO pin to trigger the flash. Also, it makes the LPC1768 look just like a drive to the PC (like mbed) Per the video, it all works "just like the mbed" with the exception that it assuems there is only a single file on the vritual drive rather than just using the latest file.

I am trying to scrape up the $$ to get a real PCB guy to do this for me!