Page 1 of 3

STM32 woes

Posted: Sun Apr 11, 2021 11:01 am
by johu
As Bart just found out, JLCPCB have removed the STM32F103RBT6 from their library. Like completely, it's not even an extended part. For those who don't know, that is the main processor that has been used for openinverter for the last 10 years.
Also it seems the price has exploded to around $12.

viewtopic.php?p=26235#p26235

Possible replacements
  • STM32F103R8T6
    Structurally identical to the RBT6 but only has 64k flash. Thats ok, the bootloader uses 4k, firmware 40k, parameters 2k. Would leave us with 58k for the firmware which at the current growth rate would last still a bit. Would need to implement flash size detection to find the correct location for storing parameters and CAN mapping
  • STM32F103RET6
    Has 512k flash and I assume larger page size. Would need adjustment of bootloader and also flash size/page size detection. Seems to have richer peripherals also.
    Both the RET6 and R8T6 are basic parts
  • STM32F2*, STM32F3, STM32F105RBT6, STM32F107R*
    Extended part and poor stock situation.
  • STM32F412RET6
    Extended part, even more expensive ($24), libopencm3 not fully fleshed out (per some time last year) so lots of software changes and completion of libopencm3 needed
  • GigaDevices parts
    Super cheap ($1.50 for the GD32F103RBT6) but mostly untested. Revealed one small compatibility issue when tested on BMS. Extended part and poor stock situation.
  • STM32F0
    Lacking performance (48 MHz, 8k SRAM)
I'm leaning towards R8T6 or RET6 and it would be easy to handle both in software.

Re: STM32 woes

Posted: Sun Apr 11, 2021 11:17 am
by jon volk
May be worth a try
https://lcsc.com/product-detail/GigaDev ... ef=jlc-SMT

JLC lists as an extended part.

Re: STM32 woes

Posted: Sun Apr 11, 2021 11:36 am
by johu
Added to list above. A bit problematic.

Re: STM32 woes

Posted: Sun Apr 11, 2021 11:46 am
by FJ3422
Experienced a sudden disappearance of components as well during last months. Even parts that were in decently in stock (1000+) a couple of days before. It looks like they might be selling stock through the backdoor due the global semiconductor shortage and thus exploded prices.

Re: STM32 woes

Posted: Sun Apr 11, 2021 1:50 pm
by JaniK
Oh crap, this too, hmm..

Re: STM32 woes

Posted: Sun Apr 11, 2021 2:53 pm
by mikmur
I bought a 2 submodule STM32F103RCT6, ARM; Flash: 256 KB; 72MGc; SRAM: 48KB. I think it will go

Re: STM32 woes

Posted: Sun Apr 11, 2021 3:27 pm
by johu
Yes that's probably the 256k variant. I will certainly replace the static addresses and page sizes with a dynamic one.

Re: STM32 woes

Posted: Mon Apr 12, 2021 1:11 pm
by Bart
Hey all,

I have contacted JLCPCB about this: they say this chip is temporarily out. Apparently, ST components have been in shortage lately. If they have it back in stock, they will add it to their library again. They could not give me an estimation of when that will happen. I have asked them if it will certainly come back at some point, and they said that they will keep trying until they can find new stock. This makes it a bit difficult to judge whether one should wait or resort to alternatives, but it can be a reassurance for the patient ones among us.

All the best,
Bart

Re: STM32 woes

Posted: Mon Apr 12, 2021 8:47 pm
by yaroslav
Greetings, as the law of meanness, just finished designing a new logic board, the processors for it ran out. will the CPU pinout change?

Re: STM32 woes

Posted: Mon Apr 12, 2021 9:02 pm
by johu
No, pin out will not change.

Re: STM32 woes

Posted: Tue Apr 13, 2021 6:38 pm
by yaroslav
Hi, I want to order the board on jlcpcb, what kind of processor can I use?

Re: STM32 woes

Posted: Tue Apr 13, 2021 7:59 pm
by johu
STM32F103R8T6 or RET6. I'm currently working on a boot loader and firmware that supports various memory sizes.

The flash size is easily determined with desig_get_flash_size().
The page size must be deduced from the type in DBGMCU_IDCODE
- The F103RBT6 is a medium density device and identified by 0x410 and have a page size of 1k
- The F105 and F107 are "Connectivity line devices" identified by 0x418 and have a page size of 2k
- The F103RET6 is a high density device, identified by 0x414, page size 2k

I think that should be all relevant ones for recent projects

Re: STM32 woes

Posted: Thu Apr 15, 2021 4:55 am
by joromy
johu wrote: Sun Apr 11, 2021 11:01 am As Bart just found out, JLCPCB have removed the STM32F103RBT6 from their library. Like completely, it's not even an extended part. For those who don't know, that is the main processor that has been used for openinverter for the last 10 years.
Also it seems the price has exploded to around $12.
I have made boards for many many years, and I don't understand the fuzz about JLCPCB. There are many others that can make boards with any components you want and not very much higher prize.
The faith of the openinverter boards should not lay in the hands of PCB manufacturer and their component stock.

Maybe you should go back to the piggyback version, then the chip pinout and type are more flexible, even possible to use completely different microcontroller.

What about this, or is that something completely different:

viewtopic.php?f=3&t=1574

Re: STM32 woes

