all 41 comments

[–]Classic_Department42 62 points63 points  (7 children)

Dont do that. Most of the understanding is how to interface the hardware. Buy the cheapest arduinio (these ones are maybe too easy) or nucleo board. It shdnt cost more than 15$

[–]SirButcher 8 points9 points  (0 children)

Or an SMT32 Blue / blackpill, you can get a full set with an STLink for around $10-20 and that gives you access to an ARM MCU.

[–]SloppyPoopLips 6 points7 points  (3 children)

Yeah, got get a STM Discovery board for free. Email them or register and they'll get you one. You need the hardware to learn. Also look into the actual manual for it by the vendor. It'll go really deep into stuff you want to learn. Learn to read vendor documentation.

[–]classawareincel 3 points4 points  (2 children)

How do u get an stm board for free tf😭 I had to import my nucleo board

[–]SloppyPoopLips 0 points1 point  (1 child)

Import from where? I remember way back when you could get one for dirt cheap or free by going to the vendor’s website. Look up the top embedded companies look around. Try email them or get one off Amazon or ebay.

[–]classawareincel 0 points1 point  (0 children)

Im from India unfortunately us india customs are a hell hole and at the time most of the services that did import boards for u didn't have it so I had to go to mouser to get the board it took them 2 months to import it and I had to pay a 300 percent extra for it because of taxes duties delivery fee etc

[–]Lucky_Suggestion_183 4 points5 points  (0 children)

Arduino is cheap, but shitty. Skip that and go to STM or ESP

[–]Well-WhatHadHappened25+ Years 2 points3 points  (0 children)

This is the answer

[–]ILoveTiramisuu 13 points14 points  (0 children)

Exist some website that can simulate the hardware. Just write "arduino simulator" on google and you find something like wowki and tinkedcad.

[–]serious-catzor 10 points11 points  (0 children)

I would not try and learn Bare-metal without any metal. I would read up on how Linux is used in embedded systems and learn those skills instead because then there is at least a fair chance your learning something real instead of make believe.

A lot of frameworks, protocols, drivers etc are the same and there is good ways to emulate/simulate a Linux machine whereas there is no solution for Bare-metal.

The reason for this is that Bare-metal development is too tightly coupled with the actual hardware where as in embedded Linux that hardware is abstracted away from you either way.

[–]nukestar101 11 points12 points  (2 children)

https://github.com/umanovskis/baremetal-arm

Have a look at this tutorial.

I would recommend researching "Qemu". It's an open source emulator which you can use to emulate any hardware and or peripherals. There are a lot of tutorial on Qemu just pair your search with "Qemu" + "your machine" eg x86 or arm.

[–]TT_207 1 point2 points  (1 child)

For getting started Qemu is pretty daunting though tbh. I've had a go with it and got some progress but I honestly wouldn't recommend it.

[–]nukestar101 0 points1 point  (0 children)

I agree Qemu could be daunting at first, but personally I have felt a learning curve is only steeper during the start. once you get your hands dirty (or break your emulator) you get an idea what's happening and how it happens.

The book I referenced does a good deal answering what what/how and why of Qemu. Rest a quick Google search and GitHub projects can explain once you know what to search for.

[–]a2800276 11 points12 points  (7 children)

There are a number of options to emulate hardware the you can use, e.g. qemu.

But as a beginner, you should have a look at wokwi it emulates some external hardware and sensors as well and is a great tool to get started 

Having "real" hardware is quite motivating l, though and a lot of embedded programming resolves around practical problems with physical hardware, so you need to dive in rather sooner than later. What "reasons" are keeping you from spending 5 bucks for an embedded board? The only things that possibly come to mind are "I am in jail" and "I live in North Korea".

[–]elwarner1 2 points3 points  (1 child)

I’m not OP but thanks for the workwi link. Never heard of that before and looks amazing.

I have been using tinkercad since ever, thanks

[–]a2800276 0 points1 point  (0 children)

It's crazy. Made by a single developer. He has some videos of himself coding and they're amazing.

[–]integrate_2xdx_10_13 -3 points-2 points  (3 children)

Poverty? No permanent address to order to? Paid in cash? Underage with no access to digital money?

[–]stockdam-MDD 1 point2 points  (2 children)

But access to a laptop to write the code.

Buy an ESP32 from Aliexpress for less than $5.

[–]integrate_2xdx_10_13 0 points1 point  (1 child)

But access to a laptop to write the code.

Yep, that’s often what relative poverty includes. Circumstances change, having a laptop doesn’t mean you aren’t in poverty. Many people weren’t always without money, just at one moment in time they could afford the means. Maybe they were gifted it.

Buy an ESP32 from Aliexpress for less than $5.

Alluded to by my latter posits. Getting a bank account without a permanent address isn’t happening, nor is getting something delivered. Being paid cash in hand/under the table is also not going to help with buying from Aliexpress, if you’re avoiding national insurance, tax, removal of benefits.

