Products > Embedded Computing
[ATSAM] Interupt handling from scratch
Simon:
So having finally worked out how to address memory with pointers (thankyou to those that helped) I can now forgoe the manufacturers header files and use my own defines to just write/read the register memory locations.
So the next hurdle in this series is interupts. These too are address specific, so how do I get the compiler to put my interupt servicing routine at the right address?
ataradov:
You do it in a linker script. Pretty minimal example here https://github.com/ataradov/mcu-starter-projects/tree/master/samc21, as usual. Actual functions can br located anywhere, but the vector table is fixed.
Also, not using manufacturer header files (or generated manually from SVD files) is a really bad idea.
Simon:
OK, thank you but what is the linker and how did you create one?
ataradov:
https://en.wikipedia.org/wiki/GNU_linker There is plenty of documentation on that stuff. You can start with the site mentioned in the article.
The linker script is here https://github.com/ataradov/mcu-starter-projects/blob/master/samc21/linker/samc21j18.ld Mine is derived from the stock one.
Simon:
OK so what have you actually done as I see most of the files are as supplied. How are your examples different from a fresh project in AS. Basically I am trying to have a project were I can setup my own accesses to the registers (memory) without clasting with existing naming in the atmel files.
Navigation
[0] Message Index
[#] Next page
Go to full version