How do I understand where hardware ends and software begins?
The hardware-software boundary confuses you, and that's honest, because it's one of the genuinely hard parts of embedded work. In most programming the hardware is hidden. Here you live right on the seam where code meets physical circuits, and that seam has its own logic that takes time to feel. The way to make it click is to follow one signal all the way through. Pick something simple, like a button press turning on a light. Trace it: the physical button changes a voltage, that voltage lands on a pin, the chip reads that pin as a one or zero, your code sees it, and your code sets another pin that drives the light. The boundary is just those handoffs between the physical and the coded, and each one is understandable on its own. Start with the smallest possible project on real hardware and make one input control one output. Watch exactly where the physical becomes digital. Once you've felt that handoff in something tiny, the boundary stops being a fog and becomes a series of clear steps. Understanding grows from the simple case outward.