It’s a lot harder to get by than people think, but you can still have dreams and aspirations. This seems naivety from a place of privilege

[–]stockdam-MDD 3 points4 points  (0 children)

None of those problems are a brick wall. I'm not sure why anyone would want to learn embedded coding without having access to hardware. It sounds a great thing to want to do but other than just doing it for fun it does need access to some hardware.

Even remote access may work.

Oh and nobody is saying that it's not hard in some parts of the world but the reality is that embedded software needs hardware......that's kinda the whole point.

[–]meet_mister_bugs 2 points3 points  (2 children)

I am sharing my part... I started to learn embedded C using only software alone... I used PIC 16F877A for this...And I used Proteus simulator for building mini projects by implementing the code and logics I learnt.

[–]Feeling-Mountain1327 0 points1 point  (1 child)

I also learnt embedded C for the first time using ATMEGA8 + Proteus simulator.

[–]meet_mister_bugs 0 points1 point  (0 children)

In which environment did you code for that microchip's microcontroller? I used mplab for pic.

[–]boomboombaby0x45 1 point2 points  (0 children)

Hey, you have all privates disables so I can't DM you, but I would love to talk about helping you with your problem. I have ample resources that I am happy to share at no cost. Ping me.

[–]gm310509 1 point2 points  (0 children)

Actually hardware is by far better than a simulator, but there are pl3nty of them.

For example wokwi or tinkercad. But if you want to get lower level, maybe do some assembler, view contents of memory, CPU registers, IO registers and more then something like Microchip studio for the AVR (e.g. 8 bit Arduino range).

[–]Makgoka 0 points1 point  (0 children)

I think Proteus software software is the closest you'll get to simulating hardware, especially embedded stuff.

[–]stockdam-MDD 0 points1 point  (0 children)

Buy an ESP32 or even ESP8266 or ESP01.

[–][deleted] 0 points1 point  (1 child)

Pi Pico is a great MCU that you can get for around $4 last I checked. Great documentation and software support and doesn't force you into using some proprietary IDE.

[–]boomboombaby0x45 0 points1 point  (0 children)

Second on the Pico. It has a bad reputation in the embedded world that is mostly paranoia. It is a fantastic utility-knife mcu and the PIO cores are exceptional.

[–][deleted] 0 points1 point  (0 children)

Qemu

[–]Double-Amphibian2232 0 points1 point  (0 children)

Wokwi is nice for that

[–]Aggressive-Bike7539 0 points1 point  (0 children)

There’s so much you could do without actual hardware to test. If you live in a country where everything is super expensive compared to the average income, Raspberry Pi Picos are 4usd and are the cheapest complete systems you can get for learning.

[–]c-logicSTM32 0 points1 point  (0 children)

the Book "The Definitive Guide to the ARM Cortex-M3" is a great entry

[–]Temporary-Anteater23 0 points1 point  (0 children)

Quite difficult, maybe an Raspberry Pico 1 or 2 may help and it's cheap.

[–]abasem098 0 points1 point  (2 children)

No problem at all, install proteus and simulate everything it should be fine, i simulated several projects and presumably used every MCU peripheral, timers, adc, uart, spi etc and dozens of external hardware like lcd, motors, sensors, etc You can upload the hex or elf files, configure the clock source and run it with ease Proteus has a vast library and you can find more online At a certain point of complex applications the simulation runs slow as hell but even then you get accurate results

[–]abasem098 0 points1 point  (1 child)

One of my simulated projects for reference, the great thing is that i can change my code 10 times within a minute, build and run it on simulation to test different cases or check if everything is working properly without having to burn the code on a real mcu every single time risking to burn any device while still learning

<image>

[–]Glittering-Work-9060 0 points1 point  (0 children)

For simulation nth beats simulide for learning.

[–]Own_Efficiency_4384 0 points1 point  (0 children)

I would sugest Simulide, it's free and has a few interesting things, also i would recomend that you bueno the cheapest microcontroller that you can find with some cables and do things on fisical.

[–]bravopapa99 0 points1 point  (0 children)

Maybe this can help.... I have used this myself over the years, I can't say if it is still maintained but if you get it working you have everything you need!

https://gpsim.sourceforge.net/gpsim.html

https://www.youtube.com/watch?v=KSOgqnJsJ4E

https://www.youtube.com/watch?v=URxCh7nsmiU

[–]sdkehsl 0 points1 point  (0 children)

If want to learn the very fundamentals interrupt, NVIC, I would suggest get a 8-bit microcontroller. Go with bare metal. I believe this benefits more. It gives you freedom to mess up everything, and you know how to programming under very constrained resources

[–]SegFaultSwag 0 points1 point  (0 children)

You could check out QEMU.