Drops N’ Roses : Drop File System

Hello !

It is time for me to explain you how our drop file system (Deluxe Rather OPerational File System = DROP FS) will work. First of all, we need such file system because we will use a flash memory. We don’t want to rewrite always at the same place (it would wear the memory out). We also want to have a structure to know where we can find the data we want to read without scanning all the memory. We also want to have an erase strategy. If you want to consult our flash documentation, to better understand how the memory works, you can !
But before, I should remind you our architecture :


One drop contains different boxes. A box gathers together messages with same parameters and properties. As an example, a box “guest book” would be accessible for both reading and writing operations for everybody. The box will store messages which will have no timeout, but when the box would be full of messages, old messages would be erased and new messages would replace them. Another example is an “administration box” where messages would be statistics such as how many visitors pass next to the drop is stored, etc… This box would be accessible only for administration who would have to be authenticate before acessing the box. So, some parameters of the box are reading/writing rights, if messages stored into it should be spreadable, or if they would have an expiration date, …

Capture d'écran 2014-04-08 15.15.39

Our memory is cut into pages of 528 bytes. We decide in a first estimation to consider that we want to store messages 512 bytes long.
Some pages will work as files. They will be an index, to store all addresses of box. Then, a box page will store all addresses of messages it contains. In addition to the address, a byte for each address would be added : it is for knowing if the address written leads to a valid page or if is leads to a page with an indirection, or a page which can be erased. It will serve to know when the box contains a lot of messages with indirection or which should be delete, and launch specific operations to clean the memory.
On the schema, you can see that the index contains only one box. This box contains three messages. The first one has been edited. To avoid to use prematurely the memory by writting everytime in the same place, when you edit a message, you recreate it in the “next free page” and you store the address of the indirection in the metadata of the page (on the bottom of the page on the schema). The message three can be deleted. And the message two is valid, without any indirection.

I am sorry if it is not really clear. Don’t hesitate to ask questions if you have any.

Drops N’ Roses : discussion 2.0


This week-end, we had to prepare a presentation to expose our state of progress, the difficulties we had, have or will have, and what are left to do. As you follow us since the very beginning, you already know what we have done. But there are only three weeks more to finish our product, and implements our “box service”, our three applications which are some examples of what developpers could do using our API and our material drop, an efficient way to manage the external memory by creating a kind of home-made memory file system, checking and optimizing the battery level, and dealing with authentification to allow different kind of access (admin, normal user, …) to our drop and boxes. Moreover, we will have to think of a smart way to synchronize the data between a drop and a smartphone, or between two smartphones. We don’t know if we will use the WaDeD algorithm because we have saving energy problem, and the less calculation the drop will do, the better ! But we don’t really have other ideas.
We also have to think about how we will sell our products, and how much. We evaluate the production price of the complete drop at 6€ each for 10000 drops.

But finally, the presentation will be on Friday. So you will have to wait a little more to access to our proposition of marketing, etc !

So, today… with Matthieu and Lau, we continue discussing facts we disagree on. It was really weary. It has been four days we discuss, and argue about how we will do every little thing. We list all functions we are going to implement, think over the way to authenticate a special user (admin) or allow a person without any special access rigths to drop off a message certified by the administrater, and so on. We are almost done, and after this vital step, we will have all elements ready to code. Or so we hope.

PS : we will explain you all our ideas very soon with schemas.

Drops N’ Roses : huge discussion

Hey !

This morning, I spend some time to search for examples of nRF51822 system off and wake up program. I realized that no wake-up was possible with any timer from this deep sleep power off mode. All examples for this deep-power-off mode, which allows to save a lot of energy, includes a push-button. So, it means an external (human) intervention, where we want a periodical timmer controlled sleep and wake-up for advertising. The only solution left is the sleep of the CPU in system on mode, and return to the “functional” mode thanks to RTC or GPIO. But it consumes much more battery.So… we would have to be particularly precautionous concerning the use of our device if we want to save some battery. I am a bit anxious, because our device had to be use almost one year with a little button cell.

I have also other concerns… With Matthieu and Lau, we did argue a lot today. because we had not the same outlooks and prospects for our project. So, we spend some time to discuss many subjects this morning and afternoon, such as the products we would “sell”, if we need to have every exchange in char so it would be readable for humans, etc… And we are not done yet.
But we will agree. We are responsible persons.

Keep following ! On Monday, you would be able to access a new presentation concerning our state of progress, and all the matters we are discussing !

Drops N’ Roses : State of progress

Hello World !

This week, I was concerned about Drops N’ Roses’ future. We have indeed RAM problem… even with the use of external memory. That is because nRF51822 RAM is only 16kB, and the BLE stack use an important part of it. Moreover, I need a buffer for exchanging data with the external memory, and Lau also use another buffer for the BLE.
So, we had to remove one of them, and to clean whatever we can to have more free space ! We don’t want stack overflow… or other memory disaster.

