Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:02 12 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Another plus for the STM32L4

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10572
Posted: 10:54pm 13 Dec 2018
Copy link to clipboard 
Print this post

One downside of the Micromite is that you need to get the firmware into a PIC32 chip to start with. Of course you can buy a pre-programmed chip from the various sources but wouldn't it be great to program a new virgin chip without any sort of programming hardware.

With the STM32 this is easy to do.

The STM32 range of chips have a specific pin name BOOT0. If this pin is tied to GND then the chip runs the program in flash memory - in our case the Armmite L$ firmware.

However, if BOOT0 is tied to VCC then the chip runs a bootloader already built into the chip itself.

Using the free STM32CubeProgrammer software you can then program the Micromite firmware into a virgin chip using nothing other than a standard USB/UART connected to any of the chips H/W uart pins.

In the case of the 48-pin and 64-pin STM32L4 chips UART2 is the Micromite Console so without any wiring changes it is possible to program the chip with new firmware simply by running STM32CubeProgrammer instead of your usual terminal emulator.

Unfortunately the NUCLEO-L432KC uses non-standard pins for the console but you can program this by connecting to the Armmite COM1 conections. For the 48 and 64-pin parts you can simply use the console pins (although com1 or com2 will also work).

The relevance of this is that I can now design a PCB for the 48-pin part and know that anyone can program the Armite L4 firmware into it without any sort of special hardware. The PIC32 is a great chip and the 28-pin version is the only 32-bit uP available in a DIP package but other than this I really think Microchip are falling way behind the curve in terms of nearly all aspects of embedded computing for the hobby market - CPU speed, power usage, ease of use, peripherals etc.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4133
Posted: 11:03pm 13 Dec 2018
Copy link to clipboard 
Print this post

I agree with you that Microchip ought to improve their offerings. They have some very good features but do lack some others. And they do seem to have an unwillingness to realise that they need to improve to compete.

If you're curious, have a look at the Allwinner CPUs and their various ways of being booted/programmed. (They're also ARM instructions but the I/O is rather different.) A decent place to have a read around is linux-sunxi.org if you do get curious (just ignore the Linux parts if you want to know the hardware).

John
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 05:14pm 15 Dec 2018
Copy link to clipboard 
Print this post

Hi Matherp, this is very interesting! This being quite new to me, forgive my ignorance...

One feature I used with the micromite on the 28 and 44 pin PIC chips that I normally use is being able to first flash the chip with mmbasic, load my program using mmedit and then sucking the whole thing out as a hex file with MPlab IPE. Then I can easily blast the operating system and my program with a pickit3 all at once. The only problem with this is when I want to send someone a new hex file to update a board, that person would have to have a pickit3 and MPLab available to load the chip with an "update".

The pickit3 has the on the go feature which works quite well, but still have to send out a pickit3 to the end user. A bit pricey.

With the SMT32 range of chips you are supporting, is it possible to do something similar, but without a programmer, using this feature. What I am thinking is being able to connect just a simple USB serial cable like THIS, and downloading a new "hex" or "binary" file that includes the operating system and program to the SMT32 chip in the bootloader mode?

This would be a great way to send "updates" for boards where the end user that has no knowledge about programming could just connect his board to a pc and "update" his board, like people do with consumer products like routers, etc.

Again, forgive my ignorance...Edited by viscomjim 2018-12-17
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10572
Posted: 06:43pm 15 Dec 2018
Copy link to clipboard 
Print this post

  Quote  With the SMT32 range of chips you are supporting, is it possible to do something similar, but without a programmer, using this feature. What I am thinking is being able to connect just a simple USB serial cable like THIS, and downloading a new "hex" or "binary" file that includes the operating system and program to the SMT32 chip in the bootloader mode?


Just tested it and it works perfectly. I flashed a virgin firmware image using nothing more than the STM32CubeProgrammer application across a CP2102 USB/UART. I then set the jumper to normal mode and restarted the Armmite L4.
Then I used teraterm to talk to MMBasic on the the ARMMite L4 and set up the flash disk drive

OPTION FLASH 2

Then I could load a program from the flash drive

LOAD "benchmark"

Next I closed teraterm and set the jumper to bootstrap mode rebooted and reconnected with STM32CubeProgrammer. I could then read the chip memory and save it to a new hex file ARMBENCH.HEX.

I then used STM32CubeProgrammer to completely erase the chip and tested to make sure it was completely empty. I then uploaded ARMBENCH.HEX using STM32CubeProgrammer and again set the jumper to normal mode and restarted the Armmite L4.

When I connected again with teraterm both the OPTION setting and the programmer were there and working.

Note all this was done with nothing more than a standard CP2102 USB/UART and the STM32CubeProgrammer application (runs on Windows AND Linux)

 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 06:52pm 15 Dec 2018
Copy link to clipboard 
Print this post

That is good news! One thing, lets say the user just has the board and absolutely no knowledge of tera term or anything like that. Can the HEX file be set to autorun and he just loads the hex file, resets the jumper and powers up and then it will just run? What I am trying to accomplish is just like and "update" for a user that has no clue. He would just update, set the jumper and go, kind of thing.... Of course, I would still have to send the cable, but a lot cheaper than sending a pickit3...Edited by viscomjim 2018-12-17
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10572
Posted: 06:58pm 15 Dec 2018
Copy link to clipboard 
Print this post

  Quote  Can the HEX file be set to autorun


Yes, of course, if OPTION AUTORUN ON is set when you save the image then the application will start immediately once the new firmware is loaded.
 
RonnS
Senior Member

Joined: 16/07/2015
Location: Germany
Posts: 121
Posted: 11:41pm 15 Dec 2018
Copy link to clipboard 
Print this post

....Edited by RonnS 2018-12-17
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025