Author Topic: processors with factory programmed bootloaders over UART  (Read 15661 times)

0 Members and 1 Guest are viewing this topic.

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 9056
  • Country: us
    • SiliconValleyGarage
processors with factory programmed bootloaders over UART
« on: September 10, 2025, 03:08:13 am »
Are there any processors out there that have a factory programmed bootloader that can work over a standard uart ( through an USB to serial chip like fti / cs340 , cp2101 or whatever )
Note : the processor must be able to run off 5 volts. not just be 5 volt tolerant on its i/o. true 5v power rail.

I do not want to muck with programmers that need drivers that don't work on operating system xyz, or only on operating system abc.
I have several development platforms and they all have issues. x doesn't work on y  , that one only works when plugged in a usb2.0 ( plug it in a usb 3.0 and it hangs )

i'm tired of all that crap. i need tools that work.

i need a simple processor. a bunch of i/o pins , an i2c  port, a simple uart . don' need anything else.

i can do this in less than 1 kilobyte of code on an 8051. but physically programming them is a problem. i want to have the ability to load the blank cpu as it comes off the factory over a standard uart.
there used to be something called FLIP but that require java to be installed and that's a no-starter
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: processors with factory programmed bootloaders over UART
« Reply #1 on: September 10, 2025, 03:33:15 am »
I mean ... yeah.

https://www.amazon.com/ATmega328P-PU-Microcontroller-Bootloader-Compatible-Arduino/dp/B0DGQRSV2F

