PSA: GD32F303 is not a drop in substitute for STM32F303 - Page 1
Forum section: electronics / general

author: OwO
author_rank: Super Contributor
timestamp: October 12, 2019, 06:02:36 am
content: I designed a board with a GD32F303 and discovered code for STM32F303 will not run on it (all peripheral accesses don't work), but code targeting STM32F103 does work and all tested peripherals (usb, dma, adc) work correctly. Initially I thought the chip was a relabeled GD32F103 but a detailed reading of the GD32F303 user manual and memory map revealed that the peripherals are identical to the F103. So the GD32F303 really is just a F103 with more ram and flash.

author: lordium
author_rank: Regular Contributor
timestamp: October 12, 2019, 06:37:23 am
content: Where did you find information that said it would be a drop in replacement? Apart from the name being similar, they are 2 different companies. Are there any information from either of them stating anything like this? Seems like a expectation vs reality problem.

author: ataradov
author_rank: Super Contributor
timestamp: October 12, 2019, 06:38:54 am
content: That's why it is a PSA, since many people would have the same expectation. There is really no point in discussing reasons for that for 1000th time.

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: October 12, 2019, 09:38:10 am
content: Quote from: OwO on October 12, 2019, 06:02:36 amPSA: RTFM !

author: Rasz
author_rank: Super Contributor
timestamp: October 12, 2019, 12:14:17 pm
content: Quote from: donotdespisethesnakemore like PSA: dodgy vendor

author: GromBeestje
author_rank: Frequent Contributor
timestamp: October 13, 2019, 02:12:19 pm
content: Quote from: Rasz on October 12, 2019, 12:14:17 pmI'm more like RTFM on this one.QuoteThe GD32F303 is a Cortex M4, versus an M3 for the F103. And there are more peripherals, like the DAC. In that sense, the features are like an STM32F303. So, not a drop-in, but offers the same features

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 13, 2019, 03:27:47 pm
content: So basically you're using a "clone" IC (at least you apparently chose it for this reason) and expect it to be a full clone, and are miffed when you discover, a bit late, that it's not.Dunno if it's funny or sad.

author: OwO
author_rank: Super Contributor
timestamp: October 13, 2019, 05:27:00 pm
content: Actually makes my job easier because all my existing code are F1 oriented and this saves having to port a lot of stuff. Don't know about the M4 vs M3 part though but binaries built for STM32F103 run on the GD32F303 with no modifications including the peripherals (currently tested: usb, adc, timer, dma, interrupts). I did make a small GD32 specific change though which is to allow running at 96MHz while using usb. I think I will end up porting the NanoVNA UI code to fit my codebase rather than the other way around since I don't feel like porting an outdated version of ChibiOS to this. One thing the gd32 lacks which is a regression is USB DFU, so firmware updates will require a st-link...EDIT: or usb-serial adapter

author: jhpadjustable
author_rank: Frequent Contributor
timestamp: October 13, 2019, 10:55:43 pm
content: Quote from: OwO on October 13, 2019, 05:27:00 pmI don't think the STM32F1 has a USB DFU bootloader either. If the F103 compatibility is that strong, an F103 bootloader from some random bloke on github might just work out of the box.

author: thm_w
author_rank: Super Contributor
timestamp: October 16, 2019, 01:21:04 am
content: I would have done the exact same thing so no blame here. GD32F103 is a straight up drop in replacement, if 303 was not they should put it in the datasheet headline or on their site somewhere. OR differentiate the number at least a bit (FX303 whatever).This is going to be very confusing because now you can't trust the PN, so any sort of flash size/ram size/etc would be suspect as well. Makes me less likely to use their ICs.

author: jhpadjustable
author_rank: Frequent Contributor
timestamp: October 16, 2019, 01:57:39 am
content: Quote from: thm_w on October 16, 2019, 01:21:04 amThey did. Notice the GD in front? That should be a big flashing neon sign that you're in a different namespace now. Why on earth did you ever assume ST is a standards body?

author: james_s
author_rank: Super Contributor
timestamp: October 16, 2019, 02:06:05 am
content: Because so many ICs do follow that convention that the brand prefix is often not even mentioned. I would have made the same assumtion as well. Occasionally old EPROMs have different programming algorithms based on the brand but even those are drop-in replacements from a functional standpoint. I can't actually think of a case I've ever encountered where two ICs with the same part number beyond the vendor prefix were not compatible.

author: langwadt
author_rank: Super Contributor
timestamp: October 16, 2019, 02:21:29 am
content: Quote from: james_s on October 16, 2019, 02:06:05 amI sure there are lots of analog parts

author: jhpadjustable
author_rank: Frequent Contributor
timestamp: October 16, 2019, 02:26:53 pm
content: Memory and 74 series logic were standardized fairly early on by a proper standards body (JEDEC). Analog was mostly standardized, such as it was, by virtue of second-sourcing agreements and gentlemanly behavior. There aren't enough numbers left for that!

author: westfw
author_rank: Super Contributor
timestamp: October 17, 2019, 08:32:46 am
content: I was vaguely under the impression that the stm32f303 was a a proper superset of the stm32f103...Other psa: the samc21 chips do not have usb... (difference between a d20 and d21 is essentially usb. Difference between c20 and c21 is... CAN.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: October 17, 2019, 06:22:08 pm
content: Looking at the migration guide STM32F1 to STM32F3 ,https://www.st.com/content/ccc/resource/technical/document/application_note/8e/c8/8d/e3/ee/ff/44/e6/DM00073522.pdf/files/DM00073522.pdf/jcr:content/translations/en.DM00073522.pdfThis is true for the peripherals themselves, but they exist at different addresses,. So it won't be binary compatible, but up to high level source compatible (just by replacing the header files)

author: SL4P
author_rank: Super Contributor
timestamp: October 20, 2019, 08:21:42 pm
content: To a large extent, many of those ‘standards’ bodies like JEDEC became pointless when China started turning out real an fake components.The desire to grab market share with non compliant or simply dodgy parts has polluted the water forever.

author: SL4P
author_rank: Super Contributor
timestamp: October 20, 2019, 08:49:49 pm
content: Nothing illegal, just the data pool is contaminated.Less reliable than if it had been followed strictly.

author: langwadt
author_rank: Super Contributor
timestamp: October 20, 2019, 08:53:40 pm
content: Quote from: blueskull on October 20, 2019, 08:34:55 pmmight not be able to register it as a trademark, back in the day Intel tried to trademark i586 (or similar) but it was denied so they started using names that they could get trademarked like Pentium

author: jhpadjustable
author_rank: Frequent Contributor
timestamp: October 20, 2019, 09:38:57 pm
content: Quote from: langwadt on October 20, 2019, 08:53:40 pmLonger:https://tedium.co/2017/05/18/intel-386-486-trademark-battles/Shorter: a mere number was judged too generic. They did successfully register i586, but lost interest in the whole idea when the i586 approval specifically disclaimed any trademark rights on the number 586 without the i at the front. Where is the outrage over the "321" op amps out there, some with RRIO, some not?