Geehy APM32F407 as STM32F407 replacement, does anyone use? - Page 1
Forum section: electronics / general

author: up8051
author_rank: Frequent Contributor
timestamp: May 06, 2022, 07:17:15 pm
content: Hi,I am trying to replace the STM32F407VGT6 chip with Geehy APM32F407VGT6 chip.Unfortunately, I only have access to the BIN File, (PIN2DMD project for pinballs).At first it seemed like everything was fine (I have two devices: first with ST second with APM and the same firmware), all device functions work (USB, SD CARD, UART ...).But there were some performance issues with the animation displaying: dropping frames.A short video showing the problem:https://drive.google.com/file/d/1GzR-Issybevt_F9sV32YMADpYpionxpl/view?usp=sharingUpper = ST chipLower = Geehy chipboth have the same firmware (PIN2DMD V4.37).As you can see in the video, in the case of APM, animation frames are lost.Does anyone use these chips?Has anyone found a difference in the operation of STM and Geehy?I am also sending a request to FAE but I don't have an answer yet.BR JarekC

author: ozcar
author_rank: Frequent Contributor
timestamp: May 07, 2022, 03:31:29 am
content: Quote from: up8051 on May 06, 2022, 07:17:15 pmWith that constraint, it sounds like an overly optimistic hope.But then I never heard of pin2dmd, so I took a look, and just about the first thing I find, straight from the horse's mouth, is "Please make sure you buy a genuine STM board. Cheap chinese copies may cause problems and are not supported."

author: up8051
author_rank: Frequent Contributor
timestamp: May 07, 2022, 08:06:10 am
content: PIN2DMD is a well-known project among pinball owners.https://pin2dmd.com/https://github.com/lucky01/PIN2DMD.The APM32F407 was the first replacement that appeared to be binary compatible.The author of PIN2DMD that I contacted suggests problems with interrupts.I am looking for other users of Geehy processors.BR JarekC

author: peter-h
author_rank: Super Contributor
timestamp: May 07, 2022, 08:22:11 pm
content: Interesting. I am using the 417 (crypto add-on) but the APM32F407 seems to include that.Can't find any pricing. Who sells these?

author: up8051
author_rank: Frequent Contributor
timestamp: May 07, 2022, 09:32:26 pm
content: Local electronic wholesaler, price is about 15€ +VAT (+10pcs)I got a reply from the FAE: APM has NVIC with 8 levels, STM has 16 levels.And here is the cause of the problems.

author: peter-h
author_rank: Super Contributor
timestamp: May 08, 2022, 07:04:44 am
content: Where is this wholesaler? Nothing on google.€15 is not cheap; I have bought 500 x 32F417 100 pin QFP for GBP 5.20. Took a while to turn up but they did. I would not buy a chinese "407" unless it was something like $2. Too much risk...Why these "copiers" emulate 99% of the ST chip and not the other 1%, I don't understand. It's a strange mentality, and I'd say not untypical of the culture (make a fast buck and move on). They would get 100x more sales if they did it properly.

author: up8051
author_rank: Frequent Contributor
timestamp: May 08, 2022, 08:48:15 am
content: The problem is also that they don't exactly describe the difference?I tried to find a supplier for the F407VGT6 / 417VGT6 at a reasonable price but I failed.The lowest price for STM I got from Chinese suppliers is $ 28, but I don't trust them.You can get e.g. F404VET6 remarked to F407VGT6.That's why I tried Geehy, they have a local distributor in my country.

author: peter-h
author_rank: Super Contributor
timestamp: May 08, 2022, 02:57:01 pm
content: QuoteThat is either in the data sheet, or it isn't. That's quite a big thing. Not a problem if you are the coder but a lot of binaries won't run.QuoteWell, with everybody and their dog in China counterfeiting everything that can be counterfeited... I posted about the fake Maxim MAX3089 chips which we got burnt with.BTW the 407 datasheethttps://www.geehy.com/uploads/tool/APM32F405xG%20407xExG%20datasheet%20V1.1.pdfdoes not mention any crypto features. That would be a 417.

author: up8051
author_rank: Frequent Contributor
timestamp: May 09, 2022, 07:09:59 pm
content: Unfortunately improving the interrupt handlingCode:#define __NVIC_PRIO_BITS 3U /*!< APM32F4XX uses 3 Bits for the Priority Levels */did not fix the problem

author: mon2
author_rank: Frequent Contributor
timestamp: May 10, 2022, 04:22:41 pm
content: While our review of this line is still ongoing..had to source some extra tools which took some time...wish to share a great contact @ factory.Quoteand for a sales contact:QuoteSo far, the support from the US contacts has been excellent.

author: up8051
author_rank: Frequent Contributor
timestamp: May 10, 2022, 05:03:36 pm
content: I correspond with:Field Application Engineer Geehy Semiconductors Co., LtdLarry LaiEmail: larry.laigeehysemi.comI can't understand why they won't make a list of the differences between APM and STM.and application note of the type "Migration from STM32F4xx to ATM32F4xx".It is difficult to compare 1,000 pages of documentation by yourself.For now, I am waiting for the answer if there are any other differences apart from NVIC priority levels.

author: robots
author_rank: Contributor
timestamp: July 27, 2022, 11:40:12 am
content: Sorry to resurect older thread, but there is no place on net that discusses this topic.We are researching usage of APM32F407xG.One very obvious problem we found is that the ADC calibration in system memory is missing. (non existent)Second problem, and i dont know it thats just me. The device is supposed to have 192kB of memory, but debugger fails to read memory, and starts reading at 128k mark (going backwards, scrolling memory view in eclipse). So there is only 128kB of ram.

