-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sketch size is too big for Arduino UNO #28
Comments
I will use two Arduino's as a solution. 1 arduino to listen from serial port for commands to be issued on BLE module, 2nd arduino to handle rest of the stuff. Luckily I had some Arduino Mini pro laying around 👯 |
I think I'm experiencing run-time memory problems. I change completely unrelated part of the code. Then suddenly, it starts getting stuck at begin call for bluetooth module. For example, I define a variable object(BLEMultimedia). Then suddenly it starts getting stuck. Even if I don't use that variable object. This happens when program uses around %80 of 32K memory. Leaving 450 bytes for local variables. |
When I have this memory problem it gets stuck at below section in DEBUG print out. Evt Device Started: Setup |
My tests show, it is able to finish beginning process if memory left for local variable is at least 515 bytes. It stops working, if you have less than 515 bytes left for local variables. Then it gets stuck at debug printout shown above. |
@ayildirim memory management is tricky, I often run out of memory when creating peripherals. The Leonardo based boards have 512bytes more SRAM than an Uno. The nRF51822 boards (RedBear and RFduino) have 16 KB of SRAM. I also use the |
@don yes. I think I will have to go with Teensy or something. I was going to make a custom gamepad/tv controller. I thought using 2 arduinos. But there isn't even enough space left for communication(listening/parsing commands) on arduino handling nrf8001. |
@ayildirim are you concerned about code space or RAM? The library is pretty ambitious on the nRF8001 side, it builds the nRF8001 setup messages on the fly on the Arduino (Nordic's Arduino lib relies on a desktop app for this) . There might be some optimizations, but would make the code harder to maintain so I stopped pursuing them. Happy to review any suggestions you have though. |
Hi @sandeepmistry , How much memory I can save by sending setup messages on the fly? Is it only that setup messages array in nrf8001.cpp? I will try to implement same thing your code, if it can save enough memory. Otherwise Im gonna go ahead and buy a Teensy 3.1 |
You mean by not calculating them on the fly? No idea ...
Many more added at run time ...
Good luck! I would say go for the Teensy or use this lib with nRFgo studio: https://github.com/NordicSemiconductor/ble-sdk-arduino/tree/master/documentation/libraries/BLE/examples/ble_HID_template probably will save you a ton of time instead of modding this lib. |
If you are running out of Flash space during the prototyping stage, it may be worthwhile to switch the ble SDK for Arduino from Nordicsemi which will generate the Setup in the nRFgo Studio (Windows tool and works on the OS X using playonmac), this will allow you to skip the library used to build the Setup in the arduino-BLEPeripheral. The Setup messages are generated by the nRFgo studio and are stored in Flash, so this needs about 1 to 2Kbytes of Flash. You may be able to cut out the Setup part of the code from the arduino-BLEPeripheral and use the rest but I will have to leave that to Sandeep to comment on. |
I need to use Mouse, Keyboard HID features together on 1 device. This library allows doing that. I am not sure if it is possible with nrfGO Studio. It compiles setup message with a given xml descriptor file for either keyboard or mouse. |
This library is way nicer to use than nRFgo. Spending $19 on a Teensy is the easiest/fastest solution. |
@ayildirim , combining mouse and keyboard functionality is pretty straightforward on nRFgo Studio as well. Additionally you can do the combining on this library and then read the GATT Server over the air and replicate it on the nRFGo studio. |
@daviddedwin @don thanks for the feedback/comments! @ayildirim can we close this now? |
@sandeepmistry yes. Thank you all for your answers. Thank you for great work @sandeepmistry. |
Hi!
I'm trying to optimise library to reduce the size of sketch and libraries. But so far, it is not going well.
Any suggestions on this will be much helpful.
I disabled DEBUG printouts.
What else can I do?
Thanks,
The text was updated successfully, but these errors were encountered: