10/19/2015 at 21:25 •
Some time has passed since my last log but it doesn't mean that nothing was done. Today I finally managed to release 0.4.0 version. Changes are not groundbreaking but it's an important step to make this watch useful and customizable.
I've spend most of the time on putting a good filesystem that will work with this very limited amount of RAM. Only 6kB of processor RAM are available for the app, that's twice the size of the screen buffer. There are still some things to do on the app size to be able to synchronize multiple files but it's now quite easy to do and should be available in few weeks. We have 512kB of flash storage and it should be enough for this.
Second big point was making it stable. Both the BLE connection and watch firmware itself. I've tested it for few days and never had situation when watch was not connected to the phone. Also random freeze or screen shifted by 8 pixels should not happen.
Third most important part for me was to add possibility to attach images, number fonts and enumerated images. So your watch will look like you want. For example now you can draw different images based on current day of week. That's also a good base for some weather forecast plugin.
Also some minor things were added:
- current day of week and day of year
- support for 12h clock
- external plugin text parameters may be now longer so current song name, artist etc can be displayed in multiple lines
- plugin installation/update/reinstallation will not require OSSW app restart, it will reconnect to new/modified plugin.
- OSSW app after next upgrade will automatically reconnect to last connected watch, so automatic update will not break connection.
- There's notification with current progress of watchset upload (watchsets may be big now so it can take some time)
- Update in musicplayer plugin that allows to control music volume
Thanks to these changes next release should be much faster than this one. I've published some new watchsets to show new features, all files can be found HERE
It would be great if I could make a web based GUI that will allow to build watchsets by drag and drop. Unfortunately for now, to be able to attach images you have to use some basic tool available HERE. Look's like it works only in Chrome for now, will try to fix that in next few days.
How to update:
To update firmware use nRF Toolbox, HERE you can find ossw-firmware-s120-0.4.0.zip
You don't have to go to bootloader mode or something. Just update from nRF Toolbox:
DFU -> SELECT FILE -> Distribution packet (ZIP) -> ossw-firmware-s120-0.4.0.zip, select device and click UPLOAD
06/03/2015 at 07:12 •
Just quick update what I've managed to do:
- it's possible to choose between central (without phone) and peripheral (with phone) mode on watch start
- I've written simple android app that sends sensor data from IpSensorMan to a watch in peripheral mode. Currently it's only HR and CSC but it's extremely easy to add any other sensor type that IpSensorMan supports. IpSensorMan supports both ANT and BLE devices (to use BLE devices you need to install beta version of this app)
- In central mode watch can connect directly to HR sensor. Other sensors will be added but it requires a little bit more work then adding them in peripheral mode.
- I rewrote gui so it's now more generic and allow to use controls on a screen. Still it requires a bit of work to be able to define what should be displayed on a watch from the phone screen (like cycling speed in this place and this size, heart rate there etc.)
- Handling notifications like missed phone calls and sms is still TODO
- I've managed to create a firmware that reverts watch to original softdevice/bootloader so it will be possible to go back to original firmware if you don't like mine ;)
- I've embedded PAWN abstract machine so it's possible to run scripts on a watch but only from internal flash/ram, have to rewrite it to be able to read them from external flash.
All of this is still an alpha version so I have to put some more work to make it user friendly and generic. Expect some photos/videos how this works in the next week.
05/13/2015 at 09:13 •
Hi, I'm back and here are the things I will focus on in the next days/weeks:
- add font support + possibility to upload fonts for given locale
- write android app that sends notifications to the watch
- add a service to android app that will allow to register data sources from other android apps like current weather, data from external sensors etc.
- embed PAWN abstract machine to allow writing custom apps for the watch, those compiled scripts will be saved on external flash so there will be additional 512kB for the apps.
04/20/2015 at 22:25 •
I've just recorded watch upgrade process and will publish it in a few days. It's stable, I've added visual notification to be able to verify if everything was upgraded successfully.
HERE you can find a newest softdevice/bootloader installer. After flashing this firmware watch will restart and use the newest S120 2.0.0 softdevice. After that you can upload your custom firmware that can work as a peripheral or as a central device. I've also created a mock application to start writing firmware, source code for it can be found HERE.
DFU (bootloader) looks like this:
And without backlight:
From now on I will focus on firmware functionality. Stay tuned!
04/15/2015 at 19:41 •
Finally I have some time to describe how to override bootloader and softdevice. It's not supported by weloop bootloader but nothing stops us from writing a custom firmware that will allow this. To make it as simple as possible and to use existing applications that support nordic DFU I've decided to merge custom installation app with a new bootloader and a softdevice and upload it as a new firmware. After firmware upload installation app is started and bootloader and softdevice are copied to the correct addresses. Unfortunately it's not so easy because it's not possible to override softdevice from the firmware. There's also problem with UICR registers because it's not possible to override them. There's only one way to change UICR - make a full memory erase. But when we do this from a firmware then watch will crash after erase because processor will be executing instructions from empty flash...
So how I did this? I've created two apps:
- ossw-installer - this app makes a copy of new softdevice and bootloader to an external flash, makes a full memory erase, copies new softdevice and bootloader from external flash to processor flash and sets correct values in UICR.
- ossw-jump - this app copies ossw-installer to processor RAM and jumps to its start address.
So haw does it work step by step? On the left there's a weloop processor flash structure before any changes. In the middle there's memory structure of ossw-combined.bin file. On the right there's a weloop processor flash structure after installation of ossw-combined.hex using nRF Master Control Panel.
After firmware installation weloop restarts and bootloader is executed and passes execution to ossw-jump. This app copies ossw-installer to RAM.
Then ossw-jump jumps to ossw-installer start address. This app copies new bootloader and softdevice to external flash.
After copying bootloader and softdevice full memory flash erase is executed so weloop processor flash is empty.
And finally new bootloader and softdevice is copied from external flash to processor flash and new bottloader address (0x3C000) is set in UICR.
And that's it, we have a new bootloader and S120 2.0.0 softdevice and may upload a new firmware with nRF Toolbox.
04/09/2015 at 21:59 •
Today I finally managed to upload a new bootloader/softdevice to a watch! It wasn't easy because bootloader that is originally installed on weloop does not allow to upload a new softdevice or bootloader. There's also no support in softdevice to run command on device start (using MBR) that will copy part of firmware from one place to another (it was added in 7.1.0 softdevice and is required to change bootloader or softdevice). So the biggest issues were:
- no bootloader/sofdevice upload feature in original bootloader
- no way to use a newer bootloader code because it requires features that are not available in S110 6.0.0 softdevice.
- UICR cannot be updated! That's the biggest issue because there is a value 0x14000 set at 0x10001000 address so there's no way to use newer softdevice with this value there. There's also 0x38000 set at 0x10001014 and I wanted to make bootloader smaller and use 0x3C000 as a start address.
So how I manage to do this? I will describe it tomorrow because it's time to go sleep ;) If you want to check it yourself take a look at THIS CODE. A compiled firmware that replaces bootloader/softdevice can be found HERE. But be careful with it, it can brick your watch!
So from now on my weloop can connect directly to other devices without a mobile phone! Now's time to write an awesome firmware ;)
04/02/2015 at 22:44 •
I've wasted few days trying to upload a sample app using S110 8.0.0 softdevice and here are the findings:
- it doesn't work with current (2.1.1) nRF Master Control Panel app for android :(
- it will work with Master Control Panel for windows but I have MacOSX... I didn't manage to install MacBook Pro bluetooth host controller driver in Windows within Virtualbox. It doesn't work either in wine (no bluetooth support).
- it WORKS with nRF Toolbox for android but only if you remove Chronos eco android app!
- Chronos eco app for android is a crap. Even if device is not paired and app is closed it breaks communication. I wasn't able to upload an app with bootloader provided with 8.0.0 softdevice when using OTHER software. After removal everything works ok. One more strange feature is that when you enter DFU mode and upgrade firmware from chronos eco android app then it will install... weloop firmware that is not compatible with chronos eco app :D
- My new watch came today so I will upload a new softdevice and an app to it soon.
- I've decided to use S120 softdevice. It has big advantage - in newest version (2.0.0) it can be used both as a central or peripheral device (all features available in S110 7.1.0) but only one at a time. This will give us a possibility to switch watch from terminal to standalone mode!
03/26/2015 at 21:16 •
The bed news is that it's not possible to update softdevice/bootloader with standard weloop bootloader. When you try to update the firmware/application it works but when you try to update bootloader/softdevice it just restarts.
The good news is that we can write a custom application that will do this. Now I'm working on an app that will fetch new bootloader/softdevice using nordic UART over BLE and save it in external flash. When everything is uploaded then it will copy data from external flash to internal flash and we will have a new softdevice/bootloader. And I have to write it using nrf 5.2.0 SDK which is really annoying ;)
There was only one problem... I didn't know what external flash is in this watch. After some research I found out that there is a standard spi command that works with almost every flash chip. It's 90h and returns chip version but that version may be shared between many variants of the same chip. Then I found a newer command: 9Fh and now I'm 100% sure what chip is there.
Manufacturer Id: 0xEF
Device Id: 0x4013
So it's definitely THIS chip :)
03/22/2015 at 09:01 •
Today I managed to write an app for mac OSX that's able to upload a custom firmware using firmware update feature of the watch. It doesn't require to enter an OTA mode so there's a catch:
You can upload a custom firmware to any watch that's in the bluetooth range and is not connected to any phone! No physical access needed!
Because of that issue I decided not to publish source code. But it doesn't stop you from uploading your custom firmware in OTA mode. To enter OTA mode just connect a charging cable, press all 3 buttons on the right side of the watch and release top and bottom keeping middle button pressed few seconds more. How to upload a new firmware in that mode? Just use a nRF Master Control Panel on an android phone. No need to calculate and provide firmware checksum (.dat file), watch bootloader is old and doesn't require to do that.
Firmware upgrade constrains
There are two ways to modify the watch:
- Update just the firmware
- Update firmware, soft device and the bootloader
The first option is quite easy. There's no way you can break anything (unless you play with internal flash from the code ;) ) because there's always a possibility to switch watch to an OTA mode and override existing/broken firmware. But it has also the biggest limitations:
- we have to use existing softdevice which is a S110 6.0.0. This is very old and obsolete softdevice and it's not possible to write code in mbed (unless you use an old/buggy version)
- we're limited to being a peripheral device so no way to connect to an external sensor without a phone
To write a firmware that way you need to:
- Set firmware base address to 0x14000 (that's the address of the first instruction in the firmware)
- Your firmware cannot be bigger than 147456 bytes (0x24000 bytes) because than you will override a bootloader (it starts at 0x38000)
- Use old NRF SDK 5.2.0 with S110 6.0.0 soft device
The second option is to override not only firmware but also the bootloader and the softdevice. That way we can use other softdevices like S120 (for central device) or S130 (both central and peripheral) and write anything we want!
I will try to upload S130 softdevice and a sample app in the following days. Stay tuned!
03/17/2015 at 22:20 •
Weloop tommy uses bq24232 chip as a battery charger. Documentation for this chip can be found HERE.
There are only two pins that are interesting for us, one is a charging indicator which is high when an external power supply is connected. The second one is a battery level.
Description NRF WLCSP ball NRF pin name Battery level H9 P0.05 Battery charging indicator C5 P0.25