And in addition, and first of all, an important clarification. There are a family of STM32F1 parts. These were once (and sometimes still are) designated "value line" and "performance line". If this doesn't sound like marketing talk, what does?
The STM32F103 is a "performance line" part. This is vital and important. The STM32F1xx datasheet covers all of these and the interrupt layout is different between these two classes. The value line parts have no USB at all! And of course, because of this, for them no interrupts are defined for USB. If you were looking in IRQ tables and not finding USB interrupts, you were probably looking at documentation for a value line part.
Other literature calls our STM32F103 with 64K of flash a "medium density" device.
Yes, it is hard to believe there is anything cheaper and lower on the scale than an STM32F103, but there most certainly is. Now you know.
The usb CNTRL registers has 8 bits that mask or enable various interrupts.
The usb ISTR (interrupt status) register has these same 8 bits in the same
position in the 16 bit word, along with other information.
Yes these are 16 bit registers on a 32 bit bus.
What do we do about these 3 interrupts? We will certainly ignore (and not enable) the wakeup interrupt. We could also ignore the HP interrupt and rely solely on the LP interrupt. This is what libmaple does.
PSR PC LR r12 r3 r2 r1 r0On return from the ISR, these 8 registers are automatically popped. That it is an interrupt routine has been indicated by a data field in the LR.
This makes it possible for exception vectors to simply reference C functions. You may be asking, what about r4 through r11 which were not saved? The C compiler always saves any of these registers it might use, so it "just works" As the ARM Cortex-M3 manual says on page 5-11 (page 105):
ISR functions can be normal C functions, and do not require a veneer.A pleasant situation that I have assumed to be true, but not understood fully until now.
Tom's Computer Info / [email protected]