Hello-
I am embarrassed to ask several "I never took a computer science course" type questions, but I am hoping a few quick direct answers will save me days or weeks of reading references which are not needed to answer my immediate questions (mainly about USB). The answers will determine if I need to read some of the USB code examples provided by st.com. [A side question is related to which st.com code I should read. The libmaple / usb / usb_lib / usb_regs.h file, version 2.2.1, has an internal st.com date of 9/22/2008, but I think st.com has released updated versions of this file.]
In microcontrollers such as the the STM32F103X chips used in the Maple there are simple circuits (AND, OR, XOR, etc gates) created using silicon. When combined the circuits create subroutines and programs which are related to specific functions (eg. USB). How am I doing so far?
My most basic question is how does software such as the st.com demo software and libmaple
which is located in FLASH/SRAM access these hardware circuits? How does a program which exists in FLASH/SRAM access a program which which exists somewhere else on the silicon wafer?
At the lowest level (which I do *not* think I am interested in learning) I am assuming accessing these circuits requires knowing which values to put in which memory spaces and when to activate the appropriate circuits. How are circuits "activated"?
In "libmaple/usb/README" it says "when a new USB core library is written (to nix ST dependence)" which suggests that the LeafLabs crew wants their products to run without using any ST code.
Currently (March 2011) some of the USB functionality has not been duplicated yet in libmaple
. For example, the functionality from the st.com code which allows isochronous USB transfers has not be duplicated in libmaple
.
In becoming independent of ST code at what level does libmaple
need to replicate what the ST code achieves?
To make the software/silicon connection does libmaple
just need to replicate just the functionality of the ST code? In other words, for the core USB functions, is libmaple
limited (or required) to using functions which match the ST code function in name only (while being given the freedom to change the body of each function). Or is libmaple
free to use any function names it wants as long as the correct values are placed in the correct memory spaces (ie the functionality of the ST code)?
For example, in usb.h (found in libmaple
) the following function is defined: usbReceiveBytes(uint8* recvBuf, uint32 len);
Is there a function also called usbReceiveBytes in the st.com code which has the same functionality, but different code in the function body?
When microprocessors are programmed are any variable names reserved?
I am assume there is a way for a low level function for a program to say "I am about to make several changes to different memory locations, so do not do anything until I am finished."
What is a register, and how are registers related to these questions? How are registers access (read or changed) by software?
Do you recommend any specific links or resources?
Thanks again for your time!
Stephen from NYC (full disclosure: I am not a member of the LeafLabs staff)