What’s wrong with Arduino?
I think it is very cool... and cheap.
Not so thrilled with Raspberry-pi though. IO seems harder.
I teach students first how to make things work using only 74xx00 series integrated circuits. Next I teach them about the internal architecture of the AVR micro controller. Then they will write their first project in assembler for the AVR. Moving forward, they write their projects using the gcc toolchain under the Code::Blocks workbench. Students learn to manipulate the compiler by tweaking its flags, same as they do the linker. Port I/O is accomplished by directly accessing the registers. If they want to use a timer, they must set it up directly.
The objective is to allow them to create viable projects without publicly supplied crutches. They can also plop an AVR processor on a breadboard and make something work.
They are fashioned to be designers, not users. Leaders, not followers.