author: wek
author_rank: Frequent Contributor
timestamp: July 27, 2022, 02:01:47 pm
content: Quote from: robots on July 27, 2022, 11:40:12 amAnd if you do the same in STM32F407?JW

author: robots
author_rank: Contributor
timestamp: August 02, 2022, 11:15:15 am
content: OMG,you are correct. I have gotten very confused on this one. Of course there is 64kB of CCM ram.:-)

author: peter-h
author_rank: Super Contributor
timestamp: August 02, 2022, 11:29:18 am
content: Cube can do some funny stuffhttps://www.eevblog.com/forum/microcontrollers/is-st-cube-ide-a-piece-of-buggy-crap/msg4316272/#msg4316272The APM32F407xG looks interesting. I wonder why they call it 407 when they seem to have the crypto stuff which the ST 417 has. But I wonder how complete it is. Is it available? I can't see anyone selling it.I looked at the ADC calibration feature of the ST 417 and decided to do my own one in factory test.

author: up8051
author_rank: Frequent Contributor
timestamp: August 02, 2022, 09:55:13 pm
content: APM32F407 don't have crypto module.

author: peter-h
author_rank: Super Contributor
timestamp: August 03, 2022, 02:46:30 pm
content: https://www.geehy.com/apm32?id=49says so. But no mention in the data sheet.I would be amazed if this was a drop-in replacement for a 32F4x7 for example. There are so many critical details in the peripherals. Could they have been synthesised with the same sourcecode?ADCs are always custom designed, hence I am not surprised they could not get it to work the same way.

author: up8051
author_rank: Frequent Contributor
timestamp: August 03, 2022, 03:36:48 pm
content: APM32F4xx User Manual page 296Quote

author: peter-h
author_rank: Super Contributor
timestamp: April 14, 2025, 11:00:20 am
content: Just tested the Geehy APM32F407VGT6 on a board which uses a STM32F417VGT6.It almost works. The only things not working the same way as the STM device are the CPU chip temperature sensing (which returns 30C all the time) and the boot loader which programs the FLASH.USB FS works and so does 10/100 ETH. The board is full of stuff e.g. UARTs and SPI. The 12 bit DAC works the same (I use an TL431 external reference). RTC works. ADC not tested. Using FatFS, FreeRTOS, LWIP, 500k of code in total.A remarkable level of compatibility - much better than the Gigadevice GD32F407VGT6 whose USB differs from STM.CPU ID: 410028000B31313952544843. Device ID is same as STM32F407/417. STLINK does not recognise it so again a Segger box with J-Flash was used.This also refers:https://www.eevblog.com/forum/microcontrollers/opinions-on-st-32f407vgt6-versus-gigadevice-gd32f407vgt6/msg5868889/#msg5868889

author: wek
author_rank: Frequent Contributor
timestamp: April 14, 2025, 02:33:12 pm
content: > CPU chip temperature sensing which returns 30C all the timeMy guess is, that this is due to missing factory-measured calibration values in the system memory; and that using the less precise method of calculating temperature from the slope values would work.JW

author: peter-h
author_rank: Super Contributor
timestamp: April 14, 2025, 02:57:59 pm
content: Indeed, but there is more: my boot loader doesn't work. It fails on a test it does before doing anything else: it tries to program and verify the uppermost FLASH block (128k) and fails on that. So no "OTA" update feature, unless this is fixed.

author: DavidAlfa
author_rank: Super Contributor
timestamp: April 14, 2025, 03:41:32 pm
content: But, are you using ST compiled fw on the Geehy or viceversa?Not good, for sure there will be some differences in specific functions like flash programming.It'll probably be easier to port the code, swapping the libs to the ones for ST / Geehy.Most ARM mcu makers cloned ST HAL / LL libs to ease the transition, externally they're basically identical, with their specific quirks under the hood.So it should be very easy, unless you went baremetal or made your own functions to "Optimize like a pro".Not that it's bad, but porting becomes a messy job.

author: peter-h
author_rank: Super Contributor
timestamp: April 14, 2025, 03:57:04 pm
content: No libs as such; I based the code on ST "HAL" functions but it is really all custom.All this proves is that FLASH programming differs; most likely just the code / algorithm is different. I just did a quick compatibility test here.As noted previously, since the ST 407 is almost same price as these two other (chinese) 407s, there is no point in using these unless we get "covid mk 2" and only chinese devices are available.But it is interesting in that supporting both devices with the same code would need some work. The device ID is the same (0x413) so you can't use that to select the code to use. You would have to use some undocumented way.To add: the chip runs MbedTLS fine too, so long as any hardware crypto is not used (obviously; that needs a 417). But it suggests that the random number generator is in there.

author: kv193
author_rank: Newbie
timestamp: May 01, 2025, 07:18:21 pm
content: I use APM32F407 in two project as alternative for STM32F407.Both project based on STM32F4xx_HAL_Driver + FreeRTOS:1-st project have STM32F4xx_HAL_Driver ver 1.21 and FreeRTOS 9.0.0Tne new 2-nd project have STM32F4xx_HAL_Driver ver 1.27.1 and FreeRTOS 10.3.1.The 1-st project work fine, no difference between STM32F407 and APM32F407.But 2-nd project start from crash firmware on APM32F407. Detail analysis discover that NVIC controller differ on two chips. Interrupt priorities registers implements 4 bit on STM32F407 while 3 bit on APM32F407. This cause suspend Task Sheduler of FreeRTOS.Perhaps that less priorities bit lead to lower perfomance in some tasks with many highly loaded and prioritysed interrupt.