We also did a focus group, talking about how we will organize our FLASH memory.
I was wondering how we would be able to keep some important data such as the drop id, etc… because, our drops will sleep the major part of the time. Iwas wondering how we would do without RAM retention to keep those data, or access them thanks to the SPI and the external memory without consumming all our batery very fast. But then, I remember we could use the NRF51822 flash for some important information.

We tought also about scenario for our diverse application Android. Here, you can see what the trasure hunting app would look like.

I also spend some time helping Lau or Sam debugging our Android application.

But I am not very proud of myself… I am not really efficient !
I will rest, and come back with more ideas, and things done (I hope)… because there are not so much time left !

Drops N’ Roses : External storage

Hey !

I am not really talkative since Friday. I am a little bit ill, and I think it explains why I am not so efficient.
Saturday, I was reading the datasheet of the FM25V20 FRAM memory. This memory was used last year by another group working on wireless dead drops for the storage of messages. I was going to implement the functions I need to use this memory with a SPI when Hubert came and said that I could not make any connection with our drops. As it was quite weird, I was concerned, and tried to connect to my own drop with gatttool. But it was not working : it returned an error for “connection denied”.
I tried to use previous commit whose state was steady. But it was all the same. I tried to flash the BLE stack again, to flash our program again. But there was nothing I can do to connect to mu drop : it was advertising, but that was all. At 7 pm, Lau came with her smartphone, and could make a connection between her phone and my device. It was kind of magic. I was not understand what was happening, and I was to tired to try anything else.

On Sunday, the first thing I did was trying to establish a connection with my drop thanks to gatttool. And it was working. I was really astonished. But I had to keep doing, so… I spend the afternoon and Monday morning to make a program using the SPI and allowing messages to be written in the FRAM.
When I tested it, and it was not working, I ask Alexis to lend me an analyzer in order to monitor which informations was really send.

The analyzer was really helpful, even if I had to weld again some wires in order to use it. Thanks to that, I saw that I was sending the data, but did not receive them when I tried to read them. Then… I figured out that it was because before each writting, I had to enable writting an data in the memory. So I fixed the issue. Then, I adjusted the code for BLE transmission. And I was done with the external storage.

When we would have our Flash memory, I think I would have to rewrite some functions (such as the method spi_master_tx_rx written by Nordic : it is really useful, but I think we can improve its behaviour for our needs).

PS : This morning, I helped RoseOnRails to weld some leds and rebuild their train circuit. They have a huge amount of welding to do.

Drops N’ Roses : History of memory

Hey !

Yersterday, I spend an hour to install Android SDK and InteliJ, and to focus on Scala and android. I try to read and understand the code that Lau has written for our scanner application. I have never done functionnal language befoore, so it was difficult for me. Hopefully, Lau helped me and show me a lot of equivalent way of writing the same code. Sam also helped me to understand the concept of Option, Some, None, … Thanks to Scala Cheat sheet that Lau recomment to me, I was also able to work on my own later on.

Moreover, as we identified a problem on our BLE code (Wednesday), I fixed it to be able to read and write message. Thanks to that, we were able to read a small message such as “message 1” using our application Android and our code on the nRF51 eval kit.
But there were still some imprecisions in our code. I does not allow to exchange more than 20 bytes because we were using notification. So, this morning, Matthieu, Lau and I test our BLE code, and fixed it. Now, even if there are still notifications, and some things that are going to disappear… our application allows the exchange of long message. 🙂

That is why we were confronted to a problem of memory. The nRF51822 of the eval kit has indeed a small RAM… so we can’t store a lot of messages using its RAM nor very long one. First, we thought it should be great to use the Flash of the nRF until we receive our PCB. And, good news, the functions to write, erase, and read the flash are already written (ble_flash.h) for the nRF. But there was a huge drawback. To write the flash memory, we have NOT to be connected. So we should create a kind of cache memory, to store the data to write in our flash… and to return to the user if he want to check that the message he has juste written is really on the drop. It is a little a waste of time to do so, because… we will not need to do that when we have our own PCB with our extern memory.
That is why we tought we could use some extern memory. Hopefully, there were still some Waded FRAM left. I spend the rest of my afternoon (and evening) to weld these components to a connector. We should be able to use it tomorrow (I hope).

DSC_0550PS : concerning the welding, at the beginning, we had the wire you can see on the right… it was muddled, so I did it again (those you can see on the left are better).

Thanks to Hubert and PHH who helped me during this trial 🙂

Good night !

Drops will have their PCB !

Hey !