Posted: Thu Apr 15, 2021 6:13 am
by mackoffgrid
JLC have been fantastic - very low cost and even more, convenient for those of us who are prototyping and building for ourselves.

While it may be more expensive, it may be better during these times for those like Johannes and Damien who need better supply - Pre-buy the critical parts -( processors) and use PCBWAY and the like. (unless you like hand soldering SMD) ;) I've experienced this before - (the RAM shortages of the late eighties, and others)

Re: STM32 woes

Posted: Sat Apr 17, 2021 8:32 pm
by esyjam
johu wrote: Tue Apr 13, 2021 7:59 pm STM32F103R8T6 or RET6. I'm currently working on a boot loader and firmware that supports various memory sizes.

The flash size is easily determined with desig_get_flash_size().
The page size must be deduced from the type in DBGMCU_IDCODE
- The F103RBT6 is a medium density device and identified by 0x410 and have a page size of 1k
- The F105 and F107 are "Connectivity line devices" identified by 0x418 and have a page size of 2k
- The F103RET6 is a high density device, identified by 0x414, page size 2k

I think that should be all relevant ones for recent projects
How about going for STM32G431?

Re: STM32 woes

Posted: Tue Apr 20, 2021 2:26 pm
by johu
I have unified the boot loader to work on both 1k and 2k page size devices: viewtopic.php?f=7&t=1587

Likewise added flash size and page size auto-detection to the two modules in libopeninv that write to flash: CAN and param_save
esyjam wrote: Sat Apr 17, 2021 8:32 pm How about going for STM32G431?
It is not in stock at JLCPCB and would require a large porting burden.

Re: STM32 woes

Posted: Thu May 06, 2021 7:49 pm
by johu
So turns out reading DBGMCU_IDCODE is unreliable on older devices. So I changed the boot loader again. It deletes a page assuming it is 1k. Before deleting the next page it will check if it was already deleted. If so, we deleted a 2k page in the first place. In any case we always collect 2k of data from the serial port and then flash it.

The firmware uses a similar pattern. Now parameters and CAN mapping may end up in the same flash page.

Re: STM32 woes

Posted: Tue May 25, 2021 1:33 pm
by Alex_kip
yaroslav wrote: Tue Apr 13, 2021 6:38 pm Hi, I want to order the board on jlcpcb, what kind of processor can I use?
Hi Yaroslav! The question is not in this topic. I'm a newbie here, I wanted to talk to a russian-speaking. I downloaded to BluePill firmware, PC13 blinks. Through esp or directly through the terminal, I receive only an echo in response to all commands. I dug up the forum - I don't understand what I did wrong. Tell me in which direction to look for the error. If possible, give me a contact. My email kiprotor@mail.ru

Re: STM32 woes

Posted: Tue Jun 29, 2021 4:16 pm
by crasbe
It seems like JLCPCB has added the STM32F103RBT6 again, even though it's now at around $21 and they only have 1 in stock..

I would not recommend using the Giga Device Clone. I've read more than one report of not all features working as they should or as expected.
Automotive electronics usually demands the highest reliability, so using a part that might not behave as expected it not really something I'd feel comfortable with.

Re: STM32 woes

Posted: Tue Jun 29, 2021 4:22 pm
by johu
Yes I'll definitely not use GigaDevices on anything I sell, just for my own prototypes.
So far I'm selling STM32F103R8T6 which only has 64k of flash. It is sufficient for the 40k firmware though (+2k parameters, +4k boot loader)

Re: STM32 woes

Posted: Wed Aug 18, 2021 8:06 am
by johu
It's getting harder. Now JLCPCB do not stock ANY LQFP64 variant of the STM32 anymore. Neither does mouser, digikey or any other big name suppliers. I found some at an obscure Hong Kong distributor (https://www.win-source.net/stmicroelect ... bt7tr.html) and will have a local company solder them onto the otherwise populated boards. Might need to raise prices a bit.

Re: STM32 woes

Posted: Wed Aug 18, 2021 8:25 am
by MattsAwesomeStuff
One can only imagine, if the OEMs are in crisis, just how bad it is for everyone else.

Also, component cost being such a small portion of a business, we're seeing toilet paper hording levels, creating even more shortages than there otherwise would've been.

Now is a bad time for anyone to start experimenting with their hardware and blowing it up :P.

I do wonder how long before us commoners will have broad component access again.

Higher prices seem quite reasonable to me. Charge what they're worth.

Re: STM32 woes

Posted: Fri Aug 20, 2021 10:32 am
by johu
You are right, it's gold mining time:
STM32F103RBT7TR: We are sorry to tell you that the old batch of this part which was at $8.027/pc has been sold out, the new batch of it is a little expensive. But to show our apologies, we have applied the loyal customers` price for you, which is $40/pc, total price difference is $6394.6 and this part is on tray.
On their site they still quote about $8 - clickbait

Re: STM32 woes

Posted: Fri Aug 20, 2021 11:01 am
by johu
So what this means is that I have to way to restock LDU boards right now. Since boards are my main revenue stream I had to increase prices to make the most of my existing stock. Nobody knows when this situation is resolved.

Re: STM32 woes

Posted: Fri Aug 20, 2021 1:22 pm
by Isaac96
If the "loyal customers' price" is $40 who knows what the common man pays...