Embedded programming

I'm trying to learn C so that I can do some embedded programming on STM32 boards, simple things like building a game controller or something.

If I work my way through the K&R would that likely teach me enough to figure it out, or would I need more external knowledge?

Attached: 41gHB8KelXL._SX377_BO1,204,203,200_.jpg (379x499, 27K)

Other urls found in this thread:

amazon.com/Definitive-Guide-Cortex®-M3-Cortex®-M4-Processors/dp/0124080820
twitter.com/SFWRedditVideos

K&R is just a primer on the C language. There's no specifics in regards to embedded programming.

Get an Arduino starter kit or something.

>would I need more external knowledge?
yes

K&R is for people wanting to implement the C language (ie write a compiler), not for people who want to program in C.

K&R is only about C, embedded system is more than that (I/O, register, etc).

But learn K&R first, it's a very smoll book. After that grab one stm32 discovery board and start tinkering with it

wow you seem really stupid. have you even read it? it's literally just beginner exercises with strings and linked lists.

He probably got overtly excited there's a problem in the book for parsing a compound type declaration

there are few things missing in the book that you will need
>understanding volatile
>understanding linking
>how to actually structure larger projects
and several things related to stm32s
>knowing ARM Cortex-M architecture
>knowing CMSIS or HAL libraries
>knowing how to actually flash your device
>how to design your program in interrupt model, concurrency primitives available and good patterns
>knowing all sorts of hardware peripherals
>how to debug baremetal programs
you can also use some IDE (CubeIDE or Atollic come to mind) solving some stuff for you (such as flashing, interactive debugger session, generating project), this gives you quick start. there is some value learning about what the IDE does for you regarding building the project, generated files used, and how it actually loads stuff into the board - keep it for later curiosity.

not this guy, but for OP i can tell the most important thing about volatile is stuff accessed from interrupt vectors - if not marked volatile, compiler might optimize it away because there is no usual code path/access to it

>the most important thing about volatile is stuff accessed from interrupt vectors

Attached: readingapu.png (649x524, 394K)

I want to learn embedded c programming from scratch, my only background in programmign is really basic things from grade 10 comp sci. Recommended books besides the K&R?

amazon.com/Definitive-Guide-Cortex®-M3-Cortex®-M4-Processors/dp/0124080820

is that actually useful for a beginner? Looks on the surface like a complicated architecture book or something.

>complicated architecture book or something
ARM architecture isn't "that" complicated.
>useful for a beginner?
Depends on: beginner in what? I wasn't new to programming nor C, but new to embedded, microchips and ARM and this was tremendously useful.

K&R C will help you learn C as well as how to write good, minimal code. You'll need other resources for working on embedded projects specifically.

The first few chapters detail those, but it also delves into UNIX system calls, program structure and OS design very briefly. It's a good book.

I'm new to C and programming in general and want to build a solid foundation.

The book taught me enough to create my own database system for a compasny that needed to database all its financial interaction with customers and suppliers
including a targetted emailing system

sounds like it would be far easier to just use sqlite

It was good enough for me to learn C from it.

C is too big for embedded fren, try forth or assembler

C books for reverse engineering? or should I just focus on x86 asm for now?

No. C works fine on embedded. Depends on what you're doing though (and get friends with static inline so you can avoid function call overhead).

>C books for reverse engineering? or should I just focus on x86 asm for now?
x86 isn't useful for embedded.

I don't get it with the books. Do a tutorial on YouTube and start tyring what you want to do. Sitting around reading isnt' the path I take. I read enought to get started, then I start, and I read how to cross hurdles when I encounter them. Then I move as far as I can until I have to look up again.
I've always found everything I need on YouTube or stackexchange, or the github docs, or the official docs. Never once thought to buy a book and sit down and read how to code without doing it. Sounds like a collosal waste of time.

K&R is for people coming from another programming language. They even stated explicitly in the beginning of the book. Get something like C programming a modern approach by King then get on 1337x and download some udemy courses.

Attached: 1567647449435.jpg (1073x1073, 134K)