I have good news ! Our PCB is ready for production ! You can find the final electrical schematic : PCB_DROP.
We chose to use internal LDO with our nRF51822. Since last time, I added a kind of connector which is similar to SWD debugger to be able to connect an external circuit with a minimum place. With Alexis, we added ground planes in top and bottom layers. Moreover, we had to add a lot of via. Thanks to that, the ground would be equipotential. We also change the width of some path such as alimentation, or for the antenna, because there are some important constraints on them.
When we were done, Alexis said that we have to wait almost one night, to check if we had not done any mistake. And he was right ! Yersterday, I realize that since the beginning, I have wrong connections for the 16Mhz quartz ! It would have been a desaster if we send earlier the PCB to production ! But now, all issues are fixed.

I have taken a screenshot of our PCB top layer. The bottom layer only include our battery mount, and a few electrical path.
So… our drop circuit will not be any larger than 3 cm * 3 cm.

Capture d'écran 2014-03-26 18.44.31Capture d'écran 2014-03-26 18.43.56

I hope we will receive the 30 of them really soon. But we probably will have to wait around two weeks, maybe more.

Yersterday, I also worked on the nRF51822 eval kit with Matthieu while Lau was doing the Android application. I was in charge with the drop program which has to create a table of messages, and to write the callback functions of a new BLE service for exchanging message. That is to say I write the processing part, while Matthieu wrote the BLE Service part (much more complicated). After that, we wanted to test our new service on our eval kit… but for a weird reason, when we should receive “message 1”, we only receive 4 characters “mess” and then, we was disconnected. We looked for the problem. I think we found it, but there was no more time to change the code and check it.

Then, I decided to update a little our website. If you are reading this blog with attention, their are not a lot of things you will learn, but elsewhere, it would help you to follow us 🙂

See you !


PCB almost ready…

Hey !

Today, guess what I have done : yes, still PCB. But I promise you that I am almost done with it, and so, you will not hear of PCB anymore. Some major changes on my PCB :

  •  First of all, about the alimentation : I was wondering if the DC/DC was really the best solution, or if it was the LDO. I resigned myself to doing some calculations about the consumption in different cases in order to know if DC/DC really allow to save some battery. One of them was the consumption of the CPU when it advertises every second, and sleep until the next time it has to advertise. It seems easy, but finding every data I need was quite difficult and took me really a lot of time. I was really annoyed (and bored), until Sam helped me by suggesting me to look at the nordic devzone. There, it was pretty obvious that DC/DC was not so good, especially when you want to use BLE (it scrambles BLE communication). That is why I removed all inductors and capacitors related to DC/DC : and that is great, it is now really easier to route !
  • I also replaced the SWD debugger…
  • … and I made some clean up, in order to have a really “pretty” PCB design View.
  • To conclude, I made my very first route (which is not just for fun, but for real) ! I am now wondering if it would pass Alexis’ test.

In addition, yersterday evening, I read Sam’s powerpoint presentation about Android, in order to understand the notions of activities, intents, services, … To be able to link it with the BLE stack, I also read some documentation.
That is why I was well prepared this morning, when Lau explained us (Matthieu and I) what she has done during last week and how her Android application worked. It was a bit difficult to apprehend Scala syntax (and Android’s).Matthieu also explained Lau and I how his own code hanged together.

I have now to bury myself into those codes, and to understand everything to be able to go on !

Back in Action

Hello !

I am now in A406, everything is back to normal !
So, today, I tried just for fun to route my PCB. I know that I will have to do it again, because it is probably not the proper way to do it, and most likely Alexis will suggest me to move some components to optimize the PCB. Also… I have to change the SWD debugger. It is not the right component for the moment (I will change it as soon as I finished this post, and maybe you will be able to see a new version of my PCB). But I made that to be assure that it was possible, and that there were not any problem that I had not seen before.


Then, I was able to boot on Linux, and to read some code. I tried to understand what my coworkers had done during the week, so I read without understanding everything Scala-Android code. I read a little tutorial about Android, because I had never done that before, and so on… I also check that I was able to flash the BLE Stack on my device (and thanks to Matthieu, I am).

Moreover, I also try some comands on the Jedi Git slides. I am still a git-beginner. That is why it is really useful to learn, try to use, and understand all comands, before to be confronted to real git problems such as an awful merge ! I am well prepared, now… I hope (it is the third time I read this presentation… so, I hope I will remember it !)

That’s all for today (well… almost, because, I said, I have to fix the SWD debugger just now !)

News from Wien – part 3

Hello !

Yersterday, I finished (except the SWD connector, which is not ready yet) the Design View . You can almost see what a drop would look like here : PCB_DROP.

I began to place the components, but I would like Alexis’s foldback before beginning to link the components with conductive tracks.

I hope it would be ready very very soon !