Author Topic: My first ARM/LPC design, critic requested.  (Read 29795 times)

0 Members and 1 Guest are viewing this topic.

Offline SirNick

  • Frequent Contributor
  • **
  • Posts: 589
Re: My first ARM/LPC design, critic requested.
« Reply #75 on: November 06, 2014, 07:58:49 pm »
You happen to know how the virtual drive thing maps the file to flash?  Is it just a binary image starting at 0x00000000?

The 812s have been giving me fits with accessibility via the UART.  My (one and only) 4078 seems stable though.
 

Offline zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #76 on: November 06, 2014, 09:22:49 pm »
You happen to know how the virtual drive thing maps the file to flash?  Is it just a binary image starting at 0x00000000?

The 812s have been giving me fits with accessibility via the UART.  My (one and only) 4078 seems stable though.

I don't know what's going on under the hood, I just followed the instructions to generate the binary file and dragged it to the virtual drive. Did it only a few times, typically I am using a debugger with SWD cable.

Here are two pointers that may help

http://bikealive.nl/creating-a-hex-file.html     // how to generate the binary file (the default of lpcxpresso is to generate only the axf)

http://www.lpcware.com/content/nxpfile/an11305-usb-system-programming-lpc11u3xlpc11u2x    // app note regarding the USB/ISP
 

Offline SirNick

  • Frequent Contributor
  • **
  • Posts: 589
Re: My first ARM/LPC design, critic requested.
« Reply #77 on: November 07, 2014, 12:40:25 am »
Ah, that explained it.  Short answer:  Yup, that's what it does.  Writing to the "disk" in consecutive block order will flash 0x00000000 on up.  Writing blocks out of order will result in random firmware. :)  Good to know.
 

Offline zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #78 on: November 08, 2014, 06:36:23 am »
I tried again the firmware update using the virtual disk. Drag and drop using the folder explorer (OSX Finder) does not work well but copying it with a command line works every time (App note AN11305 says something about additional disk activity done by the explorer). It shouldn't be too difficult to automate it.

cp hello_world.bin /Volumes/CRP\ DISABLD/firmware.bin

And here is a small 3D print case I added to the repository. Next I will clean up the libraries.



Edit:
1. I added the above command as an external tool in lpcxpresso that also does automatic build. It works like a charm.
2. The RST and ISP button labels on the board are swapped. Will fix it in next revision.
« Last Edit: November 08, 2014, 06:55:50 am by zapta »
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: My first ARM/LPC design, critic requested.
« Reply #79 on: November 08, 2014, 12:43:49 pm »
I just realized that the labels of the ISP and RST switches are swapped.  Also, when you copy a firmware binary to the virtual USB disk, do it with a command line, not drag and drop, it's more reliable this way

This may not be great news. Personally I hope it's just a Mac or Linux thing. Using the command line means there is less advantage over regular serial bootloaders and several disadvantages.

I will report back with XP results on this issue as soon as it arrives. One of my interested buddies runs Linux so it will be curious to see how that goes. I won't be sending this first unit out to him because of the bulk but when my chips arrive the first thing is to throw a minimum version together and give him a go.

In any case thanks for sending that out so quickly and I really appreciate the favor.
 

Offline zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #80 on: November 08, 2014, 05:34:26 pm »
I just experimented with a simple circuit to make the ISP mode easier. With an addition of a diode and a capacitor, the ISP button now works independently. That is, a single press also resets the MCU and enters it into ISP mode. It's handy in debug cycles using the USB/ISP mode. I may add it in rev 2 as an optional circuit.

The diode is required because sometime after reset the MCU asserts the ISP pin low for a few micro seconds. There is no discharge resistor for the capacitor but it works anyway, probably because of the diode or capacitor leakage.

Edit: the circuit was not as reliable as I thought. After removing the scope probes it sometimes didn't reset well. I ended removing that circuit and implementing a software solution that jumps to ISP mode when the button is pressed. This works much better. See ReinvokeIsp() here https://github.com/zapta/arm/blob/master/pro-mini/lpcxpresso/arm_pro_mini_lib/src/arm_pro_mini.cpp#L34



