10 years, 3 months ago.

Running Binaries on LPC1768

Hi, I hope you are having a great day. I was wondering if there is a way to run a binary on LPC1768 without having to push the reset button.

Thank you in advance! Natasha

Hi again Erik! Thank you so much for the quick reply. I updated my gist - as I realized I had not used the mbed_reset() as you suggested but just set the actual Reset pin on the LPC1768. Using the code here: https://gist.github.com/tashwoods/39aea412e3a40aaf980f it is still not working though : (

Thank you again! Natasha

posted by Tash Woods 06 May 2014

1 Answer

10 years, 3 months ago.

You mean uploading a new one to the mbed lpc1768 and then running the new binary? In order to do that the mbed has to reset. Your options are: Press the reset button, pull the reset pin low, power cycle the entire board, or send a break over the serial connection. In teraterm that last option is done by pressing alt+b.

One more option - your currently running application can issue a reset.

extern "C" void mbed_reset();
...
if (SomeCriteriaIsMet())
     mbed_reset();
...

That criteria could be a key-stroke, or perhaps that function counts the ".bin" files on the mbed localfilesystem and when the count changes it waits a little while and resets. [I have not implemented this, just theorizing]

posted by David Smart 26 Jan 2014

Thank you so much for your answer Erik! Sorry for the delay. I would like to reset mbed using software if possible. So, your last solution seems like the best one for that purpose. Do you think I should put the code you posted inside the application I am trying to run or save it as a separate binary? Also, do you know where I could find some documentation on how to code the criteria?

Thank you again! Natasha

posted by Tash Woods 04 Feb 2014

Well that wasn't my solution ;). But if you want that it should be within the application, you can't do a seperate one. The criteria could be a serial character for example: http://mbed.org/handbook/Serial

posted by Erik - 05 Feb 2014

Hi again Erik! Sorry for the delay. I am just getting back to this project. My current code is here. I reset the chip - but still have to push the button on the chip to get my code to run. Any ideas?

https://gist.github.com/tashwoods/84c81f87fa6e0f1b98a2

Thank you again!

posted by Tash Woods 06 May 2014

How is the code supposed to reset it? How is it connected? But if you want to reset from your own application, use the above mentioned option.

posted by Erik - 06 May 2014

Hi again Erik! Thank you so much for the quick reply. I updated my gist - as I realized I had not used the mbed_reset() as you suggested but just set the actual Reset pin on the LPC1768. Using the code here: https://gist.github.com/tashwoods/39aea412e3a40aaf980f it is still not working though : (

Thank you again! Natasha

posted by Tash Woods 06 May 2014

I tried that code and it seems to work, kinda. Note that since first thing you do is call mbed_reset, all it does is permanently reset itself (the status LED should flash). I then modified it to call the error function as first thing, uploaded that one, and that was automatically started and blinked LEDs in error pattern.

Only other possibility I see is that you have a different firmware version.

posted by Erik - 07 May 2014

Hi again Erik! Thank you again for the speedy response. I checked my firmware version by opening the mbed.htm file on the lpc1768. I believe I have version: 16457. Do you think I should still update?

<! mbed Microcontroller Website and Authentication Shortcut > <html> <head> <meta http-equiv="refresh" content="0; url=http://mbed.org/start?auth=101000000000000000000002F7F0CC2756c6df3663f6e80a530ada6fb21d0a0e&loader=11972&firmware=16457&configuration=4" /> <title>mbed Website Shortcut</title> </head> <body></body> </html>

posted by Tash Woods 13 May 2014

I just checked, I got 21164, it might be a problem for you.

posted by Erik - 13 May 2014