Standard for flashing on-module "helper" microcontrollers

Anyone come up with a standard for flashing code on to on-module microcontrollers without requiring the module user to do something unfriendly?

Background: I’m looking at a few modules that will need on-module MCUs (at least one of them will have very complex logic in the helper MCU). I can use jtag or isp at home, but if I were to ship those as kits, people would need some way to update them using nothing more than what a typical Gadgeteer dev would have, preferably without requiring them to disassemble anything.

Not talking Daisylink here, but if that already includes something to help, I’ll definitely consider it.

Ideally, it could be done as a program loaded on the mainboard and then sent to the module. I can think of a number of ways to handle this, but wanted to see if someone else has already paved this ground.

Pete

This is part of few of the new coming modules. We built the needed code to flash the module from mainboard. I can;t talk about details publicly yet.

Thanks Gus

Do you plan to release any of the code as OSS?

Pete

Yes :slight_smile:

Here is how I did it for my DL module. Luckily I had 4 available pins on the socket so I’v just used them in SPI configuration (6-SS(RESET), 7-MOSI, 8-MISO, 9-SCK).

Now I can have Gadgeteer to program my module through S socket,or use something like this in between and use external programmer.

Clever with the ISP module :slight_smile:

Module label aside, looks like you need the user to switch the module to an SPI port, right? Or are you using software/bit-banging?

If your module uses an on-board MCU with a lot of memory, this can get extra difficult on the new Cerebus with its limited memory, especially if you load a hex file which is quite a bit larger than the actual memory it represents.

Pete

Thanks! ;D

I was going to use hardware SPI, but theoretically you can use it on any socket with software SPI.
The hex file can be streamed. No need to load it upfront.

Streamed from what?

If a person buys the Cerebus basic kit, no SD card, and your module, how would they stream a large hex file to it?

Can you somehow stream it over usb from the PC? Load four consecutive programs?

I’m trying to figure out a way to do it which works with something they may have already built and packed into an enclosure, and which doesn’t require any additional modules beyond what they’d need to apply new firmware to the main board (IOW, DP or usb power module)

Pete

Yeah, I’ve implied SD card

BTW how big is the hex file we are talking about. What MCU are you planning to use?

Not sure yet, but some of the xmega AVR modules I’ve considered for one of the more complex projects have up to 384kb flash. Go ARM and it can be bigger.

It’s a broader question, though :slight_smile:

Pete

I am using AVR chip and standard arduino boot loader (rarely changes, mature), this you can preload before giving the module it to the end user.
My custom firmware is an arduino sketch in this case, which can be uploaded using any usb-to-serial modules.