Re: Mynewt Local BSP Instance Location
Hi Sterling, Thanks for the quick reply and solution. You're correct, the compiler was missing the reference to the repo and I can build local BSPs with the following changes from the source BSP: pkg.compiler: "@apache-mynewt-core/compiler/arm-none-eabi-m0" pkg.deps: - "@apache-mynewt-core/hw/mcu/nordic/nrf51xxx" - "@apache-mynewt-core/libs/baselibc" pkg.deps.BLE_DEVICE: - "@apache-mynewt-core/net/nimble/drivers/nrf51" Being able to clone or create packages from newt might make life easier for newcomers, yes, as well as a slightly friendlier error message. Thanks for generating the issue. There seems to be an inconsistency in the last line, although I believe the `pkg.name` field should be the same as the folder location, despite the issue saying "can not match". I'm sure it's clear to the appropriate individuals though: * Currently pkg.name and the name of the package directory can not match, and the pkg.name will be taken over the pkg directory. There should be a warning issued if the package directory does not match the package name. Best regards, Kevin On 11/05/16 23:57, Sterling Hughes wrote: Hi Kevin, I was able to reproduce the issue, it looks like you didn't update the repository descriptor for the pkg.compiler -- that should point to a package in the @apache-mynewt-core repository as well. If you do that, you should get past that error. I was able to get your target to compile. I've filed a bug in JIRA to capture some of the improvements we'll put into the next release: https://issues.apache.org/jira/browse/MYNEWT-293 As a fresh a user of Mynewt, if you can add any thoughts you have to the ticket (or thread), that would be helpful. We'll make sure to consider them as we improve newt. Cheers, Sterling
Re: Mynewt Local BSP Instance Location
Hi Kevin, I was able to reproduce the issue, it looks like you didn't update the repository descriptor for the pkg.compiler -- that should point to a package in the @apache-mynewt-core repository as well. If you do that, you should get past that error. I was able to get your target to compile. I've filed a bug in JIRA to capture some of the improvements we'll put into the next release: https://issues.apache.org/jira/browse/MYNEWT-293 As a fresh a user of Mynewt, if you can add any thoughts you have to the ticket (or thread), that would be helpful. We'll make sure to consider them as we improve newt. Cheers, Sterling On 5/11/16 10:12 AM, microBuilder.eu wrote: This is slightly modified since it now points to the repo folder but the structure and files are basically identical: targets/adablink app=@apache-mynewt-core/apps/blinky bsp=@apache-mynewt-core/hw/bsp/blefriend32 build_profile=debug targets/bleper_nrf51 app=@apache-mynewt-core/apps/bleprph bsp=@apache-mynewt-core/hw/bsp/blefriend32 build_profile=debug targets/nrf51_boot app=@apache-mynewt-core/apps/boot bsp=@apache-mynewt-core/hw/bsp/blefriend32 build_profile=optimized K. On 11/05/16 17:49, Christopher Collins wrote: Ouch... there is clearly a bug in the newt tool. There should be no problem with creating a BSP package in the local repo. Could you send the output of 'newt target show'? I would like to see what specifically triggered this crash. I'll also look see if I have the same issues with local BSPs. Thanks, Chris
Re: Re: Mynewt Local BSP Instance Location
This is slightly modified since it now points to the repo folder but the structure and files are basically identical: targets/adablink app=@apache-mynewt-core/apps/blinky bsp=@apache-mynewt-core/hw/bsp/blefriend32 build_profile=debug targets/bleper_nrf51 app=@apache-mynewt-core/apps/bleprph bsp=@apache-mynewt-core/hw/bsp/blefriend32 build_profile=debug targets/nrf51_boot app=@apache-mynewt-core/apps/boot bsp=@apache-mynewt-core/hw/bsp/blefriend32 build_profile=optimized K. On 11/05/16 17:49, Christopher Collins wrote: Ouch... there is clearly a bug in the newt tool. There should be no problem with creating a BSP package in the local repo. Could you send the output of 'newt target show'? I would like to see what specifically triggered this crash. I'll also look see if I have the same issues with local BSPs. Thanks, Chris
Re: Mynewt Local BSP Instance Location
Hi Kevin, On Wed, May 11, 2016 at 01:32:14PM +0200, Kevin Townsend wrote: > I'm trying to document the process of creating a custom BSP based on an > existing model from apache-newt-core, and copied the model into the > local `projectroot/hw/bsp/boardname` folder, updated the `pkg.yml` file, > and modified the filenames/content accordingly. I then referenced this > BSP in the bootloader and main application target via newt. > > When I reference the local `hw/bsp/boardname` instance and then try to > build I get the following error, though: > > $ newt -v build nrf51_boot > Building target targets/nrf51_boot > panic: interface conversion: interfaces.PackageInterface is nil, not > *pkg.LocalPackage [...] Ouch... there is clearly a bug in the newt tool. There should be no problem with creating a BSP package in the local repo. Could you send the output of 'newt target show'? I would like to see what specifically triggered this crash. I'll also look see if I have the same issues with local BSPs. Thanks, Chris
Mynewt Local BSP Instance Location
I'm trying to document the process of creating a custom BSP based on an existing model from apache-newt-core, and copied the model into the local `projectroot/hw/bsp/boardname` folder, updated the `pkg.yml` file, and modified the filenames/content accordingly. I then referenced this BSP in the bootloader and main application target via newt. When I reference the local `hw/bsp/boardname` instance and then try to build I get the following error, though: $ newt -v build nrf51_boot Building target targets/nrf51_boot panic: interface conversion: interfaces.PackageInterface is nil, not *pkg.LocalPackage goroutine 1 [running]: panic(0x4f6b00, 0xc820493680) /usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:464 +0x3e6 mynewt.apache.org/newt/newt/builder.(*Builder).resolveCompiler(0xc82013bc80, 0xc8201ac3c0) /Users/ktown/prog/go/src/mynewt.apache.org/newt/newt/builder/buildutil.go:102 +0x17c mynewt.apache.org/newt/newt/builder.(*Builder).PrepBuild(0xc82013bc80, 0x0, 0x0) /Users/ktown/prog/go/src/mynewt.apache.org/newt/newt/builder/build.go:313 +0x238 mynewt.apache.org/newt/newt/builder.(*Builder).Build(0xc82013bc80, 0x0, 0x0) /Users/ktown/prog/go/src/mynewt.apache.org/newt/newt/builder/build.go:413 +0x8e mynewt.apache.org/newt/newt/cli.buildRunCmd(0xc820127a00, 0xc820105720, 0x1, 0x2) /Users/ktown/prog/go/src/mynewt.apache.org/newt/newt/cli/build_cmds.go:76 +0x5fe mynewt.apache.org/newt/newt/vendor/github.com/spf13/cobra.(*Command).execute(0xc820127a00, 0xc8201055c0, 0x2, 0x2, 0x0, 0x0) /Users/ktown/prog/go/src/mynewt.apache.org/newt/newt/vendor/github.com/spf13/cobra/command.go:569 +0x85a mynewt.apache.org/newt/newt/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc820126000, 0xc820127a00, 0x0, 0x0) /Users/ktown/prog/go/src/mynewt.apache.org/newt/newt/vendor/github.com/spf13/cobra/command.go:656 +0x55c mynewt.apache.org/newt/newt/vendor/github.com/spf13/cobra.(*Command).Execute(0xc820126000, 0x0, 0x0) /Users/ktown/prog/go/src/mynewt.apache.org/newt/newt/vendor/github.com/spf13/cobra/command.go:615 +0x2d main.main() /Users/ktown/prog/go/src/mynewt.apache.org/newt/newt/newt.go:123 +0x70 When I move the `projectroot/hw/bsp/boardname` files in `projectroot/repos/apache-newt-core/hw/bsp/boardname` and then point the targets there, everything builds fine, but I'm not sure what the secret is to having local BSPs outside the main newt repo? I thought the problem might be the dependency paths in my BSP pkg.yml file but even updating them as shown below throws the same error when trying to build (prepending `aapache-newt-core` to the dependency since the root path changed when the BSP was copied locally): pkg.deps: - @apache-newt-core/hw/mcu/nordic/nrf51xxx - @apache-newt-core/libs/baselibc pkg.deps.BLE_DEVICE: - @apache-newt-core/net/nimble/drivers/nrf51 Is there a restriction on having local BSP definitions for different board targets, or perhaps I'm just missing something obvious? I can build putting them in the apache-newt-core repo, but that's probably the wrong place for a project-specific BSP or board variant?