« Last Edit: November 09, 2014, 03:26:45 pm by zapta »
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: My first ARM/LPC design, critic requested.
« Reply #81 on: November 11, 2014, 03:45:19 pm »
Zapta, would it be possible to post here files for a simple led program? The simpler the better. Just putting a pin low would be best. It would be very helpful for testing the board you sent.
« Last Edit: November 11, 2014, 06:15:29 pm by paulie »
 

Offline zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #82 on: November 11, 2014, 03:58:19 pm »
zapta, would it be possible to post here files for a simple led program? the simpler the better. just putting a pin low would be best. it would be very helpful for testing the board you sent.

What is the base line? Is using NXP libraries and lpxpresso generated files ok?  In this case the led blinking program is very simple.

 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: My first ARM/LPC design, critic requested.
« Reply #83 on: November 11, 2014, 06:00:45 pm »
Whatever is most convenient for you. If there's a LST file that would be nice too but binary is all that's needed to get me going AFAIK.

To answer your PM question I was suggesting you post for others to see instead of message that stuff about the labels and drag-n-drop but apparently you did that anyway. Also for me the threads are quickest way for me to comunicate because most of the time I don't use my own PC or even a real PC.

 

Offline zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #84 on: November 11, 2014, 06:53:22 pm »
Whatever is most convenient for you. If there's a LST file that would be nice too but binary is all that's needed to get me going AFAIK.

To answer your PM question I was suggesting you post for others to see instead of message that stuff about the labels and drag-n-drop but apparently you did that anyway. Also for me the threads are quickest way for me to comunicate because most of the time I don't use my own PC or even a real PC.

Attached is a zip with two binaries of hello world, with fast and slow blink respectively. These programs also print peridically via USB/CDC and monitor the ISP button (so you don't need to do the reset/isp maneuver).   I highly recommend installing the lpcxpresso, it's a single package that installs the entire tool chain and will allow you to experiment (it also generates make files so you can build from command line).

Let me know how it works for you.
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: My first ARM/LPC design, critic requested.
« Reply #85 on: November 12, 2014, 05:28:02 am »
Thanks. I'll get back with results as soon as I get a chance to try it. I'm particularly interested in how the drag-n-drop works under Windows.
 

Offline zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #86 on: November 12, 2014, 04:39:01 pm »
Thanks. I'll get back with results as soon as I get a chance to try it. I'm particularly interested in how the drag-n-drop works under Windows.

mbed has on github source code of a USB/ISP bootloader with hal for LPC11U35.

https://github.com/mbedmicro/CMSIS-DAP/tree/master/bootloader
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4195
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: My first ARM/LPC design, critic requested.
« Reply #87 on: November 12, 2014, 05:54:42 pm »
Haven't they published their LPC2xxx mbed chipset code yet?
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: My first ARM/LPC design, critic requested.
« Reply #88 on: November 12, 2014, 08:26:46 pm »
So your boards arrived today and I must say very impressive. Thinking that ISP connector was .1" it was quite a surprise to see how compact this really is. "Good things come in small packages" is an understatement. Out of dozens of demo boards this is definitely my favorite. Thanks for including me in this great project.

It was wonderful to find the drag-n-drop 100% reliable under Windows. What an improvement over all that flash utility/driver baloney. Out of maybe 100 downloads (~50 each alternating slow&fast) not a single failure. The reset button was initially a little flaky but a few forceful "break in hits" fixed that. Removing the JTAG connector also helped make it easier to push. Not useful to me anyway because there are no dual 1.5mm females to mate with here. JTAG itself of no use to me either and the SWD pins are available on the edge.

BTW that one button auto bootload feature of yours makes it super fast and easy to reload programs.

I was going to strip it down to minimum components but can't possibly now seeing what a work of art this is. Both design and construction are exceptional. Also with no standup pins the board is so thin it will be no problem slipping it out the day job door in a letter envelope for my buddy to test under Linux.

Thanks for the extra PC boards too. They will make the minimum hardware experiments easy. When the chips arrive I know exactly where they will go.

As soon as my PSOC4 chips arrive and that project is finished I will follow your advice and replace it with the LPCexpresso. I can't wait to try out some of those debug tools.
« Last Edit: November 12, 2014, 08:47:48 pm by paulie »
 

Offline zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #89 on: November 13, 2014, 08:25:25 am »
Paulie, I am glad that you likeed it. If you have suggestions for improving or minimizing it please let me know. I am keeping a todo list here https://github.com/zapta/arm/blob/master/pro-mini/TODO.md

It's good that drag and drop works on Windows. The Mac OS file explorer adds files named .DS_Store that mess up with the ISP/USB (though a simple command line copy works just fine).

Initially I used only the SWD connector and a debugger but now I set in eclipse/lpcxpresso a build button that also copies to the ISP drive so I don't need to mess with the debugger (still useful to have it as an option for hard to debug cases). It is very handy.
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: My first ARM/LPC design, critic requested.
« Reply #90 on: November 15, 2014, 01:37:43 pm »
No chance to install LPCexpresso yet but I did try several programs using the minimum tools in my other thread and this drag-n-drop is still working like a charm. What a breath of fresh air after dealing with all those software and hardware issues from the other methods.

ps Thought it might be nice to show a photo of the board zapta sent me. Just one cable. A lot simpler than those other multi wire setups.
« Last Edit: November 15, 2014, 01:39:34 pm by paulie »
 

Offline zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #91 on: November 15, 2014, 05:57:33 pm »
Interesting arrangement with the horizontal pins, never seen it before. 

I sent Dave a unit for mailbag. Will see what will happen with it. It's a long way to Australia.
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: My first ARM/LPC design, critic requested.
« Reply #92 on: November 16, 2014, 01:09:05 am »
Yes, mounting pins flat like that has several advantages. My Pro-Minis are that way too. For one thing it's easier to hold the board while plugging and unplugging jumpers. Makes it possible to unsolder them later in case you want to switch with wires or whatever too. Another thing is it will fit in smaller spaces. Also being thin like that allows shipping in a regular letter envelope instead of paying ten times more for package rates. In my case ZERO cost because I slip it in the day job postal bin.

And yes, I have stolen a pen and several pencils since employment began there. To my credit no paper clips... yet. :)
 

