Programming LPC11C14 firmware via CAN I/F

Started by AndyJey, August 25, 2011, 03:07:14 AM

Previous topic - Next topic

AndyJey


We have a requirement to do firmware upgrade on LPC11C14 MCUs over CAN interface. I am currently using the free version of Flash Magic V 5.84 and I have installed PEAK PCAN-USB on my Win 7 machine. I cannot find a way to configure the Flash Magic to use the PCAN-USB device to connect to the hardware. The manual only discusses UART and Ethernet, but nothing about CAN. The ESA website and Flash Magic release notes stated that programming via CAN i/f is supported. Can anyone point me to the right direction how to program the above MCU via CAN i/f? Or a document perhaps? If we need additional components to achieve the above, please let me know what else is required.

TIA
Andy


Andy Ayre

Please make sure you are using the current version which is 5.89.

The LPC11Cxx devices have two bootloaders - UART and CAN, therefore they are listed twice in the Flash Magic user interface. For example if you select "LPC11C24/301" then you will see COM port and baudrate options. However if you select "LPC11C24/301 CAN" then you will see CAN interface options.

If that doesn't help please let us know.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

AndyJey

Thanks for the reply. I have downloaded and installed the latest FlashMagic V5.89.

While I can select the correct device (LPC11C14/301 CAN) and communication interface (PEAK PCAN USB), FlashMagic does not seem to transmit anything via the PCAN USB. I tried reading the device signature and other functions with no success. I did not see any data traffic on the CAN bus.

The PCAN USB is working. I verified it by transmitting CAN packets using PCAN View utility and monitored the CAN bus using a CAN monitor program running on a separate machine.

Any suggestions?

Andy

Andy Ayre

#3
Sorry for the delay - we missed your posting.

We just went back and retested and it works. Here is what we did.

Flash Magic 5.90
Keil MCB1000 v2 with LPC11C24
PEAK PCAN-USB
Windows 7 64-bit
120Ohm terminated cable

We connected as follows:

PC <----> PCAN USB <-- 120Ohm terminated cable --> MCB1000 P4

Note that it doesn't work with P2 because the CAN H and L are swapped.

The jumpers J5 (ISP) and J6 (RST) were disconnected. These are only used for the UART interface.
The jumper J7 was disconnected.
P0_3 must be held low during reset. On our board that should happen with resistor R2 but it wasn't populated, so we had to manually connect P0_3 to GND using a wire.
P0_1 must be held low during reset. On this board that can be achieved by holding down the Reset and ISP buttons then releasing the Reset button first.

After starting PCAN-View we selected the PCAN USB and 100kbps (note: it is not 125kbps) with standard IDs.

In PCAN-View we transmitted the following message one time:

ID = 0x67D Len = 8 Data = 0x40 0x00 0x10 0x00 0x00 0x00 0x00 0x00

The bootloader responded with the following message:

ID = 0x5FD Len = 8 Data = 0x43 0x00 0x10 0x00 0x4C 0x50 0x43 0x31

If you can't get that far then Flash Magic won't work.

We closed PCAN-View, reset the board again with the Reset and ISP buttons and we were able to read the device signature in Flash Magic using ID 0x7D and a timeout of 1000ms.

If the bootloader is not connected to the CAN bus (and there are no other functioning nodes on the bus) then when Flash Magic attempts to send a CAN message it will be converted into an error frame. I'm not sure if PCAN View displays those. If it doesn't then it will appear as if nothing has been transmitted, but actually it was. You might want to look at PCAN Explorer or something more sophisticated than PCAN View for debugging.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

AndyJey

Hi Andy,

Great stuff, thanks a lot for your help.

Andy