cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for simple way to update units in the field Via Jtag or SWD

tomabcd9
Associate II
Posted on October 28, 2009 at 11:04

Looking for simple way to update units in the field Via Jtag or SWD

9 REPLIES 9
tomabcd9
Associate II
Posted on May 17, 2011 at 13:27

We are switching to STM32 processors and are looking for a simple way to update units out in the field. In the past we used Pics (dip package in a socket) and would just send a new chip for the user to put in the socket.

With the STM32 it is surface mount so would like some simple solution we can just program up and send to the customer.

So is there code available for talking over the Jtag port (on many products the serial port will be tied to other hardware so can not use the serial ISP method). Since the Jtag pins or SWD pins will be open, so we could develop the code to start, thought it would be a cost effective interface.

Our thought was a small board that just has a STM32 processor (larger flash then the target) and a connector. The small board would plug onto the Jtag connection on the customer's (target) board (gets power from target board) . We would put in the small board the code we want programmed in to the target board plus it would need the extra code to talk to the target processor over the jtag interface.

So that is why I am asking if there exist code for the STM to talk over the Jtag to another STM part.

I am also open to other suggestions on low cost (less then $30) self contained way to update the code on STM processor in the field. If there already exists something we could just buy please let me know.

Thanks

Tom

16-32micros
Associate III
Posted on May 17, 2011 at 13:28

Hi Tom,

You can RS232, UART1 using embedded boot-loader for complete ISP solution with a minimum of Hardware and Software: Refer to AN2606 and our Flash loader demonstrator :

http://www.st.com/stonline/products/literature/um/13916.pdf

Cheers,

STOne-32.

tomabcd9
Associate II
Posted on May 17, 2011 at 13:28

Yes I have read the AN2606 and have run the Flash loader demonstration. The issue with this approach is the need to use the Uart1 interface. In many of our products the Uart pins would be tied to other devices so I will have to add extra hardware to disable/disconnect the other hardware when the programmer is connected or I have to not use these two pins at all.

Since we plan on leaving the Jtag or SWD pins open for development I asked about using them for field upgrades.

Thanks

Tom

pranamesh
Associate II
Posted on May 17, 2011 at 13:28

We had a similar situation and we utilized a couple of NLASB3157 from onsemi.com. It was straight forward. We found this useful as it was combined with an FT232RL and the whole thing required a simple usb connection to the PC/laptop for upgradation without much increase in costs or complexity. The extra control O/I pins of FT232RL were utilized to make the necessary boot0 switching to achieve the whole functionality.

Our application needs to be upgraded by our customers and we did not want to provide them with a JTAG connector (and associated hardware). Using the USB cable was more suitable in such a situation.

Of course I could also possibly do this using the USB interface of the chip, but there was no example readily available. You may try based firmware update (USB IAP??) the USB and report accordingly.

tomabcd9
Associate II
Posted on May 17, 2011 at 13:28

We are looking for a solution that does NOT need a PC to do the update. (your suggestion did seem like a good solution if using a PC was a choice).

The users most times do not have a PC so I am looking for a low cost solution that I can ship to the user for them to do the update with.

(when we had surface mounted pics we used this solution to update them

http://www.flexipanel.com/TEAclipper.htm)

was hoping to find a similar type of solution for the STM32.

Thanks

Tom

clive2
Associate II
Posted on May 17, 2011 at 13:28

Controlling the JTAG of ARM parts is non trivial. A lot of bit twiddling and shifting to control the CPU registers and memory. Basically it would involve uploading some programming code to RAM, uploading sectors, executing, and repeating, in much the same manner as ULink and JLink adapters. You could look at some of the open source jtag tools to see how they work, router debricking tools, etc. I've done this for LEON3/SPARC, debug interface, but it was a total bugger, and I'd find a simpler way.

You might want to contact the H-Jtag guys, they probably have the knowledge to do this quickly.

http://www.hjtag.com/

You could try Segger, but I'd expect that to get expensive. They have a high-end stand-alone tool to do this on a production line.

If I were doing it, I would put some code in the target micro to implement a simple flashing protocol, and connect to the payloaded micro via a UART, I2C or SPI type connection. If you are using *all* the UART's you could perhaps mux one to alternate pins using the remapping functions.

If I were designing with this in mind I'd expose UART1 for programming/debug, along with BOOT0/1 and use the internal boot loader and it's relatively simple protocol. Even if you needed to recode the internal boot loader the footprint would only be about 2KB.

-Clive

pranamesh
Associate II
Posted on May 17, 2011 at 13:28

hi tom,

may be you can put the new firmware in SD/microSD card and use it for updating. But for this approach, there will be reasonable complexity in your firmware development effort like you need to implement a file system and execute the new firmware as a new file etc.....Many consumer grade electronic equipments use this method.

just for my knowledge, could you please give me some indications for the price of TEAClippers that you used earlier and what was its memory capacity? and Do you send a new teaclipper to your customer every time you upgrade the firmware?

clive2
Associate II
Posted on May 17, 2011 at 13:28

Or in the direction Pranamesh suggests, you could use a daughter card with a high density SPI flash memory ST, ATMEL, etc have 64Mbit and bigger devices in 8 pin footprints.

ST spun this off into Numonyx

http://www.numonyx.com/Documents/Datasheets/M25P64.pdf

Code to probe a serial flash and update at boot, perhaps 500-1000 bytes. Heck you could probably encrypt it relatively cheaply, and invalidate it for one time usage. For multiple uses just have a down counter.

A 64Mbit part probably sells for $2, a 4MBit (512x8) part less than $1

-Clive

tomabcd9
Associate II
Posted on May 17, 2011 at 13:28

For the TeaClipper solution most times we send the clipper to the customer and have them update all of the units then send the clipper back to us. We have been buying the clippers from Mouser

http://www.mouser.com/Search/Refine.aspx?Keyword=teaclipper

Do not know max memory limit of the TeaClipper but it had enough for the 18f and 17f parts we use. (I think it says somewhere on its web page)

About half the time we do not get the clipper units back.

To bad the Jtag solution will be so complicated so it seems the best solution will be the serial flash memory suggestion.

Thanks for your comments

Tom