systemHardReset() is the function called by the libmaple USB handler to reset the CPU before entering the boot code when the magic byte sequence is send before program upload. It is already in libmaple, so you just have to call it. You probably need to declare it as external or to include the .h where it is declared. There is no way you can get compiler errors for as long as you did not try to re-event the wheel and pasted the code which is already present in libmaple.
reset function
(22 posts) (4 voices)-
Posted 2 years ago #
-
ala42 - I don't believe systemHardReset() is linked via the IDE:
/var/folders/oE/oEzfk9h0HKOEXtVMI7BaCk+++TM/-Tmp-/build8154357291228699228.tmp/BlinkReset.o: In function `loop()':
undefined reference to `systemHardReset()'collect2: ld returned 1 exit status
Posted 2 years ago # -
Looks like this function was named nvic_sys_reset() in the mean time, now defined in nvic.c.
Posted 2 years ago # -
ala42 - "nvic_sys_reset() in the mean time, now defined in nvic.c."
Not for me.I have systemHardReset in usb_hardware.c, but it isn't linked in by the IDE, and I can't #include <usb_hardware.h> because I get multiple definitions.
Posted 2 years ago # -
I found nvic_sys_reset() in https://github.com/leaflabs/libmaple/blob/master/libmaple/nvic.c in the master branch when I read you did not have systemHardReset.
Anyway, at least in my sources systemHardReset is not declared as static, so the linker should find it.Posted 2 years ago # -
I have no time to look into it, but it seems very weird that it isn't linked, yet
#include <usb_hardware.h>
throws compile timer errors for multiple definitions.Anyway stephanschulz seems to have what he needs.
Posted 2 years ago # -
yes i do.
thank you very much for your help.Posted 2 years ago #
Reply
You must log in to post.