This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Online Compiler Doesn't Optimize?

I just tried compiling this for the BLE nano and it explodes to a 245K download (much too large for device). I've also tried including only the headers (DigitalOut and wait...) that are necessary. Same size.

How do we configure the online compiler to optimize the size and strip unnecessary dependencies from the mbed library/src. I thought that would have been automatic and I can't find any toggles anywhere for it.

Thanks,

#include "mbed.h"

DigitalOut myled(P0_12);

int main() { while(1) { myled = 1; wait(0.2); myled = 0; wait(0.2); } }

  • It would probably make more sense to ask this question on the mbed forums, but in any case the mbed online compiler does strip unnecessary symbols. The downloaded file includes the soft device and is in intel hex format (an ascii representation of the binary), hence the file size is much larger than the final binary that is downloaded to the flash.

    I'm a little puzzled why you didn't just try it before giving up?

  • I did try it. The NRF * app refused to upload it because of size.

    The only program I did successfully install from the NRF Toolbox was the Heartrate Monitor, v6. But now that it is installed, the NRF Toolbox is saying it can't find a valid DFU. Did I just brick the beacon (into a heart rate monitor)? Did it install a version of the DFU that is incompatible with the app?

    Is the only way to recovery through SWD? Or is another app capable of restoring OTA?

  • As Janek points out, the question may be better suited for the mbed forums.

    To do DFU OTA with mbed I think you must use FOTA, because the SoftDevice is included in the hex. I don't think BLE nano supports DFU OTA of the bootloader, so this has be programmed in.

    However, I don't understand how you were able to do the DFU the first time, if it was from mbed that is.

Related