Hello all,
I'm an experienced C++ programmer but very beginner to the world of embedded. My intention is to use modern C++ for embedded programming especially on ARM MCU. As my first hands-on experiment, I need to start with a Blue Pill and make its LED blink. Sadly, due to the hard situation in the place I live in, finding even such an simple board can be difficult. I'm not sure this is the right place on the site to ask my questions in this regard or not, but I hope so. I've got two questions:1) Is there any popular emulator that can properly emulate an MCU like Blue Pill, Black Pill or lower/higher models so that I can run my C++ program and observe the results on it? For instance, to see an LED blinking? If so, what's that good emulator, please? I've got two machines to install that emulator software on: Windows, and Linux.
2) What're the advantages and disadvantages of using such an emulator versus having real boards for that purpose, please?
Thanks beforehand.
QEMU ?
https://www.qemu.org/
https://wiki.qemu.org/Documentation/Platforms/ARM
https://www.youtube.com/watch?v=Zvbarf1CSGs
Ary said:What're the advantages and disadvantages of using such an emulator versus having real boards for that purpose, please?
Well, the whole point of embedded microcontrollers is precisely to do real hardware control - so you are missing that entirely!
AFAIK, Something like QEMU is just an instruction set emulator - it doesn't cover the external hardware.
As you're already an experienced C++ programmer, you know about the "software" side - so I wouldn't have thought that an emulator adds anything for you?
For STM32, rather than a Blue Pill, I would strongly recommend that you get a Nucleo board - which comes complete with a built-in debug probe - they are low-cost and widely available:
www.st.com/.../stm32-nucleo-boards.html
That way you can run on real hardware and have full debug access & visibility to the "internals" of the chip.
For full hardware simulation, there's things like Proteus:
https://www.labcenter.com/simulation/
But that's an order of magnitude more expensive than a Nucleo (or similar) - and you'll have a learning curve just for that tool.
Thank you very much for your profound reply. So I'd better bow out of emulators and stick with real hardware for the reasons you mentioned.
What Nucleo board do you suggest that I choose, please? I need some model that's not expensive, and is suitable for me as a beginner and on the other hand I can rely on that for many projects from beginners to a little higher level.
Is STM32F411 (Black Pill) that different from that Nucleo board, please?For the Pills I can make profit from their step-by-step tuts which look very useful: https://www.st.com/content/st_com/en/support/learning/stm32-education/stm32-step-by-step.htmlIf Nucleo board is very different from a Black Pill and you still recommend that it be what I should go for, does it have tuts like the above address to guide me step-by-step, please?
Hi AryThough not specifically modeling BluePill or similar, Arm provide Fixed Virtual Platforms (FVPs) in Development Studio and Keil MDK packages. These are system models and include things suck as simulated LEDs. These are also the reference platform for a number of the supplied examples (including a blinky LED blinker application!).https://developer.arm.com/documentation/100966/1113/MPS2-Platform-FVPsIf you need more info, feel free to send me a direct message (I am an employee at Arm)
Andy Neil said:Proteus ... But that's an order of magnitude more expensive than a Nucleo (or similar)
Proteus ... But that's an order of magnitude more expensive than a Nucleo (or similar)
Ronan Synnott said:Fixed Virtual Platforms (FVPs) in Development Studio and Keil MDK packages
and that seems to be another order of magnitude (or more) over Proteus?!
Hi Andy, good point. You can in fact get a Cortex-M55 FVP for free from here (Corstone-300)developer.arm.com/.../arm-ecosystem-fvps
but don't you still need MDK Pro to use it?
it can run standalone. We have now also changed it such that it works with all MDK editions (not 100% sure if it works with 'Lite').
I wrote you a reply but I don't know why it's been deleted! :|Thank you for your answer. Is Nucleo board that different from a Black Pill (STM32F411) for which there're step-by-step tuts on the STM website: https://www.st.com/content/st_com/en/support/learning/stm32-education/stm32-step-by-step.html on how to get started? Of course both boards are STM32, so the tuts may work for both.If you still recommend a Nucleo board, what model of that is suitable for me, please?I need a rather cheap model so that I can rely on it for various projects from blinking an LED to a little higher level ones.
Hi Ary, perhaps it is best to explain what you are trying to achieve. If it is simply to program boards with limited awareness of what is going on 'under the hood', then there are a number of programs out there for these... for example Arduino (of which Black Pill is an example), mbed, or Raspberry Pi Nano.
If you are looking at lower level programming, for example bringing up an RTOS, or at-the-metal programming, then boards such as Nucleo make more sense.
Ronan Synnott said:We have now also changed it such that it works with all MDK editions
that's good - needs an update to the 'Compare MDK Editions' page, then:
Ary said:Is STM32F411 (Black Pill) that different from that Nucleo board, please?
First thing to understand is that STM32F411 is just the name of the chip (actually, a family of chips):
https://www.st.com/en/microcontrollers-microprocessors/stm32f411.html
There is a Nucleo board with an STM32F411 chip on it:
www.st.com/.../nucleo-f411re.html
For "Black Pill", I assume you mean this:
https://hobbycomponents.com/st-micro-electronics/1057-stm32f411-black-pill-development-board
Key things which the Nucleo gives you that the BlackPill hasn't:
See: https://www.avrfreaks.net/comment/3097061#comment-3097061 - I really wouldn't recommend the Black or Blue pill for a beginner to learn on (fine once you're past that stage)
Another advantage is that the Nucleo has the Arduino headers - so you can just pop on an Arduino shield, if you want.
ST also make a load of shields to fit Nucleo boards.
Note that I am not affiliated to or sponsored by ST in any way; also, as noted in that linked thread, pretty much all the Big Name manufacturers have similar low-cost development/evaluation boards
OK, I will go for NUCLEO-F411RE and I assume its preference over Blue/Black Pill apart from many extra features it brings us, is that working on it for me as a beginner is simpler than on the Pills and I can rely on it (NUCLEO-F411RE) for a longer time for many other embedded programming tasks in the future as well. Right? The next question, as any starter may encounter, is that, what other peripherals am I better to purchase with the board (NUCLEO-F411RE)? I mean things like a breadboard, cables, etc.
For starters, I think the Nucleo should be adequate on its own: you have an LED to blink, a button to press, and the virtual COM port for serial IO - that should be plenty to be getting on with...
That'll get you through the first 6 steps here: https://www.avrfreaks.net/comment/1138166#comment-1138166
With that foundation, you should have enough understanding to know where you want to go next
Don't I even need a USB cable to be able to run the C++ projects I will write by my PC onto the board!?
Yes, of course you will need a USB cable - I assume you already have such things.
Make sure you have the correct one, though: many (most? all?) of the Nucleo-64 board have mini - not micro - USB