The temperature example app uses wifi to send the tempersture to a remote url.
Posts made by mhvelplund
@stoffera I can live without it. I haven't written anything in C++ since the late 90's, so to be honest, I only added C++ 11 because it seemed to be the dialect preferred in example code on the net. With that in mind, I doubt anything I produce i C++ will be of production quality ;)
Thanks a bunch for the help!
@stoffera i put the code up on Git in a public repo. It's obviously a work in progress, and the reason I got bogged down in logging in the first place is because the rest didn't work as intended ;) The aim of the task is to provide a Phone-like keypad for typing messages.
You can turn the SDFS code on and off by (un)commenting the
#CDEFS=-DSDFSline in the Makefile.
I'm running the tool chain on OSX.
@stoffera ther's no ELF file, but I guess that's because the linker fails. None of the .o files in the build dir have an .rodata section or an .cyloadablemeta section for that matter.
So the extra data seems to be something that gets linked in when I refer to the SDFileSystem object from the mbed framework.
@stoffera I've tried both with the SDFileSystem as a global and as a member var in the app controller, and I only access it in or after the wake from sleep. No dice.
It links fine in a hello world app where I do nothing but initialise the SD FS and write a log line, and obviously it works in the temperature app.
Based on the error message ("
messenger.elf section '.rodata' will not fit in region 'rom'"), it seems like I'm accidentally putting more than 32 kb data in the constants sectition of RAM but I can't see how. Can I use objdump to see what is stealing all the space?
@stoffera: Working from the
temperaturetask example (the stuff that load Wi-Fi config from an SD card), I figured I would need to initialize the SD filesystem before I can write to it.
Looking at mbed's cookbook on the subject, I added the following to my
#include <SDFileSystem.h> SDFileSystem sdfs(SD_SPI_MOSI, SD_SPI_MISO, SD_SPI_CLK, SD_SPI_CS, "sd");
Now, when I compile, I get an error during linking that seems to suggest I'm exceeding the max size of binaries:
... Compiling C++: app_controller.cpp Linking messenger.elf /usr/local/openmono/gcc-arm-none-eabi-5_2-2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld: messenger.elf section `.rodata' will not fit in region `rom' /usr/local/openmono/gcc-arm-none-eabi-5_2-2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld: section .cyloadablemeta loaded at [000000000003ffc0,000000000003ffff] overlaps section .rodata loaded at [000000000003acf8,0000000000041dd7] /usr/local/openmono/gcc-arm-none-eabi-5_2-2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld: region `rom' overflowed by 0 bytes collect2: error: ld returned 1 exit status make: *** [messenger.elf] Error 1
Size-wise, my program is actually a little smalle than the temperature example task, so I'm not sure what I'm doing wrong.
The framework code makes liberal use of the
mbed_debug.h. As far as I can tell that method just dumps the string on
stderr. What is the preferred way to access the output? Should I redirect it to a file with something like:
... or is there a better way?
What is the maximum size of an .elf file?
The elf files that result from compiling the default monomake project are 1.7Mb in size.
- How much built in flash memory does the Mono have and what is the maximum size of an .elf file for the Mono?
- Is there any way to reduce the size of the binary?
- If I don't need accelerometer and temperature, could I leave out that code?
I'm not a C++ programmer in my day job so I apologise in advance if this is a stupid question, ie. if the compiler strips unreferenced libs automatically :)