News for hackers. Stuff that matters.
Re:How to flash an LED: writing ARM assembly for an STM32 mi... by lochsh on Friday April 03, 2020 @06:46PM (#22774670)
You don't need an OS to do more advanced or efficient sleeping. You could have one of the timer peripherals generate an interrupt on a regular basis, and then put the chip in a lower power sleep mode in between interrupts.
Re:How to flash an LED: writing ARM assembly for an STM32 mi... by saagarjha on Friday April 03, 2020 @06:57PM (#22774735)
Isn't that what an OS would do, essentially?
Re:How to flash an LED: writing ARM assembly for an STM32 mi... by lochsh on Friday April 03, 2020 @07:00PM (#22774760)
Yes, probably! But you can do it yourself without one.

Here is an example in C using libopencm3, that uses timers to trigger an interrupt used to flash LEDs https://github.com/libopencm3/libopencm3-examples/tree/maste...

Re:How to flash an LED: writing ARM assembly for an STM32 mi... by dmitrygr on Friday April 03, 2020 @08:13PM (#22775114)
that is basically a mini-os :)
Re:How to flash an LED: writing ARM assembly for an STM32 mi... by foldr on Saturday April 04, 2020 @07:15AM (#22777596)
You can set up a wakeup interrupt using a timer by moving a few values into a few registers. It doesn't require anything like an OS. Even tiny 8-bit microcontrollers can do this.
Re:How to flash an LED: writing ARM assembly for an STM32 mi... by als0 on Friday April 03, 2020 @07:34PM (#22774941)
Sure, but putting the chip to sleep is one instruction, and programming the timer interval is only about a dozen instructions. So you don't really need an OS in this context.
Re:How to flash an LED: writing ARM assembly for an STM32 mi... by yjftsjthsd-h on Friday April 03, 2020 @09:51PM (#22775555)
There is a blurry line on the edges of "library" and "OS"; most people would put this particular example on the "library" side.