chipKIT® Development Platform

Inspired by Arduino™

Update Sketch in one custom Chipkit board via another?

Created Sat, 20 Aug 2016 00:19:07 +0000 by rs2845


rs2845

Sat, 20 Aug 2016 00:19:07 +0000

Hello all,

Before I get well underway writing my code for an alarm system I am building, I had a question.

My control panel is going to be made from one main PIC32MZ2048ECM100 and a few PIC32MX270F256B’s (to handle separate yet more intensive tasks) all with no boot loader (will use PICKit to program, a solution provided by majenko here )

I am also allocating a single PIC32 (MX or MZ undecided) chip (lets call this “chip z” for now) to solely handle the internet connectivity, working with the main PIC32MZ chip to complete tasks.

I'm wanting to update the sketches in these various PIC32's, through chip Z, via the internet.

Question: Can I use a single PIC32MX or MZ to update the sketches in any of the other PIC32’s on my system? I've thought of an ideal process below:

  • User chooses “Check for updates” via the panel’s HMI touchscreen
  • Main PIC32MZ sends all current software versions to “chip z”
  • Chip z then polls my server via ESP8266 and checks for newer firmware files (preferably a hex or bin file). It will then download them and store in chip Z’s flash memory one at a time or a winbond external flash IC (1MB).
  • Chip Z then "shuts down" the each IC (holds them in reset, or another mode suitable for the process) and flash the new firmware to it.
  • All chips are reset and panel re-boots.

Does anyone know of other people who have used a PIC32/Chipkit board to update the sketch in another? I’ve found threads like this and [url]this[/url=http://chipkit.net/forum/viewtopic.php?t=3650] detailing the use of SD cards/USB sticks or eeproms to update, but haven't found anything sufficient to help me get started.

Hopefully I can be pointed in the right direction, or perhaps learn how to code this functionality myself. Thanks in advanced!


majenko

Sat, 20 Aug 2016 00:45:46 +0000

What you're proposing is not an easy task.

You basically have to build a hardware programmer with multiplexing to each chip, and embed in it the software to do the programming. Not a simple job.

You'd need to start by understanding how the ICSP pins on a PIC32 work and how to communicate with them to do the programming. You can start here to find out more:

http://ww1.microchip.com/downloads/en/DeviceDoc/61145L.pdf

By the time you understand that you will know far more than me ;)


rs2845

Sun, 28 Aug 2016 13:09:53 +0000

I was hoping there'd be more glimmers of hope!

I have since come across this article, showing the use of an Arduino Nano as a JTag programmer for PIC32- a project called "ardupic32".. I am yet to find out how it works and whether MZ parts are supported...

http://www.microchip.com/forums/m653443.aspx https://code.google.com/archive/p/ardupic32/

You know significantly more than me, is there any point pursuing this? Even if I can just upgrade my main PIC32, the smaller ones wouldn't really need upgrading as they just control inputs and outputs at more specific timings..


majenko

Sun, 28 Aug 2016 21:36:20 +0000

A project similar to yours is something I do want to tackle myself sometime:

  • Hardware programmer with HID programming interface
  • ICSP connected to master chip
  • CDC/ACM pass-through to master chip UART
  • (probably) AN1388-based programming protocol

The idea is a small MX270 or similar sits on a development board as the USB interface to, say, an MZ chip. It directly programs it (no need for bootloaders and rubbish like that) and still gives a UART interface.