How to flash an LED: writing ARM assembly for an STM32 microcontroller
1–10 of 68 posts
Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller
#2Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller
#3Anybody got USB communication (CDC class) working on this platform without the proprietary libs?
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 not start or run.
Your options are to carefully rewrite STM's libs (which are based on real synopsis docs and DO work) or use them as is. Both solutions IMHO leave you subject to STM's EULA and such
this is the #1 issue in stm32
a close #2 is the their so-smart-it-is-useless i2c controller. I know of no project that uses it. Everyone bitbangs i2c master on stm32. The hardware unit is very easy to wedge to a point where only a power cycle unwedges it.
Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller
#4Anybody got USB communication (CDC class) working on this platform without the proprietary libs?
This Rust library is an abstract USB library that can implement CDC serial https://docs.rs/usb-device/0.2.5/usb_device/, and this library connects it to the STM32 USB peripheral https://github.com/stm32-rs/stm32-usbd
Examples here: https://github.com/stm32-rs/stm32-usbd-examples
Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller
#5 1 @ Set BR8 field in GPIOA_BSRR, to clear GPIOA8
2 movw r1, #0x0000
3 movt r1, #0x0100
you can just use a mov to get that value. Any 8-bit value shifted left any number of bits is synthesizable using one MOVRe: How to flash an LED: writing ARM assembly for an STM32 microcontroller
#6Anybody 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…
Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller
#7@author: 1 @ Set BR8 field in GPIOA_BSRR, to clear GPIOA8 2 movw r1, #0x0000 3 movt r1, #0x0100 you can just use a mov to get that value. Any 8-bit value shifted left any number of bits is synthesizable using one MOV
Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller
#8Anybody got USB communication (CDC class) working on this platform without the proprietary libs?
I don't have experience with this, but from talking to people who do, there are indeed open source implementations. They say the documentation is a bit confusing, but it does describe everything. This Rust library is an abstract USB library that can implement CDC serial https://docs.rs/usb-device/0.2.5/usb_device/ , and this library connects it to the STM32 USB peripheral https://github.com/stm32-rs/stm32-usbd Exampl…
Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller
#9Anybody 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…
https://github.com/STMicroelectronics/STM32CubeF4/tree/maste...
(I've chosen the version for STM32F4 arbitrarily; if there's something similar in one of their other USB support libraries, feel free to point to that instead.)
Re: How to flash an LED: writing ARM assembly for an STM32 microcontroller
#10@author: 1 @ Set BR8 field in GPIOA_BSRR, to clear GPIOA8 2 movw r1, #0x0000 3 movt r1, #0x0100 you can just use a mov to get that value. Any 8-bit value shifted left any number of bits is synthesizable using one MOV
This is true! If I was writing something to be optimal speed- and size-wise, I'd do that. I think I just liked the consistency with the other parts of the code where using both was necessary :)
So you could do `mov r1, #0x01000000` right? nice.