I finally managed to implement the persistent storage I needed. I don't know if that is the most appropriate way to do this, but I found out that by including "waf_platform.h" header I can use the functions platform_write_flash_chunk() and platform_erase_flash() to do the operations on the flash memory.
Unfortunatelly, the flash memory on the STM32F205, which is used by the Inventek module, can only be erased at sector level. The memory is organized in sectors of 16KB, 64KB and 128KB. The smaller sectors are already used for the bootloader, DCT and application, so the only sectors available I've got are the last ones, with 128KB each.
So I decided to use two sectors, in a way that every time the buffer gets full one sector will be erased, leaving half of the current data still there. Then I can guarantee that at least the last 128KB of data will be preserved (and 256KB at most). That is way bigger than what I had in mind (1 or 2 KB), but as long as my application barely takes half of the available flash memory, I think there will be no problem.