I’ve been playing with RuuviTag for a week now and have some questions about it.
Is it possible to compile and run nRF5_SDK_15.2.0_9412b96 examples to work with RuuviTag?
I’ve copied the pca10040 directory for ble_app_uart example and messed with the Makefile and copied the compiler flags from ruuvi.firmware.c-project Makefile, but without success.
Is there any minimal app example that can be run with RuuviTag?
I’ve modified the ruuvitag_fw project and I have been able to run my own code with it, but since I don’t need all the stuff the firmware has. I’ve been thinking it would be nice to have some minimal template project as base to own implementations.
Is it a known problem that after enabling BLE UART service to ruuvitag_firmware, the hardware resets itself when sending messages over 20 bytes from Android app?
Yes, with some caveats. You’ll need to erase the bootloader and flash the new softdevice in the tag, so a wired connection is almost a must. In a pinch the bootloader and softdevice can be uploaded with DFU.
The SDK examples do not initialize sensor GPIO pins, and if the chip selects and SPI are left floating you’ll have excess power consumption.
SDK examples are my starting points, if you’re working with SDK15 you might be interested in Ruuvi Blog and fork off the project at some convenient point
Yes, the BLE UART service can handle only 20 byte chunks.
Device gets flashed, but debug shows " app: Fatal error"
Flashing the full hex of self-compiled ruuvitag.firmware.c works, so SDK 15.2 stuff seems to work with my device.
To me crash when sending over 20 bytes to BLE UART seems like a bug. I understand the message could be truncated or error raised, but cannot see crash as a feature and was hoping this is because SDK 12 or softdevice 3 thing and fixed to SDK 15 and softdevice 6. But of course this is not in your hands, just asking if this is known issue since this kind of crash might prevent using the hardware for more demanding implementations.
I think the most probable cause for crash is that there is no check for incoming data length and it overflows the 20-byte buffer. GATT on RuuviTags has been used mostly on various demos and proof-of-concepts, so you can expect a lot of rough edges there.
Example projects seem to be working with SES. I must have made some mistake when compiling/flashing from commandline. The 20 byte barrier doesn’t seem to be problem either. Thanks again for you tips. Seems like this hardware can do the things I would like it to do