> On Aug 25, 2017, at 10:28 AM, Alfred Schilken <[email protected]> wrote: > > Thanks Marko, this helps. > > So I can cut off some Kb from the FLASH_AREA_REBOOT_LOG area, > create an own slot with it and bind it to an own log_fcb_handler. > > Right?
Yes, all that should work. > > I wanted to be sure, that the FLASH_AREA_NFFS can’t be shared by several > handlers. > flash_map thing is a convenience thing which allows us to have a way of specifying flash regions meant for a specific purpose and be platform independent. In general, the thinking was that an entry in the flash_map would be used by one consumer only (image slots for images, bootloader etc). Also, to create an FCB, you don’t necessarily need a flash_map entry. If I remember correctly, you pass it an array of flash sectors which you’d want to use (which don’t necessarily have to be contiguous either). FLASH_AREA_NFFS is special in this regard, because the thinking was that if you’d need a place to store config, and you’d use either NFFS or FCB. Some platforms don’t have that many flash sectors (STM32F2/4), so we ended up reusing that same area of flash. If you’re not going to use sys/config, or NFFS, you can use that space for your logs as well. > > EDV-Beratung Schilken > [email protected] > www.schilken.de > mobil: +49 178 1475677 > >> Am 25.08.2017 um 19:06 schrieb marko kiiskila <[email protected]>: >> >> >>> On Aug 25, 2017, at 9:29 AM, Alfred Schilken <[email protected]> wrote: >>> >>> Hello, >>> >>> I couldn’t find an example usage of the log_fcb_handler and just used the >>> reboot_log for writing to the 16 kB FLASH_AREA_REBOOT_LOG area. >>> >>> This works fine but it a bit dirty. >>> >>> Is there a cleaner way to use both the CONFIG_FCB and the LOG_FCB at the >>> same time in an app? >>> Maybe both can use the FLASH_AREA_NFFS? >>> >>> The BSP is an nRF51, so no chance to use a real filesystem - I think. >> >> >> True. However, nrf51 has small flash blocks, so you should be able to have >> dedicated >> flash areas for different uses. So maybe it’ll be ok? >> >> At least the intent has been that you should be able to have multiple, >> separate areas, >> for logs with FCB. >> I.e. create separate FCB structures, tying them to their respective >> log_handlers. >> Then direct logs of the types you want to that specific log handler. >> >> I’m pretty sure we have specific sample apps showing this. I’d recommend >> looking >> at the unit test we have for sys/log, specifically the ones which use FCB as >> the >> log target. >> >> Hope this helps, >> M >> >