Also, if you already have ANY working Arduino-compatible board (doesn't matter whether it has a AVR CPU or not) then you can load a standard sketch onto it which then allows you to load the serial bootloader onto blank AVRs.

https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP/
« Last Edit: September 10, 2025, 03:37:13 am by brucehoult »
 

Offline oPossum

  • Super Contributor
  • ***
  • Posts: 1559
  • Country: us
  • Very dangerous - may attack at any time
Re: processors with factory programmed bootloaders over UART
« Reply #2 on: September 10, 2025, 03:45:57 am »
CH552, CH554 and CH559 have USB and UART bootloader as supplied by the manufacturer.

3 to 5 volt operation. "single cycle" 8051 core.
 

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 9056
  • Country: us
    • SiliconValleyGarage
Re: processors with factory programmed bootloaders over UART
« Reply #3 on: September 10, 2025, 04:13:55 am »
Thanks for the suggestions so far

let me clarify a couple more things :
-  tqfp44 pins or more. i need lots of i/o

No arduino. not an option. AVR is not the issue. The processors as sold on digikey do not have the bootloader in it. It needs to have a FACTORY bootloader. not something flashed by some external tool. ( those external tools are again a pain in the butt. ).

Processor needs to be available on digikey/mouser.  so CHxxx or any other chinese thing is out

I'm leaning towards a 32U4 now ...  ( A UPDI port is acceptable as i can wire up a simple usb-uart to make a UPDI. It requires no flashing of anything.)

Having to preloading of bootloader and the requirement of drivers is key thing i want to avoid. It's a board with a USB port. Either through as USB <> uart or using the built-in USB of the processor.

FLIP is an option (32U4. and that guy can also work over UPDI, so you don't really need flip)

I am currently trying to use the ATxmega4809 but my experience has been horrible with that processor. The documentation is very bad. Especially the usage of the port mux and what peripherals override pins under what conditions. I spend more than a day just figuring out when the UART enables XCK and or XDIR on the pins. Now i'm stuck getting the interrupts to work ... The simulator in AVR Studio can't simulate it properly.






Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5412
  • Country: si
Re: processors with factory programmed bootloaders over UART
« Reply #4 on: September 10, 2025, 05:49:27 am »
Most modern ARM based MCUs have a bootloader baked into a hidden ROM inside. Some are just smart enough to boot from external flash, others do the whole shebang of UART, I2C, SPI, USB, CAN...etc. But most of these are 3.3V parts (tho to be fair i haven't used 5V with MCUs for over a decade, most digital chips are 3V3 nowdays).

That being said i would NEVER use this built in bootloader for development. You don't get any form of in circuit debugging capability with these bootloaders (since while bootloader is running your user code is not running). So as a result tracking down bugs in your code devolves into blinking an LED at various parts of the code, debug printing..etc, recompiling the code every time, flashing the entire chip every time, having to manually get the chip in bootloader mode every time etc.. This wastes SO much time. I do often use these bootloaders to implement in-field firmware updates tho.

Alternatively i can buy a dev board with a USB to JTAG/SWD interface built into it for around 10€, bring out the programming lines onto a cable with a plug on the end, plug that into the MCU based board i am developing and suddenly i have full in circuit debug capability. With after changing a line of code it takes just 1 click to compile and program the code into the MCU. Programing takes <1 second since it only rewrites parts of the flash that changed. Then i can single step trough my code, look at any variable, change any variable, look at all hardware registers, can even poke IO pins directly live by writing to the GPIO peripheral registers. This saves so much time that the 10€ investment in the programmer board pays itself back in 1 day of bug hunting.

As for documentation for MCUs. It is mostly all not very good. The difference is just that some documentation is only slightly bad while others are horrendously bad. It is partially due to it being more difficult to write good documentation for the more modern MCUs due to how much more complex they are. Best solution is to simply stick to a very popular MCU series so that if you get a problem you can google your way out of it.
 

Offline pqass

  • Super Contributor
  • ***
  • Posts: 1179
  • Country: ca
Re: processors with factory programmed bootloaders over UART
« Reply #5 on: September 10, 2025, 06:30:39 am »
Quote
Are there any processors out there that have a factory programmed bootloader that can work over a standard uart...

I do not want to muck with programmers...

I want to have the ability to load the blank cpu as it comes off the factory over a standard uart.

With regards to ATmega or ATtiny (what I know)...

Downloading your compiled program to an MCU will require some kind of program on your host.

A bootloader (listening on the MCU UART) just mimics a well-known hardware programmer protocol so that the host program thinks it's talking to a serially-attached hardware programmer.
Like this setup:  (a) host USB ---> USB-TTL UART RX/TX/RESET pins on MCU
Otherwise, with a blank MCU, your setup would be:
    (b) host USB ---> HW programmer ---> MISO/MOSI/SCK/RESET pins on MCU
    (c) host USB ---> USB-UART TTL RX/TX+resistor ---> UPDI pin on MCU
   
What brucehoult suggested was to install the ArduinoISP example program (from the Arduino IDE) on a loose Arduino UNO or Nano to use that as the "HW programmer" in (b) above.
Then use that UNO/NANO HW programmer to install the Optiboot bootloader on blank chips from Digikey.

The host program to download your compiled code to the MCU (blank or with bootloader) is "avrdude" and is available for Windows/MacOS/Linux.
It's part of the Arduino IDE zip/installer or standalone from Github.

The advantage of using a bootloader (listening on the MCU UART) allows you to use the same externally accessible serial port for both your application-specific use and updating the firmware without having to open up the product enclosure.  (b) and (c) setups will require different pins than TX/RX/RTS which usually require access to the PCB.

 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 12741
  • Country: nz
Re: processors with factory programmed bootloaders over UART
« Reply #6 on: September 10, 2025, 06:42:00 am »
Digikey offers a programming service for MCUs, never used it myself. but you can buy chips on tape/reels already programmed with your code

You can do the same directly from the Microchip store which sells AVRs. Look for the "Factory programmable" option.
eg https://www.microchipdirect.com/product/ATMEGA128-16AU
I know Mikeselectricstuff uses this service so the price should be fair, but 'fair' is probably relative to your MCU cost and what your time is worth. I think it's around $0.30 for 0 - 0.5k volume.

It seems the Digikey URL for it is 404 atm, https://www.digikey.co.nz/en/resources/dk-services/programming-services
But I have seen the program service show up as an option on Digikey MCU's in the past.
(Have already reported 404 page to digikey.)

I am currently trying to use the ATxmega4809 but my experience has been horrible with that processor. The documentation is very bad. Especially the usage of the port mux and what peripherals override pins under what conditions. I spend more than a day just figuring out when the UART enables XCK and or XDIR on the pins.
I use the ATMega (16/32/48)09 and (16/32/48)08 ranges and have not had any issues. But i dont use XCK/XDIR just raw UART TX/RX. The only issue i had was blowing them up due to me stupidly putting the AVCC cap on the wrong side of the series inductor and damaging the pin from ringing caused by pulsed current flow.
« Last Edit: September 10, 2025, 07:04:51 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 
The following users thanked this post: voltsandjolts, Ian.M

Online nctnico

  • Super Contributor
  • ***
  • Posts: 30343
  • Country: nl
    • NCT Developments
Re: processors with factory programmed bootloaders over UART
« Reply #7 on: September 10, 2025, 08:28:03 am »
Are there any processors out there that have a factory programmed bootloader that can work over a standard uart ( through an USB to serial chip like fti / cs340 , cp2101 or whatever )
Note : the processor must be able to run off 5 volts. not just be 5 volt tolerant on its i/o. true 5v power rail.

The only option that pops into my mind are the old 8051 based microcontrollers from Philips. Don't know if these are still active parts. NXP continued having fully featured bootloaders in their ARM offerings (LPC series) but no 5V power.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3399
  • Country: au
Re: processors with factory programmed bootloaders over UART
« Reply #8 on: September 10, 2025, 08:34:19 am »
Note : the processor must be able to run off 5 volts. not just be 5 volt tolerant on its i/o. true 5v power rail.
i can do this in less than 1 kilobyte of code on an 8051. but physically programming them is a problem. i want to have the ability to load the blank cpu as it comes off the factory over a standard uart.

The SiLabs EFM8BB5x series are 5V and have UART bootloaders, with 1T 8051 50Mhz cores & ADC and some have DAC.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3399
  • Country: au
Re: processors with factory programmed bootloaders over UART
« Reply #9 on: September 10, 2025, 08:56:13 am »
Thanks for the suggestions so far

let me clarify a couple more things :
-  tqfp44 pins or more. i need lots of i/o

The older Atmel AT89LP51Rx2 series have UART loaders.

Nuvoton recently expanded the pin-count choices, so their MG51LD1AE comes in TQFP48

FWIU these are UART bootloader capable, but do not have order codes yet for factory installed loaders.
The ISP system is included on their eval boards or standalone
https://www.techdesign.com/market/categories/development-tool/development-board/8051_evb?search=MG51LD1AE


They have a PC-less programming solution, that stores the code in the USB dongle SPI flash and you just press a button, no PC software needed at all, once set up.

https://www.techdesign.com/market/categories/development-tool/other-tools/debugger-programmer?search=NU-LINK-PRO

Addit: And some news reporting on the new MG51 series
https://www.hackster.io/news/nuvoton-technology-dusts-off-the-classic-8051-architecture-for-its-numicro-mg51-microcontrollers-29a820386303
For that they support Keil/Iar and SDCC/Eclipse, which has a file parsing editor that catches many semantic/typo bugs pre-compile.
« Last Edit: September 15, 2025, 09:45:29 am by PCB.Wiz »
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 2704
  • Country: au
    • Halestrom
Re: processors with factory programmed bootloaders over UART
« Reply #10 on: September 10, 2025, 10:35:42 am »
STC are my favourite 8-bit for this.

For programming: UART + stcgal software (win or Linux)
For compiling: sdcc (or any other 8051 compiler)
 

Offline 8goran8

  • Contributor
  • Posts: 40
  • Country: cs
Re: processors with factory programmed bootloaders over UART
« Reply #11 on: September 10, 2025, 11:11:21 am »
The PIC32CM JH00/JH01 family might suit your needs.
You can read more about the factory bootloader in Appendix 1 of the datasheet.
I must mention that I have never used this microcontroller family.
 

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 9056
  • Country: us
    • SiliconValleyGarage
Re: processors with factory programmed bootloaders over UART
« Reply #12 on: September 10, 2025, 12:17:11 pm »
Thanks for all the suggestions.

Here is the dilemma i am trying to solve :
i build a product , put it in the field and at some point a software update is made. I can not expect the user of the product to have a programming cable, chunk of hardware or the skills to perform brain surgery.
I want the ability to give the user a file and point him to a software tool ( something i do not have to make, maintain or support ) to load that file onto the processor over a common USB port ( either through the baked-in USB , or a usb to uart that i have put in the product. )

It's already bad enough that there invariably will be questions like "i am using operating systems xyz and there is no tool for that"

For example the RP2040 and 2350 emulate a mass storage device. simply drag the firmware file and magic happens.
Where are the other processors that have a DFU baked in by their maker ? Mass storage class, CDC class or through a UART.

Something that does not need drivers , has the loader available for Windows XP,7,8,9,10,11 , MacOs -x (any flavor) , linux (an even bigger can of worms and verions) ,and most importantly does not need ANY ACTION ON MY PART to get it on the processor or maintain it.

I may have to bite the bullet and switch to a 3.3 volt processor. i'll have to do everything over I2C and use I/O expanders . I want to avoid level shifters as much as possible. they are also a headache. There's only like 6 signals that would need level shifters as they are interrupt inputs to the processor.

I have a drawer full of dongles and boards , each requiring their own software and driver to program and debug various processors. some of them cost a lot of money and their makers are no longer existing or don't support them anymore.
Every couple of years there is a new "picKit" or other tool that goes out of support and you need to buy a new one if you want to use a newer processor or the newer development tool.

it is annoying and a waste of time and money.
So i want to switch to a processor that doesn't need all that stuff.

Again , it is the problem after development of supplying the end user with firmware updates that does not require them to open the device, buy a extra piece of hardware , muck with drivers and software and becomes a support headache.
It also solves the problem on my end of requiring the same tools or a programming service to load the initial DFU code .


« Last Edit: September 10, 2025, 12:27:50 pm by free_electron »
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 12741
  • Country: nz
Re: processors with factory programmed bootloaders over UART
« Reply #13 on: September 10, 2025, 12:30:02 pm »
Do you care about protecting your firmware binary, because a lot of MCUs that are programable over the UART require you to send an unencrypted copy of your binary.  So if you give out firmware for your customer to flash you are giving out the raw unencrypted firmware file.

Some MCUs do have encrypted factory bootloader options, STM32 has one.
Just something to consider.

One thing i've seen people do is throw a $0.50 ESP8266 or similar onto their PCB connected to the main processors programming lines, and have the ESP running a webserver that just allows you to connect over wifi from any phone and upload a bin file through the HTML page that automatically loads when you open a browser (eg captive portal).
The ESP handles the reprogramming of the main MCU in a user friendly way. You cannot brick your main MCU and if you dont like the fact that your product now has wifi you can have it only power on the ESP8266 through some jumpers or button or something when the user puts the device into a programming mode.
One downside is your product now has a RF transmitter on it so there are certification implications.
Pretty sure you could get all that working pretty easily as i think there's lots of arduino examples on doing that on an ESP
« Last Edit: September 10, 2025, 12:44:37 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Pseudobyte

  • Frequent Contributor
  • **
  • Posts: 358
  • Country: us
  • Embedded Systems Engineer / PCB Designer
Re: processors with factory programmed bootloaders over UART
« Reply #14 on: September 10, 2025, 12:44:17 pm »
Yeah I think you will be hard pressed to find a true 5V micro with a baked in USB mass storage device bootloader.

If you can find a 5V micro with USB you could always write the bootloader yourself.

I have products that all serve up single page web apps as the primary HMI. Through that web interface our customers can simply upload a new encrypted firmware package (encrypted to prevent someone from loading something malicious). The bootloader will decrypt and load the the new firmware when the unit is power cycled. Doing it this way does require a real file system though.

Another option would be to skip the bootloader all together and just have your application do direct firmware upgrades. I would only go this route if the micro you are using has multiple flash banks and you can preserve the old firmware until the new firmware boots.
“They Don’t Think It Be Like It Is, But It Do”
 

Offline ftg

  • Frequent Contributor
  • **
  • Posts: 549
  • Country: fi
    • ftg's RF hax paeg
Re: processors with factory programmed bootloaders over UART
« Reply #15 on: September 10, 2025, 12:52:31 pm »
Renesas RA4M1 series is used Arduino UNO R4 Minima.
Can do 5V and seems to have some USB bootloader.

Nuvoton seems to have NUC131LD2AE and that's also 5V tolerant and a modern ARM.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 30343
  • Country: nl
    • NCT Developments
Re: processors with factory programmed bootloaders over UART
« Reply #16 on: September 10, 2025, 01:51:01 pm »
Thanks for all the suggestions.

Here is the dilemma i am trying to solve :
i build a product , put it in the field and at some point a software update is made. I can not expect the user of the product to have a programming cable, chunk of hardware or the skills to perform brain surgery.
I want the ability to give the user a file and point him to a software tool ( something i do not have to make, maintain or support ) to load that file onto the processor over a common USB port ( either through the baked-in USB , or a usb to uart that i have put in the product. )

It's already bad enough that there invariably will be questions like "i am using operating systems xyz and there is no tool for that"

For example the RP2040 and 2350 emulate a mass storage device. simply drag the firmware file and magic happens.
Where are the other processors that have a DFU baked in by their maker ? Mass storage class, CDC class or through a UART.
Again, NXP's LPC series. LPC11U6xx series for example does this. You can drag& drop new firmware into the microcontroller when it is connected to a USB port. You'd need a button though to put the device into this state. Alternatively, create firmware which has this functionality while the device is running normally.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 9056
  • Country: us
    • SiliconValleyGarage
Re: processors with factory programmed bootloaders over UART
« Reply #17 on: September 10, 2025, 02:39:10 pm »
Do you care about protecting your firmware binary,
nope. i even share the source code.

Quote
seen people do is throw a $0.50 ESP8266

That's again requiring an effort from my side to write such thing, flash it on the esp32... and the ESP is not friendly. QFN package, rf antenna issues. I don't want shoes, hats, capes or other noseplucking. no stacked modules.

i do not want the burden of having to support all that !
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 9056
  • Country: us
    • SiliconValleyGarage
Re: processors with factory programmed bootloaders over UART
« Reply #18 on: September 10, 2025, 02:40:12 pm »
If you can find a 5V micro with USB you could always write the bootloader yourself.

that's exactly what i don't want !

Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 9056
  • Country: us
    • SiliconValleyGarage
Re: processors with factory programmed bootloaders over UART
« Reply #19 on: September 10, 2025, 02:44:41 pm »
Renesas RA4M1 series is used Arduino UNO R4 Minima.
Can do 5V and seems to have some USB bootloader.

Nuvoton seems to have NUC131LD2AE and that's also 5V tolerant and a modern ARM.

Renesas and Nuvoton don't work for me. No workable toolchain for me.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 9056
  • Country: us
    • SiliconValleyGarage
Re: processors with factory programmed bootloaders over UART
« Reply #20 on: September 10, 2025, 02:54:37 pm »
Again, NXP's LPC series.

i need to take a look at those. problem will be finding a toolchain. i need a BASIC compiler... not interested in C/C++

not 5 volt ... :(
« Last Edit: September 10, 2025, 02:59:07 pm by free_electron »
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline BradC

  • Super Contributor
  • ***
  • Posts: 2524
  • Country: au
Re: processors with factory programmed bootloaders over UART
« Reply #21 on: September 10, 2025, 03:00:50 pm »
The old 68hc11 had a uart bootloader baked in. Probably a bit old for your tastes though.
 

Offline ftg

  • Frequent Contributor
  • **
  • Posts: 549
  • Country: fi
    • ftg's RF hax paeg
Re: processors with factory programmed bootloaders over UART
« Reply #22 on: September 10, 2025, 03:01:24 pm »
It might be quite hard to find a 5V tolerant chip with TQFP-44 or larger and embedded USB or UART bootloader that requires no installation of anything on the PC side.

But I'm surprised there's no BASIC compiler compatible with the R4 Minima from Arduino.
 

Offline squadchannel

  • Super Contributor
  • ***
  • Posts: 1275
  • Country: jp
  • deepl translate user
Re: processors with factory programmed bootloaders over UART
« Reply #23 on: September 10, 2025, 03:22:22 pm »
b.....BASIC!?!? :o |O :scared:
 
The following users thanked this post: tooki, newbrain

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 9056
  • Country: us
    • SiliconValleyGarage
Re: processors with factory programmed bootloaders over UART
« Reply #24 on: September 10, 2025, 03:40:35 pm »
b.....BASIC!?!? :o |O :scared:

YES BASIC !  i have my reasons and i'm not going into endless discussions on the why. Those always become endless .
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->