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 :)
Arduino board definition
The JSON file at https://raw.githubusercontent.com/getopenmono/arduino_comp/master/package_openmono_index.json points towards files hosted at localhost ... this doesn't work :)
The file is the one referenced in your documentation on how to use the Arduino IDE with Mono.
RE: First support question ;)
So, after fiddling around a bit I got a little further. On OSX you have to run the
sudo. If you don't, there's no error message, the device simply isn't found. I was able to successfully load the watch app in this way. The TicTacToe app loads without errors, but the buzzer makes a slightly more "angry" sounding noise when it's done, and there is nothing on the screen afterwards. It might be broken, but it's hard to say.
First support question ;)
I got my Mono Maker in the mail today and I hurried home to unbox it. When I first pushed the little grey power button, it switched on and showed a screen saying goto openmono.com/start . Sofar so good. Then I plugged it into my computer using a USB cable before reading the guide on the site about holding in the reset button. Of course nothing happened (because it wasn't in boot mode i guess) so I installed monoprog and tried to turn it on holding in the reset button. Now, however, it won't turn on. Nothing happens when I press the power button or reset button or any combination thereof. I've tried charging it, and still nothing. What am I doing wrong now?