Offline zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #93 on: December 17, 2014, 05:04:49 pm »
A quick update. Published here https://github.com/zapta/arm/tree/master/pro-mini a partial draft of the documentation. Hope to complete it in the next few days. Please let me know of any comments you may have.:wq
 

Offline magetoo

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: se
Re: My first ARM/LPC design, critic requested.
« Reply #94 on: December 18, 2014, 09:46:27 pm »
Cute board!  And it's encouraging to see that using an 11U part was relatively straightforward.

I have a r0ket board that was given away to attendees at the Chaos Communication Camp in 2011, based on an LPC1343 (Cortex-M3).  Might have to dig that one up again now.

I think the 1343 was the first part to have the USB drive-with-firmware-binary thing.  As I understand it, it's designed with Windows and drag-and-drop in mind; Windows will (re-)write the whole file from start to end, which is not necessarily the case elsewhere.  For all other platforms they recommend using "dd" for writing the firmware binary.
 

Offline zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #95 on: December 18, 2014, 10:02:12 pm »
Cute board!  And it's encouraging to see that using an 11U part was relatively straightforward.

I have a r0ket board that was given away to attendees at the Chaos Communication Camp in 2011, based on an LPC1343 (Cortex-M3).  Might have to dig that one up again now.

I think the 1343 was the first part to have the USB drive-with-firmware-binary thing.  As I understand it, it's designed with Windows and drag-and-drop in mind; Windows will (re-)write the whole file from start to end, which is not necessarily the case elsewhere.  For all other platforms they recommend using "dd" for writing the firmware binary.

Drag and drop doesn't work on Mac OSX because it adds the hidden .DS_Store file with directory metadta.  For development (under Mac OSX) and I using this script which is configured as a LPCXpresso external tool. When I click the icon it builds the project and copies the file.

https://github.com/zapta/arm/blob/master/pro-mini/lpcxpresso/hello_world/copy_to_usb_isp.sh
 

Offline zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #96 on: December 18, 2014, 10:04:15 pm »
Thanks everybody for your help with the design. The board and the documentation are now ready and I created for it a fresh thread here

https://www.eevblog.com/forum/microcontrollers/introducing-the-arm-pro-mini-board-arm-made-eazy/msg570973/#msg570973
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf