Live data from Hacker News

How to flash an LED: writing ARM assembly for an STM32 microcontroller

mcla.ug

31–40 of 68 posts

Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller

#31
post #20

Is there a better way to sleep/delay other than what basically seems like 100% CPU usage in a subtraction loop?

The other approach to delay's (keep in mind, that there is no other process to yield the CPU too) is to use a timer (a peripheral of the micro controller). This would take a fair bit more code to configure the timer, and setup an interrupt to handle the timer.

How do multiple processes usually 'share' a timer?

Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller

#33
post #20

Earlier quoted context omitted.

The other approach to delay's (keep in mind, that there is no other process to yield the CPU too) is to use a timer (a peripheral of the micro controller). This would take a fair bit more code to configure the timer, and setup an interrupt to handle the timer.

How do multiple processes usually 'share' a timer?

by either having the timer fire regularly and have run code to figure out what needs to be done now, or having code to set it to the time to the next needed interrupt

Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller

#34
post #3

Earlier quoted context omitted.

no, i spent months on this, and the answer is no They use IP from synopsis, but synopsis refuses to allow their docs to be published so every manufacturer has to read them and regurgitate them into their own docs in their own words . In any case official STM docs are incomplete. See their driver source - it accesses undocumented registers and sets undocumented bits in documented regs. Without them the usb core will n…

Maybe I don't understand the question. Aren't the STM32 CDC libraries redistributable?

The STM32 USB libraries are provided under the oddly named "Ultimate Liberty License" [1], which is actually incredibly restrictive -- it requires the code to only be used on ST hardware, and prohibits it from being used "in any manner that would subject this software to any Open Source Terms".

[1]: http://www.st.com/SLA0044

Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller

#35

This was a really interesting article, and I learned a lot. I'm very much lacking in chip/assembly level knowledge, and this helped me to understand a little bit more. Thank you, Lochsh, for writing it!

This is lovely to hear, I'm so glad it was helpful!

Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller

#36
post #27
post #8

Earlier quoted context omitted.

those open source libs use undocumented regs documented and thus are based on STM lib. License in question thus

Is clean-room reverse engineering even viable? That is, would anyone agree that an independent discovery of what bit does what is even possible, and this is not lifted from known drivers?

Clean-room reverse engineering doesn't require that. If someone were to read the existing drivers and write documentation explaining how the hardware appears to work, that documentation would be unencumbered, and a freely licensed driver could be written based on that documentation. The only methodology that would be questionable would be a developer writing a new driver while referring directly to the vendor driver.

To put it another way -- the IP protections on the current library are a matter of copyright law, and the protections are on the code itself. The facts of which bits do what -- which are embodied in that code -- are not protected (or protectable!), and can be reused freely.

Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller

#38
post #27

Earlier quoted context omitted.

Is clean-room reverse engineering even viable? That is, would anyone agree that an independent discovery of what bit does what is even possible, and this is not lifted from known drivers?

Clean-room reverse engineering doesn't require that. If someone were to read the existing drivers and write documentation explaining how the hardware appears to work, that documentation would be unencumbered, and a freely licensed driver could be written based on that documentation. The only methodology that would be questionable would be a developer writing a new driver while referring directly to the vendor driver.…

>The facts of which bits do what -- which are embodied in that code -- are not protected (or protectable!), and can be reused freely.

Though given Oracle's current legal proceedings that might change...

Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller

#39
post #3
post #2

Anybody got USB communication (CDC class) working on this platform without the proprietary libs?

no, i spent months on this, and the answer is no They use IP from synopsis, but synopsis refuses to allow their docs to be published so every manufacturer has to read them and regurgitate them into their own docs in their own words . In any case official STM docs are incomplete. See their driver source - it accesses undocumented registers and sets undocumented bits in documented regs. Without them the usb core will n…

Avoid ST at all costs in my experience. Their documentation is terrible. They never acknowledge hardware errata even after clear evidence of it. They’re not a company with a solid engineering culture imo

Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller

#40
post #39
post #3

Earlier quoted context omitted.

no, i spent months on this, and the answer is no They use IP from synopsis, but synopsis refuses to allow their docs to be published so every manufacturer has to read them and regurgitate them into their own docs in their own words . In any case official STM docs are incomplete. See their driver source - it accesses undocumented registers and sets undocumented bits in documented regs. Without them the usb core will n…

Avoid ST at all costs in my experience. Their documentation is terrible. They never acknowledge hardware errata even after clear evidence of it. They’re not a company with a solid engineering culture imo

Which MCU makers do you prefer?
Post reply on HN