Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 7 months ago.
mbed_interface_reset() with OS5 not resetting the semihost interface
I have been developing with mbed with an LPC1768 for a good few years now and for convenience have developed a serial interface framework for s/w development that uses mbed_interface_reset() to invoke a software controlled reset rather than having to press the reset button - it all works really well.
Problem I have: I am just starting to migrate to OS5 to utilise threading and have ported the bare minimum code to get my basic serial framework (above) working with continued use of mbed_interface_reset() and it no longer works. I have printf debugged and the call to the function returns -1 suggesting the mbed_interface_connected() is NOT connected (Github code snippet below). I am receiving and handshaking serial commands through the Serial(USBTX, USBRX) interface so it's definitely connected in some context at least.
## Github library code snippet
int mbed_interface_reset(void) { if (mbed_interface_connected()) { semihost_reset(); return 0; } else { return -1; } }
If anyone can provide any pointers that would be greatly helpful.
2 Answers
6 years, 7 months ago.
I would look into using NVIC_SystemReset() - https://os.mbed.com/questions/4680/reset-command-soft-reset/.
Thank you Sarah, unfortunately this is not the same but that's because my question wasn't so clear...
NVIC_SystemReset() will reset the LPC1768 but that's not what I am after per say. The mbed_interface_reset() (when it works) causes the CMSIS-DAP interface to reload any new bin image into the LPC1768 flash before reset occurs making it possible for me to perform a code upgrade without need to access the reset button for the same.
posted by 23 Sep 20176 years, 7 months ago.
Also, I was told years ago, when using the mbed RTOS, you should be using RawSerial, not Serial. I have been using RawSerial ever since.
I am certain there have been some improvements since then. There are not overarching problems using Serial and mbed OS 5 (note: this is our latest product, which combines mbed RTOS with the traditional mbed library). Read more about it here - https://www.mbed.com/en/platform/mbed-os/.
posted by 22 Sep 2017
Good question... I've raised a ticket.
posted by Jan Jongboom 27 Sep 2017According to this response behavior is correct on mbed OS 5.5.6 and mbed OS 5.6... Which version are you on?
posted by Jan Jongboom 29 Sep 2017