How to Add APM32 MCU to SimuIIDE
Quote from ukka on September 19, 2025, 8:11 amI want to add an ARM MCU (APM32) to a virtual environment to safely test hazardous code and circuits. I haven't been able to find any intuitive, step-by-step tutorials or other guides. While I know that reading the source code is a valid approach, it is very time-consuming, and I am short on time. Therefore, I'm looking for methods, tutorials, or references that can significantly save time.
Thank you very much for any help or guidance you can provide.
I want to add an ARM MCU (APM32) to a virtual environment to safely test hazardous code and circuits. I haven't been able to find any intuitive, step-by-step tutorials or other guides. While I know that reading the source code is a valid approach, it is very time-consuming, and I am short on time. Therefore, I'm looking for methods, tutorials, or references that can significantly save time.
Thank you very much for any help or guidance you can provide.
Quote from arcachofo on September 19, 2025, 9:39 amHi.
The MCU framework in Simulide only supports 8 bits MCUs, I'm experimenting with Qemu to implement 32 bits MCUs that run at hundreds of MHz, for example Simulide 2 comes with a very simple model for ESP32, but it's very experimental and have a few challenges to solve.
An option would be to implement the MCU from scratch without using the MCU framework, but simulation would be quite slow running it at hundreds of MHz.
In any case implementing these MCUs would be quite time consuming, probably in the many hundred to a few thousand hours of work.
Hi.
The MCU framework in Simulide only supports 8 bits MCUs, I'm experimenting with Qemu to implement 32 bits MCUs that run at hundreds of MHz, for example Simulide 2 comes with a very simple model for ESP32, but it's very experimental and have a few challenges to solve.
An option would be to implement the MCU from scratch without using the MCU framework, but simulation would be quite slow running it at hundreds of MHz.
In any case implementing these MCUs would be quite time consuming, probably in the many hundred to a few thousand hours of work.
Quote from ukka on September 19, 2025, 12:58 pmThank you very much for your reply.
You mentioned SimulIDE 2, but I couldn't find any related code repositories or other information on Google. Has it not been publicly released yet? If possible, I would love to participate in its development. I truly love SimulIDE; it's the "Holy Grail" I've been searching for.
Thank you very much for your reply.
You mentioned SimulIDE 2, but I couldn't find any related code repositories or other information on Google. Has it not been publicly released yet? If possible, I would love to participate in its development. I truly love SimulIDE; it's the "Holy Grail" I've been searching for.
Quote from arcachofo on September 19, 2025, 1:15 pmYou can find SimulIDE 2 in tester builds: https://simulide.com/p/testers/
Source code is here: https://github.com/eeTools/SimulIDE-dev
Qemu fork for ESP32 integration in SimulIDE is here: https://github.com/Arcachofo/qemu_espressif
Qemu supports ARM CPUs, I don't see any official port for APM32, but it could be something out there:
https://www.qemu.org/docs/master/system/target-arm.htmlIf there is already some work done to support APm32 in Qemu, then it would be relatively easy to make it run in SimulIDE, at least for basic things.
If not then I have little idea of how to do it, I guess it would require some deep knowledge of Qemu and a fair amount of work.
You can find SimulIDE 2 in tester builds: https://simulide.com/p/testers/
Source code is here: https://github.com/eeTools/SimulIDE-dev
Qemu fork for ESP32 integration in SimulIDE is here: https://github.com/Arcachofo/qemu_espressif
Qemu supports ARM CPUs, I don't see any official port for APM32, but it could be something out there:
https://www.qemu.org/docs/master/system/target-arm.html
If there is already some work done to support APm32 in Qemu, then it would be relatively easy to make it run in SimulIDE, at least for basic things.
If not then I have little idea of how to do it, I guess it would require some deep knowledge of Qemu and a fair amount of work.
Quote from ukka on September 19, 2025, 1:31 pmThank you again for your reply.
The APM32 is an MCU similar to the STM32, which QEMU seems to already support. Therefore, it might not be necessary to start from scratch. I have tried to simulate it with QEMU before, but the lack of tutorials and the complexity of the Meson build system defeated me. However, the emergence of SimulIDE2 gives me a strong reason to continue fighting that complex build system, as it could allow me to fully build the holy grail I have been searching for.
Thank you again for your reply.
The APM32 is an MCU similar to the STM32, which QEMU seems to already support. Therefore, it might not be necessary to start from scratch. I have tried to simulate it with QEMU before, but the lack of tutorials and the complexity of the Meson build system defeated me. However, the emergence of SimulIDE2 gives me a strong reason to continue fighting that complex build system, as it could allow me to fully build the holy grail I have been searching for.
Quote from arcachofo on September 19, 2025, 5:02 pmThe APM32 is an MCU similar to the STM32,
How similar?
What about all the peripherals?One option would be to add some STM32 to SimulIDE, this should be relatively easy, then see what is needed for APM32.
If you are willing to take the challenge let me know and we can start to work in it.
The APM32 is an MCU similar to the STM32,
How similar?
What about all the peripherals?
One option would be to add some STM32 to SimulIDE, this should be relatively easy, then see what is needed for APM32.
If you are willing to take the challenge let me know and we can start to work in it.
Quote from ukka on September 19, 2025, 11:50 pmTo put it a bit dramatically, some people joke that the APM32 is an STM32 with the ST logo sanded off and replaced with APM (this is just a joke, of course). It's true that a few APM32 models can be directly programmed with the corresponding STM32 code, but this is a rare exception. In China, besides the APM32, there are other MCU series like the GD32 and HC32. Rumor has it that the GD32 can even be a pin-to-pin equivalent for the STM32.
The peripherals are almost identical with no major differences. For a popular model like the F103C8T6, the main distinctions are a slight variation in the number of peripherals or different register addresses. You can find the specific details by checking the datasheets for both the APM32F103C8T6 and the STM32F103C8T6.
Naturally, the APM32 and other domestic MCUs are not simply rebranded versions. Their differences must be analyzed on a model-by-model basis. However, these distinctions are usually minor, often just slight variations in peripherals or clock speeds.
I'm ready to take on the challenge. Where should I start? Could you give me a specific task or goal?
Also, I'm in the UTC+8 time zone. What about you? I think knowing our time difference is crucial for good communication.
To put it a bit dramatically, some people joke that the APM32 is an STM32 with the ST logo sanded off and replaced with APM (this is just a joke, of course). It's true that a few APM32 models can be directly programmed with the corresponding STM32 code, but this is a rare exception. In China, besides the APM32, there are other MCU series like the GD32 and HC32. Rumor has it that the GD32 can even be a pin-to-pin equivalent for the STM32.
The peripherals are almost identical with no major differences. For a popular model like the F103C8T6, the main distinctions are a slight variation in the number of peripherals or different register addresses. You can find the specific details by checking the datasheets for both the APM32F103C8T6 and the STM32F103C8T6.
Naturally, the APM32 and other domestic MCUs are not simply rebranded versions. Their differences must be analyzed on a model-by-model basis. However, these distinctions are usually minor, often just slight variations in peripherals or clock speeds.
I'm ready to take on the challenge. Where should I start? Could you give me a specific task or goal?
Also, I'm in the UTC+8 time zone. What about you? I think knowing our time difference is crucial for good communication.
Quote from arcachofo on September 20, 2025, 8:21 amTo put it a bit dramatically, some people joke that the APM32 is an STM32 with the ST logo sanded off and replaced with APM (this is just a joke, of course).
That is very good news.
Still a challenge, don't get me wrong, but we can start working from the work of others.
I'm ready to take on the challenge. Where should I start? Could you give me a specific task or goal?
Nice, the first step would be to fork our Qemu repo and build it:
https://github.com/Arcachofo/qemu_espressif
Which OS are you using?I'm already starting to add the basic things in Simulide for STM32.
I sent you a PM so we can chat: https://simulide.com/p/messages
Also, I'm in the UTC+8 time zone. What about you? I think knowing our time difference is crucial for good communication.
I'm at UTC+2.
To put it a bit dramatically, some people joke that the APM32 is an STM32 with the ST logo sanded off and replaced with APM (this is just a joke, of course).
That is very good news.
Still a challenge, don't get me wrong, but we can start working from the work of others.
I'm ready to take on the challenge. Where should I start? Could you give me a specific task or goal?
Nice, the first step would be to fork our Qemu repo and build it:
https://github.com/Arcachofo/qemu_espressif
Which OS are you using?
I'm already starting to add the basic things in Simulide for STM32.
I sent you a PM so we can chat: https://simulide.com/p/messages
Also, I'm in the UTC+8 time zone. What about you? I think knowing our time difference is crucial for good communication.
I'm at UTC+2.
