madison-embedded / gcc-builds

For projects built with the GNU toolchain.
GNU General Public License v3.0
11 stars 8 forks source link

Common: missing reset command #11

Closed vkottler closed 7 years ago

vkottler commented 7 years ago

Being able to reset the board from the command line would be a great utility.

vkottler commented 7 years ago

I recommend cloning this repo to get all of the necessary documentation.

The STM32F767ZI reference manual says the following:

image

When we consult the ARM Cortex-M7 Reference Manual as instructed, surprise! There's no description for the "Application Interrupt and Reset Control Register".

When we search it online here we can actually read about it:

image

hmm... yeah I'm sure it's somewhere in these manuals!

davidguyuchen commented 7 years ago

It seems we can take advantage of NVIC_SYSTEMRESET command documented in core_cm7.h file in the CMSIS files folder. It basically overwrites the reset register bits to implement a software reset, which is pretty much what we are looking for.

screen shot 2017-06-26 at 2 54 11 pm
vkottler commented 7 years ago

Oh dang, good find. There's always useful stuff in there! Feel free to make a command-line command that calls it and test it out

davidguyuchen commented 7 years ago

Has been implemented and pushed.