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 !

1 comment to Drops N’ Roses : History of memory

  • Florent

    Concerning flash access, the SoftDevice implements some functions which allow you to erase/write the internal flash while still being connected through BLE.
    I think they are available from SoftDevice v6.0.0 & SDK v5.1.0.

    However, these functions are asynchronous, eg. they will immediately return and you’ll get an event from the SoftDevice once the operation is completed.

    You can either use them directly (sd_ble_flash_page_erase, sd_ble_flash_write) or through the pstorage SDK module.
    Using the SDK module may be a little bit more difficult. But it’s already used by the bond manager (another SDK module) and I’m not sure it won’t get messed up if you’re using the SoftDevice calls directly…

    Good luck!