I am doing some more work to get to know the STM32F103, now looking in the libopencm3 library and learning from the example code. (using ubuntu as development platform)
I am looking at the demo application to create a usb-over-serial interface (usb_cdcacm), as found here:
When I take this code and modify the pin configuration for the maple mini, it works nicely. However, when I start expanding the application (printing out a rolling text), the code does not even initialise the USB bus anymore.
dmesg gives this: usb 3-3: new full-speed USB device number 110 using xhci_hcd usb 3-3: device descriptor read/64, error -71
Now, one of the lines of code that I do not understand is this: SCB_VTOR = (uint32_t) 0x08005000;
(line 242 of cscacm.c. It is actually the first line of code executed in "main").
The VTOR seams to be the vector table offset register, which seams to be
-if I am correct- the place where the interrupt vector table is stored in memory. (i.e. flash)
I am a bit surprised to see this line. Isn't this just some part of the memory-layout, so something that that linker must take care of. (it is the linker that generates the hex-file and puts everything at the correct place in flash, no?)
Can somebody explain what is the exact use of this? Why would you need to use this in your code? (and what is it doing in this application?)
And do you need to tell the linker how to deal with this?
Cheerio! Kr. Bonne