On Mon, Aug 29, 2016 at 04:53:12PM -0700, marko kiiskila wrote: > Hi, > > for bootloader I’d like to have different set of devices than the app. > What did you have in mind for that? Different bsp_init() routines? > Or would bsp_init() have conditional parts depending on syscfg.h says?
I know you already know the following, but I wanted to summarize how Mynewt currently handles this for other readers. Currently, each BSP in apache-mynewt-core is intended to be used with both the boot loader and with "real" apps. When a BSP setting needs to have a different value for the boot loader, this is indicated via the "bootloader" feature. Here is an example from the nrf52dk BSP's pkg.yml file: pkg.linkerscript: "nrf52dk.ld" pkg.linkerscript.bootloader.OVERWRITE: "boot-nrf52dk.ld" I hadn't considered it, but it should be possible to do the same thing for settings in syscfg.yml files. That said, I think it might better to have two different BSPs. My feeling is that the BSP should specify which peripherals get initialized, and this should not be dependent on which app you are building. Another option is to disable peripherals in the boot target's syscfg.yml file, since the target's configuration overrides the BSP's. I don't think it's possible to do this in the app's file, because the app doesn't know which BSP it is being built for. I don't think this is a very good solution, because one of the primary goals of this feature is to move system configuration out of the way so that the app developer doesn't need to worry about it (at first). Thanks, Chris